Re: Don't let cabinet Extract() crash IE

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

 



Hello,

after this patch the IE 5.5 installer works for DXMINI.CAB, DXDDEX.CAB and 
SWFLASH.CAB

ChangeLog
--------------
	added the linked list with the name of files of the CAB archive





diff -urw ../wine/dlls/cabinet/cabextract.c dlls/cabinet/cabextract.c
--- ../wine/dlls/cabinet/cabextract.c	2003-12-31 09:45:41.000000000 +0100
+++ dlls/cabinet/cabextract.c	2004-01-07 21:31:53.000000000 +0100
@@ -2564,6 +2564,7 @@
 {
   struct cabinet *basecab, *cab, *cab1, *cab2;
   struct cab_file *filelist, *fi;
+  struct ExtractFileList **destlistptr = &(dest->filelist);
 
   /* The first result of a search will be returned, and
    * the remaining results will be chained to it via the cab->next structure
@@ -2632,6 +2633,16 @@
                 strlen(dest->directory) ? dest->directory : "",
                 strlen(dest->directory) ? "\\": "",
                 fi->filename);
+	*destlistptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
+				sizeof(struct ExtractFileList));
+	if(*destlistptr) {
+	   (*destlistptr)->unknown = TRUE; /* FIXME: were do we get the value? */
+	   (*destlistptr)->filename = HeapAlloc(GetProcessHeap(), 0, (
+						strlen(fi->filename)+1));
+	   if((*destlistptr)->filename) 
+		lstrcpyA((*destlistptr)->filename, fi->filename);
+	   destlistptr = &((*destlistptr)->next);
+	}
     }
   }
 
diff -urw ../wine/dlls/cabinet/cabinet.h dlls/cabinet/cabinet.h
--- ../wine/dlls/cabinet/cabinet.h	2003-12-31 09:45:41.000000000 +0100
+++ dlls/cabinet/cabinet.h	2004-01-06 22:06:47.000000000 +0100
@@ -553,11 +553,17 @@
  0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff                    \
 }
 
+struct ExtractFileList {
+        LPSTR  filename;
+        struct ExtractFileList *next;
+        BOOL   unknown;  /* always 1L */
+} ;
+
 /* the first parameter of the function extract */
 typedef struct {
         long  result1;          /* 0x000 */
         long  unknown1[3];      /* 0x004 */
-        long  result2;          /* 0x010 */
+        struct ExtractFileList *filelist; /* 0x010 */
         long  filecount;        /* 0x014 */
         long  unknown2;         /* 0x018 */
         char  directory[0x104]; /* 0x01c */
diff -urw ../wine/dlls/cabinet/cabinet_main.c dlls/cabinet/cabinet_main.c
--- ../wine/dlls/cabinet/cabinet_main.c	2004-01-06 20:54:00.000000000 +0100
+++ dlls/cabinet/cabinet_main.c	2004-01-07 22:21:36.000000000 +0100
@@ -76,8 +76,10 @@
  *   dest         pointer to a buffer of 0x32c bytes containing
  *           [I]  - number with value 1 at index 0x18
  *                - the dest path starting at index 0x1c
- *           [O]  - the number of files inside the CAB file at index 0x14
- *                - the name of the last file with dest path at idx 0x12
+ *           [O]  - a linked list with the filename existing inside the
+ *                  CAB file at idx 0x10
+ *                - the number of files inside the CAB file at index 0x14
+ *                - the name of the last file with dest path at idx 0x120
  *   what    [I]  char* describing what to uncompress, I guess.
  *
  * RETURNS
@@ -114,6 +116,7 @@
   if (!dir) return E_OUTOFMEMORY;
   lstrcpyA(dir, dest->directory);
   dest->filecount=0;
+  dest->filelist = NULL;
 
   TRACE("extracting to dir: %s\n", debugstr_a(dir));
 
@@ -121,15 +124,6 @@
   if (!process_cabinet(what, dir, FALSE, FALSE, dest))
     return E_OUTOFMEMORY;
 
-  /* the magic 13 is returned by all cab files tested so far:
-   * DXDDEX.CAB, DXMINI.CAB, SWFLASH.CAB on win2k
-   * but it crashes the ie5.5 installer :-( . The native dll does not return
-   * the four zeros. The value depends on the combination of the cab file and
-   * the destination path. It appears to be a pointer to an optional return struct.
-   * The IE6 installer derefs this value + 4. Contents currently unknown.
-   */
-  dest->result2 = 0;
-
   LocalFree(dir);
 
   TRACE("filecount %08lx,lastfile %s\n",

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

  Powered by Linux