title | description | keywords | topic_type | ms.topic | api_name | api_type | ms.date | ||||
---|---|---|---|---|---|---|---|---|---|---|---|
SRB_CLOSE_STREAM |
SRB\_CLOSE\_STREAM |
|
|
reference |
|
|
11/28/2017 |
The class driver sends this request to close a stream.
The minidriver should set one of the following as the status in the SRB:
STATUS_SUCCESS
Indicates successful completion of the command.
STATUS_NOT_IMPLEMENTED
Indicates that the function is not supported by the minidriver.
STATUS_IO_DEVICE_ERROR
Indicates that a hardware failure occurred.
The class driver provides a HW_STREAM_OBJECT buffer in pSrb->StreamObject, with pSrb->StreamObject->StreamNumber set to the number of the stream to be closed. The pSrb pointer points to a HW_STREAM_REQUEST_BLOCK structure. StreamNumber corresponds to the offset of the stream within the HW_STREAM_DESCRIPTOR structure that the minidriver provides in response to a SRB_GET_STREAM_INFO request.
If the minidriver successfully closes the stream, the minidriver returns STATUS_SUCCESS. Otherwise, it returns an appropriate error status.
When the SRB_CLOSE_STREAM command is received by the minidriver, the responding minidriver routine should:
-
Free any resources allocated by the minidriver when the stream was opened.
-
Stop referencing the clock if a clock was used for the stream.
-
Reset the stream state to Stop.
Note that a stream could be closed arbitrarily while streaming if an associated user-mode application crashes. Therefore, you must release all outstanding resources for the stream, complete all pending SRBs for the stream, and put the stream back into a quiescent state.