Click to Rate and Give Feedback
MSDN
MSDN Library
 Controlling GPS Intermediate Driver...
Collapse All/Expand All Collapse All
Controlling GPS Intermediate Driver Execution
Windows Mobile SupportedWindows Embedded CE Supported
8/28/2008

The GPS Intermediate Driver (GPSID) supports some of the standard service IOCTLs.

In Windows Embedded CE 6.0 the GPS Intermediate Driver is a service that runs in services.exe. In Windows Mobile 6 the GPS Intermediate Driver is not technically a Windows Embedded CE service (because it runs in device.exe, not services.exe),

GPSID supports these standard service IOCTLs:

For example, IOCTL_SERVICE_REFRESH causes the GPSID to re-read its configuration information from the registry. The other IOCTLs can be used to query, disable, or re-enable GPSID operation. For example, you might use IOCTL_SERVICE_STOP to turn off the GPSID.

The GPSID uses a control channel, "GPD0:", to process this group of IOCTLs. To send IOCTLs to the GPS Intermediate Driver:

  1. Open a connection to the GPS Intermediate Driver, by calling CreateFile and passing "GPD0:" as the first parameter.
  2. Send the desired message to the GPS Intermediate Driver, by calling DeviceIoControl with the appropriate IOCTL.
  3. Close the connection to the GPS Intermediate Driver, by calling CloseHandle.

For example, the following code sends an IOCTL_SERVICE_REFRESH to the GPS Intermediate Driver:

HANDLE hGPS = CreateFile(L"GPD0:", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hGPS != INVALID_HANDLE_VALUE) {
   DeviceIoControl(hGPS,IOCTL_SERVICE_REFRESH,0,0,0,0,0,0);
   CloseHandle(hGPS);
}

This IOCTL causes the GPS Intermediate Driver to enter a state where it accepts calls for data using the parsed API or the raw interface. You might use this IOCTL to restart the GPS Intermediate Driver after turning it off using IOCTL_SERVICE_STOP.

This IOCTL does not open the GPS hardware. Instead, the first parsed API or raw interface call causes GPSID to open the GPS hardware.

This IOCTL causes the GPS Intermediate Driver to:

  • close its connection to the underlying GPS hardware, even if applications are currently using the GPS Intermediate Driver to retrieve GPS data,
  • close existing raw interface handles with an error, and
  • signal all events passed in the GPSOpenDevice hDeviceStateChange parameter.

Any calls to GPSID using GPSOpenDevice or CreateFile will fail after this IOCTL has been processed. To re-enable the GPSID after using this IOCTL, use IOCTL_SERVICE_START.

This IOCTL returns the current state of the GPS Intermediate Driver. For more information, see IOCTL_SERVICE_STATUS.

This IOCTL causes the GPSID to re-read its configuration parameters from the registry. The GPSID does not reflect any registry changes until the IOCTL_SERVICE_REFRESH IOCTL is processed. For more information, see Refreshing GPS Intermediate Driver Configuration using IOCTL_SERVICE_REFRESH.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker