From 2918a272e3b4da3faa1e5b8fd84a83f84e1764b4 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Thu, 23 Aug 2007 15:46:52 -0700 Subject: [PATCH] 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 24be376cbe3..50ef06e8afd 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 ef004471e12..eea62184805 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 6fb5ad5900c..8cadfe202d8 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); -- 2.11.4.GIT