IOCTL_UNIT_QUERY_LOCAL_PLUGS (Windows CE 5.0)
This IOCTL permits the caller to determine the state of the plugs that are associated with your registered subunit. The DeviceIoControl function calls this IOCTL.
Parameters
- hDevice
[in] Handle to the target object. To get a device handle, call the CreateFile function with a name obtained dynamically from the SetupDiEnumDeviceInterfaces function. - dwIoControlCode
[in] Set to IOCTL_UNIT_QUERY_LOCAL_PLUGS. This value identifies the target operation and the type of device on which to perform it. - lpInBuffer
[in] Must be completed with a properly initialized UNIT_QueryLocalPlugs_Request structure. The uqlp_Flags member must be pre-initialized. - BufferSize
[in] Set to sizeof(UNIT_QueryLocalPlugs_Request). - lpOutBuffer
[out] This field should be set to point to a UNIT_QueryLocalPlugs_Response structure. - nOutBufferSize
[out] This field should be pre-initialized with the maximum size of the lpOutBuffer. This buffer should have a UNIT_QueryPlugs_Response structure at its head, but also must have space after the structure for all of the desired extra entries of the sqps_BufferIds array. - lpBytesReturned
[out] Pointer to a DWORD variable that receives the actual count of bytes returned by the function in the output buffer. - lpOverlapped
[out] If not used, NULL. Otherwise, this should point to a completely filled out OVERLAPPED structure that contains a valid event. The event will be signaled when the I/O operation is complete.
Return Values
If the operation succeeds, DeviceIoControl returns a non-zero value. If the operation fails, DeviceIoControl returns zero. To get extended error information, call GetLastError.
Remarks
The AVC_UNIT driver maintains individual state for each client that has opened one of its device objects. It records whether a plug has changed state since the last time an application queried it, so that if a change occurs between two application calls to IOCTL_UNIT_QUERY_LOCAL_PLUGS, you will still receive an update. The data might appear to be duplicated from the previous report.
If between these calls the only connection to a plug is disconnected, and then a new connection is established, this request will return immediately to the application which is still stating that at least one plug is connected.
This command only returns one changed plug definition per call. If more are available, subsequent calls are necessary to obtain their details.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Avc_unit.h.
See Also
CreateFile | DeviceIoControl | UNIT_QueryLocalPlugs_Request | UNIT_QueryLocalPlugs_Response
Send Feedback on this topic to the authors