次の方法で共有


LocalSize (Compact 2013)

3/28/2014

This function returns the current size, in bytes, of the specified local memory object.

Syntax

UINT LocalSize(
  HLOCAL hMem
);

Parameters

  • hMem
    [in] Handle to the local memory object. This handle is returned by the LocalAlloc or LocalReAlloc function.

Return Value

In the debug configuration, where heap sentinels are enabled, the return value is the exact allocation size for the heap item.

In the retail configuration, where debug information is not included, the return value is the value allocation size aligned to the block size (32 bytes).

Zero indicates that the specified handle is not valid or that the object has been discarded. To get extended error information, call GetLastError.

Remarks

The size of a memory block can be larger than the size requested when the memory was allocated.

Requirements

Header

winbase.h

Library

coredll.lib

See Also

Reference

Memory Management Functions
LocalAlloc
LocalReAlloc