Tuesday, April 18, 2006

Logon Notification events under Windows



While working on the PSP program, I wanted to have a mechanism where to get notifications when the computer is locked and unlocked. Initially I thought that there would be some windows notification messages sent to every windows, but it was not the case. There is something called Windows Notification Package, which fecilitates the logon events for an application. All you need is to create a dll with required export functions (each function for Lock, Unlock, Logon,...) and create some registry entries. Now, this is a service of the Winlogon process, which is the main process started after the boot sequence. It is the Winlogon process that displays the SAS dialog. The registry key need to be created under:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify
Once the registry entries and dll are in place, the Windows need to be restarted. Apparently the Winlogon creates a list of notification functions at startup and debugging becomes a pain since the dll is locked by the process.

No comments: