Unauthorized Windows 95 Update -- W16LOCK
- W16LOCK.C -- Source code for a small Win32 program which demonstrates the Win16Lock in Windows 95. This version is corrected from the version that appears in
Unauthorized Windows 95, page 553.
After the book was written, KERNEL32.DLL stopped exporting the
undocumented GetpWin16Lock(), _EnterSysLevel(), and _LeaveSysLevel()
Win32 functions by name. These functions are still present,
and are exported -- but by number, not name. (GetpWin16Lock is
KERNEL32.93, _EnterSysLevel is KERNEL32.97, and _LeaveSysLevel is
KERNEL32.98.) However, KERNEL32 does not allow imports by ordinal.
To access these functions, W16LOCK.C now uses the GetK32ProcAddress()
function from K32EXP.C.
Note: The Win16Lock is definitely not a mutex, even though
Microsoft now calls it the "Win16Mutex." As can be seen from this
program, it's a single DWORD, located down in conventional memory
(below 1MB) no less.
- W16LOCK.EXE -- A small Win32 program which demonstrates how easy it is to grab the Win16Lock in Windows 95, and thus stop the entire system. The Win16Lock is grabbed with the undocumented _EnterSysLevel() Win32 API, and released with _LeaveSysLevel().