Differences
This shows you the differences between two versions of the page.
| en:docs:win16:api:kernel:localsize [2023/05/01 10:44] – created prokushev | en:docs:win16:api:kernel:localsize [2026/03/04 05:53] (current) – prokushev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{page> | {{page> | ||
| - | ====== | + | ====== |
| + | ==== Brief ==== | ||
| + | Returns the current size (in bytes) of a local memory object. | ||
| - | ===== Brief ===== | + | ==== Syntax |
| + | <code c>UINT WINAPI LocalSize( | ||
| + | HLOCAL hMem | ||
| + | );</ | ||
| - | ===== Syntax ===== | + | ==== Parameters |
| - | ===== Parameters ===== | + | hMem – Handle to the memory object. |
| - | ===== Return | + | ==== Return |
| - | ===== Notes ===== | + | Returns the size of the block, or zero if the handle is invalid or the object has been discarded. |
| - | ===== Example Code ===== | + | Call GetLastError for extended error information. |
| - | ==== C Binding | + | ==== Notes ==== |
| + | The returned size may be larger than the originally requested size because of internal alignment. | ||
| + | |||
| + | Use LocalFlags first to check whether the block has been discarded. | ||
| + | |||
| + | ==== Example Code ==== | ||
| + | ==== C Binding ==== | ||
| + | <code c>UINT size = LocalSize(hMem);</ | ||
| ==== MASM Binding ==== | ==== MASM Binding ==== | ||
| + | <code asm>push hMem | ||
| + | call LocalSize</ | ||
| + | |||
| + | ==== See also ==== | ||
| - | ===== See also ===== | + | * [[LocalAlloc]] |
| + | * [[LocalFlags]] | ||
| {{page> | {{page> | ||




