PRB: Specifying Device Name in IoCreateDevice (280308)



The information in this article applies to:

  • Microsoft Windows 2000 Driver Development Kit (DDK)
  • Microsoft Windows NT 4.0 Driver Development Kit (DDK)

This article was previously published under Q280308

SYMPTOMS

The IoCreateDevice function returns STATUS_OBJECT_PATH_NOT_FOUND, if the DeviceName specified has

\DEVICE\xyz

instead of:

\Device\xyz

where "xzy" is the user-defined name.

CAUSE

The system creates a case-sensitive directory object for DeviceObjects.

RESOLUTION

Specify "\Device" instead of "\DEVICE". For example:
#define NT_DEVICE_NAME    "\\Device\\Test"  /* Correct definition */ 
#define NT_DEVICE_NAME    "\\DEVICE\\Test"   /* Wrong definition */ 
				

STATUS

This behavior is by design. Please note on Windows XP and above, the object manager has been changed to create objects by default with OBJ_CASE_INSENSITIVE attributes, so you can specify either /Device/xyz or /DEVICE/xyz - both the syntax will work.

Modification Type:MinorLast Reviewed:7/21/2004
Keywords:kbKMode kbprb KB280308