Windows CE 6.0 introduces some new security features including new meaning for User Mode and Kernel Mode.   Loosely speaking, Kernel Mode has access to the system’s resources and User Mode is greatly restricted. One of the new restrictions on User Mode code is that calls to KernelIoControl are limited to the following OEMIoControl IOCTLs:
        IOCTL_HAL_GET_CACHE_INFO
        IOCTL_HAL_GET_DEVICE_INFO
        IOCTL_HAL_GET_DEVICEID
        IOCTL_HAL_GET_UUID
        IOCTL_PROCESSOR_INFORMATION
As an OEM you can change this to allow access to other IOCTLs. The default restriction makes a lot of sense for consumer devices, but for closed systems or systems that the OEM wants to provide more functionality, there is a need to provide more IOCTLs for use from User Mode code.
User Mode code accesses these IOCTLS through a new oalioctl.dll. The code for oalioctl.dll is available in %_WINCEROOT%\Public\Common\Oak\Oalioctl, so I won’t publish the code here. But basically it has an IoControl function that has a switch statement which limits access to OEMIoControl(). So to add more IOCTLs, we need to clone the code and change the switch statement.
Copyright © 2008 – Bruce Eitman
All Rights Reserved