From 9251abfe4f4d89081478b0fa76fbb8e2ec7ac79c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 29 Oct 2016 23:53:47 -0400 Subject: [PATCH] Filled in stubs for QUECALLS library. --- native/os2types.h | 1 + native/quecalls.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++ native/quecalls.h | 24 +++++++++++++++++ 3 files changed, 91 insertions(+) diff --git a/native/os2types.h b/native/os2types.h index a4d0594..a7ec546 100644 --- a/native/os2types.h +++ b/native/os2types.h @@ -63,6 +63,7 @@ typedef HANDLE HFILE, *PHFILE; typedef HANDLE HDIR, *PHDIR; typedef HANDLE HEV, *PHEV; typedef HANDLE HMTX, *PHMTX; +typedef HANDLE HQUEUE, *PHQUEUE; typedef HANDLE PID, *PPID; typedef HANDLE TID, *PTID; typedef SHANDLE HVIO, *PHVIO; diff --git a/native/quecalls.c b/native/quecalls.c index cf3c241..3104778 100644 --- a/native/quecalls.c +++ b/native/quecalls.c @@ -1,7 +1,73 @@ #include "os2native.h" #include "quecalls.h" + +APIRET DosCreateQueue(PHQUEUE phq, ULONG priority, PSZ pszName) +{ + TRACE_NATIVE("DosCreateQueue(%p, %u, '%s')", phq, priority, pszName); + FIXME("write me"); + return ERROR_QUE_NO_MEMORY; +} // DosCreateQueue + +APIRET DosCloseQueue(HQUEUE hq) +{ + TRACE_NATIVE("DosCloseQueue(%u)", (uint) hq); + FIXME("write me"); + return ERROR_QUE_INVALID_HANDLE; +} // DosCloseQueue + +APIRET DosOpenQueue(PPID ppid, PHQUEUE phq, PSZ pszName) +{ + TRACE_NATIVE("DosOpenQueue(%p, %p, '%s')", ppid, phq, pszName); + FIXME("write me"); + return ERROR_QUE_NO_MEMORY; +} // DosOpenQueue + +APIRET DosPeekQueue(HQUEUE hq, PREQUESTDATA pRequest, PULONG pcbData, PPVOID ppbuf, PULONG element, BOOL32 nowait, PBYTE ppriority, HEV hsem) +{ + TRACE_NATIVE("DosPeekQueue(%u, %p, %p, %p, %p, %u, %p, %u)", (uint) hq, pRequest, pcbData, ppbuf, element, (uint) nowait, ppriority, (uint) hsem); + FIXME("write me"); + return ERROR_QUE_INVALID_HANDLE; +} // DosPeekQueue + +APIRET DosPurgeQueue(HQUEUE hq) +{ + TRACE_NATIVE("DosPurgeQueue(%u)", (uint) hq); + FIXME("write me"); + return ERROR_QUE_INVALID_HANDLE; +} // DosCloseQueue + +APIRET DosQueryQueue(HQUEUE hq, PULONG pcbEntries) +{ + TRACE_NATIVE("DosQueryQueue(%u, %p)", (uint) hq, pcbEntries); + FIXME("write me"); + return ERROR_QUE_INVALID_HANDLE; +} // DosQueryQueue + +APIRET DosReadQueue(HQUEUE hq, PREQUESTDATA pRequest, PULONG pcbData, PPVOID ppbuf, ULONG element, BOOL32 wait, PBYTE ppriority, HEV hsem) +{ + TRACE_NATIVE("DosReadQueue(%u, %p, %p, %p, %u, %u, %p, %u)", (uint) hq, pRequest, pcbData, ppbuf, (uint) element, (uint) wait, ppriority, (uint) hsem); + FIXME("write me"); + return ERROR_QUE_INVALID_HANDLE; +} // DosReadQueue + +APIRET DosWriteQueue(HQUEUE hq, ULONG request, ULONG cbData, PVOID pbData, ULONG priority) +{ + TRACE_NATIVE("DosWriteQueue(%u)", (uint) hq); + FIXME("write me"); + return ERROR_QUE_INVALID_HANDLE; +} // DosWriteQueue + + LX_NATIVE_MODULE_INIT() + LX_NATIVE_EXPORT(DosReadQueue, 9), + LX_NATIVE_EXPORT(DosPurgeQueue, 10), + LX_NATIVE_EXPORT(DosCloseQueue, 11), + LX_NATIVE_EXPORT(DosQueryQueue, 12), + LX_NATIVE_EXPORT(DosPeekQueue, 13), + LX_NATIVE_EXPORT(DosWriteQueue, 14), + LX_NATIVE_EXPORT(DosOpenQueue, 15), + LX_NATIVE_EXPORT(DosCreateQueue, 16) LX_NATIVE_MODULE_INIT_END() // end of quecalls.c ... diff --git a/native/quecalls.h b/native/quecalls.h index 58dffed..160b601 100644 --- a/native/quecalls.h +++ b/native/quecalls.h @@ -7,6 +7,30 @@ extern "C" { #endif +typedef struct +{ + PID pid; + ULONG ulData; +} REQUESTDATA, *PREQUESTDATA; + +enum +{ + QUE_FIFO = 0, + QUE_LIFO = 1, + QUE_PRIORITY = 2, + QUE_NOCONVERT_ADDRESS = 0, + QUE_CONVERT_ADDRESS = 4 +}; + +APIRET OS2API DosCreateQueue(PHQUEUE phq, ULONG priority, PSZ pszName); +APIRET OS2API DosCloseQueue(HQUEUE hq); +APIRET OS2API DosOpenQueue(PPID ppid, PHQUEUE phq, PSZ pszName); +APIRET OS2API DosPeekQueue(HQUEUE hq, PREQUESTDATA pRequest, PULONG pcbData, PPVOID ppbuf, PULONG element, BOOL32 nowait, PBYTE ppriority, HEV hsem); +APIRET OS2API DosPurgeQueue(HQUEUE hq); +APIRET OS2API DosQueryQueue(HQUEUE hq, PULONG pcbEntries); +APIRET OS2API DosReadQueue(HQUEUE hq, PREQUESTDATA pRequest, PULONG pcbData, PPVOID ppbuf, ULONG element, BOOL32 wait, PBYTE ppriority, HEV hsem); +APIRET OS2API DosWriteQueue(HQUEUE hq, ULONG request, ULONG cbData, PVOID pbData, ULONG priority); + #ifdef __cplusplus } #endif