From 528876c40230f0e8c0fefa39b9b77088892b7319 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Wed, 27 Jan 2010 10:26:36 -0800 Subject: [PATCH] wintrust: Return error directly from SOFTPUB_LoadCatalogMessage. --- dlls/wintrust/softpub.c | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 9d13b4a1a37..967bb1a439e 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -364,9 +364,9 @@ error: return err; } -static BOOL SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) +static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) { - BOOL ret; + DWORD err; HANDLE catalog = INVALID_HANDLE_VALUE; if (!data->pWintrustData->u.pCatalog) @@ -378,27 +378,36 @@ static BOOL SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (catalog == INVALID_HANDLE_VALUE) - return FALSE; - ret = CryptSIPRetrieveSubjectGuid( + return GetLastError(); + if (!CryptSIPRetrieveSubjectGuid( data->pWintrustData->u.pCatalog->pcwszCatalogFilePath, catalog, - &data->u.pPDSip->gSubject); - if (!ret) + &data->u.pPDSip->gSubject)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_GetSIP(data); - if (!ret) + } + if (!SOFTPUB_GetSIP(data)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_GetMessageFromFile(data, catalog, - data->pWintrustData->u.pCatalog->pcwszCatalogFilePath); - if (!ret) + } + if (!SOFTPUB_GetMessageFromFile(data, catalog, + data->pWintrustData->u.pCatalog->pcwszCatalogFilePath)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_CreateStoreFromMessage(data); - if (!ret) + } + if (!SOFTPUB_CreateStoreFromMessage(data)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_DecodeInnerContent(data); + } + if (!SOFTPUB_DecodeInnerContent(data)) + err = GetLastError(); /* FIXME: this loads the catalog file, but doesn't validate the member. */ error: CloseHandle(catalog); - return ret; + return err; } HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) @@ -420,7 +429,7 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) err = SOFTPUB_LoadFileMessage(data); break; case WTD_CHOICE_CATALOG: - ret = SOFTPUB_LoadCatalogMessage(data); + err = SOFTPUB_LoadCatalogMessage(data); break; default: FIXME("unimplemented for %d\n", data->pWintrustData->dwUnionChoice);