This sample is composed of two parts, the Win32 portion and the
kernel device driver portion.  Each part can be found in their
respective directories, WIN32 and DRIVER.

The Win32 portion contains a file, GETHNDL.C, which attempts to
obtain a handle to LOADTEST.  The executable is built using the
Windows NT SDK.  First update the environment and path by running
<mstools>\setenv.bat.  Then change to the directory where you have
the C source code and the makefile.  Type NMAKE to compile the Win32
program, GETHNDL.EXE.

The kernel driver portion contains the driver source code, LDUNLD.C
(which is short for LOAD/UNLOAD) and two text files to be used in
conjuction with your registry.  The driver is built using the Windows
NT DDK.  To build the driver, first copy the driver directory to a
directory in the ..\dd portion of your Windows NT DDK tree.  I
suggest naming the directory to LDUNLD to avoid confusion :

cd <ddk_root>\private\ntos\dd
md ldunld
copy \driver ldunld
cd ldunld

Then, assuming you have run <ddk_root>\setenv.bat, build the driver by
typing :

build -cef

Copy the built driver, LDUNLD.SYS to the ..\system\drivers
directory :

cd \<ddk_root>\public\sdk\lib\i386    ; assuming x86 machine
copy ldunld.sys \<winnt_root>\system\drivers

Now, update the registry :

cd \<ddk_root>\private\ntos\dd\ldunld
regini ldunld.ini        ; add the driver to the registry
regini ldunld.lnk        ; create a symbolic link

Reboot.

Execute GETHNDL.EXE -- should not get a handle
net start ldunld
Execute GETHNDL.EXE -- should get a handle
net stop ldunld     -- will only work with Administrator privileges
Execute GETHNDL.EXE -- should not get a handle

That's all there is to it.  You can net start the driver with User
privileges, but you won't be able to stop it.  There are also debug
print messages if you build a checked version.
