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:34] – prokushev | en: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 |
| 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 < | #include < | ||
| - | BOOL InitializeLocalHeap(WORD seg, WORD offset, WORD size) { | + | BOOL WINAPI |
| return LocalInit(seg, | return LocalInit(seg, | ||
| } | } | ||
| Line 42: | Line 43: | ||
| < | < | ||
| ; 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 | ||
| </ | </ | ||




