Commit dce2a459 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wintrust: Return error directly from SOFTPUB_LoadCertMessage.

parent 6099adf7
...@@ -282,9 +282,9 @@ error: ...@@ -282,9 +282,9 @@ error:
return err; return err;
} }
static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data) static DWORD SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data)
{ {
BOOL ret; DWORD err;
if (data->pWintrustData->u.pCert && if (data->pWintrustData->u.pCert &&
WVT_IS_CBSTRUCT_GT_MEMBEROFFSET(WINTRUST_CERT_INFO, WVT_IS_CBSTRUCT_GT_MEMBEROFFSET(WINTRUST_CERT_INFO,
...@@ -294,6 +294,7 @@ static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data) ...@@ -294,6 +294,7 @@ static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data)
{ {
CRYPT_PROVIDER_SGNR signer = { sizeof(signer), { 0 } }; CRYPT_PROVIDER_SGNR signer = { sizeof(signer), { 0 } };
DWORD i; DWORD i;
BOOL ret;
/* Add a signer with nothing but the time to verify, so we can /* Add a signer with nothing but the time to verify, so we can
* add a cert to it * add a cert to it
...@@ -321,19 +322,18 @@ static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data) ...@@ -321,19 +322,18 @@ static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data)
ret = data->psPfns->pfnAddStore2Chain(data, ret = data->psPfns->pfnAddStore2Chain(data,
data->pWintrustData->u.pCert->pahStores[i]); data->pWintrustData->u.pCert->pahStores[i]);
} }
if (!ret)
err = GetLastError();
} }
else else
{ {
/* Do nothing!? See the tests */ /* Do nothing!? See the tests */
ret = TRUE; err = ERROR_SUCCESS;
} }
} }
else else
{ err = ERROR_INVALID_PARAMETER;
SetLastError(ERROR_INVALID_PARAMETER); return err;
ret = FALSE;
}
return ret;
} }
static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data)
...@@ -408,7 +408,6 @@ error: ...@@ -408,7 +408,6 @@ error:
HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data)
{ {
BOOL ret = TRUE;
DWORD err = ERROR_SUCCESS; DWORD err = ERROR_SUCCESS;
TRACE("(%p)\n", data); TRACE("(%p)\n", data);
...@@ -419,7 +418,7 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) ...@@ -419,7 +418,7 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data)
switch (data->pWintrustData->dwUnionChoice) switch (data->pWintrustData->dwUnionChoice)
{ {
case WTD_CHOICE_CERT: case WTD_CHOICE_CERT:
ret = SOFTPUB_LoadCertMessage(data); err = SOFTPUB_LoadCertMessage(data);
break; break;
case WTD_CHOICE_FILE: case WTD_CHOICE_FILE:
err = SOFTPUB_LoadFileMessage(data); err = SOFTPUB_LoadFileMessage(data);
...@@ -429,21 +428,14 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) ...@@ -429,21 +428,14 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data)
break; break;
default: default:
FIXME("unimplemented for %d\n", data->pWintrustData->dwUnionChoice); FIXME("unimplemented for %d\n", data->pWintrustData->dwUnionChoice);
SetLastError(ERROR_INVALID_PARAMETER); err = ERROR_INVALID_PARAMETER;
ret = FALSE;
} }
if (!ret) if (err)
data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] =
GetLastError();
else if (err)
{
data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = err; data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = err;
ret = FALSE; TRACE("returning %d (%08x)\n", !err ? S_OK : S_FALSE,
}
TRACE("returning %d (%08x)\n", ret ? S_OK : S_FALSE,
data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]); data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]);
return ret ? S_OK : S_FALSE; return !err ? S_OK : S_FALSE;
} }
static CMSG_SIGNER_INFO *WINTRUST_GetSigner(CRYPT_PROVIDER_DATA *data, static CMSG_SIGNER_INFO *WINTRUST_GetSigner(CRYPT_PROVIDER_DATA *data,
......
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