VxD Programming Hints
Last updated Aug 5, 1998
There are two methods to open a file in a VxD. If you are using VToolsD, there is a function R0_ReadFile that can be used for this. If you aren't, there is a IFS manager service, IFSMgr_Ring0_FileIO. See the help file for more documentation.
If you are trying to detect the VxD from a Win32 executable, there is a method using CreateFile.
The key is to open the device name, not the VxD name. This is the name used in the Declare_Virtual_Device macro.
Example:
Check if the vxd "vxdmy.vxd" is loaded. This vxd has a device name
of MYVXD.
If the CreateFile call fails, vxdmy.vxd isn't loaded.hDevice = CreateFile("\\\\.\\MYVXD", 0, 0, NULL, 0, 0, NULL);
Thanks to Gregg Conklin and Ripon Bhattacharjee for information about the KnownVxDs registry key.
Static VxD's are loaded on Windows startup, and stay loaded until Windows shutdown. There are three ways to do this:
Example:
Load myvxd.vxd from the system.ini file.
[386Enh] device=myvxd.vxd
The keyname will be the device name, and the value will be the path. So, a vxd with a device name of AVXD, and a driver name of myvxd.vxd, located in the system directory would look like:[HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\SessionManager\KnownVxDs]
The other path is:"AVXD"="C:\\WINDOWS\\SYSTEM\\MYVXD.VXD"
The keynames are dependent on the type of driver.[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD]