Skip to content

Commit

Permalink
DosFlatToSel() is called like any other OS/2 API.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
icculus committed Oct 9, 2016
1 parent ccad3a0 commit 086e05d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions native/doscalls.c
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion native/doscalls.h
Expand Up @@ -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);
Expand Down

0 comments on commit 086e05d

Please sign in to comment.