crypt32: Avoid casting away const from the context pointer.
This commit is contained in:
parent
a4ec3ff61b
commit
8926dce077
|
@ -125,7 +125,7 @@ void *Context_GetLinkedContext(void *context, size_t contextSize)
|
|||
contextSize);
|
||||
}
|
||||
|
||||
PCONTEXT_PROPERTY_LIST Context_GetProperties(void *context, size_t contextSize)
|
||||
PCONTEXT_PROPERTY_LIST Context_GetProperties(const void *context, size_t contextSize)
|
||||
{
|
||||
PBASE_CONTEXT ptr = BASE_CONTEXT_FROM_CONTEXT(context, contextSize);
|
||||
|
||||
|
|
|
@ -266,10 +266,10 @@ DWORD WINAPI CertEnumCRLContextProperties(PCCRL_CONTEXT pCRLContext,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static BOOL WINAPI CRLContext_SetProperty(void *context, DWORD dwPropId,
|
||||
DWORD dwFlags, const void *pvData);
|
||||
static BOOL CRLContext_SetProperty(PCCRL_CONTEXT context, DWORD dwPropId,
|
||||
DWORD dwFlags, const void *pvData);
|
||||
|
||||
static BOOL CRLContext_GetHashProp(void *context, DWORD dwPropId,
|
||||
static BOOL CRLContext_GetHashProp(PCCRL_CONTEXT context, DWORD dwPropId,
|
||||
ALG_ID algID, const BYTE *toHash, DWORD toHashLen, void *pvData,
|
||||
DWORD *pcbData)
|
||||
{
|
||||
|
@ -284,10 +284,9 @@ static BOOL CRLContext_GetHashProp(void *context, DWORD dwPropId,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static BOOL WINAPI CRLContext_GetProperty(void *context, DWORD dwPropId,
|
||||
void *pvData, DWORD *pcbData)
|
||||
static BOOL CRLContext_GetProperty(PCCRL_CONTEXT context, DWORD dwPropId,
|
||||
void *pvData, DWORD *pcbData)
|
||||
{
|
||||
PCCRL_CONTEXT pCRLContext = (PCCRL_CONTEXT)context;
|
||||
PCONTEXT_PROPERTY_LIST properties =
|
||||
Context_GetProperties(context, sizeof(CRL_CONTEXT));
|
||||
BOOL ret;
|
||||
|
@ -322,12 +321,12 @@ static BOOL WINAPI CRLContext_GetProperty(void *context, DWORD dwPropId,
|
|||
{
|
||||
case CERT_SHA1_HASH_PROP_ID:
|
||||
ret = CRLContext_GetHashProp(context, dwPropId, CALG_SHA1,
|
||||
pCRLContext->pbCrlEncoded, pCRLContext->cbCrlEncoded, pvData,
|
||||
context->pbCrlEncoded, context->cbCrlEncoded, pvData,
|
||||
pcbData);
|
||||
break;
|
||||
case CERT_MD5_HASH_PROP_ID:
|
||||
ret = CRLContext_GetHashProp(context, dwPropId, CALG_MD5,
|
||||
pCRLContext->pbCrlEncoded, pCRLContext->cbCrlEncoded, pvData,
|
||||
context->pbCrlEncoded, context->cbCrlEncoded, pvData,
|
||||
pcbData);
|
||||
break;
|
||||
default:
|
||||
|
@ -377,13 +376,13 @@ BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
ret = CRLContext_GetProperty((void *)pCRLContext, dwPropId, pvData,
|
||||
ret = CRLContext_GetProperty(pCRLContext, dwPropId, pvData,
|
||||
pcbData);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BOOL WINAPI CRLContext_SetProperty(void *context, DWORD dwPropId,
|
||||
static BOOL CRLContext_SetProperty(PCCRL_CONTEXT context, DWORD dwPropId,
|
||||
DWORD dwFlags, const void *pvData)
|
||||
{
|
||||
PCONTEXT_PROPERTY_LIST properties =
|
||||
|
@ -460,8 +459,7 @@ BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
|
|||
SetLastError(E_INVALIDARG);
|
||||
return FALSE;
|
||||
}
|
||||
ret = CRLContext_SetProperty((void *)pCRLContext, dwPropId, dwFlags,
|
||||
pvData);
|
||||
ret = CRLContext_SetProperty(pCRLContext, dwPropId, dwFlags, pvData);
|
||||
TRACE("returning %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -317,7 +317,7 @@ void Context_CopyProperties(const void *to, const void *from,
|
|||
/* Returns context's properties, or the linked context's properties if context
|
||||
* is a link context.
|
||||
*/
|
||||
PCONTEXT_PROPERTY_LIST Context_GetProperties(void *context, size_t contextSize);
|
||||
PCONTEXT_PROPERTY_LIST Context_GetProperties(const void *context, size_t contextSize);
|
||||
|
||||
void Context_AddRef(void *context, size_t contextSize);
|
||||
|
||||
|
|
Loading…
Reference in New Issue