| Previous | Next |
| STATUS_DEVICE_POWER_FAILURE | STATUS_MEMORY_NOT_ALLOCATED |
STATUS_FREE_VM_NOT_AT_BASE
MEM_RELEASE must identify the start of the reservation
Releasing a reservation is different from decommitting pages inside it. When the region size is zero and the caller requests full release, the base must be exactly the address returned by the original reservation call. An interior pointer, even if page-aligned, cannot identify the allocation object to release.
Store allocation bases in ownership objects and never derive them by rounding arbitrary pointers. If only a subrange should become reusable, decommit it while preserving the reservation, subject to the API rules. Mapped views must still use UnmapViewOfFile.
What to inspect
- Compare the supplied pointer with VirtualQuery AllocationBase and the original allocation record.
- Verify RegionSize and FreeType correspond to release rather than decommit.
- Audit pointer arithmetic and allocator headers for loss of the true base address.
References
- Microsoft: VirtualFree
- Microsoft WDK: NtFreeVirtualMemory
- Microsoft: VirtualQuery
- Microsoft Open Specifications: NTSTATUS values
Looking for a different code? Search another status or error code.