Commit 8926dce0 authored by Alexandre Julliard's avatar Alexandre Julliard

crypt32: Avoid casting away const from the context pointer.

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