Alexandre Julliard : cabinet: Use the proper fcntl defines in the FDI_OPEN calls.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 22 06:23:24 CDT 2007


Module: wine
Branch: master
Commit: d5ff7282653129e3ca3b482e7708e05ff9b0351f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d5ff7282653129e3ca3b482e7708e05ff9b0351f

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Aug 22 11:46:17 2007 +0200

cabinet: Use the proper fcntl defines in the FDI_OPEN calls.

---

 dlls/cabinet/cabinet.h      |   17 +++++++++++++++++
 dlls/cabinet/cabinet_main.c |    7 -------
 dlls/cabinet/fdi.c          |    4 ++--
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/dlls/cabinet/cabinet.h b/dlls/cabinet/cabinet.h
index befa604..4cd1f77 100644
--- a/dlls/cabinet/cabinet.h
+++ b/dlls/cabinet/cabinet.h
@@ -33,6 +33,23 @@
 #define _S_IWRITE 0x0080
 #define _S_IREAD  0x0100
 
+/* from msvcrt/fcntl.h */
+#define _O_RDONLY      0
+#define _O_WRONLY      1
+#define _O_RDWR        2
+#define _O_ACCMODE     (_O_RDONLY|_O_WRONLY|_O_RDWR)
+#define _O_APPEND      0x0008
+#define _O_RANDOM      0x0010
+#define _O_SEQUENTIAL  0x0020
+#define _O_TEMPORARY   0x0040
+#define _O_NOINHERIT   0x0080
+#define _O_CREAT       0x0100
+#define _O_TRUNC       0x0200
+#define _O_EXCL        0x0400
+#define _O_SHORT_LIVED 0x1000
+#define _O_TEXT        0x4000
+#define _O_BINARY      0x8000
+
 #define CAB_SPLITMAX (10)
 
 #define CAB_SEARCH_SIZE (32*1024)
diff --git a/dlls/cabinet/cabinet_main.c b/dlls/cabinet/cabinet_main.c
index 2c21286..4cea2a1 100644
--- a/dlls/cabinet/cabinet_main.c
+++ b/dlls/cabinet/cabinet_main.c
@@ -37,13 +37,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(cabinet);
 
-/* the following defintions are copied from msvcrt/fcntl.h */
-
-#define _O_RDONLY      0
-#define _O_WRONLY      1
-#define _O_RDWR        2
-#define _O_ACCMODE     (_O_RDONLY|_O_WRONLY|_O_RDWR)
-
 
 /***********************************************************************
  * DllGetVersion (CABINET.2)
diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c
index 01203b6..ef00447 100644
--- a/dlls/cabinet/fdi.c
+++ b/dlls/cabinet/fdi.c
@@ -2128,7 +2128,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state
             TRACE("full cab path/file name: %s\n", debugstr_a(fullpath));
         
             /* try to get a handle to the cabfile */
-            cabhf = PFDI_OPEN(CAB(hfdi), fullpath, 32768, _S_IREAD | _S_IWRITE);
+            cabhf = PFDI_OPEN(CAB(hfdi), fullpath, _O_RDONLY|_O_BINARY, _S_IREAD | _S_IWRITE);
             if (cabhf == -1) {
               /* no file.  allow the user to try again */
               fdin.fdie = FDIERROR_CABINET_NOT_FOUND;
@@ -2492,7 +2492,7 @@ BOOL __cdecl FDICopy(
   TRACE("full cab path/file name: %s\n", debugstr_a(fullpath));
 
   /* get a handle to the cabfile */
-  cabhf = PFDI_OPEN(hfdi, fullpath, 32768, _S_IREAD | _S_IWRITE);
+  cabhf = PFDI_OPEN(hfdi, fullpath, _O_RDONLY|_O_BINARY, _S_IREAD | _S_IWRITE);
   if (cabhf == -1) {
     PFDI_INT(hfdi)->perf->erfOper = FDIERROR_CABINET_NOT_FOUND;
     PFDI_INT(hfdi)->perf->erfType = ERROR_FILE_NOT_FOUND;




More information about the wine-cvs mailing list