RE: dllimport got error 126 on Win2K terminal server

From: [MSFT]Allen (yweng@online.microsoft.com)
Date: 01/17/03


From: yweng@online.microsoft.com ([MSFT]Allen)
Date: Fri, 17 Jan 2003 07:43:17 GMT


Please don't cross post the issue. I have tested the LogonUser and
MessageBox separately, didn't reproduce the problem as you described. They
worked well both on my XP machine and my W2K Terminal Server. In my testing
code, I didn't explicitely speficy the path since both functions are in the
system DLLs. I logged on to W2K Terminal Server from the XP machine using
the Remoting Desktop Connection and ran the testing application on it. I am
the adminstrator on both machines and have .NET framework installed on both
machines. Can you elaborate more on the issue?

Thanks,
-Allen

Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com

Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com

--------------------
| From: "Bo Dong" <bo_dong@yahoo.com>
| Subject: dllimport got error 126 on Win2K terminal server
| Date: Thu, 16 Jan 2003 17:09:27 -0800
| Lines: 81
|
| Greetings,
| In my C# program, when I use DllImport without path to dll, such as:
| [DllImport("advapi32.dll", SetLastError = true)]
| public static extern bool LogonUser(String lpszUsername, String
lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, out
int phToken);
| It works fine on my XP Pro machine, but doesn't work on Win2K Terminal
Server (error code 126 - The specified module could not be found). If I
hard code the path to DllImport(@"c:\winnt\system32\advapi32.dll"), it
works for Win2K Terminal Server but not on my XP Pro, which has path to
"c:\windows\system32". FYI, Win2K Terminal Server path settings has
"c:\winnt\system32" and "%SystemRoot%\system32" in it, but my program can't
find the dll without explicit path. I also tried to use:
| [DllImport(Environment.SystemDirectory + "advapi32.dll", SetLastError =
true)]
| But it doesn't work either. Please help.
| Many Thanks!
| Bo
|



Relevant Pages

  • Re: Winlogon notification dll doesnt work on 2003 server
    ... spelling of the entry functions is correct in the notification package reg ... The code I use for testing the dll is ... but I cannot get it to work on Windows 2003 Terminal Server. ... log in from a remote XP machine using the Remote Desktop Connection ...
    (microsoft.public.platformsdk.security)
  • Winlogon notification dll doesnt work on 2003 server
    ... I am implementing a Winlogon notification dll. ... but I cannot get it to work on Windows 2003 Terminal Server. ... log in from a remote XP machine using the Remote Desktop Connection as ...
    (microsoft.public.platformsdk.security)
  • Re: Total Terminal Server connections
    ... DLL it imports WinStationGetTermSrvCountersValue which is probably the ... MCSE, CCEA, Microsoft MVP - Terminal Server ... I can get this information via the "qwinsta /counter" command, ...
    (microsoft.public.windows.terminal_services)
  • RE: 800a01ad error while debugging VB6 DLL under IIS6.0 on Win2003SP1
    ... I am looking for possible solutions to debug it using terminal server. ... A VB6.0 DLL works fine when called from ASP page without debug mode. ...
    (microsoft.public.vb.com)
  • RE: 800a01ad error while debugging VB6 DLL under IIS6.0 on Win2003SP1
    ... I am looking for possible solutions to debug it using terminal server. ... A VB6.0 DLL works fine when called from ASP page without debug mode. ...
    (microsoft.public.win32.programmer.ole)

Loading