Index: trunk/src/win32k/kKrnlLib/kKrnlLibTst.def
===================================================================
--- trunk/src/win32k/kKrnlLib/kKrnlLibTst.def	(revision 6785)
+++ trunk/src/win32k/kKrnlLib/kKrnlLibTst.def	(revision 6786)
@@ -1,3 +1,3 @@
-;/* $Id: kKrnlLibTst.def,v 1.1 2001-09-17 01:17:01 bird Exp $
+;/* $Id: kKrnlLibTst.def,v 1.2 2001-09-23 06:45:21 bird Exp $
 ; *
 ; * Definition file for the Ring-3 test program.
@@ -44,6 +44,12 @@
 
 IMPORTS
+     DosQuerySysState = DOSCALL1.368
+
+     _DosRead         = DOSCALL1.281
      _DosWrite        = DOSCALL1.282
+     _DosOpen         = DOSCALL1.273
+     _DosClose        = DOSCALL1.257
+     _DosSetFilePtr   = DOSCALL1.256
+
      _DOS16OPEN       = DOSCALL1.70
      _DOS16CLOSE      = DOSCALL1.59
-     DosQuerySysState = DOSCALL1.368
Index: trunk/src/win32k/kKrnlLib/testcase/Dos.c
===================================================================
--- trunk/src/win32k/kKrnlLib/testcase/Dos.c	(revision 6785)
+++ trunk/src/win32k/kKrnlLib/testcase/Dos.c	(revision 6786)
@@ -1,3 +1,3 @@
-/* $Id: Dos.c,v 1.1 2001-09-17 01:41:12 bird Exp $
+/* $Id: Dos.c,v 1.2 2001-09-23 06:45:20 bird Exp $
  *
  * Thunkers for OS/2 APIs.
@@ -33,5 +33,19 @@
 *******************************************************************************/
 APIRET  APIENTRY        _DosWrite(HFILE hFile, PVOID pBuffer, ULONG cbWrite, PULONG pcbActual);
-
+APIRET  APIENTRY        _DosClose(HFILE hFile);
+APIRET  APIENTRY        _DosOpen(
+                            PSZ     pszFileName,
+                            PHFILE  pHf,
+                            PULONG  pulAction,
+                            ULONG   cbFile,
+                            ULONG   ulAttribute,
+                            ULONG   fsOpenFlags,
+                            ULONG   fsOpenMode,
+                            PEAOP2  peaop2);
+APIRET  APIENTRY        _DosSetFilePtr(
+                            HFILE   hFile,
+                            LONG    ib,
+                            ULONG   method,
+                            PULONG  ibActual);
 
 /**
@@ -53,2 +67,83 @@
 }
 
+
+/**
+ * DosClose overload. Ensures that the stack is 32-bit!
+ */
+APIRET  APIENTRY        DosClose(HFILE hFile)
+{
+    BOOL    f32Stack = ((int)&hFile > 0x10000);
+    APIRET  rc;
+    if (!f32Stack)
+        ThunkStack16To32();
+
+    rc = _DosClose(hFile);
+
+    if (!f32Stack)
+        ThunkStack32To16();
+
+    return rc;
+}
+
+
+/**
+ * DosOpen overload. Ensures that the stack is 32-bit!
+ */
+APIRET  APIENTRY        DosOpen(
+                            PSZ    pszFileName,
+                            PHFILE pHf,
+                            PULONG pulAction,
+                            ULONG  cbFile,
+                            ULONG  ulAttribute,
+                            ULONG  fsOpenFlags,
+                            ULONG  fsOpenMode,
+                            PEAOP2 peaop2)
+{
+    BOOL    f32Stack = ((int)&cbFile > 0x10000);
+    APIRET  rc;
+    if (!f32Stack)
+        ThunkStack16To32();
+
+    rc = _DosOpen(pszFileName,
+                   pHf,
+                   pulAction,
+                   cbFile,
+                   ulAttribute,
+                   fsOpenFlags,
+                   fsOpenMode,
+                   peaop2);
+
+    if (!f32Stack)
+        ThunkStack32To16();
+
+    return rc;
+}
+
+
+/**
+ * DosSetFilePtr overload. Ensures that the stack is 32-bit!
+ */
+APIRET  APIENTRY        DosSetFilePtr(
+                            HFILE   hFile,
+                            LONG    ib,
+                            ULONG   method,
+                            PULONG  ibActual)
+{
+    BOOL    f32Stack = ((int)&hFile > 0x10000);
+    APIRET  rc;
+    if (!f32Stack)
+        ThunkStack16To32();
+
+    rc = _DosSetFilePtr(hFile,
+                        ib,
+                        method,
+                        ibActual);
+
+    if (!f32Stack)
+        ThunkStack32To16();
+
+    return rc;
+}
+
+
+
