A program to modify msgina.dll in order to inactivate the Lock Workstation button in the Windows NT Security (Ctrl-Alt-Del) dialog.
Copyright (C) 1997 by
This program is free software under the GNU General Public License. See the file LICENSE for details. The latest version of NOLOCKWS can be found at http://wwwthep.physik.uni-mainz.de/~frink/nt.html.
Especially for large PC pools in universities or schools it is very annoying when users lock their NT workstations, leave, and forget to come back. Subsequent users have the choice of resetting the PC or calling an administrator who can unlock the workstation. While lots of Windows NT settings can be changed through the registry, disabling the Lock Workstation button in the Windows NT Security (Ctrl-Alt-Del) dialog seems to be forgotten.
Some time ago, I suggested a method how to overcome this: load msgina.dll from the \winnt\system32 directory with a resource editor (which come with most C++ compilers for Windows) and modify the window style attributes of the Lock Workstation button in dialog #1650 (this is the Windows NT Security dialog).
However, this is cumbersome, dangerous (a corrupt msgina.dll may prevent the system from booting properly), and not everybody has a resource compiler to hand. Therefore I decided to write a program that automates this task. This is the first BETA version intended for a broader testing than I can do.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
For short, the main aspects of the GNU General Public License are in my personal interpretation which may not be 100% accurate (I am a physicist, not a lawyer):
Let me briefly explain how the program works. Source code is included, so you may examine it on your own and modify it under the restrictions of the GNU General Public License.
The Windows NT Security dialog with the Lock Workstation button is contained in %systemroot%\system32\msgina.dll. NOLOCKWS scans this file for the text on the button. For the English version, this is Lock &Workstation in Unicode (16 bit), the '&' in front of the 'W' denotes the accelerator key Alt-W. Located 22 bytes ahead of this string, one finds the button's 32 bit window attributes. By default, these are 0x50010001L (least significant bit may be zero) . To disable the button, the WS_DISABLED flag (0x08000000L) has to be set, i.e. the window attributes have to be modified to 0x58010001L (alternatively it would be possible to hide the button by clearing the WS_VISIBLE 0x10000000L flag). The modified file cannot immediately replace the original one, since it is in use. Therefore, the original file has to be renamed to something else, afterwards the modified file can be saved as msgina.dll. The changes become active at the next reboot.
Again: This program is still in BETA state and is distributed WITHOUT ANY WARRANTY. Before you use this program, make a backup of all your important data, create an Emergency Repair Disk (with RDISK /S), and have your three NT Setup disks and the CD to hand, since it is possible that an unexpected failure may leave your system in an unusable state (although I have not experienced any problems yet).
Using this program is simple:
On successful completion, NOLOCKWS will have created a backup of the unmodified msgina.dll called msgina.bak in the same directory. If this file already exists (when you run the program for the second time), NOLOCKWS will prompt you to rename (with File Manager/Explorer, then choose retry) or delete it.
Desaster recovery, if something went wrong (I hope this never happens, these are just some ideas, untested because it has not been necessary yet):
As a proper GPL program, NOLOCKWS comes with source code. Therefore it should be easy to compile it on any NT platform. Adjust the /machine: qualifier in the .mak makefile. Link with your C runtime library, kernel32.lib, user32.lib and advapi32.lib. I have compiled it for Intel x86 with Microsoft Visual C++ 4.2 (Cygnus' gcc for GNU-Win32 lacks <conio.h>), and for DEC Alpha with VC++ 4.1, both under NT 4.0. You should have received both binary versions. They should run under NT 3.5/3.51 as well.
Since NOLOCKWS simply scans msgina.dll for a text sequence and modifies a byte near this sequence where it expects the window attributes for the Lock workstation button, it relies heavily on an unchanged resource format. I do not want to rule out problems with 64 bit versions of NT 5.0 (announced e.g. for axp).
NOLOCKWS runs fine on NT 4.0 Server and Workstation U.S. (x86) and NT 4.0 WS U.S. (axp). I have successfully modified msgina.dlls from NT 3.51 x86 and axp, which indicated an identical resource format.
To do: More tests, especially on international versions (I need the text in your local language. Please help me, see section 7)
This program does not run on Windows 95! (Why should it?)
nolockws.exe | precompiled binary file for Intel x86 |
a_nolockws.exe | precompiled binary file for DEC Alpha |
nolockws.c | source code | nolockws.mak | makefile for VC++ (adjust the /machine qualifier for non-x86) |
LICENSE | GNU General Public License |
readme.1st | first instructions |
readme.html | this documentation |
If you have any suggestions, ideas for improvements, problems or anything else concerning the program or the documentation, send an e-mail to Alexander.Frink@Uni-Mainz.DE or snailmail to Alexander Frink, Hermann Schauss Str. 8, D-65232 Taunusstein, Germany.
A short list of possible improvements I have collected: