Share via


This IOCTL returns the current DEVICE_ID structure assigned to the device. A request to retrieve the DEVICE_ID is made by calling the KernelIoControl function with IOCTL_HAL_GET_DEVICEID.


  • dwIoControlCode
    [in] Set to IOCTL_HAL_GET_DEVICEID to retrieve the DEVICE_ID structure.
  • lpInBuf
    [in] Can be defined by OEMs for their specific purposes.
  • nInBufSize
    [in] Set to the size of the OEM lpInBuf data.
  • lpOutBuf
    [in] Set to the address of an allocated DEVICE_ID structure.
  • nOutBufSize
    [in] Set to the size of the DEVICE_ID structure.
  • lpBytesReturned
    [in] Address of a DWORD that receives the size in bytes of the data returned.

Return Values

If the system has provided support for IOCTL_HAL_GET_DEVICEID, returns TRUE for success. If support is not provided for IOCTL_HAL_GET_DEVICEID or the request fails, returns FALSE.


If FALSE is returned, call GetLastError for information. An ERROR_INSUFFICIENT_BUFFER error indicates that the allocated buffer is too small to store the information. In this case, the content of dwSize of the DEVICE_ID structure is set to the required buffer size. Reallocate the buffer and request the information again. To request the identifier buffer sizes required for the DEVICE_ID structure, set the dwSize member of the DEVICE_ID structure to zero.


OS Versions: Windows CE 2.10 and later.
Header: Pkfuncs.h.

See Also

KernelIoControl | DEVICE_ID | Identifying Devices Uniquely

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.