The HidD_GetSerialNumberString routine returns the embedded string of a top-level collection that identifies the serial number of the collection's physical device.
BOOLEAN HidD_GetSerialNumberString( HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength );
Specifies an open handle to a top-level collection.
Pointer to a caller-allocated buffer that the routine uses to return the requested serial number string. The routine returns a NULL-terminated wide character string.
Specifies the length, in bytes, of a caller-allocated buffer provided at Buffer. If the buffer is not large enough to return the entire NULL-terminated embedded string, the routine returns nothing in the buffer.
HidD_GetSerialNumberString returns TRUE if it successfully returns the entire NULL-terminated embedded string. Otherwise, the routine returns FALSE.
Only user-mode applications can call HidD_GetSerialNumberString. Kernel-mode drivers can use IOCTL_HID_GET_SERIALNUMBER_STRING.
The maximum possible number of characters in an embedded string is device specific. For USB devices, the maximum string length is 126 wide characters (not including the terminating NULL character).
For more information, see HID Collections.
|Windows version||Available in Windows 2000 and later versions of Windows.|
|Header||hidsdi.h (include Hidsdi.h)|