crypt32: Assign to structs instead of using memcpy.

This commit is contained in:
Andrew Talbot 2008-02-13 21:16:19 +00:00 committed by Alexandre Julliard
parent 649d8b5298
commit 70c4b66781
3 changed files with 7 additions and 9 deletions

View File

@ -986,8 +986,7 @@ static BOOL CRYPT_BuildCandidateChainFromCert(HCERTCHAINENGINE hChainEngine,
chain->ref = 1;
chain->world = world;
chain->context.cbSize = sizeof(CERT_CHAIN_CONTEXT);
memcpy(&chain->context.TrustStatus, &simpleChain->TrustStatus,
sizeof(CERT_TRUST_STATUS));
chain->context.TrustStatus = simpleChain->TrustStatus;
chain->context.cChain = 1;
chain->context.rgpChain = CryptMemAlloc(sizeof(PCERT_SIMPLE_CHAIN));
chain->context.rgpChain[0] = simpleChain;
@ -1029,8 +1028,7 @@ static PCERT_SIMPLE_CHAIN CRYPT_CopySimpleChainToElement(
if (element)
{
memcpy(element, chain->rgpElement[i],
sizeof(CERT_CHAIN_ELEMENT));
*element = *chain->rgpElement[i];
element->pCertContext = CertDuplicateCertificateContext(
chain->rgpElement[i]->pCertContext);
/* Reset the trust status of the copied element, it'll get

View File

@ -78,7 +78,7 @@ static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags,
if (pStreamInfo)
{
msg->streamed = TRUE;
memcpy(&msg->stream_info, pStreamInfo, sizeof(msg->stream_info));
msg->stream_info = *pStreamInfo;
}
else
{
@ -1124,7 +1124,7 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
CRYPT_SIGNED_INFO info;
char oid_rsa_data[] = szOID_RSA_data;
memcpy(&info, msg->msg_data.info, sizeof(info));
info = *msg->msg_data.info;
/* Quirk: OID is only encoded messages if an update has happened */
if (msg->base.state != MsgStateInit)
info.content.pszObjId = oid_rsa_data;

View File

@ -325,7 +325,7 @@ BOOL WINAPI CryptSIPRetrieveSubjectGuid
dos = (IMAGE_DOS_HEADER *)pMapped;
if (dos->e_magic == IMAGE_DOS_SIGNATURE)
{
memcpy(pgSubject, &unknown, sizeof(GUID));
*pgSubject = unknown;
SetLastError(S_OK);
bRet = TRUE;
goto cleanup1;
@ -435,8 +435,8 @@ static void CRYPT_CacheSIP(const GUID *pgSubject, SIP_DISPATCH_INFO *info)
if (prov)
{
memcpy(&prov->subject, pgSubject, sizeof(prov->subject));
memcpy(&prov->info, info, sizeof(prov->info));
prov->subject = *pgSubject;
prov->info = *info;
EnterCriticalSection(&providers_cs);
list_add_tail(&providers, &prov->entry);
LeaveCriticalSection(&providers_cs);