Commit 2918a272 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

cabinet: Return the value of GetLastError if FDICopy fails.

parent b1bd9208
......@@ -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:
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment