AllocateMemory |
Allocate memory from a device’s memory region.
virtual HRESULT AllocateMemory(UINT64 ullSize, UINT64* pullOffset) abstract;
[in] Size of the allocation.
[out] Offset into device memory region where memory has been allocated.
Returns S_OK if successful, otherwise a failure HRESULT.
The AllocateMemory function returns an offset into a device’s memory region that has been allocated for use by this session. If the device is located on the local interface card, the memory can be allocated either on the device itself or on the computer’s system memory.
The following example demonstrates use of the AllocateMemory function.
// CoAcme4321.cpp STDMETHODIMP Acme4321::IAcme4321_Configure() { UINT64 ullOffset; hr = io.Memory.AllocateMemory(100, &ullOffset); // ... hr = io.Memory.FreeMemory(ulOffset); return hr; }