AVStrMiniInitializeAllocator routine

An AVStream minidriver's AVStrMiniInitializeAllocator routine initializes an allocator that will be associated with a pin.

Syntax


PFNKSPININITIALIZEALLOCATOR AVStrMiniInitializeAllocator;

NTSTATUS AVStrMiniInitializeAllocator(
  _In_  PKSPIN               Pin,
  _In_  PKSALLOCATOR_FRAMING AllocatorFraming,
  _Out_ PVOID                *Context
)
{ ... }

Parameters

Pin [in]

Pointer to a KSPIN structure describing the pin with which the allocator is to be associated.

AllocatorFraming [in]

Pointer to a KSALLOCATOR_FRAMING structure describing the framing requirements that the allocator should use.

Context [out]

Pointer to a context for the allocator that will be passed as a parameter to the other routines for this structure. For example, the driver could store pin or allocator framing structures for later reference by the other callback routines. Note that other routines for KSALLOCATOR_DISPATCH must have at least an indirect way of referencing Pin. (For instance, AVStrMiniAllocate will need to be able to access the AllocatorFraming information for Pin, and Context is the only parameter that AVStream will pass it.)

Return value

AVStrMiniInitializeAllocator should return STATUS_SUCCESS or the error code that it received attempting to create the allocator.

Remarks

The minidriver specifies this routine's address in the InitializeAllocator member of its KSALLOCATOR_DISPATCH structure. The minidriver passes this structure to the class driver in KSPIN_DISPATCH.

Note that kernel-mode allocators cannot allocate frames that could eventually reach user mode.

AVStream calls AVStrMiniInitializeAllocator to initialize the given allocator. The handler for this routine should prepare to handle memory allocation and free requests.

For more information, see KS Allocators.

Requirements

Target platform

Version

Available in Microsoft Windows XP and later operating systems and DirectX 8.0 and later DirectX versions.

Header

Ks.h (include Ks.h)

See also

AVStrMiniDeleteAllocator
KSALLOCATOR_DISPATCH
KSALLOCATOR_FRAMING
KSPIN
KSPIN_DISPATCH

 

 

Send comments about this topic to Microsoft

Show: