Commit 70c4b667 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

crypt32: Assign to structs instead of using memcpy.

parent 649d8b52
......@@ -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
......
......@@ -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;
......
......@@ -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);
......
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