Skip to Content
Professional Windows® Embedded Compact 7
book

Professional Windows® Embedded Compact 7

by Samuel Phung, David Jones, Thierry Joubert
September 2011
Intermediate to advanced
744 pages
19h 4m
English
Wrox
Content preview from Professional Windows® Embedded Compact 7

ADDING AN IOCTL TO THE OAL

In this activity, you add a new IOCTL and its handler inside the OAL of a cloned Virtual PC BSP. It’s best to use a cloned BSP because this activity can modify the BSP’s source code.

The OAL IOCTLs that an application can call is limited because it runs in user mode. User mode threads have limited access to kernel functionality. To test the new IOCTL, add a simple stream driver that loads at startup in kernel mode. This driver can call the kernel in its XXX_Init function.

To add a new IOCTL to the BSP’s OAL you need to:

1. Define the IOCTL index in the list of the BSPs’ OALs.

2. Specify the function that handles the IOCTL.

3. Associate the IOCTL and its handler function.

4. Implement the IOCTL handler.

5. Rebuild the OAL.

6. Remake the OS image.

Getting Started

Clone the Compact 7 Virtual PC BSP as in Chapter 6 but for the VPC BSP. Only complete the section “Clone an Existing BSP.” None of the other sections in that chapter are relevant here. Create, build, and test a Debug build of the OS with the cloned BSP.

Defining a New IOCTL

A new IOCTL

x86_IOCTL_VPC_MY_FUNC _NUM

is to be defined. Defining a new IOCTL for an OAL requires three new entries the BSP source code.

1. In Solution Explorer navigate to the $(_WINCEROOT)\PLATFORM\<Your cloned BSP>\src\inc folder.

2. Open vpc_ioctl.h.

Define the IOCTL enum

The first entry is its enum definition in the header file:

3. Find the IOCTL enums:

  • From the top do a Quick Search for enum. (There is only one in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Pro Windows Embedded Compact 7: Producing Device Drivers

Pro Windows Embedded Compact 7: Producing Device Drivers

Abraham Kcholi
Windows® Embedded CE 6.0 Fundamentals

Windows® Embedded CE 6.0 Fundamentals

Stanislav Pavlov, Pavel Belevsky
How to Develop a Great Digital Strategy

How to Develop a Great Digital Strategy

Jeanne W. Ross, Cynthia M. Beath, Ina M. Sebastian
The Hidden Cost of AI-Assisted Creativity

The Hidden Cost of AI-Assisted Creativity

Léonard Boussioux, Anil Doshi, Oliver Hauser, Kartik Hosanagar

Publisher Resources

ISBN: 9781118167489Purchase bookDownloads