How to block CTRL + ALT + DEL in Windows NT/2000

Source: Internet
Author: User

How to block CTRL + ALT + DEL in Windows NT/2000
Author: ac952_z_cn

Preface
In Windows 9x, we can use systemparametersinfo (spi_screensaverrunning, 1, null, 0); To block CTRL + ALT + DEL, but it does not work in NT/2000, even the wh_keyboard_ll low-level keyboard hook cannot be intercepted! By replacing Gina DLL, the function of blocking CTRL + ALT + DEL under NT/2000 is well implemented.

Download 6 K source code

I. Principles
In NT/2000, interactive login support is implemented by WinLogon calling Gina DLL. Gina DLL provides an interactive interface to provide authentication requests for user login. During Winlogon initialization, the system registers and intercepts the CTRL + ALT + DEL message.ProgramYou cannot get the message CTRL + ALT + DEL.
Winlogon interacts with Gina DLL. The default value is MSGINA. dll (in the System32 directory ). Microsoft also provides our own interfaces
Gina dll can be compiled to replace MSGINA. dll.

Three desktops will be created during Winlogon initialization:
(1) Winlogon desktop: displays Windows security and other interfaces, such as pressing CTRL + ALT + DEL and logging in to Windows.
(2) Application desktop: The interface we usually see on my computer
(3) Screen Saver desktop: Screen Saver display interface.

After the user logs in, when pressing CTRL + ALT + DEL, Winlogon calls the output function of Gina dll: wlxloggedonsas,
At this moment, it is on the Winlogon desktop. As long as we direct it to the application desktop, the system will not display the Windows security interface.
That is, after you press CTRL + ALT + DEL, it does not play any role. When we switch the desktop, the screen will flash!

Ii. Program Implementation
Gina DLL needs to output the following functions (Winlogon will call)
Wlxactivateusershell
Wlxdisplaylockednotice
Wlxdisplaysasnotice
Wlxdisplaystatusmessage
Wlxgetstatusmessage
Wlxinitialize
Wlxislockok
Wlxislogoffok
Wlxloggedonsas
Wlxloggedoutsas
Wlxlogoff
Wlxnegotiate
Wlxnetworkproviderload
Wlxremovestatusmessage
Wlxscreensaverpolicy
Wlxshutdown
Wlxstartapplication
Wlxwkstalockedsas
To simplify programming, We Dynamically Retrieve appeal functions from MSGINA. dll and directly call MSGINA. dll in the Custom DLL (noreboot. dll ).
. Now we need to deal with the wlxloggedonsas function:

 

Int winapi example (pvoid pwlxcontext, DWORD dwsastype, pvoid preserved) {handle hmutex; writeinfo ("wlxloggedonsas \ r \ n"); // used to record information if (dwsastype = secure) {// block ctrl_alt_del. You can also determine whether to block or not based on specific conditions. // I use mutex to control whether to block (Note: use Unicode) hmutex = openmutex (mutex_all_access, false, l "_ ac952_z_cn_ctrl_alt_del"); If (hmutex) {closehandle (hmutex); writeinfo ("disble CTRL + ALT + DEL \ r \ n "); Return wlx_sas_action_none; // switch the screen to the application desktop and block CTRL + ALT + DEL} else writeinfo ("not disble CTRL + ALT + DEL \ r \ n ");} return prcwlxloggedonsas (// This is from MSGINA. DLL. Pwlxcontext, dwsastype, preserved );}

We need to call hmutex = createmutex (null, false, "_ ac952_z_cn_ctrl_alt_del") in our own program to shield CTRL + ALT + DEL.

Iii. Installation and precautions:

In writing Gian DLL, you must note that Gina DLL uses Unicode.

Gina DLL installation:
Key name: \ HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Winlogon
Variable name: GinaDLL
Variable type: [REG_SZ]
Content: "the name of your gina DLL" For example: "noreboot. dll:

Copy your gina DLL (noreboot. dll) to the system directory (system32), restart the machine, and your gina DLL (noreboot. dll) will run.
If you cannot enter your system, copy MSGINA. DLL to your gina DLL (noreboot. dll) after entering dos.
Security Mode: Delete the key value.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.