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

From: Alpar (Alpar_at_discussions.microsoft.com)
Date: 04/29/05


Date: Fri, 29 Apr 2005 09:00:03 -0700

Thanks Hao, you are right. I tried it on a clean 2003 server and it works
fine. The registry entries were correct, most likely it was some other
incorrect setting on the previous server.
Sometimes, reassuring that things do work as they are supposed to, helps :)

"Hao Zhuang [MSFT]" wrote:

> 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: Outlook(R) Mobile Access probelms
    ... sorry ut we are about to start ANOTHER clean install. ... Did you use the backup files to restore your SBS Server? ... > Microsoft CSS Online Newsgroup Support ... > check http://support.microsoft.com for regional support phone numbers. ...
    (microsoft.public.windows.server.sbs)
  • Re: 2000 database restore on 2003
    ... At that point you would have to remove the server from AD ... If you goal is to get to E2k3 from E2k and have a clean build of the box ... In place upgrade the E2k to E2k3. ... Backup the edb and stm files to a safe location ...
    (microsoft.public.exchange2000.information.store)
  • Re: w3k server
    ... I would check out the rootkit tool from http://www.sysinternals.com there ... >> You don't clean rootkits. ... >>> I am convinced my server has been compromised. ... >>> its registry entries and files. ...
    (microsoft.public.windows.server.general)
  • Re: can more then one server run on a small business 2003 network
    ... Well, a fresh install will be clean, but as I said, it is not necessary to ... STILL have access to the accounting folders. ... >> the second 2003 DC to a member server if desired and do whatever you need ...
    (microsoft.public.windows.server.sbs)
  • Re: Timeout question on a socket thread
    ... The simplest way to construct the server is to have one thread that loops on the ServerSocket. ... clean up and the leave the thread. ... So if you want a short timeout on the login and a longer timeout on the main I/O thread you can. ... public void run{ ...
    (comp.lang.java.programmer)