en:docs:win16:api:kernel:localhandle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:docs:win16:api:kernel:localhandle [2023/05/01 10:44] – created prokusheven:docs:win16:api:kernel:localhandle [2026/03/04 06:17] (current) prokushev
Line 1: Line 1:
 {{page>en:templates:win16api}} {{page>en:templates:win16api}}
  
-======  ======+====== LocalHandle ====== 
 +==== Brief ==== 
 +Retrieves the handle associated with a given pointer to a local memory object.
  
-===== Brief =====+==== Syntax ==== 
 +<code c>HLOCAL WINAPI LocalHandle( 
 +LPCVOID pMem 
 +);</code>
  
-===== Syntax =====+==== Parameters ====
  
-===== Parameters =====+pMem – Pointer to a memory block inside the local heap (returned by LocalLock).
  
-===== Return Code =====+==== Return Value ====
  
-===== Notes =====+Returns the handle of the object, or NULL if the pointer does not belong to the local heap. Call GetLastError.
  
-===== Example Code =====+==== Notes ====
  
-==== C Binding ====+This function is the inverse of LocalLock.
  
 +Useful when you only have a pointer and need the handle for other operations (e.g., LocalFlags, LocalSize).
 +
 +==== Example Code ====
 +==== C Binding ====
 +<code c>HLOCAL h = LocalHandle(pData);</code>
 ==== MASM Binding ==== ==== MASM Binding ====
 +<code asm>push p
 +call LocalHandle</code>
 +
 +==== See also ====
 +
 +  * [[LocalLock]]
  
-===== See also ===== 
  
 {{page>en:templates:win16}} {{page>en:templates:win16}}