HeapSize

HeapSize returns the size, in bytes, of a memory block allocated from a heap by HeapAlloc or HeapReAlloc.

Syntax

Copy
DWORD HeapSize(
    HANDLE hHeap,
    DWORD dwFlags,
    LPCVOID lpMem
);

Parameters

hHeap

The heap in which the memory block resides. This handle is returned by GetProcessHeap.

Flags

Ignored.

lpMem

A pointer to the memory block whose size the function will obtain. This pointer is returned by HeapAlloc or HeapReAlloc.

Return Value

If the function succeeds, it returns the size, in bytes, of the allocated memory block. If the function fails, it returns 0XFFFFFFFF.

The function does not call SetLastError. An application cannot call GetLastError for extended error information.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

windows.h rtkrnl.lib

See Also: