OEMIoControl (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function provides a generic I/O control code (IOCTL) for OEM-supplied information.

BOOL OEMIoControl( 
  DWORD dwIoControlCode, 
  LPVOID lpInBuf, 
  DWORD nInBufSize, 
  LPVOID lpOutBuf, 
  DWORD nOutBufSize, 
  LPDWORD lpBytesReturned 


[in] IOCTL, which can be pre-defined, or any OEM-defined control code. For more information, see OAL IOCTLs.
[out] Pointer to the input buffer that can contain additional information associated with the dwIoControlCode parameter.

For example, when the dwIoControlCode parameter has the value IOCTL_HAL_GET_DEVICE_INFO, the lpInBuf parameter contains one of the SPI_* codes in the following table.

SPI_GETPLATFORMTYPEString specifying the type of Windows CE device.
SPI_GETOEMINFOString specifying OEM information that distinguishes this specific device from others of the same type.
[in] Size in bytes of lpInBuf.

For example, when dwIoControlCode is set to IOCTL_HAL_GET_DEVICE_INFO and the input buffer contains the SPI code, nInBufsize is set to the value 4.

[out] Pointer to the output buffer supplied by the caller.

Your implementation should place the information requested by the dwIoControlCode and lpInBuf parameters into lpOutBuf, set lpBytesReturned to indicate the size of the data in lpOutbuf, and return TRUE.

If the size of the requested information exceeds the buffer size specified by nOutBufSize, call the function SetLastError using the ERROR_INSUFFICIENT_BUFFER flag and return FALSE.

[in] Specifies the maximum number of bytes that can be returned in lpOutBuf.

The caller sets this value.

[in] Number of bytes returned in lpOutBuf.

Return Values

If this function succeeds, it returns TRUE.

If this function fails, it returns FALSE.


This function is the means of returning system information requested by the SystemParametersInfo function. This function must be implemented. When a device driver or routine calls the KernelIoControl kernel routine to pass an IOCTL, the kernel calls OEMIoControl.

The system can be pre-empted when this function is called. The kernel does no processing but passes all parameters directly to this function. The kernel function is provided to allow an OEM device driver to communicate with kernel mode OAL code.

From within this function, you can make Windows CE API calls.

A sample implementation is provided in the Oemioctl.c file.

When adding custom IOCTLs handled by OEMIoControl, the last identifier used is equal to 67 for kernel IOCTLs based on FILE_DEVICE_HAL.

Function codes 0 through 2047 are reserved for Microsoft; codes 2048 through 4095 are reserved for customers.

Currently, internal product teams and external customers are using values in the range of 1000 through 1100.


OS Versions: Windows CE 2.10 and later.
Header: Kwin32.h.
Link Library: Nk.lib.

See Also

KernelIoControl | OEMSetRealTime | SetKernelCommDev | SystemParametersInfo | Implementing the OEMIoControl Function

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.