en:docs:win16:api:kernel:localinit

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:docs:win16:api:kernel:localinit [2026/02/08 09:34] prokusheven:docs:win16:api:kernel:localinit [2026/02/20 07:09] (current) – [Notes] prokushev
Line 8: Line 8:
 ===== Syntax ===== ===== Syntax =====
 <code c> <code c>
-BOOL LocalInit(+BOOL WINAPI LocalInit(
   WORD  wSegment,   WORD  wSegment,
   WORD  wOffset,   WORD  wOffset,
Line 27: Line 27:
   * The function sets up a local heap manager within the provided segment, enabling local memory allocation functions to operate within that segment.   * The function sets up a local heap manager within the provided segment, enabling local memory allocation functions to operate within that segment.
   * Applications typically call LocalInit during initialization of a data segment or a dynamically allocated memory block intended for use as a local heap.   * Applications typically call LocalInit during initialization of a data segment or a dynamically allocated memory block intended for use as a local heap.
 +  * First 16 bytes of segment used as system data area.
  
 ===== Example Code ===== ===== Example Code =====
Line 34: Line 35:
 #include <windows.h> #include <windows.h>
  
-BOOL InitializeLocalHeap(WORD seg, WORD offset, WORD size) {+BOOL WINAPI InitializeLocalHeap(WORD seg, WORD offset, WORD size) {
     return LocalInit(seg, offset, size);     return LocalInit(seg, offset, size);
 } }
Line 42: Line 43:
 <file> <file>
 ; Assume AX = segment, DX = offset, CX = heap size ; Assume AX = segment, DX = offset, CX = heap size
-push cx          ; wHeapSize 
-push dx          ; wOffset 
 push ax          ; wSegment push ax          ; wSegment
 +push dx          ; wOffset
 +push cx          ; wHeapSize
 call LocalInit   ; Returns AX = non-zero if success call LocalInit   ; Returns AX = non-zero if success
 </file> </file>