UNIT_ConnectToRemotePlugCB (Windows CE 5.0)
This function is called when a request has arrived for your subunit to initiate a connection to a serial bus plug on a particular node.
NTSTATUS (*UNIT_ConnectToRemotePlugCB)(PVOID Context, HANDLE Plug,ULONG Direction,UNIT_MediaType MediaType,PVOID Request);
Parameters
Context
[in] Opaque value that the subunit driver provided when utilizing the UNIT_CMD_REGISTER_SUBUNIT command that can be used however the subunit desires.Plug
[in] HANDLE value of the remote plug to connect to.Direction
[in] Defines whether the subunit intends to utilize the provided plug as an input plug UNIT_PLUG_Direction_Input, or an output plug, UNIT_PLUG_Direction_Output.If the provided plug is an output plug, it is implied that you want to receive a connection to it.
If the provided plug is an input plug, that implies that you want to start a transmit connection to it. The provided plug is a remote rather than local plug, and the I/O definitions are from the perspective of that remote node.
MediaType
[in] Defines the digital media type that the subunit can receive, for an input plug, or transmit, for an output plug. Must be from the STREAM_MediaType enumeration.Request
[in] Opaque value that the virtual subunit should save, to be passed into IOCTL_UNIT_CONNECTION_REQUEST_PROCESSED, if this callback request is not completed immediately.
Return Values
If the operation was successful, the subunit should return STATUS_SUCCESS.
If the virtual subunit could not complete processing on this request immediately, it can return STATUS_PENDING, in which case it must send down an IOCTL_UNIT_CONNECTION_REQUEST_PROCESSED later to permit the unit driver to complete the overall AV/C request.
Otherwise, an appropriate error code should be returned. Any error code will cause the request from the external device to be rejected.
Remarks
The Connection And Compatibility Management Specification, from the IEEE 1394 Trade Association, requires that any virtual subunit driver be able to be notified to initiate a connection to a particular plug on a particular node. This is inverted from the typical connectivity for a virtual subunit, where other nodes connect to its plugs.
When the request arrives at the unit driver, the appropriate virtual subunit is identified and this callback is made. That subunit does not have to complete the request at this time.
If the virtual subunit returns a value of STATUS_PENDING, the unit driver will respond to the AV/C request with an interim response.
If STATUS_PENDING is used, the virtual subunit must later utilize IOCTL_UNIT_CONNECTION_REQUEST_PROCESSED to permit the unit driver to properly respond and complete the AV/C request.
The plug handle provided by the unit driver to the virtual subunit deals with referring to a plug of an arbitrary node. When the subunit driver has no need for the plug any longer, that is, either has disconnected any associated connections, chosen not to attempt any connections, or failed at an attempt to establish a connection, it must send an IOCTL_UNIT_DEREFERENCE_CONNECTION_PLUG request down, permitting the unit driver to properly free the associated resources.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Avc_unit.h.
Link Library: Avc_unit.lib.
See Also
IOCTL_UNIT_CONNECTION_REQUEST_PROCESSED | IOCTL_UNIT_DEREFERENCE_CONNECTION_PLUG | STREAM_MediaType
Send Feedback on this topic to the authors