Bewerken

Delen via


PFNKSPININITIALIZEALLOCATOR callback function (ks.h)

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

Syntax

PFNKSPININITIALIZEALLOCATOR Pfnkspininitializeallocator;

NTSTATUS Pfnkspininitializeallocator(
  [in]  PKSPIN Pin,
  [in]  PKSALLOCATOR_FRAMING AllocatorFraming,
  [out] PVOID *Context
)
{...}

Parameters

[in] Pin

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

[in] AllocatorFraming

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

[out] Context

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

Requirement Value
Minimum supported client Available in Microsoft Windows XP and later operating systems and DirectX 8.0 and later DirectX versions.
Target Platform Desktop
Header ks.h (include Ks.h)

See also

AVStrMiniDeleteAllocator

KSALLOCATOR_DISPATCH

KSALLOCATOR_FRAMING

KSPIN

KSPIN_DISPATCH