Is it possible to hook to WinLogon proc when logon to window?

613 views Asked by At

I need to develop a dll which will be called whenever somebody logon to window. This dll will hook to the WinLogon proc and do something, the WinLogon process will be suspended until the dll done their work.

I tried to take around stackoverflow as well as msdn but I can't find the relevant article.

Is there anyone here can give me some related article or suggestion?

Thank you all in advance!

1

There are 1 answers

0
Drake Wu On BEST ANSWER

In Windows 2000,Windows XP and Windows Server 2003, you could use Winlogon Notification Package. But in Windows Vista and later, Winlogon notification packages are no longer supported, see Winlogon Notification Packages Removed: Impact on Windows Vista Planning and Deployment.

You can use the alternative solutions listed in the document to hook the logon event. It should be noted that Service Control Manager (SCM) Notifications and System Event Notification Service (SENS) are usually asynchronous, and Group Policy Scripts are also asynchronous by default to improve system boot and login performance.

However, there is a Group Policy option to have scripts executed synchronously(Computer Configuration\Administrative Templates\System\Scripts\Run startup scripts synchronously). Please note that this is not a recommended configuration and should only be used if no other methods are available. You must also extensively test the script to ensure that it does not cause any system performance problems.