// ks.h
KSDDKAPI NTSTATUS KsAcquireCachedMdl(
PIRP Irp,
REFGUID Guid,
PFNKSCANCELPINNEDMDL CancelRoutine,
PVOID CancelContext,
PMDL *MdlAddr,
PVOID *ReleaseContext
);
View the official Windows Driver Kit DDI referenceNo description available.
This function is used to acquire the MDL cached by the KS port driver. The function is used by a kernel mode driver to acquire the MDL for a pipeline-supplied sample generated by an Avstream driver.
IrpThe IRP passed from the user mode containing the user-mode sample buffer.
GuidThe GUID extracted from the MFSampleExtension_MDLCacheCookie attribute item of the IMFSample passed by the pipeline.
CancelRoutineCancel routine, a callback function supplied by the Avstream miniport driver. This function is called when the state of the pin generating the sample is going to STOP state. The signature of the cancel routine is as follows:
_IRQL_requires_max_(DISPATCH_LEVEL)
typedef
VOID
(*PFNKSCANCELPINNEDMDL)(
_In_ GUID,
_In_ PVOID,
_In_ PVOID
);
GUID GUID passed in the KsAcquireCachedMdl function by the Avstream miniport driver.
PVOID Cancel context supplied by the Avstream miniport driver in the KsAcquireCachedMdl function call.
PVOID Release context. This is the output of the KsAcquireCachedMdl function.
CancelContextThe context passed to the Avstream driver in the cancel routine. This context is used by the Avstream driver to get into the driver context.
MdlAddrReturn value: The resultant MDL if KS finds the MDL stored for the sample buffer.
ReleaseContextReturn value: The context to be stored by Avstream driver. This context should be passed to KS when releasing the MDL acquired by the KsAcquireCachedMdl call.
Returns STATUS_SUCCESS for success conditions.