Index: trunk/src/kernel32/oslibdos.cpp
===================================================================
--- trunk/src/kernel32/oslibdos.cpp	(revision 7273)
+++ trunk/src/kernel32/oslibdos.cpp	(revision 7275)
@@ -1,3 +1,3 @@
-/* $Id: oslibdos.cpp,v 1.81 2001-10-29 20:08:40 sandervl Exp $ */
+/* $Id: oslibdos.cpp,v 1.82 2001-10-30 18:46:45 sandervl Exp $ */
 /*
  * Wrappers for OS/2 Dos* API
@@ -40,4 +40,5 @@
 static PROC_DosSetFilePtrL   DosSetFilePtrLProc   = 0;
 static PROC_DosSetFileLocksL DosSetFileLocksLProc = 0;
+static PROC_DosOpenL         DosOpenLProc = 0;
 static BOOL f64BitIO = FALSE;
 //******************************************************************************
@@ -59,4 +60,7 @@
     return;
   }
+  if(DosQueryProcAddr(hDoscalls, 981, NULL, (PFN *)&DosOpenLProc) != NO_ERROR) {
+    return;
+  }
   f64BitIO = TRUE;
 }
@@ -94,4 +98,24 @@
 
     yyrc = DosSetFileLocksLProc(hFile, pflUnlock, pflLock, timeout, flags);
+    SetFS(sel);
+
+    return yyrc;
+}
+//******************************************************************************
+//******************************************************************************
+APIRET APIENTRY OdinDosOpenL(PCSZ  pszFileName,
+                             PHFILE phf,
+                             PULONG pulAction,
+                             LONGLONG cbFile,
+                             ULONG ulAttribute,
+                             ULONG fsOpenFlags,
+                             ULONG fsOpenMode,
+                             PEAOP2 peaop2)
+{
+ APIRET yyrc;
+ USHORT sel = RestoreOS2FS();
+
+    yyrc = DosOpenLProc(pszFileName, phf, pulAction, cbFile, ulAttribute, fsOpenFlags,
+                        fsOpenMode, peaop2);
     SetFS(sel);
 
@@ -912,5 +936,5 @@
    HFILE   hFile;
    ULONG   actionTaken = 0;
-   ULONG   fileSize = 0;
+   LONGLONG fileSize = {0};
    ULONG   fileAttr = FILE_NORMAL;
    ULONG   openFlag = 0;
@@ -1009,12 +1033,12 @@
    {
         dprintf(("DosOpen %s openFlag=%x openMode=%x", lpszFile, openFlag, openMode));
-        rc = DosOpen((PSZ)lpszFile,
-                      &hFile,
-                      &actionTaken,
-                      fileSize,
-                      fileAttr,
-                      openFlag,
-                      openMode,
-                      NULL);
+        rc = OdinDosOpenL((PSZ)lpszFile,
+                           &hFile,
+                           &actionTaken,
+                           fileSize,
+                           fileAttr,
+                           openFlag,
+                           openMode,
+                           NULL);
     if (rc == ERROR_TOO_MANY_OPEN_FILES)
     {
@@ -1082,5 +1106,5 @@
 {
    ULONG   actionTaken = 0;
-   ULONG   fileSize = 0;
+   LONGLONG fileSize = {0};
    ULONG   fileAttr = FILE_NORMAL;
    ULONG   openFlag = 0;
@@ -1125,12 +1149,12 @@
         openMode |= OPEN_SHARE_DENYREADWRITE;
 
-   rc = DosOpen((PSZ)lpszFile,
-                &hFile,
-                &actionTaken,
-                fileSize,
-                fileAttr,
-                openFlag,
-                openMode,
-                NULL);
+   rc = OdinDosOpenL((PSZ)lpszFile,
+                     &hFile,
+                     &actionTaken,
+                     fileSize,
+                     fileAttr,
+                     openFlag,
+                     openMode,
+                     NULL);
 
    if(rc != NO_ERROR)
@@ -1146,7 +1170,7 @@
         if((rc == ERROR_OPEN_FAILED) && (openFlag & OPEN_ACTION_OPEN_IF_EXISTS))
         {
-            SetLastError(ERROR_FILE_NOT_FOUND_W);
-        }
-        else    SetLastError(error2WinError(rc));
+             SetLastError(ERROR_FILE_NOT_FOUND_W);
+        }
+        else SetLastError(error2WinError(rc));
 
         return HFILE_ERROR_W;
Index: trunk/src/kernel32/oslibdos.h
===================================================================
--- trunk/src/kernel32/oslibdos.h	(revision 7273)
+++ trunk/src/kernel32/oslibdos.h	(revision 7275)
@@ -1,3 +1,3 @@
-/* $Id: oslibdos.h,v 1.36 2001-10-25 13:19:05 sandervl Exp $ */
+/* $Id: oslibdos.h,v 1.37 2001-10-30 18:46:46 sandervl Exp $ */
 
 /*
@@ -301,4 +301,23 @@
                               ULONG timeout,
                               ULONG flags);
+
+
+   typedef APIRET (* APIENTRY PROC_DosOpenL)(PCSZ  pszFileName, PHFILE phf,
+                                             PULONG pulAction,
+                                             LONGLONG cbFile,
+                                             ULONG ulAttribute,
+                                             ULONG fsOpenFlags,
+                                             ULONG fsOpenMode,
+                                             PEAOP2 peaop2);
+
+   APIRET APIENTRY OdinDosOpenL(PCSZ  pszFileName,
+                                PHFILE phf,
+                                PULONG pulAction,
+                                LONGLONG cbFile,
+                                ULONG ulAttribute,
+                                ULONG fsOpenFlags,
+                                ULONG fsOpenMode,
+                                PEAOP2 peaop2);
+
 #endif
 
