/* Application-side Win16 global-memory helpers from Code2. */ #include "tdkpin_global_memory.h" /* 1008:15c7 — allocate a movable/fixed block and return its locked far view. */ Win16FarPtr tdkpin_global_allocate_locked(UINT16 flags, uint32_t bytes) { HGLOBAL16 allocation = GlobalAlloc16(flags, bytes); return GlobalLock16(allocation); } /* * 1008:15e7 — recover the allocation handle from the pointer selector, unlock * it, then free it. The offset half of the supplied far pointer is ignored. */ void tdkpin_global_unlock_and_free(Win16FarPtr block) { HGLOBAL16 allocation = GlobalHandle16(win16_far_selector(block)); (void)GlobalUnlock16(allocation); (void)GlobalFree16(allocation); }