次の方法で共有


HeapSize (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

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

Parameters

  • hHeap
    [in] Handle to the heap in which the memory block resides.

    This handle is returned by the HeapCreate or GetProcessHeap function.

  • dwFlags
    [in] This parameter is ignored.
  • lpMem
    [in] Valid pointer to the memory block whose size the function will obtain.

    The HeapAlloc or HeapReAlloc function returns this pointer.

Return Value

The size, in bytes, of the allocated memory block indicates success. Because heap allocation rounds the size of a memory block up to the next 32-byte boundary, the size can be larger than the size requested when the memory was allocated. 0xFFFFFFFF indicates failure. The function does not call SetLastError.

Requirements

Header winbase.h
Library coredll.lib
Windows Embedded CE Windows CE 1.0 and later

See Also

Reference

Memory Management Functions
GetProcessHeap
HeapAlloc
HeapCreate
HeapDestroy
HeapFree
HeapReAlloc
SetLastError