Re: Winlogon notification dll doesn't work on 2003 server

From: Hao Zhuang [MSFT] (hzhuang_at_online.microsoft.com)
Date: 04/28/05


Date: Thu, 28 Apr 2005 12:52:09 -0700

i used your code with minor modifications and it worked. make sure the
spelling of the entry functions is correct in the notification package reg
key.

-- 
This posting is provided "AS IS" with no warranties, and confers no rights.
"Alpar" <Alpar@discussions.microsoft.com> wrote in message 
news:01D1AE2F-5A12-4DD7-B2A7-DB0BDAED5F36@microsoft.com...
> Thank you for the prompt answer. The code I use for testing the dll is 
> fairly
> simple:
>
>
> TCHAR g_szPath[] = TEXT("C:\\Winnt\\Notepad.exe");
>
> //Event handler for the Winlogon Logon event
> VOID APIENTRY StartProcessAtWinLogon (PWLX_NOTIFICATION_INFO pInfo)
> {
> TCHAR szText[MAX_PATH];
>
>    STARTUPINFO si;
>    si.cb = sizeof(STARTUPINFO);
>    si.lpReserved = NULL;
>    si.lpTitle = NULL;
>    si.lpDesktop = TEXT("WinSta0\\Default");
>    si.dwX = si.dwY = si.dwXSize = si.dwYSize = 0L;
>    si.dwFlags = 0;;
>    si.wShowWindow = SW_SHOW;
>    si.lpReserved2 = NULL;
>    si.cbReserved2 = 0;
>
> DWORD dwWritten;
>
> HANDLE hFile = CreateFile(TEXT("c:\\TSP.txt"), GENERIC_ALL, NULL, NULL,
> OPEN_ALWAYS, NULL, NULL);
> strcpy(szText, TEXT("StartProcessAtWinLogon \r\n"));
> WriteFile(hFile, szText, strlen(szText), &dwWritten, NULL);
> CloseHandle(hFile);
>
>    CreateProcess(NULL, g_szPath, NULL, NULL, FALSE, CREATE_NEW_CONSOLE,
>                  NULL, NULL, &si, &g_pi);
>
> MessageBox(NULL, "Winlogon Test", "Winlogon Test", MB_OK);
> }
>
> On XP, the text file is created, Notepad is started and the message box is
> displayed. On Windows 2003 Server, none of the three things happen. I 
> tried
> logging in on the console and also remotely, doesn't seem to make a
> difference.
> Other (third party) notification dlls I see in the registry key work
> correctly, therefore I suspect that must be a problem in my code.
>
> Any ideas?
>
> Thank you,
> Alpar
>
>
>
> "Hao Zhuang [MSFT]" wrote:
>
>> in winxp there is only a single session while in ws2003 multiple TS 
>> sessions
>> and the console session can coexist. this mean, there is only a single
>> winlogon.exe process in winxp while in ws2003 each session has a
>> winlogon.exe. if your winlogon notification package dll relies on some
>> global data shared, you may have problems.
>>
>> - hao
>>
>> -- 
>> This posting is provided "AS IS" with no warranties, and confers no 
>> rights.
>>
>>
>>
>> "Alpar" <Alpar@discussions.microsoft.com> wrote in message
>> news:4D852056-554C-4363-8B92-0139D779D87B@microsoft.com...
>> > Hi,
>> >
>> > I am implementing a Winlogon notification dll. The dll works fine on
>> > Windows
>> > XP, but I cannot get it to work on Windows 2003 Terminal Server.
>> > The dll creates a text file, starts Notepad and displays a message box
>> > when
>> > the logon event occurs. All these work fine on XP.
>> > Whne I logon to teh Windows 2003 server, none of the above happens. The
>> > dll
>> > is locked by the system, therfore winlogon.exe must use/load it.
>> >
>> > I tried to :
>> > 1. log in from the console as administrator
>> > 2. log in from a remote XP machine using the Remote Desktop Connection 
>> > as
>> > a
>> > regular terminal server user
>> > 2. log in from a remote XP machine using the Remote Desktop Connection 
>> > as
>> > the administrator terminal server user
>> > None of them helps.
>> >
>> > If anyone knows what to do differently for 2003 server in the code that
>> > works on XP, please let me know.
>> >
>> > Thanks,
>> > Alpar
>> > alpar@blackice.NOSAPM_com.NO_SPAM
>> >
>>
>>
>> 


Relevant Pages

  • Re: Winlogon notification dll doesnt work on 2003 server
    ... and the console session can coexist. ... > 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)
  • 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: dllimport got error 126 on Win2K terminal server
    ... worked well both on my XP machine and my W2K Terminal Server. ... lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, out ... works for Win2K Terminal Server but not on my XP Pro, ... find the dll without explicit path. ...
    (microsoft.public.dotnet.security)
  • 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)