James Hawkins : cabinet: Close the opened file handle even in error cases.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Dec 15 07:21:41 CST 2006


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

Author: James Hawkins <truiken at gmail.com>
Date:   Fri Dec 15 03:47:15 2006 -0600

cabinet: Close the opened file handle even in error cases.

---

 dlls/cabinet/fdi.c |   33 +++++++++++----------------------
 1 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c
index 0cb319c..70db803 100644
--- a/dlls/cabinet/fdi.c
+++ b/dlls/cabinet/fdi.c
@@ -2809,6 +2809,17 @@ BOOL __cdecl FDICopy(
       err = fdi_decomp(file, 1, decomp_state, pszCabPath, pfnfdin, pvUser);
       if (err) CAB(current) = NULL; else CAB(offset) += file->length;
 
+      /* fdintCLOSE_FILE_INFO notification */
+      ZeroMemory(&fdin, sizeof(FDINOTIFICATION));
+      fdin.pv = pvUser;
+      fdin.psz1 = (char *)file->filename;
+      fdin.hf = filehf;
+      fdin.cb = (file->attribs & cffile_A_EXEC) ? TRUE : FALSE; /* FIXME: is that right? */
+      fdin.date = file->date;
+      fdin.time = file->time;
+      fdin.attribs = file->attribs; /* FIXME: filter _A_EXEC? */
+      ((*pfnfdin)(fdintCLOSE_FILE_INFO, &fdin));
+
       switch (err) {
         case DECR_OK:
           break;
@@ -2829,28 +2840,6 @@ BOOL __cdecl FDICopy(
           PFDI_INT(hfdi)->perf->fError = TRUE;
           goto bail_and_fail;
       }
-
-      /* fdintCLOSE_FILE_INFO notification */
-      ZeroMemory(&fdin, sizeof(FDINOTIFICATION));
-      fdin.pv = pvUser;
-      fdin.psz1 = (char *)file->filename;
-      fdin.hf = filehf;
-      fdin.cb = (file->attribs & cffile_A_EXEC) ? TRUE : FALSE; /* FIXME: is that right? */
-      fdin.date = file->date;
-      fdin.time = file->time;
-      fdin.attribs = file->attribs; /* FIXME: filter _A_EXEC? */
-      err = ((*pfnfdin)(fdintCLOSE_FILE_INFO, &fdin));
-      if (err == FALSE || err == -1) {
-        /*
-         * SDK states that even though they indicated failure,
-         * we are not supposed to try and close the file, so we
-         * just treat this like all the others
-         */
-        PFDI_INT(hfdi)->perf->erfOper = FDIERROR_USER_ABORT;
-        PFDI_INT(hfdi)->perf->erfType = 0;
-        PFDI_INT(hfdi)->perf->fError = TRUE;
-        goto bail_and_fail;
-      }
     }
   }
 




More information about the wine-cvs mailing list