Differences
This shows you the differences between two versions of the page.
| en:docs:win16:api:kernel:localunlock [2023/05/01 10:44] – created prokushev | en:docs:win16:api:kernel:localunlock [2026/03/04 05:09] (current) – prokushev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{page> | {{page> | ||
| - | ====== | + | ====== |
| + | ==== Brief ==== | ||
| + | Decrements the lock count of a local memory object. | ||
| - | ===== Brief ===== | + | ==== Syntax |
| + | <code c>BOOL WINAPI LocalUnlock( | ||
| + | HLOCAL hMem | ||
| + | );</ | ||
| - | ===== Syntax ===== | + | ==== Parameters |
| - | ===== Parameters ===== | + | hMem – Handle to the memory object. |
| - | ===== Return | + | ==== Return |
| - | ===== Notes ===== | + | Returns FALSE (0) if the lock count becomes zero (object is now unlocked). |
| - | ===== Example Code ===== | + | Returns TRUE (non‑zero) if the lock count is still greater than zero after decrementing. |
| - | ==== C Binding | + | ==== Notes ==== |
| + | The return value indicates the new lock state, not success or failure – the function always succeeds for a valid handle. | ||
| + | |||
| + | Unlocking allows the heap manager to move or discard the block during compaction. | ||
| + | |||
| + | ==== Example Code ==== | ||
| + | ==== C Binding ==== | ||
| + | <code c>BOOL stillLocked = LocalUnlock(hMem);</ | ||
| ==== MASM Binding ==== | ==== MASM Binding ==== | ||
| + | <code asm>push hMem | ||
| + | call LocalUnlock | ||
| + | test ax, ax ; zero if completely unlocked</ | ||
| + | |||
| + | ==== See also ==== | ||
| - | ===== See also ===== | + | * [[LocalLock]] |
| + | * [[LocalFlags]] | ||
| {{page> | {{page> | ||




