cab_F_00: codename: "whee"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes the Office 2000 installer, if you are so lucky
as to get it to run that far ;)  The Office 2000 installer now
becomes an exemplary example of the inefficient nature of the
FDI API's mechanism of decrypting all previous files in a folder
to get to the current one...  (thus we decrpypt file #1, then 
#1 and #2, then #1, #2, and #3, then #1, #2, #3, and #4, and so
on as we iterate through a folder, quite painful for large
folders) to fix this, we have to remember some kind of
decryption "state" between files in the FDICopy loop... but I
really want a break from fdi.c for now, so no plans to jump
right into this; this should be the last patch for a while,
barring more bug reports.

Gerold: you know what to do with this ;)

License: LGPL

ChangeLog:

* dlls/cabinet: cabinet.h, fdi.c:
  Greg Turner <gmturner007@ameritech.net>
- ERR("WARNING") just doesn't look right ;)
- treat zero file handle as invalid if the callback returns it
- provide the same args as Windows to the Open callback.
- some exit states (technically not OS-level errors per se) are
  worth marking as ERR nevertheless.... I should probably do some
  more like this, for consistency.

--
diff -ur --minimal --exclude-from=/home/greg/bin/winetreediff_excl ../wine.vanilla/dlls/cabinet/cabinet.h ./dlls/cabinet/cabinet.h
--- ../wine.vanilla/dlls/cabinet/cabinet.h	2003-07-19 05:16:03.000000000 -0500
+++ ./dlls/cabinet/cabinet.h	2003-07-27 06:15:47.000000000 -0500
@@ -24,6 +24,10 @@
 #include "fdi.h"
 #include "fci.h"
 
+/* from msvcrt/sys/stat.h */
+#define _S_IWRITE 0x0080
+#define _S_IREAD  0x0100
+
 #define CAB_SPLITMAX (10)
 
 #define CAB_SEARCH_SIZE (32*1024)
diff -ur --minimal --exclude-from=/home/greg/bin/winetreediff_excl ../wine.vanilla/dlls/cabinet/fdi.c ./dlls/cabinet/fdi.c
--- ../wine.vanilla/dlls/cabinet/fdi.c	2003-07-19 05:16:03.000000000 -0500
+++ ./dlls/cabinet/fdi.c	2003-07-27 14:57:18.000000000 -0500
@@ -39,7 +39,6 @@
 #include "winbase.h"
 #include "winerror.h"
 #include "fdi.h"
-#include "msvcrt/fcntl.h" /* _O_.* */
 #include "cabinet.h"
 
 #include "wine/debug.h"
@@ -235,7 +234,7 @@
 
     if (!ok) {
       if (len == maxlen) {
-        ERR("WARNING: cabinet is truncated\n");
+        ERR("cabinet is truncated\n");
         break;
       }
       len += 256;
@@ -1825,7 +1824,7 @@
             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, _O_BINARY | _O_RDONLY | _O_SEQUENTIAL, 0);
+            cabhf = PFDI_OPEN(CAB(hfdi), fullpath, 32768, _S_IREAD | _S_IWRITE);
             if (cabhf == -1) {
               /* no file.  allow the user to try again */
               fdin.fdie = FDIERROR_CABINET_NOT_FOUND;
@@ -1833,9 +1832,16 @@
               continue;
             }
         
+            if (cabhf == 0) {
+              ERR("PFDI_OPEN returned zero for %s.\n", fullpath);
+              fdin.fdie = FDIERROR_CABINET_NOT_FOUND;
+              if (((*pfnfdin)(fdintNEXT_CABINET, &fdin))) return DECR_USERABORT;
+              continue;
+            }
+
             /* check if it's really a cabfile. Note that this doesn't implement the bug */
             if (!FDI_read_entries(CAB(hfdi), cabhf, &fdici, &(cab->next->mii))) {
-              WARN("FDIIsCabinet failed.\n");
+              ERR("FDIIsCabinet failed.\n");
               PFDI_CLOSE(CAB(hfdi), cabhf);
               fdin.fdie = FDIERROR_NOT_A_CABINET;
               if (((*pfnfdin)(fdintNEXT_CABINET, &fdin))) return DECR_USERABORT;
@@ -2020,7 +2026,7 @@
   TRACE("full cab path/file name: %s\n", debugstr_a(fullpath));
 
   /* get a handle to the cabfile */
-  cabhf = PFDI_OPEN(hfdi, fullpath, _O_BINARY | _O_RDONLY | _O_SEQUENTIAL, 0);
+  cabhf = PFDI_OPEN(hfdi, fullpath, 32768, _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;
@@ -2029,6 +2035,15 @@
     return FALSE;
   }
 
+  if (cabhf == 0) {
+    ERR("PFDI_OPEN returned zero for %s.\n", fullpath);
+    PFDI_INT(hfdi)->perf->erfOper = FDIERROR_CABINET_NOT_FOUND;
+    PFDI_INT(hfdi)->perf->erfType = ERROR_FILE_NOT_FOUND;
+    PFDI_INT(hfdi)->perf->fError = TRUE;
+    SetLastError(ERROR_FILE_NOT_FOUND);
+    return FALSE;
+  }
+
   /* check if it's really a cabfile. Note that this doesn't implement the bug */
   if (!FDI_read_entries(hfdi, cabhf, &fdici, &(CAB(mii)))) {
     ERR("FDIIsCabinet failed.\n");
-- 
gmt

#define SHOCK_TRACE(...) \
  do {\
    WINE_TRACE("\n\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" \
               "X#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#X\n" \
               "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" \
               "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" \
               "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" \
               "X#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#X\n" \
               "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n"); \
    WINE_TRACE(__VA_ARGS__); \
    WINE_TRACE("\n\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" \
               "X#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#X\n" \
               "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" \
               "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" \
               "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" \
               "X#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#X\n" \
               "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n"); \
  } while (0)



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux