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

wintrust: Return error directly from SOFTPUB_GetFileSubject.

parent fc1fbf61
...@@ -104,26 +104,24 @@ static DWORD SOFTPUB_OpenFile(CRYPT_PROVIDER_DATA *data) ...@@ -104,26 +104,24 @@ static DWORD SOFTPUB_OpenFile(CRYPT_PROVIDER_DATA *data)
/* Assumes data->pWintrustData->u.pFile exists. Sets data->pPDSip->gSubject to /* Assumes data->pWintrustData->u.pFile exists. Sets data->pPDSip->gSubject to
* the file's subject GUID. * the file's subject GUID.
*/ */
static BOOL SOFTPUB_GetFileSubject(CRYPT_PROVIDER_DATA *data) static DWORD SOFTPUB_GetFileSubject(CRYPT_PROVIDER_DATA *data)
{ {
BOOL ret; DWORD err = ERROR_SUCCESS;
if (!WVT_ISINSTRUCT(WINTRUST_FILE_INFO, if (!WVT_ISINSTRUCT(WINTRUST_FILE_INFO,
data->pWintrustData->u.pFile->cbStruct, pgKnownSubject) || data->pWintrustData->u.pFile->cbStruct, pgKnownSubject) ||
!data->pWintrustData->u.pFile->pgKnownSubject) !data->pWintrustData->u.pFile->pgKnownSubject)
{ {
ret = CryptSIPRetrieveSubjectGuid( if (!CryptSIPRetrieveSubjectGuid(
data->pWintrustData->u.pFile->pcwszFilePath, data->pWintrustData->u.pFile->pcwszFilePath,
data->pWintrustData->u.pFile->hFile, data->pWintrustData->u.pFile->hFile,
&data->u.pPDSip->gSubject); &data->u.pPDSip->gSubject))
err = GetLastError();
} }
else else
{
data->u.pPDSip->gSubject = *data->pWintrustData->u.pFile->pgKnownSubject; data->u.pPDSip->gSubject = *data->pWintrustData->u.pFile->pgKnownSubject;
ret = TRUE; TRACE("returning %d\n", err);
} return err;
TRACE("returning %d\n", ret);
return ret;
} }
/* Assumes data->u.pPDSip exists, and its gSubject member set. /* Assumes data->u.pPDSip exists, and its gSubject member set.
...@@ -335,11 +333,9 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) ...@@ -335,11 +333,9 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data)
err = SOFTPUB_OpenFile(data); err = SOFTPUB_OpenFile(data);
if (err) if (err)
goto error; goto error;
if (!SOFTPUB_GetFileSubject(data)) err = SOFTPUB_GetFileSubject(data);
{ if (err)
err = GetLastError();
goto error; goto error;
}
if (!SOFTPUB_GetSIP(data)) if (!SOFTPUB_GetSIP(data))
{ {
err = GetLastError(); err = GetLastError();
......
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