Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:docs:win16:api:kernel:localinit [2026/02/08 09:33] – prokushev | en:docs:win16:api:kernel:localinit [2026/02/08 16:07] (current) – prokushev | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| ===== Syntax ===== | ===== Syntax ===== | ||
| <code c> | <code c> | ||
| - | BOOL LocalInit( | + | BOOL WINAPI |
| WORD wSegment, | WORD wSegment, | ||
| WORD wOffset, | WORD wOffset, | ||
| Line 25: | Line 25: | ||
| ===== Notes ===== | ===== Notes ===== | ||
| - | * < | ||
| * 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 < | + | * Applications typically call LocalInit during initialization of a data segment or a dynamically allocated memory block intended for use as a local heap. |
| - | * The heap size (< | + | |
| - | * For compatibility and performance reasons, modern Windows applications should use the standard heap functions (e.g., < | + | |
| ===== Example Code ===== | ===== Example Code ===== | ||
| Line 37: | Line 34: | ||
| #include < | #include < | ||
| - | BOOL InitializeLocalHeap(WORD seg, WORD offset, WORD size) { | + | BOOL WINAPI |
| return LocalInit(seg, | return LocalInit(seg, | ||
| } | } | ||
| Line 45: | Line 42: | ||
| < | < | ||
| ; 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 | call LocalInit | ||
| </ | </ | ||




