Commit 0170a41e authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Don't set ret to TRUE when it already is.

Set it to FALSE when it needs to be.
parent 23cfbe2e
...@@ -185,20 +185,17 @@ static BOOL WINAPI CertContext_GetProperty(void *context, DWORD dwPropId, ...@@ -185,20 +185,17 @@ static BOOL WINAPI CertContext_GetProperty(void *context, DWORD dwPropId,
if (ret) if (ret)
{ {
if (!pvData) if (!pvData)
{
*pcbData = blob.cbData; *pcbData = blob.cbData;
ret = TRUE;
}
else if (*pcbData < blob.cbData) else if (*pcbData < blob.cbData)
{ {
SetLastError(ERROR_MORE_DATA); SetLastError(ERROR_MORE_DATA);
*pcbData = blob.cbData; *pcbData = blob.cbData;
ret = FALSE;
} }
else else
{ {
memcpy(pvData, blob.pbData, blob.cbData); memcpy(pvData, blob.pbData, blob.cbData);
*pcbData = blob.cbData; *pcbData = blob.cbData;
ret = TRUE;
} }
} }
else else
...@@ -320,10 +317,7 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, ...@@ -320,10 +317,7 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
if (ret) if (ret)
{ {
if (!pvData) if (!pvData)
{
*pcbData = sizeof(HCRYPTPROV); *pcbData = sizeof(HCRYPTPROV);
ret = TRUE;
}
else if (*pcbData < sizeof(HCRYPTPROV)) else if (*pcbData < sizeof(HCRYPTPROV))
{ {
SetLastError(ERROR_MORE_DATA); SetLastError(ERROR_MORE_DATA);
...@@ -331,10 +325,7 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, ...@@ -331,10 +325,7 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
ret = FALSE; ret = FALSE;
} }
else else
{
*(HCRYPTPROV *)pvData = keyContext.hCryptProv; *(HCRYPTPROV *)pvData = keyContext.hCryptProv;
ret = TRUE;
}
} }
break; break;
} }
......
...@@ -302,20 +302,17 @@ static BOOL WINAPI CRLContext_GetProperty(void *context, DWORD dwPropId, ...@@ -302,20 +302,17 @@ static BOOL WINAPI CRLContext_GetProperty(void *context, DWORD dwPropId,
if (ret) if (ret)
{ {
if (!pvData) if (!pvData)
{
*pcbData = blob.cbData; *pcbData = blob.cbData;
ret = TRUE;
}
else if (*pcbData < blob.cbData) else if (*pcbData < blob.cbData)
{ {
SetLastError(ERROR_MORE_DATA); SetLastError(ERROR_MORE_DATA);
*pcbData = blob.cbData; *pcbData = blob.cbData;
ret = FALSE;
} }
else else
{ {
memcpy(pvData, blob.pbData, blob.cbData); memcpy(pvData, blob.pbData, blob.cbData);
*pcbData = blob.cbData; *pcbData = blob.cbData;
ret = TRUE;
} }
} }
else else
......
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