O'Reilly logo

Professional Windows® Embedded Compact 7 by Thierry Joubert, David Jones, Samuel Phung

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

IMPLEMENTING IOCTLS

You can add IOCTLs to the stream project when generated by the CEDriverWiz Wizard. The Simple IOCTLs option just adds five successive IOCTLs from a base value. Advanced IOCTLs add five IOCTL values that are unique for the OS using the CTL_CODE macro. The IOCTLs are defined in the driver’s header file and deduced in the XXX_IOControl function in the driver when a call is made to it. That function takes as a parameter an IOCTL value, and if the value is found in the switch statement, it returns true. Otherwise it returns false. To use the stream IOCTL interface, an application needs to include the stream header file. The IOCTL test application sends ten IOCTL values starting from the first so that five succeed and the next five fail.

1. Create a driver with Simple IOCTLs.

2. Build the driver and run the OS.

3. Run the TestIOCTls application.

4. Note that five pass and five fail.

5. Repeat 1 to 4 for Advanced IOCTls.

6. Note the values generated.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required