Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Controlling GPS Intermediate Driver Execution

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

The GPS Intermediate Driver (GPSID) runs in device.exe and supports some of the standard service IOCTLs:

IOCTL_SERVICE_START

IOCTL_SERVICE_STOP

IOCTL_SERVICE_STATUS

IOCTL_SERVICE_REFRESH

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.

Community Additions

Show:
© 2015 Microsoft