James Hawkins : cabinet: Return the value of GetLastError if FDICopy fails.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 24 05:24:48 CDT 2007


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

Author: James Hawkins <truiken at gmail.com>
Date:   Thu Aug 23 15:46:52 2007 -0700

cabinet: 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(-)

diff --git a/dlls/cabinet/cabinet_main.c b/dlls/cabinet/cabinet_main.c
index 24be376..50ef06e 100644
--- a/dlls/cabinet/cabinet_main.c
+++ b/dlls/cabinet/cabinet_main.c
@@ -357,7 +357,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 6fb5ad5..8cadfe2 100644
--- a/dlls/cabinet/tests/extract.c
+++ b/dlls/cabinet/tests/extract.c
@@ -572,13 +572,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);




More information about the wine-cvs mailing list