From 086e05dd0cc38d204d412ca42703b62ea5554251 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 9 Oct 2016 13:44:10 -0400 Subject: [PATCH] DosFlatToSel() is called like any other OS/2 API. I must have been reading docs for device drivers, or something...? Now it returns the top word of the linear pointer, in hopes that this will just get mushed back together later, knock on wood. --- native/doscalls.c | 11 ++++++----- native/doscalls.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/native/doscalls.c b/native/doscalls.c index 2400a40..1966d42 100644 --- a/native/doscalls.c +++ b/native/doscalls.c @@ -411,13 +411,14 @@ APIRET DosSetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD rec) return NO_ERROR; } // DosSetExceptionHandler -ULONG DosFlatToSel(void) +ULONG DosFlatToSel(PVOID ptr) { // this actually passes the arg in eax instead of the stack. - uint32 eax = 0; - __asm__ __volatile__ ("" : "=a" (eax)); - TRACE_NATIVE("DosFlatToSel(%p)", (void *) (size_t) eax); - return (ULONG) 0x12345678; // !!! FIXME + //uint32 eax = 0; + //__asm__ __volatile__ ("" : "=a" (eax)); + //TRACE_NATIVE("DosFlatToSel(%p)", (void *) (size_t) eax); + TRACE_NATIVE("DosFlatToSel(%p)", ptr); + return ((ULONG) ((size_t)ptr)) >> 16; // !!! FIXME } // DosFlatToSel APIRET DosSetSignalExceptionFocus(BOOL32 flag, PULONG pulTimes) diff --git a/native/doscalls.h b/native/doscalls.h index 2aeda45..b016bb6 100644 --- a/native/doscalls.h +++ b/native/doscalls.h @@ -181,7 +181,7 @@ APIRET OS2API DosExitList(ULONG ordercode, PFNEXITLIST pfn); APIRET OS2API DosCreateEventSem(PSZ pszName, PHEV phev, ULONG flAttr, BOOL32 fState); APIRET OS2API DosCreateMutexSem(PSZ pszName, PHMTX phmtx, ULONG flAttr, BOOL32 fState); APIRET OS2API DosSetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD pERegRec); -ULONG OS2API DosFlatToSel(void); +ULONG OS2API DosFlatToSel(PVOID ptr); APIRET OS2API DosSetSignalExceptionFocus(BOOL32 flag, PULONG pulTimes); APIRET OS2API DosSetRelMaxFH(PLONG pcbReqCount, PULONG pcbCurMaxFH); APIRET OS2API DosAllocMem(PPVOID ppb, ULONG cb, ULONG flag);