Commit 90358516 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

crypt32: Remove remaining superfluous pointer casts.

parent c0d2a21d
...@@ -37,7 +37,7 @@ typedef struct _WINE_FILESTOREINFO ...@@ -37,7 +37,7 @@ typedef struct _WINE_FILESTOREINFO
static void WINAPI CRYPT_FileCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) static void WINAPI CRYPT_FileCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
{ {
PWINE_FILESTOREINFO store = (PWINE_FILESTOREINFO)hCertStore; PWINE_FILESTOREINFO store = hCertStore;
TRACE("(%p, %08x)\n", store, dwFlags); TRACE("(%p, %08x)\n", store, dwFlags);
if (store->dirty) if (store->dirty)
...@@ -51,7 +51,7 @@ static void WINAPI CRYPT_FileCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) ...@@ -51,7 +51,7 @@ static void WINAPI CRYPT_FileCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
static BOOL WINAPI CRYPT_FileWriteCert(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_FileWriteCert(HCERTSTORE hCertStore,
PCCERT_CONTEXT cert, DWORD dwFlags) PCCERT_CONTEXT cert, DWORD dwFlags)
{ {
PWINE_FILESTOREINFO store = (PWINE_FILESTOREINFO)hCertStore; PWINE_FILESTOREINFO store = hCertStore;
TRACE("(%p, %p, %d)\n", hCertStore, cert, dwFlags); TRACE("(%p, %p, %d)\n", hCertStore, cert, dwFlags);
store->dirty = TRUE; store->dirty = TRUE;
...@@ -61,7 +61,7 @@ static BOOL WINAPI CRYPT_FileWriteCert(HCERTSTORE hCertStore, ...@@ -61,7 +61,7 @@ static BOOL WINAPI CRYPT_FileWriteCert(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_FileDeleteCert(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_FileDeleteCert(HCERTSTORE hCertStore,
PCCERT_CONTEXT pCertContext, DWORD dwFlags) PCCERT_CONTEXT pCertContext, DWORD dwFlags)
{ {
PWINE_FILESTOREINFO store = (PWINE_FILESTOREINFO)hCertStore; PWINE_FILESTOREINFO store = hCertStore;
TRACE("(%p, %p, %08x)\n", hCertStore, pCertContext, dwFlags); TRACE("(%p, %p, %08x)\n", hCertStore, pCertContext, dwFlags);
store->dirty = TRUE; store->dirty = TRUE;
...@@ -71,7 +71,7 @@ static BOOL WINAPI CRYPT_FileDeleteCert(HCERTSTORE hCertStore, ...@@ -71,7 +71,7 @@ static BOOL WINAPI CRYPT_FileDeleteCert(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_FileWriteCRL(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_FileWriteCRL(HCERTSTORE hCertStore,
PCCRL_CONTEXT crl, DWORD dwFlags) PCCRL_CONTEXT crl, DWORD dwFlags)
{ {
PWINE_FILESTOREINFO store = (PWINE_FILESTOREINFO)hCertStore; PWINE_FILESTOREINFO store = hCertStore;
TRACE("(%p, %p, %d)\n", hCertStore, crl, dwFlags); TRACE("(%p, %p, %d)\n", hCertStore, crl, dwFlags);
store->dirty = TRUE; store->dirty = TRUE;
...@@ -81,7 +81,7 @@ static BOOL WINAPI CRYPT_FileWriteCRL(HCERTSTORE hCertStore, ...@@ -81,7 +81,7 @@ static BOOL WINAPI CRYPT_FileWriteCRL(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_FileDeleteCRL(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_FileDeleteCRL(HCERTSTORE hCertStore,
PCCRL_CONTEXT pCrlContext, DWORD dwFlags) PCCRL_CONTEXT pCrlContext, DWORD dwFlags)
{ {
PWINE_FILESTOREINFO store = (PWINE_FILESTOREINFO)hCertStore; PWINE_FILESTOREINFO store = hCertStore;
TRACE("(%p, %p, %08x)\n", hCertStore, pCrlContext, dwFlags); TRACE("(%p, %p, %08x)\n", hCertStore, pCrlContext, dwFlags);
store->dirty = TRUE; store->dirty = TRUE;
...@@ -91,7 +91,7 @@ static BOOL WINAPI CRYPT_FileDeleteCRL(HCERTSTORE hCertStore, ...@@ -91,7 +91,7 @@ static BOOL WINAPI CRYPT_FileDeleteCRL(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_FileWriteCTL(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_FileWriteCTL(HCERTSTORE hCertStore,
PCCTL_CONTEXT ctl, DWORD dwFlags) PCCTL_CONTEXT ctl, DWORD dwFlags)
{ {
PWINE_FILESTOREINFO store = (PWINE_FILESTOREINFO)hCertStore; PWINE_FILESTOREINFO store = hCertStore;
TRACE("(%p, %p, %d)\n", hCertStore, ctl, dwFlags); TRACE("(%p, %p, %d)\n", hCertStore, ctl, dwFlags);
store->dirty = TRUE; store->dirty = TRUE;
...@@ -101,7 +101,7 @@ static BOOL WINAPI CRYPT_FileWriteCTL(HCERTSTORE hCertStore, ...@@ -101,7 +101,7 @@ static BOOL WINAPI CRYPT_FileWriteCTL(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_FileDeleteCTL(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_FileDeleteCTL(HCERTSTORE hCertStore,
PCCTL_CONTEXT pCtlContext, DWORD dwFlags) PCCTL_CONTEXT pCtlContext, DWORD dwFlags)
{ {
PWINE_FILESTOREINFO store = (PWINE_FILESTOREINFO)hCertStore; PWINE_FILESTOREINFO store = hCertStore;
TRACE("(%p, %p, %08x)\n", hCertStore, pCtlContext, dwFlags); TRACE("(%p, %p, %08x)\n", hCertStore, pCtlContext, dwFlags);
store->dirty = TRUE; store->dirty = TRUE;
...@@ -129,7 +129,7 @@ static BOOL CRYPT_ReadBlobFromFile(HANDLE file, PCERT_BLOB blob) ...@@ -129,7 +129,7 @@ static BOOL CRYPT_ReadBlobFromFile(HANDLE file, PCERT_BLOB blob)
static BOOL WINAPI CRYPT_FileControl(HCERTSTORE hCertStore, DWORD dwFlags, static BOOL WINAPI CRYPT_FileControl(HCERTSTORE hCertStore, DWORD dwFlags,
DWORD dwCtrlType, void const *pvCtrlPara) DWORD dwCtrlType, void const *pvCtrlPara)
{ {
PWINE_FILESTOREINFO store = (PWINE_FILESTOREINFO)hCertStore; PWINE_FILESTOREINFO store = hCertStore;
BOOL ret; BOOL ret;
TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType, TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType,
...@@ -292,7 +292,7 @@ PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv, ...@@ -292,7 +292,7 @@ PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv,
DWORD dwFlags, const void *pvPara) DWORD dwFlags, const void *pvPara)
{ {
HCERTSTORE store = 0; HCERTSTORE store = 0;
LPCWSTR fileName = (LPCWSTR)pvPara; LPCWSTR fileName = pvPara;
DWORD access, create; DWORD access, create;
HANDLE file; HANDLE file;
...@@ -376,7 +376,7 @@ PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv, ...@@ -376,7 +376,7 @@ PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv,
CryptReleaseContext(hCryptProv, 0); CryptReleaseContext(hCryptProv, 0);
} }
} }
return (PWINECRYPT_CERTSTORE)store; return store;
} }
PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv, PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv,
...@@ -386,21 +386,21 @@ PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv, ...@@ -386,21 +386,21 @@ PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv,
PWINECRYPT_CERTSTORE ret = NULL; PWINECRYPT_CERTSTORE ret = NULL;
TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags, TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags,
debugstr_a((LPCSTR)pvPara)); debugstr_a(pvPara));
if (!pvPara) if (!pvPara)
{ {
SetLastError(ERROR_FILE_NOT_FOUND); SetLastError(ERROR_FILE_NOT_FOUND);
return NULL; return NULL;
} }
len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, pvPara, -1, NULL, 0);
if (len) if (len)
{ {
LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR)); LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR));
if (storeName) if (storeName)
{ {
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, storeName, len); MultiByteToWideChar(CP_ACP, 0, pvPara, -1, storeName, len);
ret = CRYPT_FileNameOpenStoreW(hCryptProv, dwFlags, storeName); ret = CRYPT_FileNameOpenStoreW(hCryptProv, dwFlags, storeName);
CryptMemFree(storeName); CryptMemFree(storeName);
} }
......
...@@ -109,7 +109,7 @@ static const BYTE empty_data_content[] = { 0x04,0x00 }; ...@@ -109,7 +109,7 @@ static const BYTE empty_data_content[] = { 0x04,0x00 };
static void CDataEncodeMsg_Close(HCRYPTMSG hCryptMsg) static void CDataEncodeMsg_Close(HCRYPTMSG hCryptMsg)
{ {
CDataEncodeMsg *msg = (CDataEncodeMsg *)hCryptMsg; CDataEncodeMsg *msg = hCryptMsg;
if (msg->bare_content != empty_data_content) if (msg->bare_content != empty_data_content)
LocalFree(msg->bare_content); LocalFree(msg->bare_content);
...@@ -191,7 +191,7 @@ static BOOL CRYPT_EncodeDataContentInfoHeader(CDataEncodeMsg *msg, ...@@ -191,7 +191,7 @@ static BOOL CRYPT_EncodeDataContentInfoHeader(CDataEncodeMsg *msg,
static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
DWORD cbData, BOOL fFinal) DWORD cbData, BOOL fFinal)
{ {
CDataEncodeMsg *msg = (CDataEncodeMsg *)hCryptMsg; CDataEncodeMsg *msg = hCryptMsg;
BOOL ret = FALSE; BOOL ret = FALSE;
if (msg->base.state == MsgStateFinalized) if (msg->base.state == MsgStateFinalized)
...@@ -320,7 +320,7 @@ static BOOL CRYPT_CopyParam(void *pvData, DWORD *pcbData, const void *src, ...@@ -320,7 +320,7 @@ static BOOL CRYPT_CopyParam(void *pvData, DWORD *pcbData, const void *src,
static BOOL CDataEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, static BOOL CDataEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
DWORD dwIndex, void *pvData, DWORD *pcbData) DWORD dwIndex, void *pvData, DWORD *pcbData)
{ {
CDataEncodeMsg *msg = (CDataEncodeMsg *)hCryptMsg; CDataEncodeMsg *msg = hCryptMsg;
BOOL ret = FALSE; BOOL ret = FALSE;
switch (dwParamType) switch (dwParamType)
...@@ -372,7 +372,7 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, ...@@ -372,7 +372,7 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo,
msg->bare_content_len = sizeof(empty_data_content); msg->bare_content_len = sizeof(empty_data_content);
msg->bare_content = (LPBYTE)empty_data_content; msg->bare_content = (LPBYTE)empty_data_content;
} }
return (HCRYPTMSG)msg; return msg;
} }
typedef struct _CHashEncodeMsg typedef struct _CHashEncodeMsg
...@@ -385,7 +385,7 @@ typedef struct _CHashEncodeMsg ...@@ -385,7 +385,7 @@ typedef struct _CHashEncodeMsg
static void CHashEncodeMsg_Close(HCRYPTMSG hCryptMsg) static void CHashEncodeMsg_Close(HCRYPTMSG hCryptMsg)
{ {
CHashEncodeMsg *msg = (CHashEncodeMsg *)hCryptMsg; CHashEncodeMsg *msg = hCryptMsg;
CryptMemFree(msg->data.pbData); CryptMemFree(msg->data.pbData);
CryptDestroyHash(msg->hash); CryptDestroyHash(msg->hash);
...@@ -444,7 +444,7 @@ static BOOL CRYPT_EncodePKCSDigestedData(CHashEncodeMsg *msg, void *pvData, ...@@ -444,7 +444,7 @@ static BOOL CRYPT_EncodePKCSDigestedData(CHashEncodeMsg *msg, void *pvData,
static BOOL CHashEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, static BOOL CHashEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
DWORD dwIndex, void *pvData, DWORD *pcbData) DWORD dwIndex, void *pvData, DWORD *pcbData)
{ {
CHashEncodeMsg *msg = (CHashEncodeMsg *)hCryptMsg; CHashEncodeMsg *msg = hCryptMsg;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE("(%p, %d, %d, %p, %p)\n", hCryptMsg, dwParamType, dwIndex, TRACE("(%p, %d, %d, %p, %p)\n", hCryptMsg, dwParamType, dwIndex,
...@@ -487,8 +487,7 @@ static BOOL CHashEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, ...@@ -487,8 +487,7 @@ static BOOL CHashEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
break; break;
} }
case CMSG_COMPUTED_HASH_PARAM: case CMSG_COMPUTED_HASH_PARAM:
ret = CryptGetHashParam(msg->hash, HP_HASHVAL, (BYTE *)pvData, pcbData, ret = CryptGetHashParam(msg->hash, HP_HASHVAL, pvData, pcbData, 0);
0);
break; break;
case CMSG_VERSION_PARAM: case CMSG_VERSION_PARAM:
if (msg->base.state != MsgStateFinalized) if (msg->base.state != MsgStateFinalized)
...@@ -512,7 +511,7 @@ static BOOL CHashEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, ...@@ -512,7 +511,7 @@ static BOOL CHashEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
static BOOL CHashEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, static BOOL CHashEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
DWORD cbData, BOOL fFinal) DWORD cbData, BOOL fFinal)
{ {
CHashEncodeMsg *msg = (CHashEncodeMsg *)hCryptMsg; CHashEncodeMsg *msg = hCryptMsg;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE("(%p, %p, %d, %d)\n", hCryptMsg, pbData, cbData, fFinal); TRACE("(%p, %p, %d, %d)\n", hCryptMsg, pbData, cbData, fFinal);
...@@ -555,8 +554,7 @@ static HCRYPTMSG CHashEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, ...@@ -555,8 +554,7 @@ static HCRYPTMSG CHashEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo,
LPSTR pszInnerContentObjID, PCMSG_STREAM_INFO pStreamInfo) LPSTR pszInnerContentObjID, PCMSG_STREAM_INFO pStreamInfo)
{ {
CHashEncodeMsg *msg; CHashEncodeMsg *msg;
const CMSG_HASHED_ENCODE_INFO *info = const CMSG_HASHED_ENCODE_INFO *info = pvMsgEncodeInfo;
(const CMSG_HASHED_ENCODE_INFO *)pvMsgEncodeInfo;
HCRYPTPROV prov; HCRYPTPROV prov;
ALG_ID algID; ALG_ID algID;
...@@ -592,7 +590,7 @@ static HCRYPTMSG CHashEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, ...@@ -592,7 +590,7 @@ static HCRYPTMSG CHashEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo,
msg = NULL; msg = NULL;
} }
} }
return (HCRYPTMSG)msg; return msg;
} }
typedef struct _CMSG_SIGNER_ENCODE_INFO_WITH_CMS typedef struct _CMSG_SIGNER_ENCODE_INFO_WITH_CMS
...@@ -1086,7 +1084,7 @@ static BOOL CSignedMsgData_UpdateAuthenticatedAttributes( ...@@ -1086,7 +1084,7 @@ static BOOL CSignedMsgData_UpdateAuthenticatedAttributes(
ret = CryptEncodeObjectEx(X509_ASN_ENCODING, PKCS_ATTRIBUTES, ret = CryptEncodeObjectEx(X509_ASN_ENCODING, PKCS_ATTRIBUTES,
&msg_data->info->rgSignerInfo[i].AuthAttrs, &msg_data->info->rgSignerInfo[i].AuthAttrs,
CRYPT_ENCODE_ALLOC_FLAG, NULL, (LPBYTE)&encodedAttrs, &size); CRYPT_ENCODE_ALLOC_FLAG, NULL, &encodedAttrs, &size);
if (ret) if (ret)
{ {
ret = CryptHashData( ret = CryptHashData(
...@@ -1176,7 +1174,7 @@ typedef struct _CSignedEncodeMsg ...@@ -1176,7 +1174,7 @@ typedef struct _CSignedEncodeMsg
static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg) static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg)
{ {
CSignedEncodeMsg *msg = (CSignedEncodeMsg *)hCryptMsg; CSignedEncodeMsg *msg = hCryptMsg;
DWORD i; DWORD i;
CryptMemFree(msg->innerOID); CryptMemFree(msg->innerOID);
...@@ -1193,7 +1191,7 @@ static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg) ...@@ -1193,7 +1191,7 @@ static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg)
static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
DWORD dwIndex, void *pvData, DWORD *pcbData) DWORD dwIndex, void *pvData, DWORD *pcbData)
{ {
CSignedEncodeMsg *msg = (CSignedEncodeMsg *)hCryptMsg; CSignedEncodeMsg *msg = hCryptMsg;
BOOL ret = FALSE; BOOL ret = FALSE;
switch (dwParamType) switch (dwParamType)
...@@ -1301,7 +1299,7 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, ...@@ -1301,7 +1299,7 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
static BOOL CSignedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, static BOOL CSignedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
DWORD cbData, BOOL fFinal) DWORD cbData, BOOL fFinal)
{ {
CSignedEncodeMsg *msg = (CSignedEncodeMsg *)hCryptMsg; CSignedEncodeMsg *msg = hCryptMsg;
BOOL ret = FALSE; BOOL ret = FALSE;
if (msg->base.state == MsgStateFinalized) if (msg->base.state == MsgStateFinalized)
...@@ -1345,8 +1343,7 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags, ...@@ -1345,8 +1343,7 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
const void *pvMsgEncodeInfo, LPSTR pszInnerContentObjID, const void *pvMsgEncodeInfo, LPSTR pszInnerContentObjID,
PCMSG_STREAM_INFO pStreamInfo) PCMSG_STREAM_INFO pStreamInfo)
{ {
const CMSG_SIGNED_ENCODE_INFO_WITH_CMS *info = const CMSG_SIGNED_ENCODE_INFO_WITH_CMS *info = pvMsgEncodeInfo;
(const CMSG_SIGNED_ENCODE_INFO_WITH_CMS *)pvMsgEncodeInfo;
DWORD i; DWORD i;
CSignedEncodeMsg *msg; CSignedEncodeMsg *msg;
...@@ -1510,7 +1507,7 @@ typedef struct _CDecodeMsg ...@@ -1510,7 +1507,7 @@ typedef struct _CDecodeMsg
static void CDecodeMsg_Close(HCRYPTMSG hCryptMsg) static void CDecodeMsg_Close(HCRYPTMSG hCryptMsg)
{ {
CDecodeMsg *msg = (CDecodeMsg *)hCryptMsg; CDecodeMsg *msg = hCryptMsg;
if (msg->base.open_flags & CMSG_CRYPT_RELEASE_CONTEXT_FLAG) if (msg->base.open_flags & CMSG_CRYPT_RELEASE_CONTEXT_FLAG)
CryptReleaseContext(msg->crypt_prov, 0); CryptReleaseContext(msg->crypt_prov, 0);
...@@ -1563,8 +1560,7 @@ static BOOL CDecodeMsg_DecodeDataContent(CDecodeMsg *msg, CRYPT_DER_BLOB *blob) ...@@ -1563,8 +1560,7 @@ static BOOL CDecodeMsg_DecodeDataContent(CDecodeMsg *msg, CRYPT_DER_BLOB *blob)
DWORD size; DWORD size;
ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_OCTET_STRING, ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_OCTET_STRING,
blob->pbData, blob->cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, (LPBYTE)&data, blob->pbData, blob->cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &data, &size);
&size);
if (ret) if (ret)
{ {
ret = ContextPropertyList_SetProperty(msg->properties, ret = ContextPropertyList_SetProperty(msg->properties,
...@@ -1703,7 +1699,7 @@ static BOOL CDecodeMsg_DecodeContent(CDecodeMsg *msg, CRYPT_DER_BLOB *blob, ...@@ -1703,7 +1699,7 @@ static BOOL CDecodeMsg_DecodeContent(CDecodeMsg *msg, CRYPT_DER_BLOB *blob,
ret = CryptDecodeObjectEx(X509_ASN_ENCODING, PKCS_CONTENT_INFO, ret = CryptDecodeObjectEx(X509_ASN_ENCODING, PKCS_CONTENT_INFO,
msg->msg_data.pbData, msg->msg_data.cbData, CRYPT_DECODE_ALLOC_FLAG, msg->msg_data.pbData, msg->msg_data.cbData, CRYPT_DECODE_ALLOC_FLAG,
NULL, (LPBYTE)&info, &size); NULL, &info, &size);
if (ret) if (ret)
{ {
if (!strcmp(info->pszObjId, szOID_RSA_data)) if (!strcmp(info->pszObjId, szOID_RSA_data))
...@@ -1802,7 +1798,7 @@ static BOOL CDecodeMsg_FinalizeSignedContent(CDecodeMsg *msg, ...@@ -1802,7 +1798,7 @@ static BOOL CDecodeMsg_FinalizeSignedContent(CDecodeMsg *msg,
ret = CryptDecodeObjectEx(X509_ASN_ENCODING, ret = CryptDecodeObjectEx(X509_ASN_ENCODING,
X509_OCTET_STRING, content->pbData, content->cbData, X509_OCTET_STRING, content->pbData, content->cbData,
CRYPT_DECODE_ALLOC_FLAG, NULL, (LPBYTE)&blob, &size); CRYPT_DECODE_ALLOC_FLAG, NULL, &blob, &size);
if (ret) if (ret)
{ {
ret = CSignedMsgData_Update(&msg->u.signed_data, ret = CSignedMsgData_Update(&msg->u.signed_data,
...@@ -1839,7 +1835,7 @@ static BOOL CDecodeMsg_FinalizeContent(CDecodeMsg *msg, CRYPT_DER_BLOB *blob) ...@@ -1839,7 +1835,7 @@ static BOOL CDecodeMsg_FinalizeContent(CDecodeMsg *msg, CRYPT_DER_BLOB *blob)
static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
DWORD cbData, BOOL fFinal) DWORD cbData, BOOL fFinal)
{ {
CDecodeMsg *msg = (CDecodeMsg *)hCryptMsg; CDecodeMsg *msg = hCryptMsg;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE("(%p, %p, %d, %d)\n", hCryptMsg, pbData, cbData, fFinal); TRACE("(%p, %p, %d, %d)\n", hCryptMsg, pbData, cbData, fFinal);
...@@ -1939,7 +1935,7 @@ static BOOL CDecodeHashMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType, ...@@ -1939,7 +1935,7 @@ static BOOL CDecodeHashMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
{ {
ret = CRYPT_CopyParam(pvData, pcbData, blob.pbData, blob.cbData); ret = CRYPT_CopyParam(pvData, pcbData, blob.pbData, blob.cbData);
if (ret && pvData) if (ret && pvData)
CRYPT_FixUpAlgorithmID((CRYPT_ALGORITHM_IDENTIFIER *)pvData); CRYPT_FixUpAlgorithmID(pvData);
} }
else else
SetLastError(CRYPT_E_INVALID_MSG_TYPE); SetLastError(CRYPT_E_INVALID_MSG_TYPE);
...@@ -2136,7 +2132,7 @@ static BOOL CRYPT_CopySignerInfo(void *pvData, DWORD *pcbData, ...@@ -2136,7 +2132,7 @@ static BOOL CRYPT_CopySignerInfo(void *pvData, DWORD *pcbData,
else else
{ {
LPBYTE nextData = (BYTE *)pvData + sizeof(CMSG_SIGNER_INFO); LPBYTE nextData = (BYTE *)pvData + sizeof(CMSG_SIGNER_INFO);
CMSG_SIGNER_INFO *out = (CMSG_SIGNER_INFO *)pvData; CMSG_SIGNER_INFO *out = pvData;
ret = TRUE; ret = TRUE;
out->dwVersion = in->dwVersion; out->dwVersion = in->dwVersion;
...@@ -2206,7 +2202,7 @@ static BOOL CRYPT_CopyCMSSignerInfo(void *pvData, DWORD *pcbData, ...@@ -2206,7 +2202,7 @@ static BOOL CRYPT_CopyCMSSignerInfo(void *pvData, DWORD *pcbData,
else else
{ {
LPBYTE nextData = (BYTE *)pvData + sizeof(CMSG_CMS_SIGNER_INFO); LPBYTE nextData = (BYTE *)pvData + sizeof(CMSG_CMS_SIGNER_INFO);
CMSG_CMS_SIGNER_INFO *out = (CMSG_CMS_SIGNER_INFO *)pvData; CMSG_CMS_SIGNER_INFO *out = pvData;
out->dwVersion = in->dwVersion; out->dwVersion = in->dwVersion;
out->SignerId.dwIdChoice = in->SignerId.dwIdChoice; out->SignerId.dwIdChoice = in->SignerId.dwIdChoice;
...@@ -2265,7 +2261,7 @@ static BOOL CRYPT_CopySignerCertInfo(void *pvData, DWORD *pcbData, ...@@ -2265,7 +2261,7 @@ static BOOL CRYPT_CopySignerCertInfo(void *pvData, DWORD *pcbData,
else else
{ {
LPBYTE nextData = (BYTE *)pvData + sizeof(CERT_INFO); LPBYTE nextData = (BYTE *)pvData + sizeof(CERT_INFO);
CERT_INFO *out = (CERT_INFO *)pvData; CERT_INFO *out = pvData;
memset(out, 0, sizeof(CERT_INFO)); memset(out, 0, sizeof(CERT_INFO));
if (in->SignerId.dwIdChoice == CERT_ID_ISSUER_SERIAL_NUMBER) if (in->SignerId.dwIdChoice == CERT_ID_ISSUER_SERIAL_NUMBER)
...@@ -2306,7 +2302,7 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType, ...@@ -2306,7 +2302,7 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_OCTET_STRING, ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_OCTET_STRING,
msg->u.signed_data.info->content.Content.pbData, msg->u.signed_data.info->content.Content.pbData,
msg->u.signed_data.info->content.Content.cbData, msg->u.signed_data.info->content.Content.cbData,
CRYPT_DECODE_ALLOC_FLAG, NULL, (LPBYTE)&blob, &size); CRYPT_DECODE_ALLOC_FLAG, NULL, &blob, &size);
if (ret) if (ret)
{ {
ret = CRYPT_CopyParam(pvData, pcbData, blob->pbData, ret = CRYPT_CopyParam(pvData, pcbData, blob->pbData,
...@@ -2453,7 +2449,7 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType, ...@@ -2453,7 +2449,7 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
static BOOL CDecodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, static BOOL CDecodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
DWORD dwIndex, void *pvData, DWORD *pcbData) DWORD dwIndex, void *pvData, DWORD *pcbData)
{ {
CDecodeMsg *msg = (CDecodeMsg *)hCryptMsg; CDecodeMsg *msg = hCryptMsg;
BOOL ret = FALSE; BOOL ret = FALSE;
switch (msg->type) switch (msg->type)
...@@ -2628,12 +2624,11 @@ static BOOL CDecodeSignedMsg_VerifySignatureEx(CDecodeMsg *msg, ...@@ -2628,12 +2624,11 @@ static BOOL CDecodeSignedMsg_VerifySignatureEx(CDecodeMsg *msg,
{ {
case CMSG_VERIFY_SIGNER_PUBKEY: case CMSG_VERIFY_SIGNER_PUBKEY:
ret = CDecodeSignedMsg_VerifySignatureWithKey(msg, ret = CDecodeSignedMsg_VerifySignatureWithKey(msg,
para->hCryptProv, para->dwSignerIndex, para->hCryptProv, para->dwSignerIndex, para->pvSigner);
(PCERT_PUBLIC_KEY_INFO)para->pvSigner);
break; break;
case CMSG_VERIFY_SIGNER_CERT: case CMSG_VERIFY_SIGNER_CERT:
{ {
PCCERT_CONTEXT cert = (PCCERT_CONTEXT)para->pvSigner; PCCERT_CONTEXT cert = para->pvSigner;
ret = CDecodeSignedMsg_VerifySignatureWithKey(msg, para->hCryptProv, ret = CDecodeSignedMsg_VerifySignatureWithKey(msg, para->hCryptProv,
para->dwSignerIndex, &cert->pCertInfo->SubjectPublicKeyInfo); para->dwSignerIndex, &cert->pCertInfo->SubjectPublicKeyInfo);
...@@ -2650,7 +2645,7 @@ static BOOL CDecodeSignedMsg_VerifySignatureEx(CDecodeMsg *msg, ...@@ -2650,7 +2645,7 @@ static BOOL CDecodeSignedMsg_VerifySignatureEx(CDecodeMsg *msg,
static BOOL CDecodeMsg_Control(HCRYPTMSG hCryptMsg, DWORD dwFlags, static BOOL CDecodeMsg_Control(HCRYPTMSG hCryptMsg, DWORD dwFlags,
DWORD dwCtrlType, const void *pvCtrlPara) DWORD dwCtrlType, const void *pvCtrlPara)
{ {
CDecodeMsg *msg = (CDecodeMsg *)hCryptMsg; CDecodeMsg *msg = hCryptMsg;
BOOL ret = FALSE; BOOL ret = FALSE;
switch (dwCtrlType) switch (dwCtrlType)
...@@ -2743,7 +2738,7 @@ HCRYPTMSG WINAPI CryptMsgDuplicate(HCRYPTMSG hCryptMsg) ...@@ -2743,7 +2738,7 @@ HCRYPTMSG WINAPI CryptMsgDuplicate(HCRYPTMSG hCryptMsg)
if (hCryptMsg) if (hCryptMsg)
{ {
CryptMsgBase *msg = (CryptMsgBase *)hCryptMsg; CryptMsgBase *msg = hCryptMsg;
InterlockedIncrement(&msg->ref); InterlockedIncrement(&msg->ref);
} }
...@@ -2756,7 +2751,7 @@ BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg) ...@@ -2756,7 +2751,7 @@ BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg)
if (hCryptMsg) if (hCryptMsg)
{ {
CryptMsgBase *msg = (CryptMsgBase *)hCryptMsg; CryptMsgBase *msg = hCryptMsg;
if (InterlockedDecrement(&msg->ref) == 0) if (InterlockedDecrement(&msg->ref) == 0)
{ {
...@@ -2772,7 +2767,7 @@ BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg) ...@@ -2772,7 +2767,7 @@ BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg)
BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData, BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData,
DWORD cbData, BOOL fFinal) DWORD cbData, BOOL fFinal)
{ {
CryptMsgBase *msg = (CryptMsgBase *)hCryptMsg; CryptMsgBase *msg = hCryptMsg;
TRACE("(%p, %p, %d, %d)\n", hCryptMsg, pbData, cbData, fFinal); TRACE("(%p, %p, %d, %d)\n", hCryptMsg, pbData, cbData, fFinal);
...@@ -2782,7 +2777,7 @@ BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData, ...@@ -2782,7 +2777,7 @@ BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData,
BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
DWORD dwIndex, void *pvData, DWORD *pcbData) DWORD dwIndex, void *pvData, DWORD *pcbData)
{ {
CryptMsgBase *msg = (CryptMsgBase *)hCryptMsg; CryptMsgBase *msg = hCryptMsg;
TRACE("(%p, %d, %d, %p, %p)\n", hCryptMsg, dwParamType, dwIndex, TRACE("(%p, %d, %d, %p, %p)\n", hCryptMsg, dwParamType, dwIndex,
pvData, pcbData); pvData, pcbData);
...@@ -2792,7 +2787,7 @@ BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, ...@@ -2792,7 +2787,7 @@ BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
BOOL WINAPI CryptMsgControl(HCRYPTMSG hCryptMsg, DWORD dwFlags, BOOL WINAPI CryptMsgControl(HCRYPTMSG hCryptMsg, DWORD dwFlags,
DWORD dwCtrlType, const void *pvCtrlPara) DWORD dwCtrlType, const void *pvCtrlPara)
{ {
CryptMsgBase *msg = (CryptMsgBase *)hCryptMsg; CryptMsgBase *msg = hCryptMsg;
TRACE("(%p, %08x, %d, %p)\n", hCryptMsg, dwFlags, dwCtrlType, TRACE("(%p, %08x, %d, %p)\n", hCryptMsg, dwFlags, dwCtrlType,
pvCtrlPara); pvCtrlPara);
......
...@@ -108,11 +108,11 @@ static BOOL CRYPT_QueryContextObject(DWORD dwObjectType, const void *pvObject, ...@@ -108,11 +108,11 @@ static BOOL CRYPT_QueryContextObject(DWORD dwObjectType, const void *pvObject,
/* Cert, CRL, and CTL contexts can't be "embedded" in a file, so /* Cert, CRL, and CTL contexts can't be "embedded" in a file, so
* just read the file directly * just read the file directly
*/ */
ret = CRYPT_ReadBlobFromFile((LPCWSTR)pvObject, &fileBlob); ret = CRYPT_ReadBlobFromFile(pvObject, &fileBlob);
blob = &fileBlob; blob = &fileBlob;
break; break;
case CERT_QUERY_OBJECT_BLOB: case CERT_QUERY_OBJECT_BLOB:
blob = (const CERT_BLOB *)pvObject; blob = pvObject;
ret = TRUE; ret = TRUE;
break; break;
default: default:
...@@ -198,11 +198,11 @@ static BOOL CRYPT_QuerySerializedContextObject(DWORD dwObjectType, ...@@ -198,11 +198,11 @@ static BOOL CRYPT_QuerySerializedContextObject(DWORD dwObjectType,
/* Cert, CRL, and CTL contexts can't be "embedded" in a file, so /* Cert, CRL, and CTL contexts can't be "embedded" in a file, so
* just read the file directly * just read the file directly
*/ */
ret = CRYPT_ReadBlobFromFile((LPCWSTR)pvObject, &fileBlob); ret = CRYPT_ReadBlobFromFile(pvObject, &fileBlob);
blob = &fileBlob; blob = &fileBlob;
break; break;
case CERT_QUERY_OBJECT_BLOB: case CERT_QUERY_OBJECT_BLOB:
blob = (const CERT_BLOB *)pvObject; blob = pvObject;
ret = TRUE; ret = TRUE;
break; break;
default: default:
...@@ -287,7 +287,7 @@ static BOOL CRYPT_QuerySerializedStoreObject(DWORD dwObjectType, ...@@ -287,7 +287,7 @@ static BOOL CRYPT_QuerySerializedStoreObject(DWORD dwObjectType,
const void *pvObject, DWORD *pdwMsgAndCertEncodingType, DWORD *pdwContentType, const void *pvObject, DWORD *pdwMsgAndCertEncodingType, DWORD *pdwContentType,
HCERTSTORE *phCertStore, HCRYPTMSG *phMsg) HCERTSTORE *phCertStore, HCRYPTMSG *phMsg)
{ {
LPCWSTR fileName = (LPCWSTR)pvObject; LPCWSTR fileName = pvObject;
HANDLE file; HANDLE file;
BOOL ret = FALSE; BOOL ret = FALSE;
...@@ -450,11 +450,11 @@ static BOOL CRYPT_QueryMessageObject(DWORD dwObjectType, const void *pvObject, ...@@ -450,11 +450,11 @@ static BOOL CRYPT_QueryMessageObject(DWORD dwObjectType, const void *pvObject,
/* This isn't an embedded PKCS7 message, so just read the file /* This isn't an embedded PKCS7 message, so just read the file
* directly * directly
*/ */
ret = CRYPT_ReadBlobFromFile((LPCWSTR)pvObject, &fileBlob); ret = CRYPT_ReadBlobFromFile(pvObject, &fileBlob);
blob = &fileBlob; blob = &fileBlob;
break; break;
case CERT_QUERY_OBJECT_BLOB: case CERT_QUERY_OBJECT_BLOB:
blob = (const CERT_BLOB *)pvObject; blob = pvObject;
ret = TRUE; ret = TRUE;
break; break;
default: default:
...@@ -583,7 +583,7 @@ static BOOL CRYPT_QueryEmbeddedMessageObject(DWORD dwObjectType, ...@@ -583,7 +583,7 @@ static BOOL CRYPT_QueryEmbeddedMessageObject(DWORD dwObjectType,
GUID subject; GUID subject;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE("%s\n", debugstr_w((LPCWSTR)pvObject)); TRACE("%s\n", debugstr_w(pvObject));
if (dwObjectType != CERT_QUERY_OBJECT_FILE) if (dwObjectType != CERT_QUERY_OBJECT_FILE)
{ {
...@@ -592,11 +592,11 @@ static BOOL CRYPT_QueryEmbeddedMessageObject(DWORD dwObjectType, ...@@ -592,11 +592,11 @@ static BOOL CRYPT_QueryEmbeddedMessageObject(DWORD dwObjectType,
SetLastError(E_INVALIDARG); SetLastError(E_INVALIDARG);
return FALSE; return FALSE;
} }
file = CreateFileW((LPCWSTR)pvObject, GENERIC_READ, FILE_SHARE_READ, file = CreateFileW(pvObject, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (file != INVALID_HANDLE_VALUE) if (file != INVALID_HANDLE_VALUE)
{ {
ret = CryptSIPRetrieveSubjectGuid((LPCWSTR)pvObject, file, &subject); ret = CryptSIPRetrieveSubjectGuid(pvObject, file, &subject);
if (ret) if (ret)
{ {
SIP_DISPATCH_INFO sip; SIP_DISPATCH_INFO sip;
...@@ -614,7 +614,7 @@ static BOOL CRYPT_QueryEmbeddedMessageObject(DWORD dwObjectType, ...@@ -614,7 +614,7 @@ static BOOL CRYPT_QueryEmbeddedMessageObject(DWORD dwObjectType,
subjectInfo.cbSize = sizeof(subjectInfo); subjectInfo.cbSize = sizeof(subjectInfo);
subjectInfo.pgSubjectType = &subject; subjectInfo.pgSubjectType = &subject;
subjectInfo.hFile = file; subjectInfo.hFile = file;
subjectInfo.pwsFileName = (LPCWSTR)pvObject; subjectInfo.pwsFileName = pvObject;
ret = sip.pfGet(&subjectInfo, &encodingType, 0, &blob.cbData, ret = sip.pfGet(&subjectInfo, &encodingType, 0, &blob.cbData,
NULL); NULL);
if (ret) if (ret)
...@@ -1623,7 +1623,7 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType, ...@@ -1623,7 +1623,7 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType,
else else
{ {
*pcbFormat = bytesNeeded; *pcbFormat = bytesNeeded;
strcpyW((LPWSTR)pbFormat, infoNotAvailable); strcpyW(pbFormat, infoNotAvailable);
} }
} }
else else
...@@ -2021,7 +2021,7 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType, ...@@ -2021,7 +2021,7 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType,
else else
{ {
*pcbFormat = bytesNeeded; *pcbFormat = bytesNeeded;
strcpyW((LPWSTR)pbFormat, infoNotAvailable); strcpyW(pbFormat, infoNotAvailable);
} }
} }
else else
......
...@@ -123,7 +123,7 @@ HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, ...@@ -123,7 +123,7 @@ HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName,
{ {
if (!strcasecmp(pszFuncName, cursor->name)) if (!strcasecmp(pszFuncName, cursor->name))
{ {
ret = (HCRYPTOIDFUNCSET)cursor; ret = cursor;
break; break;
} }
} }
...@@ -151,7 +151,7 @@ HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, ...@@ -151,7 +151,7 @@ HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName,
} }
LeaveCriticalSection(&funcSetCS); LeaveCriticalSection(&funcSetCS);
return (HCRYPTOIDFUNCSET)ret; return ret;
} }
static char *CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName, static char *CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName,
...@@ -194,7 +194,7 @@ BOOL WINAPI CryptGetDefaultOIDDllList(HCRYPTOIDFUNCSET hFuncSet, ...@@ -194,7 +194,7 @@ BOOL WINAPI CryptGetDefaultOIDDllList(HCRYPTOIDFUNCSET hFuncSet,
DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList) DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList)
{ {
BOOL ret = TRUE; BOOL ret = TRUE;
struct OIDFunctionSet *set = (struct OIDFunctionSet *)hFuncSet; struct OIDFunctionSet *set = hFuncSet;
char *keyName; char *keyName;
HKEY key; HKEY key;
long rc; long rc;
...@@ -244,7 +244,7 @@ BOOL WINAPI CryptInstallOIDFunctionAddress(HMODULE hModule, ...@@ -244,7 +244,7 @@ BOOL WINAPI CryptInstallOIDFunctionAddress(HMODULE hModule,
TRACE("(%p, %d, %s, %d, %p, %08x)\n", hModule, dwEncodingType, TRACE("(%p, %d, %s, %d, %p, %08x)\n", hModule, dwEncodingType,
debugstr_a(pszFuncName), cFuncEntry, rgFuncEntry, dwFlags); debugstr_a(pszFuncName), cFuncEntry, rgFuncEntry, dwFlags);
set = (struct OIDFunctionSet *)CryptInitOIDFunctionSet(pszFuncName, 0); set = CryptInitOIDFunctionSet(pszFuncName, 0);
if (set) if (set)
{ {
DWORD i; DWORD i;
...@@ -386,7 +386,7 @@ BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, ...@@ -386,7 +386,7 @@ BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
HCRYPTOIDFUNCADDR *phFuncAddr) HCRYPTOIDFUNCADDR *phFuncAddr)
{ {
BOOL ret = FALSE; BOOL ret = FALSE;
struct OIDFunctionSet *set = (struct OIDFunctionSet *)hFuncSet; struct OIDFunctionSet *set = hFuncSet;
TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType, TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType,
debugstr_a(pszOID), dwFlags, ppvFuncAddr, phFuncAddr); debugstr_a(pszOID), dwFlags, ppvFuncAddr, phFuncAddr);
...@@ -441,7 +441,7 @@ BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr, ...@@ -441,7 +441,7 @@ BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr,
*/ */
if (hFuncAddr) if (hFuncAddr)
{ {
struct FuncAddr *addr = (struct FuncAddr *)hFuncAddr; struct FuncAddr *addr = hFuncAddr;
CryptMemFree(addr->dllList); CryptMemFree(addr->dllList);
FreeLibrary(addr->lib); FreeLibrary(addr->lib);
...@@ -474,7 +474,7 @@ BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, ...@@ -474,7 +474,7 @@ BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr, DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr,
HCRYPTOIDFUNCADDR *phFuncAddr) HCRYPTOIDFUNCADDR *phFuncAddr)
{ {
struct OIDFunctionSet *set = (struct OIDFunctionSet *)hFuncSet; struct OIDFunctionSet *set = hFuncSet;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType, TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType,
...@@ -509,7 +509,7 @@ BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, ...@@ -509,7 +509,7 @@ BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
} }
else else
{ {
struct FuncAddr *addr = (struct FuncAddr *)*phFuncAddr; struct FuncAddr *addr = *phFuncAddr;
if (!addr) if (!addr)
{ {
...@@ -1504,11 +1504,11 @@ PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, ...@@ -1504,11 +1504,11 @@ PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey,
{ {
struct OIDInfo *info; struct OIDInfo *info;
TRACE("CRYPT_OID_INFO_NAME_KEY: %s\n", debugstr_w((LPWSTR)pvKey)); TRACE("CRYPT_OID_INFO_NAME_KEY: %s\n", debugstr_w(pvKey));
EnterCriticalSection(&oidInfoCS); EnterCriticalSection(&oidInfoCS);
LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry) LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
{ {
if (!lstrcmpW(info->info.pwszName, (LPWSTR)pvKey) && if (!lstrcmpW(info->info.pwszName, pvKey) &&
(!dwGroupId || info->info.dwGroupId == dwGroupId)) (!dwGroupId || info->info.dwGroupId == dwGroupId))
{ {
ret = &info->info; ret = &info->info;
...@@ -1521,7 +1521,7 @@ PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, ...@@ -1521,7 +1521,7 @@ PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey,
case CRYPT_OID_INFO_OID_KEY: case CRYPT_OID_INFO_OID_KEY:
{ {
struct OIDInfo *info; struct OIDInfo *info;
LPSTR oid = (LPSTR)pvKey; LPSTR oid = pvKey;
TRACE("CRYPT_OID_INFO_OID_KEY: %s\n", debugstr_a(oid)); TRACE("CRYPT_OID_INFO_OID_KEY: %s\n", debugstr_a(oid));
EnterCriticalSection(&oidInfoCS); EnterCriticalSection(&oidInfoCS);
......
...@@ -43,7 +43,7 @@ typedef struct _WINE_PROVIDERSTORE ...@@ -43,7 +43,7 @@ typedef struct _WINE_PROVIDERSTORE
static void WINAPI CRYPT_ProvCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) static void WINAPI CRYPT_ProvCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
{ {
PWINE_PROVIDERSTORE store = (PWINE_PROVIDERSTORE)hCertStore; PWINE_PROVIDERSTORE store = hCertStore;
TRACE("(%p, %08x)\n", store, dwFlags); TRACE("(%p, %08x)\n", store, dwFlags);
...@@ -69,7 +69,7 @@ static BOOL CRYPT_ProvAddCert(PWINECRYPT_CERTSTORE store, void *cert, ...@@ -69,7 +69,7 @@ static BOOL CRYPT_ProvAddCert(PWINECRYPT_CERTSTORE store, void *cert,
{ {
ret = TRUE; ret = TRUE;
if (ps->provWriteCert) if (ps->provWriteCert)
ret = ps->provWriteCert(ps->hStoreProv, (PCCERT_CONTEXT)cert, ret = ps->provWriteCert(ps->hStoreProv, cert,
CERT_STORE_PROV_WRITE_ADD_FLAG); CERT_STORE_PROV_WRITE_ADD_FLAG);
if (ret) if (ret)
ret = ps->memStore->certs.addContext(ps->memStore, cert, NULL, ret = ps->memStore->certs.addContext(ps->memStore, cert, NULL,
...@@ -135,7 +135,7 @@ static BOOL CRYPT_ProvAddCRL(PWINECRYPT_CERTSTORE store, void *crl, ...@@ -135,7 +135,7 @@ static BOOL CRYPT_ProvAddCRL(PWINECRYPT_CERTSTORE store, void *crl,
{ {
ret = TRUE; ret = TRUE;
if (ps->provWriteCrl) if (ps->provWriteCrl)
ret = ps->provWriteCrl(ps->hStoreProv, (PCCRL_CONTEXT)crl, ret = ps->provWriteCrl(ps->hStoreProv, crl,
CERT_STORE_PROV_WRITE_ADD_FLAG); CERT_STORE_PROV_WRITE_ADD_FLAG);
if (ret) if (ret)
ret = ps->memStore->crls.addContext(ps->memStore, crl, NULL, ret = ps->memStore->crls.addContext(ps->memStore, crl, NULL,
...@@ -202,7 +202,7 @@ static BOOL CRYPT_ProvAddCTL(PWINECRYPT_CERTSTORE store, void *ctl, ...@@ -202,7 +202,7 @@ static BOOL CRYPT_ProvAddCTL(PWINECRYPT_CERTSTORE store, void *ctl,
{ {
ret = TRUE; ret = TRUE;
if (ps->provWriteCtl) if (ps->provWriteCtl)
ret = ps->provWriteCtl(ps->hStoreProv, (PCCTL_CONTEXT)ctl, ret = ps->provWriteCtl(ps->hStoreProv, ctl,
CERT_STORE_PROV_WRITE_ADD_FLAG); CERT_STORE_PROV_WRITE_ADD_FLAG);
if (ret) if (ret)
ret = ps->memStore->ctls.addContext(ps->memStore, ctl, NULL, ret = ps->memStore->ctls.addContext(ps->memStore, ctl, NULL,
...@@ -250,7 +250,7 @@ static BOOL CRYPT_ProvDeleteCTL(PWINECRYPT_CERTSTORE store, void *ctl) ...@@ -250,7 +250,7 @@ static BOOL CRYPT_ProvDeleteCTL(PWINECRYPT_CERTSTORE store, void *ctl)
static BOOL WINAPI CRYPT_ProvControl(HCERTSTORE hCertStore, DWORD dwFlags, static BOOL WINAPI CRYPT_ProvControl(HCERTSTORE hCertStore, DWORD dwFlags,
DWORD dwCtrlType, void const *pvCtrlPara) DWORD dwCtrlType, void const *pvCtrlPara)
{ {
PWINE_PROVIDERSTORE store = (PWINE_PROVIDERSTORE)hCertStore; PWINE_PROVIDERSTORE store = hCertStore;
BOOL ret = TRUE; BOOL ret = TRUE;
TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType, TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType,
......
...@@ -319,7 +319,7 @@ static BOOL CRYPT_RegFlushStore(PWINE_REGSTOREINFO store, BOOL force) ...@@ -319,7 +319,7 @@ static BOOL CRYPT_RegFlushStore(PWINE_REGSTOREINFO store, BOOL force)
static void WINAPI CRYPT_RegCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) static void WINAPI CRYPT_RegCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
{ {
PWINE_REGSTOREINFO store = (PWINE_REGSTOREINFO)hCertStore; PWINE_REGSTOREINFO store = hCertStore;
TRACE("(%p, %08x)\n", store, dwFlags); TRACE("(%p, %08x)\n", store, dwFlags);
if (dwFlags) if (dwFlags)
...@@ -392,7 +392,7 @@ static BOOL CRYPT_RegDeleteContext(PWINE_REGSTOREINFO store, ...@@ -392,7 +392,7 @@ static BOOL CRYPT_RegDeleteContext(PWINE_REGSTOREINFO store,
static BOOL WINAPI CRYPT_RegWriteCert(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_RegWriteCert(HCERTSTORE hCertStore,
PCCERT_CONTEXT cert, DWORD dwFlags) PCCERT_CONTEXT cert, DWORD dwFlags)
{ {
PWINE_REGSTOREINFO store = (PWINE_REGSTOREINFO)hCertStore; PWINE_REGSTOREINFO store = hCertStore;
TRACE("(%p, %p, %d)\n", hCertStore, cert, dwFlags); TRACE("(%p, %p, %d)\n", hCertStore, cert, dwFlags);
...@@ -402,7 +402,7 @@ static BOOL WINAPI CRYPT_RegWriteCert(HCERTSTORE hCertStore, ...@@ -402,7 +402,7 @@ static BOOL WINAPI CRYPT_RegWriteCert(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_RegDeleteCert(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_RegDeleteCert(HCERTSTORE hCertStore,
PCCERT_CONTEXT pCertContext, DWORD dwFlags) PCCERT_CONTEXT pCertContext, DWORD dwFlags)
{ {
PWINE_REGSTOREINFO store = (PWINE_REGSTOREINFO)hCertStore; PWINE_REGSTOREINFO store = hCertStore;
TRACE("(%p, %p, %08x)\n", store, pCertContext, dwFlags); TRACE("(%p, %p, %08x)\n", store, pCertContext, dwFlags);
...@@ -413,7 +413,7 @@ static BOOL WINAPI CRYPT_RegDeleteCert(HCERTSTORE hCertStore, ...@@ -413,7 +413,7 @@ static BOOL WINAPI CRYPT_RegDeleteCert(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_RegWriteCRL(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_RegWriteCRL(HCERTSTORE hCertStore,
PCCRL_CONTEXT crl, DWORD dwFlags) PCCRL_CONTEXT crl, DWORD dwFlags)
{ {
PWINE_REGSTOREINFO store = (PWINE_REGSTOREINFO)hCertStore; PWINE_REGSTOREINFO store = hCertStore;
TRACE("(%p, %p, %d)\n", hCertStore, crl, dwFlags); TRACE("(%p, %p, %d)\n", hCertStore, crl, dwFlags);
...@@ -423,7 +423,7 @@ static BOOL WINAPI CRYPT_RegWriteCRL(HCERTSTORE hCertStore, ...@@ -423,7 +423,7 @@ static BOOL WINAPI CRYPT_RegWriteCRL(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_RegDeleteCRL(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_RegDeleteCRL(HCERTSTORE hCertStore,
PCCRL_CONTEXT pCrlContext, DWORD dwFlags) PCCRL_CONTEXT pCrlContext, DWORD dwFlags)
{ {
PWINE_REGSTOREINFO store = (PWINE_REGSTOREINFO)hCertStore; PWINE_REGSTOREINFO store = hCertStore;
TRACE("(%p, %p, %08x)\n", store, pCrlContext, dwFlags); TRACE("(%p, %p, %08x)\n", store, pCrlContext, dwFlags);
...@@ -434,7 +434,7 @@ static BOOL WINAPI CRYPT_RegDeleteCRL(HCERTSTORE hCertStore, ...@@ -434,7 +434,7 @@ static BOOL WINAPI CRYPT_RegDeleteCRL(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_RegWriteCTL(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_RegWriteCTL(HCERTSTORE hCertStore,
PCCTL_CONTEXT ctl, DWORD dwFlags) PCCTL_CONTEXT ctl, DWORD dwFlags)
{ {
PWINE_REGSTOREINFO store = (PWINE_REGSTOREINFO)hCertStore; PWINE_REGSTOREINFO store = hCertStore;
TRACE("(%p, %p, %d)\n", hCertStore, ctl, dwFlags); TRACE("(%p, %p, %d)\n", hCertStore, ctl, dwFlags);
...@@ -444,7 +444,7 @@ static BOOL WINAPI CRYPT_RegWriteCTL(HCERTSTORE hCertStore, ...@@ -444,7 +444,7 @@ static BOOL WINAPI CRYPT_RegWriteCTL(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_RegDeleteCTL(HCERTSTORE hCertStore, static BOOL WINAPI CRYPT_RegDeleteCTL(HCERTSTORE hCertStore,
PCCTL_CONTEXT pCtlContext, DWORD dwFlags) PCCTL_CONTEXT pCtlContext, DWORD dwFlags)
{ {
PWINE_REGSTOREINFO store = (PWINE_REGSTOREINFO)hCertStore; PWINE_REGSTOREINFO store = hCertStore;
TRACE("(%p, %p, %08x)\n", store, pCtlContext, dwFlags); TRACE("(%p, %p, %08x)\n", store, pCtlContext, dwFlags);
...@@ -455,7 +455,7 @@ static BOOL WINAPI CRYPT_RegDeleteCTL(HCERTSTORE hCertStore, ...@@ -455,7 +455,7 @@ static BOOL WINAPI CRYPT_RegDeleteCTL(HCERTSTORE hCertStore,
static BOOL WINAPI CRYPT_RegControl(HCERTSTORE hCertStore, DWORD dwFlags, static BOOL WINAPI CRYPT_RegControl(HCERTSTORE hCertStore, DWORD dwFlags,
DWORD dwCtrlType, void const *pvCtrlPara) DWORD dwCtrlType, void const *pvCtrlPara)
{ {
PWINE_REGSTOREINFO store = (PWINE_REGSTOREINFO)hCertStore; PWINE_REGSTOREINFO store = hCertStore;
BOOL ret; BOOL ret;
TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType, TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType,
......
...@@ -627,7 +627,7 @@ static BOOL CRYPT_WriteSerializedStoreToFile(HANDLE file, HCERTSTORE store) ...@@ -627,7 +627,7 @@ static BOOL CRYPT_WriteSerializedStoreToFile(HANDLE file, HCERTSTORE store)
static BOOL CRYPT_SavePKCSToMem(HCERTSTORE store, static BOOL CRYPT_SavePKCSToMem(HCERTSTORE store,
DWORD dwMsgAndCertEncodingType, void *handle) DWORD dwMsgAndCertEncodingType, void *handle)
{ {
CERT_BLOB *blob = (CERT_BLOB *)handle; CERT_BLOB *blob = handle;
CRYPT_SIGNED_INFO signedInfo = { 0 }; CRYPT_SIGNED_INFO signedInfo = { 0 };
PCCERT_CONTEXT cert = NULL; PCCERT_CONTEXT cert = NULL;
PCCRL_CONTEXT crl = NULL; PCCRL_CONTEXT crl = NULL;
...@@ -767,7 +767,7 @@ struct MemWrittenTracker ...@@ -767,7 +767,7 @@ struct MemWrittenTracker
/* handle is a pointer to a MemWrittenTracker. Assumes its pointer is valid. */ /* handle is a pointer to a MemWrittenTracker. Assumes its pointer is valid. */
static BOOL CRYPT_MemOutputFunc(void *handle, const void *buffer, DWORD size) static BOOL CRYPT_MemOutputFunc(void *handle, const void *buffer, DWORD size)
{ {
struct MemWrittenTracker *tracker = (struct MemWrittenTracker *)handle; struct MemWrittenTracker *tracker = handle;
BOOL ret; BOOL ret;
if (tracker->written + size > tracker->cbData) if (tracker->written + size > tracker->cbData)
...@@ -797,7 +797,7 @@ static BOOL CRYPT_CountSerializedBytes(void *handle, const void *buffer, ...@@ -797,7 +797,7 @@ static BOOL CRYPT_CountSerializedBytes(void *handle, const void *buffer,
static BOOL CRYPT_SaveSerializedToMem(HCERTSTORE store, static BOOL CRYPT_SaveSerializedToMem(HCERTSTORE store,
DWORD dwMsgAndCertEncodingType, void *handle) DWORD dwMsgAndCertEncodingType, void *handle)
{ {
CERT_BLOB *blob = (CERT_BLOB *)handle; CERT_BLOB *blob = handle;
DWORD size = 0; DWORD size = 0;
BOOL ret; BOOL ret;
...@@ -864,11 +864,11 @@ BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, ...@@ -864,11 +864,11 @@ BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType,
closeFile = FALSE; closeFile = FALSE;
break; break;
case CERT_STORE_SAVE_TO_FILENAME_A: case CERT_STORE_SAVE_TO_FILENAME_A:
handle = CreateFileA((LPCSTR)pvSaveToPara, GENERIC_WRITE, 0, NULL, handle = CreateFileA(pvSaveToPara, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, 0, NULL); CREATE_ALWAYS, 0, NULL);
break; break;
case CERT_STORE_SAVE_TO_FILENAME_W: case CERT_STORE_SAVE_TO_FILENAME_W:
handle = CreateFileW((LPCWSTR)pvSaveToPara, GENERIC_WRITE, 0, NULL, handle = CreateFileW(pvSaveToPara, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, 0, NULL); CREATE_ALWAYS, 0, NULL);
break; break;
case CERT_STORE_SAVE_TO_MEMORY: case CERT_STORE_SAVE_TO_MEMORY:
......
...@@ -273,7 +273,7 @@ static BOOL CRYPT_MemDeleteCtl(PWINECRYPT_CERTSTORE store, void *pCtlContext) ...@@ -273,7 +273,7 @@ static BOOL CRYPT_MemDeleteCtl(PWINECRYPT_CERTSTORE store, void *pCtlContext)
static void WINAPI CRYPT_MemCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) static void WINAPI CRYPT_MemCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
{ {
WINE_MEMSTORE *store = (WINE_MEMSTORE *)hCertStore; WINE_MEMSTORE *store = hCertStore;
TRACE("(%p, %08x)\n", store, dwFlags); TRACE("(%p, %08x)\n", store, dwFlags);
if (dwFlags) if (dwFlags)
...@@ -335,14 +335,14 @@ static PWINECRYPT_CERTSTORE CRYPT_SysRegOpenStoreW(HCRYPTPROV hCryptProv, ...@@ -335,14 +335,14 @@ static PWINECRYPT_CERTSTORE CRYPT_SysRegOpenStoreW(HCRYPTPROV hCryptProv,
DWORD dwFlags, const void *pvPara) DWORD dwFlags, const void *pvPara)
{ {
static const WCHAR fmt[] = { '%','s','\\','%','s',0 }; static const WCHAR fmt[] = { '%','s','\\','%','s',0 };
LPCWSTR storeName = (LPCWSTR)pvPara; LPCWSTR storeName = pvPara;
LPWSTR storePath; LPWSTR storePath;
PWINECRYPT_CERTSTORE store = NULL; PWINECRYPT_CERTSTORE store = NULL;
HKEY root; HKEY root;
LPCWSTR base; LPCWSTR base;
TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags, TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags,
debugstr_w((LPCWSTR)pvPara)); debugstr_w(pvPara));
if (!pvPara) if (!pvPara)
{ {
...@@ -450,21 +450,21 @@ static PWINECRYPT_CERTSTORE CRYPT_SysRegOpenStoreA(HCRYPTPROV hCryptProv, ...@@ -450,21 +450,21 @@ static PWINECRYPT_CERTSTORE CRYPT_SysRegOpenStoreA(HCRYPTPROV hCryptProv,
PWINECRYPT_CERTSTORE ret = NULL; PWINECRYPT_CERTSTORE ret = NULL;
TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags, TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags,
debugstr_a((LPCSTR)pvPara)); debugstr_a(pvPara));
if (!pvPara) if (!pvPara)
{ {
SetLastError(ERROR_FILE_NOT_FOUND); SetLastError(ERROR_FILE_NOT_FOUND);
return NULL; return NULL;
} }
len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, pvPara, -1, NULL, 0);
if (len) if (len)
{ {
LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR)); LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR));
if (storeName) if (storeName)
{ {
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, storeName, len); MultiByteToWideChar(CP_ACP, 0, pvPara, -1, storeName, len);
ret = CRYPT_SysRegOpenStoreW(hCryptProv, dwFlags, storeName); ret = CRYPT_SysRegOpenStoreW(hCryptProv, dwFlags, storeName);
CryptMemFree(storeName); CryptMemFree(storeName);
} }
...@@ -479,7 +479,7 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv, ...@@ -479,7 +479,7 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv,
BOOL ret; BOOL ret;
TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags, TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags,
debugstr_w((LPCWSTR)pvPara)); debugstr_w(pvPara));
if (!pvPara) if (!pvPara)
{ {
...@@ -541,7 +541,7 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv, ...@@ -541,7 +541,7 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv,
CryptReleaseContext(hCryptProv, 0); CryptReleaseContext(hCryptProv, 0);
} }
} }
return (PWINECRYPT_CERTSTORE)store; return store;
} }
static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreA(HCRYPTPROV hCryptProv, static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreA(HCRYPTPROV hCryptProv,
...@@ -551,21 +551,21 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreA(HCRYPTPROV hCryptProv, ...@@ -551,21 +551,21 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreA(HCRYPTPROV hCryptProv,
PWINECRYPT_CERTSTORE ret = NULL; PWINECRYPT_CERTSTORE ret = NULL;
TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags, TRACE("(%ld, %08x, %s)\n", hCryptProv, dwFlags,
debugstr_a((LPCSTR)pvPara)); debugstr_a(pvPara));
if (!pvPara) if (!pvPara)
{ {
SetLastError(ERROR_FILE_NOT_FOUND); SetLastError(ERROR_FILE_NOT_FOUND);
return NULL; return NULL;
} }
len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, pvPara, -1, NULL, 0);
if (len) if (len)
{ {
LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR)); LPWSTR storeName = CryptMemAlloc(len * sizeof(WCHAR));
if (storeName) if (storeName)
{ {
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pvPara, -1, storeName, len); MultiByteToWideChar(CP_ACP, 0, pvPara, -1, storeName, len);
ret = CRYPT_SysOpenStoreW(hCryptProv, dwFlags, storeName); ret = CRYPT_SysOpenStoreW(hCryptProv, dwFlags, storeName);
CryptMemFree(storeName); CryptMemFree(storeName);
} }
...@@ -669,7 +669,7 @@ static PWINECRYPT_CERTSTORE CRYPT_PKCSOpenStore(HCRYPTPROV hCryptProv, ...@@ -669,7 +669,7 @@ static PWINECRYPT_CERTSTORE CRYPT_PKCSOpenStore(HCRYPTPROV hCryptProv,
{ {
HCRYPTMSG msg; HCRYPTMSG msg;
PWINECRYPT_CERTSTORE store = NULL; PWINECRYPT_CERTSTORE store = NULL;
const CRYPT_DATA_BLOB *data = (const CRYPT_DATA_BLOB *)pvPara; const CRYPT_DATA_BLOB *data = pvPara;
BOOL ret; BOOL ret;
DWORD msgOpenFlags = dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG ? 0 : DWORD msgOpenFlags = dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG ? 0 :
CMSG_CRYPT_RELEASE_CONTEXT_FLAG; CMSG_CRYPT_RELEASE_CONTEXT_FLAG;
...@@ -712,7 +712,7 @@ static PWINECRYPT_CERTSTORE CRYPT_PhysOpenStoreW(HCRYPTPROV hCryptProv, ...@@ -712,7 +712,7 @@ static PWINECRYPT_CERTSTORE CRYPT_PhysOpenStoreW(HCRYPTPROV hCryptProv,
FIXME("(%ld, %08x, %p): stub\n", hCryptProv, dwFlags, pvPara); FIXME("(%ld, %08x, %p): stub\n", hCryptProv, dwFlags, pvPara);
else else
FIXME("(%ld, %08x, %s): stub\n", hCryptProv, dwFlags, FIXME("(%ld, %08x, %s): stub\n", hCryptProv, dwFlags,
debugstr_w((LPCWSTR)pvPara)); debugstr_w(pvPara));
return NULL; return NULL;
} }
...@@ -795,7 +795,7 @@ HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, ...@@ -795,7 +795,7 @@ HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider,
hCryptProv, dwFlags, pvPara); hCryptProv, dwFlags, pvPara);
else else
hcs = openFunc(hCryptProv, dwFlags, pvPara); hcs = openFunc(hCryptProv, dwFlags, pvPara);
return (HCERTSTORE)hcs; return hcs;
} }
HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV_LEGACY hProv, HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV_LEGACY hProv,
...@@ -829,7 +829,7 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, ...@@ -829,7 +829,7 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition,
PCCERT_CONTEXT *ppStoreContext) PCCERT_CONTEXT *ppStoreContext)
{ {
PWINECRYPT_CERTSTORE store = (PWINECRYPT_CERTSTORE)hCertStore; PWINECRYPT_CERTSTORE store = hCertStore;
BOOL ret = TRUE; BOOL ret = TRUE;
PCCERT_CONTEXT toAdd = NULL, existing = NULL; PCCERT_CONTEXT toAdd = NULL, existing = NULL;
...@@ -944,7 +944,7 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, ...@@ -944,7 +944,7 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore,
PCCERT_CONTEXT pPrev) PCCERT_CONTEXT pPrev)
{ {
WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *)hCertStore; WINECRYPT_CERTSTORE *hcs = hCertStore;
PCCERT_CONTEXT ret; PCCERT_CONTEXT ret;
TRACE("(%p, %p)\n", hCertStore, pPrev); TRACE("(%p, %p)\n", hCertStore, pPrev);
...@@ -972,8 +972,7 @@ BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext) ...@@ -972,8 +972,7 @@ BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext)
} }
else else
{ {
PWINECRYPT_CERTSTORE hcs = PWINECRYPT_CERTSTORE hcs = pCertContext->hCertStore;
(PWINECRYPT_CERTSTORE)pCertContext->hCertStore;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
ret = FALSE; ret = FALSE;
...@@ -991,7 +990,7 @@ BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore, ...@@ -991,7 +990,7 @@ BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore,
PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition, PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
PCCRL_CONTEXT* ppStoreContext) PCCRL_CONTEXT* ppStoreContext)
{ {
PWINECRYPT_CERTSTORE store = (PWINECRYPT_CERTSTORE)hCertStore; PWINECRYPT_CERTSTORE store = hCertStore;
BOOL ret = TRUE; BOOL ret = TRUE;
PCCRL_CONTEXT toAdd = NULL, existing = NULL; PCCRL_CONTEXT toAdd = NULL, existing = NULL;
...@@ -1111,8 +1110,7 @@ BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext) ...@@ -1111,8 +1110,7 @@ BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
} }
else else
{ {
PWINECRYPT_CERTSTORE hcs = PWINECRYPT_CERTSTORE hcs = pCrlContext->hCertStore;
(PWINECRYPT_CERTSTORE)pCrlContext->hCertStore;
if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC) if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
ret = FALSE; ret = FALSE;
...@@ -1126,7 +1124,7 @@ BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext) ...@@ -1126,7 +1124,7 @@ BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext)
PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore, PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore,
PCCRL_CONTEXT pPrev) PCCRL_CONTEXT pPrev)
{ {
WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *)hCertStore; WINECRYPT_CERTSTORE *hcs = hCertStore;
PCCRL_CONTEXT ret; PCCRL_CONTEXT ret;
TRACE("(%p, %p)\n", hCertStore, pPrev); TRACE("(%p, %p)\n", hCertStore, pPrev);
...@@ -1141,7 +1139,7 @@ PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore, ...@@ -1141,7 +1139,7 @@ PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore,
HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore) HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore)
{ {
WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *)hCertStore; WINECRYPT_CERTSTORE *hcs = hCertStore;
TRACE("(%p)\n", hCertStore); TRACE("(%p)\n", hCertStore);
...@@ -1152,7 +1150,7 @@ HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore) ...@@ -1152,7 +1150,7 @@ HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore)
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
{ {
WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *) hCertStore; WINECRYPT_CERTSTORE *hcs = hCertStore;
TRACE("(%p, %08x)\n", hCertStore, dwFlags); TRACE("(%p, %08x)\n", hCertStore, dwFlags);
...@@ -1176,7 +1174,7 @@ BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) ...@@ -1176,7 +1174,7 @@ BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags, BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags,
DWORD dwCtrlType, void const *pvCtrlPara) DWORD dwCtrlType, void const *pvCtrlPara)
{ {
WINECRYPT_CERTSTORE *hcs = (WINECRYPT_CERTSTORE *)hCertStore; WINECRYPT_CERTSTORE *hcs = hCertStore;
BOOL ret; BOOL ret;
TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType, TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType,
...@@ -1199,7 +1197,7 @@ BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags, ...@@ -1199,7 +1197,7 @@ BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags,
BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId, BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
void *pvData, DWORD *pcbData) void *pvData, DWORD *pcbData)
{ {
PWINECRYPT_CERTSTORE store = (PWINECRYPT_CERTSTORE)hCertStore; PWINECRYPT_CERTSTORE store = hCertStore;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE("(%p, %d, %p, %p)\n", hCertStore, dwPropId, pvData, pcbData); TRACE("(%p, %d, %p, %p)\n", hCertStore, dwPropId, pvData, pcbData);
...@@ -1263,7 +1261,7 @@ BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId, ...@@ -1263,7 +1261,7 @@ BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
BOOL WINAPI CertSetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId, BOOL WINAPI CertSetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
DWORD dwFlags, const void *pvData) DWORD dwFlags, const void *pvData)
{ {
PWINECRYPT_CERTSTORE store = (PWINECRYPT_CERTSTORE)hCertStore; PWINECRYPT_CERTSTORE store = hCertStore;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE("(%p, %d, %08x, %p)\n", hCertStore, dwPropId, dwFlags, pvData); TRACE("(%p, %d, %08x, %p)\n", hCertStore, dwPropId, dwFlags, pvData);
...@@ -1278,7 +1276,7 @@ BOOL WINAPI CertSetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId, ...@@ -1278,7 +1276,7 @@ BOOL WINAPI CertSetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
default: default:
if (pvData) if (pvData)
{ {
const CRYPT_DATA_BLOB *blob = (const CRYPT_DATA_BLOB *)pvData; const CRYPT_DATA_BLOB *blob = pvData;
ret = ContextPropertyList_SetProperty(store->properties, dwPropId, ret = ContextPropertyList_SetProperty(store->properties, dwPropId,
blob->pbData, blob->cbData); blob->pbData, blob->cbData);
...@@ -1392,7 +1390,7 @@ BOOL WINAPI CertEnumPhysicalStore(const void *pvSystemStore, DWORD dwFlags, ...@@ -1392,7 +1390,7 @@ BOOL WINAPI CertEnumPhysicalStore(const void *pvSystemStore, DWORD dwFlags,
FIXME("(%p, %08x, %p, %p): stub\n", pvSystemStore, dwFlags, pvArg, FIXME("(%p, %08x, %p, %p): stub\n", pvSystemStore, dwFlags, pvArg,
pfnEnum); pfnEnum);
else else
FIXME("(%s, %08x, %p, %p): stub\n", debugstr_w((LPCWSTR)pvSystemStore), FIXME("(%s, %08x, %p, %p): stub\n", debugstr_w(pvSystemStore),
dwFlags, pvArg, dwFlags, pvArg,
pfnEnum); pfnEnum);
return FALSE; return FALSE;
......
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