Virtual Device Identifier Numbers

In the DECLARE_VIRTUAL_DEVICE line of every virtual device driver (VxD) is the "VxD ID" field. This field will be either a unique number assigned to the virtual device, or the Undefined_Device_ID constant.

Certain virtual devices for Windows must a have unique identifier. A VxD that calls a Microsoft® MS-DOS® device or a terminate-and-stay-resident (TSR) program must have an identifier. An identifier is also required for a VxD that provides any of the following:

In addition, Windows provides no protection against loading a VxD using Undefined_Device_ID more than once. When Windows loads, it gets a list of all virtual devices to be loaded (through the INT 2Fh, AX=1605h broadcast and the SYSTEM.INI file). If a particular VxD is specified more than once and it uses Undefined_Device_ID, the VxD will be loaded multiple times. If, however, the virtual device has its own unique identifier, Windows will recognize the situation, inform the user, and abort the loading process (unless there is code in the VxD that allows Windows to continue).