VideoPortAllocatePool function (video.h)

The VideoPortAllocatePool function allocates a block of pool memory, inserting a caller-supplied tag at the beginning of the memory.

Syntax

VIDEOPORT_API PVOID VideoPortAllocatePool(
  [in] IN PVOID        HwDeviceExtension,
  [in] IN VP_POOL_TYPE PoolType,
  [in] IN SIZE_T       NumberOfBytes,
  [in] IN ULONG        Tag
);

Parameters

[in] HwDeviceExtension

Pointer to the miniport driver's device extension.

[in] PoolType

Specifies the type of memory pool to allocate. This parameter can be set to one of the following:

Value Meaning
VpNonPagedPool The pool is from nonpaged memory.
VpPagedPool The pool is from paged memory.
VpNonPagedPoolCacheAligned The pool is from cache-aligned, nonpaged memory.
VpPagedPoolCacheAligned The pool is from cache-aligned, paged memory.

[in] NumberOfBytes

Specifies the number of bytes of memory to allocate.

[in] Tag

Specifies a four-byte allocation tag, consisting of up to four ASCII characters, that uniquely identifies the driver that is allocating the memory. The tag string is delimited with single quotes.

Return value

On successful allocation of the memory pool, VideoPortAllocatePool returns the address of the allocated memory pool. Otherwise, this function returns NULL.

Remarks

VideoPortAllocatePool is intended to replace VideoPortAllocateBuffer, which is obsolete.

The Tag string should be specified in byte-reversed order. It is recommended that the first letter in the string (before it is reversed) be 'D' to denote a display driver; the other three bytes should be indicative of the driver name. For example, the Tag string 'zyxD' appears as 'Dxyz' if pool is dumped. The tag appears in any crash dump of the system that occurs.

Callers of VideoPortAllocatePool can be running at IRQL = DISPATCH_LEVEL only if the requested PoolType is one of the VpNonPagedXxx types. Otherwise, callers must be running at IRQL < DISPATCH_LEVEL.

Requirements

Requirement Value
Minimum supported client Available in Windows XP and later versions of the Windows operating systems.
Target Platform Desktop
Header video.h (include Video.h)
Library Videoprt.lib
DLL Videoprt.sys
IRQL See Remarks section.

See also

VideoPortFreePool