Filled in stubs for QUECALLS library.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 29 Oct 2016 23:53:47 -0400
changeset 72 75ded8736bbd
parent 71 1a6a5ecb59de
child 73 b8295997c8d2
Filled in stubs for QUECALLS library.
native/os2types.h
native/quecalls.c
native/quecalls.h
--- a/native/os2types.h	Sat Oct 29 02:05:01 2016 -0400
+++ b/native/os2types.h	Sat Oct 29 23:53:47 2016 -0400
@@ -63,6 +63,7 @@
 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;
--- a/native/quecalls.c	Sat Oct 29 02:05:01 2016 -0400
+++ b/native/quecalls.c	Sat Oct 29 23:53:47 2016 -0400
@@ -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 ...
--- a/native/quecalls.h	Sat Oct 29 02:05:01 2016 -0400
+++ b/native/quecalls.h	Sat Oct 29 23:53:47 2016 -0400
@@ -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