Commit 8085ea5f authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wintrust: Return error directly from SOFTPUB_CreateStoreFromMessage.

parent 568b0025
...@@ -194,20 +194,23 @@ static DWORD SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file, ...@@ -194,20 +194,23 @@ static DWORD SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
return err; return err;
} }
static BOOL SOFTPUB_CreateStoreFromMessage(CRYPT_PROVIDER_DATA *data) static DWORD SOFTPUB_CreateStoreFromMessage(CRYPT_PROVIDER_DATA *data)
{ {
BOOL ret = FALSE; DWORD err = ERROR_SUCCESS;
HCERTSTORE store; HCERTSTORE store;
store = CertOpenStore(CERT_STORE_PROV_MSG, data->dwEncoding, store = CertOpenStore(CERT_STORE_PROV_MSG, data->dwEncoding,
data->hProv, CERT_STORE_NO_CRYPT_RELEASE_FLAG, data->hMsg); data->hProv, CERT_STORE_NO_CRYPT_RELEASE_FLAG, data->hMsg);
if (store) if (store)
{ {
ret = data->psPfns->pfnAddStore2Chain(data, store); if (!data->psPfns->pfnAddStore2Chain(data, store))
err = GetLastError();
CertCloseStore(store, 0); CertCloseStore(store, 0);
} }
TRACE("returning %d\n", ret); else
return ret; err = GetLastError();
TRACE("returning %d\n", err);
return err;
} }
static DWORD SOFTPUB_DecodeInnerContent(CRYPT_PROVIDER_DATA *data) static DWORD SOFTPUB_DecodeInnerContent(CRYPT_PROVIDER_DATA *data)
...@@ -341,11 +344,9 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) ...@@ -341,11 +344,9 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data)
data->pWintrustData->u.pFile->pcwszFilePath); data->pWintrustData->u.pFile->pcwszFilePath);
if (err) if (err)
goto error; goto error;
if (!SOFTPUB_CreateStoreFromMessage(data)) err = SOFTPUB_CreateStoreFromMessage(data);
{ if (err)
err = GetLastError();
goto error; goto error;
}
if (!SOFTPUB_DecodeInnerContent(data)) if (!SOFTPUB_DecodeInnerContent(data))
err = GetLastError(); err = GetLastError();
error: error:
...@@ -381,11 +382,9 @@ static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) ...@@ -381,11 +382,9 @@ static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data)
data->pWintrustData->u.pFile->pcwszFilePath); data->pWintrustData->u.pFile->pcwszFilePath);
if (err) if (err)
goto error; goto error;
if (!SOFTPUB_CreateStoreFromMessage(data)) err = SOFTPUB_CreateStoreFromMessage(data);
{ if (err)
err = GetLastError();
goto error; goto error;
}
if (!SOFTPUB_DecodeInnerContent(data)) if (!SOFTPUB_DecodeInnerContent(data))
err = GetLastError(); err = GetLastError();
/* FIXME: this loads the catalog file, but doesn't validate the member. */ /* FIXME: this loads the catalog file, but doesn't validate the member. */
......
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