This IOCTL permits a subunit to provide a group of functions that the Unit filter driver should call in particular situations. 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_REGISTER_SUBUNIT. 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_RegisterSubunit_Request structure. The urs_SubunitID, urs_ParentDeviceObject, urs_Context, urs_AllocateLocalPlug, urs_FreeLocalPlug, and urs_ConnectToRemotePlug members must be pre-initialized. - BufferSize
[in] Set to sizeof(UNIT_RegisterSubunit_Request). - lpOutBuffer
[out] Must point to a UNIT_RegisterSubunit_Response structure that is completed by the unit filter driver while processing this command. The urs_RegistrationToken member will be completed. - nOutBufferSize
[out] Should be completed with at least sizeof(UNIT_RegisterSubunit_Response). - 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
A subunit driver can register with the unit filter driver, and when references to the driver are made, the unit filter driver can issue a callback into the subunit driver for processing of the event.
The IOCTL_UNIT_REGISTER_SUBUNIT command takes the type value for your subunit, pointers to callback functions, and a context value that should be passed into those callbacks, and returns a registration token. You must use this registration token when issuing many other AVC_UNIT IOCTLs.
The type value is a non-encoded value, which is just the type value, unmodified, with no identifier. For example, use 0x04 for a VCR or tape subunit, not 0x20.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Avc_unit.h.
See Also
CreateFile | DeviceIoControl | UNIT_RegisterSubunit_Request | UNIT_RegisterSubunit_Response
Send Feedback on this topic to the authors