cabinet 5: Return the value of GetLastError if FDICopy fails

James Hawkins truiken at gmail.com
Thu Aug 23 17:46:52 CDT 2007


Hi,

Changelog:
* Return the value of GetLastError if FDICopy fails.

 dlls/cabinet/cabinet_main.c  |    2 +-
 dlls/cabinet/fdi.c           |    1 -
 dlls/cabinet/tests/extract.c |   11 ++++-------
 3 files changed, 5 insertions(+), 9 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/cabinet/cabinet_main.c b/dlls/cabinet/cabinet_main.c
index ef1793a..b202fea 100644
--- a/dlls/cabinet/cabinet_main.c
+++ b/dlls/cabinet/cabinet_main.c
@@ -359,7 +359,7 @@ HRESULT WINAPI Extract(SESSION *dest, LPCSTR szCabName)
 
     if (!FDICopy(hfdi, name, path, 0,
          fdi_notify_extract, NULL, dest))
-        res = E_FAIL;
+        res = HRESULT_FROM_WIN32(GetLastError());
 
     HeapFree(GetProcessHeap(), 0, str);
 end:
diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c
index ef00447..eea6218 100644
--- a/dlls/cabinet/fdi.c
+++ b/dlls/cabinet/fdi.c
@@ -2495,7 +2495,6 @@ BOOL __cdecl FDICopy(
   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;
     PFDI_INT(hfdi)->perf->fError = TRUE;
     SetLastError(ERROR_FILE_NOT_FOUND);
     return FALSE;
diff --git a/dlls/cabinet/tests/extract.c b/dlls/cabinet/tests/extract.c
index 1bf0b4f..5ce5ba8 100644
--- a/dlls/cabinet/tests/extract.c
+++ b/dlls/cabinet/tests/extract.c
@@ -571,13 +571,10 @@ static void test_Extract(void)
     session.Operation = EXTRACT_FILLFILELIST | EXTRACT_EXTRACTFILES;
     res = pExtract(&session, "nonexistent.cab");
     node = session.FileList;
-    todo_wine
-    {
-        ok(res == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
-           "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08x\n", res);
-        ok(session.Error.erfOper == FDIERROR_CABINET_NOT_FOUND,
-           "Expected FDIERROR_CABINET_NOT_FOUND, got %d\n", session.Error.erfOper);
-    }
+    ok(res == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
+       "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08x\n", res);
+    ok(session.Error.erfOper == FDIERROR_CABINET_NOT_FOUND,
+       "Expected FDIERROR_CABINET_NOT_FOUND, got %d\n", session.Error.erfOper);
     ok(session.FileSize == 0, "Expected 0, got %d\n", session.FileSize);
     ok(session.Error.erfType == 0, "Expected 0, got %d\n", session.Error.erfType);
     ok(session.Error.fError == TRUE, "Expected TRUE, got %d\n", session.Error.fError);
-- 
1.4.4.2


More information about the wine-patches mailing list