Dwedit
Dwedit

Reputation: 754

Are there name restrictions on "Device Instance Path" names?

I am asking about Win32 Device Instance Path names. You see these types of paths in the Device Manager. An example device instance path name is ACPI\DLLK0706\3&11583659&0 for a keyboard.

Are there any restrictions on Device Instance Path names? For instance, I am not seeing any path names that exceed 255 characters in length, or use any non-ASCII characters, but are these restrictions real or just a coincidence?

Upvotes: 0

Views: 468

Answers (1)

RbMm
RbMm

Reputation: 33754

Device Instance Path returned by PDO device when it handle IRP_MN_QUERY_ID. and exist several restrictions for length (must be less than MAX_DEVICE_ID_LEN characters long ) and can not use any non-ASCII characters (all must be in [0x20, 0x80) range and must not be ';' in string )

If a driver returns an ID with an illegal character, the system will bug check. Characters with the following values are illegal in an ID for this IRP:

  • Less than or equal to 0x20 (' ')
  • Greater than 0x7F
  • Equal to 0x2C (',')

A driver must conform to the following length restrictions for IDs:

  • Each hardware ID or compatible ID that a driver returns in this IRP must be less than MAX_DEVICE_ID_LEN characters long. This constant currently has a value of 200 as defined in sdk\inc\cfgmgr32.h.
  • The container ID that a driver returns in this IRP must be formatted as a globally unique identifier (GUID), and must be
    MAX_GUID_STRING_LEN characters, which includes the null terminator.
  • If a bus driver supplies globally unique instance IDs for its child devices (that is, the driver sets DEVICE_CAPABILITIES.UniqueID for
    the devices), then the combination of device ID plus instance ID must be less than (MAX_DEVICE_ID_LEN - 1) characters. The operating system requires the additional character for a path separator.
  • If a bus driver does not supply globally unique instance IDs for its child devices, then the combination of device ID plus instance ID must be less than (MAX_DEVICE_ID_LEN - 28). The value of this equation is currently 172.

Upvotes: 2

Related Questions