StorPortAllocateDmaMemory - NtDoc

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

ULONG StorPortAllocateDmaMemory(
  [in]           PVOID               HwDeviceExtension,
  [in]           SIZE_T              NumberOfBytes,
  [in]           PHYSICAL_ADDRESS    LowestAcceptableAddress,
  [in]           PHYSICAL_ADDRESS    HighestAcceptableAddress,
  [in, optional] PHYSICAL_ADDRESS    BoundaryAddressMultiple,
  [in]           MEMORY_CACHING_TYPE CacheType,
  [in]           NODE_REQUIREMENT    PreferredNode,
  [out]          PVOID               *BufferPointer,
  [out]          PPHYSICAL_ADDRESS   PhysicalAddress
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-storport-storportallocatedmamemory)

StorPortAllocateDmaMemory function

Description

This function is the extended version of the StorPortAllocateContiguousMemorySpecifyCacheNode function. It allocates a range of physically contiguous noncached, nonpaged memory, and returns the physical address of the allocated buffer.

Parameters

HwDeviceExtension [in]

A pointer to the hardware device extension for the host bus adapter (HBA).

NumberOfBytes [in]

The number of bytes to allocate.

LowestAcceptableAddress [in]

The lowest physical address that is valid for the allocation. For example, if the device can only reference physical memory in the 8 MB to 16 MB range, this value would be set to 0x800000 (8 MB).

HighestAcceptableAddress [in]

The highest physical address that is valid for the allocation. For example, if the device can only reference physical memory below 16 MB, this value would be set to 0xFFFFFF (16 MB - 1).

BoundaryAddressMultiple [in, optional]

The physical address multiple that this allocation must not cross.

CacheType [in]

The desired cache type for the mapping.

PreferredNode [in]

The preferred node from which the allocation should be made if pages are available on that node.

BufferPointer [out]

The variable that receives the starting address of the allocated memory block. Upon return from this routine, if this variable is zero, a contiguous range could not be found to satisfy the request. If this variable is not NULL, it contains a pointer (for example, a virtual address in the nonpaged portion of the system) to the allocated physically contiguous memory.

PhysicalAddress [out]

Physical address of the allocated memory block.

Return value

This function returns a STOR_STATUS code.

Return code Description
STOR_STATUS_NOT_IMPLEMENTED This function is not implemented on the active operating system.
STOR_STATUS_SUCCESS The operation was successful.
STOR_STATUS_INSUFFICIENT_RESOURCES The operation failed to allocate the requested memory because of insufficient resources.

Remarks

If the request fails, BufferPointer will be set to NULL.

See also

StorPortFreeDmaMemory