KsAcquireCachedMdl - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ks.h

KSDDKAPI NTSTATUS KsAcquireCachedMdl(
  PIRP                 Irp,
  REFGUID              Guid,
  PFNKSCANCELPINNEDMDL CancelRoutine,
  PVOID                CancelContext,
  PMDL                 *MdlAddr,
  PVOID                *ReleaseContext
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ks-ksacquirecachedmdl)

Description

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.

Parameters

Irp

The IRP passed from the user mode containing the user-mode sample buffer.

Guid

The GUID extracted from the MFSampleExtension_MDLCacheCookie attribute item of the IMFSample passed by the pipeline.

CancelRoutine

Cancel 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.

CancelContext

The context passed to the Avstream driver in the cancel routine. This context is used by the Avstream driver to get into the driver context.

MdlAddr

Return value: The resultant MDL if KS finds the MDL stored for the sample buffer.

ReleaseContext

Return 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.

Return value

Returns STATUS_SUCCESS for success conditions.