Поделиться через


IOCTL_HAL_SET_DEVICE_INFO (Windows Embedded CE 6.0)

1/5/2010

This IOCTL is called to set the data returned by IOCTL_HAL_GET_DEVICE_INFO.

The OEMIoControl function calls this IOCTL.

Parameters

  • dwIoControlCode
    [in] Set to IOCTL_HAL_SET_DEVICE_INFO.
  • lpInBuf
    [in] Points to a buffer that can contain a string and a DWORD that represents the data to be changed.

    This DWORD is at the front of the string and can be set to one of the following values: SPI_GETPLATFORMTYPE or SPI_GETOEMINFO.

    The string can be any string and length that is supported by the hardware platform.

  • nInBufSize
    [in] Set to the size of the buffer pointed to by lpInBuf.
  • lpOutBuf
    [in] Set to NULL.
  • nOutBufSize
    [in] Set to 0.
  • lpBytesReturned
    [in] Set to NULL.

Remarks

Only enable this IOCTL in a test platform, not on a retail device. This IOCTL provides a way to take a platform, such as a CEPC, and force it to mimic another device type.

The following code example shows how to implement IOCTL_HAL_SET_DEVICE_INFO.

case IOCTL_HAL_SET_DEVICE_INFO:
   if (nInBufSize >= sizeof(DWORD)) {
     len = *(LPDWORD)lpInBuf;
     switch (len) {
     case SPI_GETPLATFORMTYPE :
       nInBufSize -= sizeof(DWORD);
       if (nInBufSize <= sizeof(HALPlatformStr)){
           memcpy(HALPlatformStr,
                  ((LPBYTE)lpInBuf)+sizeof(DWORD),
                  nInBufSize);
           retval = TRUE;
       } else {
           SetLastError(ERROR_INVALID_PARAMETER);
       }
       break;
     default :
       SetLastError(ERROR_INVALID_PARAMETER);
       break;
     }
   } else {
     SetLastError(ERROR_INVALID_PARAMETER);
   }
break;

Requirements

Header pkfuncs.h
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

Device Information IOCTLs
IOCTL_HAL_GET_DEVICE_INFO
OEMIoControl