Just enough to get wasm.exe to not crash prompting for the Any key.
This lets the program survive if you run it without command line arguments.
This commit is contained in:
1 parent
970cbbc0c2
commit
411c204ccb
3 files changed
+50
-2
No files matched your search
+35
-2
@@ -1,7 +1,40 @@
|
||||
#include "os2native.h"
|
||||
#include "os2native16.h"
|
||||
#include "kbdcalls.h"
|
||||
|
||||
LX_NATIVE_MODULE_INIT()
|
||||
APIRET16 KbdCharIn(PKBDKEYINFO pkbci, USHORT fWait, HKBD hkbd)
|
||||
{
|
||||
TRACE_NATIVE("KbdCharIn(%p, %u, %u)", pkbci, fWait, hkbd);
|
||||
FIXME("this is just enough to survive 'press any key'");
|
||||
getchar();
|
||||
return NO_ERROR;
|
||||
} // kbdCharIn
|
||||
|
||||
static APIRET16 bridge16to32_KbdCharIn(uint8 *args)
|
||||
{
|
||||
const HKBD hkbd = *((HKBD *) args); args += 2;
|
||||
const USHORT fWait = *((USHORT *) args); args += 2;
|
||||
//PKBDKEYINFO pkbci = (PKBDKEYINFO) GLoaderState->convert1616to32(*((uint32*) args)); //args += 4;
|
||||
return KbdCharIn(NULL/*FIXMEpkbci*/, fWait, hkbd);
|
||||
} // bridge16to32_KbdCharIn
|
||||
|
||||
LX_NATIVE_MODULE_16BIT_SUPPORT()
|
||||
LX_NATIVE_MODULE_16BIT_API(KbdCharIn)
|
||||
LX_NATIVE_MODULE_16BIT_SUPPORT_END()
|
||||
|
||||
LX_NATIVE_MODULE_DEINIT({
|
||||
LX_NATIVE_MODULE_DEINIT_16BIT_SUPPORT();
|
||||
})
|
||||
|
||||
static int initKbdcalls(void)
|
||||
{
|
||||
LX_NATIVE_MODULE_INIT_16BIT_SUPPORT()
|
||||
LX_NATIVE_INIT_16BIT_BRIDGE(KbdCharIn, 8)
|
||||
LX_NATIVE_MODULE_INIT_16BIT_SUPPORT_END()
|
||||
return 1;
|
||||
} // initViocalls
|
||||
|
||||
LX_NATIVE_MODULE_INIT({ if (!initKbdcalls()) return NULL; })
|
||||
LX_NATIVE_EXPORT16(KbdCharIn, 4)
|
||||
LX_NATIVE_MODULE_INIT_END()
|
||||
|
||||
// end of kbdcalls.c ...
|
||||
|
||||
@@ -7,6 +7,20 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#pragma pack(push, 2)
|
||||
typedef struct
|
||||
{
|
||||
UCHAR chChar;
|
||||
UCHAR chScan;
|
||||
UCHAR fbStatus;
|
||||
UCHAR bNlsShift;
|
||||
USHORT fsState;
|
||||
ULONG time;
|
||||
} KBDKEYINFO, *PKBDKEYINFO;
|
||||
#pragma pack(pop)
|
||||
|
||||
APIRET16 OS2API16 KbdCharIn(PKBDKEYINFO pkbci, USHORT fWait, HKBD hkbd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -66,6 +66,7 @@ typedef HANDLE HMTX, *PHMTX;
|
||||
typedef HANDLE PID, *PPID;
|
||||
typedef HANDLE TID, *PTID;
|
||||
typedef SHANDLE HVIO, *PHVIO;
|
||||
typedef SHANDLE HKBD, *PHKBD;
|
||||
typedef PCHAR PSZ;
|
||||
|
||||
typedef int (APIENTRY *PFN)(void);
|
||||
|
||||
Reference in new issue
Block a user