AVCSTRM_READ
The AVCSTRM_READ function code is used to submit a data buffer avcstrm.sys that is filled with data from the specified stream.
I/O Status Block
If successful, avcstrm.sys sets Irp->IoStatus.Status to STATUS_SUCCESS.
Possible error return values include:
Error Status | Description |
---|---|
STATUS_DEVICE_REMOVED | The device corresponding to the AVCSTRM_READ operation no longer exists. |
STATUS_CANCELLED | The request was unable to be completed. |
STATUS_INVALID_PARAMETER | A parameter specified in the IRP is incorrect, |
STATUS_INSUFFICIENT_RESOURCES | There were not sufficient system resources to complete the request. |
STATUS_PENDING | The request has been received but requires further processing. The I/O completion routine will handle the final response. |
AVC_STREAM_REQUEST_BLOCK Input
SizeOfThisBlock, Version and Function
Use the INIT_AVCSTRM_HEADER macro to initialize these members. Pass AVCSTRM_READ in the Request argument of the macro.
AVCStreamContext
Specifies the stream context (handle) returned by an earlier AVCSTRM_OPEN call that is the source of data for the read operation.
BufferStruct
Specifies the buffer the read operation should place data in.
A subunit driver must first allocate an IRP and an AVC_STREAM_REQUEST_BLOCK structure.
Next, it should use the INIT_AVCSTRM_HEADER macro to initialize the AVC_STREAM_REQUEST_BLOCK structure, passing AVCSTRM_READ as the Request argument to the macro.
Next, the subunit driver sets the AVCStreamContext member to the stream context (handle) of the stream that provides the data to be read. Finally, the subunit driver sets the BufferStruct member of the CommandData union that describes the buffer the read operation places data into.
To send this request, a subunit submits an IRP_MJ_INTERNAL_DEVICE_CONTROL IRP with the IoControlCode member of the IRP set to IOCTL_AVCSTRM_CLASS and the Argument1 member of the IRP set to the AVC_STREAM_REQUEST_BLOCK structure that describes the read operation to take place.
This command completes asynchronously. When it is completed, the I/O completion routine set in the IRP is called.
This function code must be called at IRQL = PASSIVE_LEVEL.
Comments
This function uses the BufferStruct member of the CommandData union in the AVC_STREAM_REQUEST_BLOCK structure as shown below.
typedef struct _AVC_STREAM_REQUEST_BLOCK {
ULONG SizeOfThisBlock;
ULONG Version;
AVCSTRM_FUNCTION Function;
.
.
PVOID AVCStreamContext;
.
.
union _tagCommandData {
.
.
AVCSTRM_BUFFER_STRUCT BufferStruct;
.
.
} CommandData;
} AVC_STREAM_REQUEST_BLOCK, *PAVC_STREAM_REQUEST_BLOCK;
Requirements
Headers: Declared in avcstrm.h. Include avcstrm.h.