Skip to content

API: MmFreeMemory

Archie_UwU edited this page Jan 19, 2024 · 1 revision

Frees heap memory allocated by the MmAllocateMemory function.

Syntax

AurieStatus MmFreeMemory(
    [in] AurieModule* Owner,
    [in] PVOID        AllocationBase
);

Parameters

Owner

The plugin that allocated the memory. The lifetime of the allocation is dependant upon the lifetime of the owner module. Allocations are automatically freed after the ModuleUnload routine, any module operation callbacks, and interface destructors belonging to the module return. Modules should always supply g_ArSelfModule or equivalent.

AllocationBase

The base of the memory allocation to be freed. Allocations in the global "persistent" pool aren't tied to a module, meaning any module can free any persistent memory allocation.

Return Value

If the memory was not allocated by the MmAllocateMemory function, the function returns AURIE_INVALID_PARAMETER. Otherwise, the function returns AURIE_SUCCESS and frees the memory.