Commit e7b0f07c authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

ole32: Assign to structs instead of using memcpy.

parent 4971f2f6
......@@ -141,9 +141,9 @@ FTMarshalImpl_GetUnmarshalClass (LPMARSHAL iface, REFIID riid, void *pv, DWORD d
TRACE("(%s, %p, 0x%x, %p, 0x%x, %p)\n", debugstr_guid(riid), pv,
dwDestContext, pvDestContext, mshlflags, pCid);
if (dwDestContext == MSHCTX_INPROC || dwDestContext == MSHCTX_CROSSCTX)
memcpy(pCid, &CLSID_InProcFreeMarshaler, sizeof(CLSID_InProcFreeMarshaler));
*pCid = CLSID_InProcFreeMarshaler;
else
memcpy(pCid, &CLSID_DfMarshal, sizeof(CLSID_InProcFreeMarshaler));
*pCid = CLSID_DfMarshal;
return S_OK;
}
......
......@@ -724,7 +724,7 @@ static HRESULT WINAPI DataAdviseHolder_Advise(
*/
This->Connections[index].sink = pAdvise;
This->Connections[index].advf = advf & ~WINE_ADVF_REMOTE;
memcpy(&(This->Connections[index].fmat), pFetc, sizeof(FORMATETC));
This->Connections[index].fmat = *pFetc;
if (pFetc->ptd)
{
This->Connections[index].fmat.ptd = CoTaskMemAlloc(pFetc->ptd->tdSize);
......
......@@ -242,7 +242,7 @@ static unsigned char * ChannelHooks_ClientFillBuffer(SChannelHookCallInfo *info,
wire_orpc_extent->conformance = (extension_size+7)&~7;
wire_orpc_extent->size = extension_size;
memcpy(&wire_orpc_extent->id, &entry->id, sizeof(wire_orpc_extent->id));
wire_orpc_extent->id = entry->id;
buffer += FIELD_OFFSET(WIRE_ORPC_EXTENT, data[wire_orpc_extent->conformance]);
}
......@@ -362,7 +362,7 @@ static unsigned char * ChannelHooks_ServerFillBuffer(SChannelHookCallInfo *info,
wire_orpc_extent->conformance = (extension_size+7)&~7;
wire_orpc_extent->size = extension_size;
memcpy(&wire_orpc_extent->id, &entry->id, sizeof(wire_orpc_extent->id));
wire_orpc_extent->id = entry->id;
buffer += FIELD_OFFSET(WIRE_ORPC_EXTENT, data[wire_orpc_extent->conformance]);
}
......@@ -411,7 +411,7 @@ HRESULT RPC_RegisterChannelHook(REFGUID rguid, IChannelHook *hook)
if (!entry)
return E_OUTOFMEMORY;
memcpy(&entry->id, rguid, sizeof(entry->id));
entry->id = *rguid;
entry->hook = hook;
IChannelHook_AddRef(hook);
......@@ -553,7 +553,7 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
{
WIRE_ORPC_EXTENT *wire_orpc_extent = msg->Buffer;
wire_orpc_extent->conformance = 0;
memcpy(&wire_orpc_extent->id, &GUID_NULL, sizeof(wire_orpc_extent->id));
wire_orpc_extent->id = GUID_NULL;
wire_orpc_extent->size = 0;
msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPC_EXTENT, data[0]);
}
......@@ -737,7 +737,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
{
WIRE_ORPC_EXTENT *wire_orpc_extent = msg->Buffer;
wire_orpc_extent->conformance = 0;
memcpy(&wire_orpc_extent->id, &GUID_NULL, sizeof(wire_orpc_extent->id));
wire_orpc_extent->id = GUID_NULL;
wire_orpc_extent->size = 0;
msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPC_EXTENT, data[0]);
}
......
......@@ -913,12 +913,12 @@ static HRESULT WINAPI IPropertyStorage_fnStat(
hr = IStream_Stat(This->stm, &stat, STATFLAG_NONAME);
if (SUCCEEDED(hr))
{
memcpy(&statpsstg->fmtid, &This->fmtid, sizeof(statpsstg->fmtid));
memcpy(&statpsstg->clsid, &This->clsid, sizeof(statpsstg->clsid));
statpsstg->fmtid = This->fmtid;
statpsstg->clsid = This->clsid;
statpsstg->grfFlags = This->grfFlags;
memcpy(&statpsstg->mtime, &stat.mtime, sizeof(statpsstg->mtime));
memcpy(&statpsstg->ctime, &stat.ctime, sizeof(statpsstg->ctime));
memcpy(&statpsstg->atime, &stat.atime, sizeof(statpsstg->atime));
statpsstg->mtime = stat.mtime;
statpsstg->ctime = stat.ctime;
statpsstg->atime = stat.atime;
statpsstg->dwOSVersion = This->originatorOS;
}
return hr;
......@@ -1309,7 +1309,7 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This)
goto end;
}
This->format = hdr.wFormat;
memcpy(&This->clsid, &hdr.clsid, sizeof(This->clsid));
This->clsid = hdr.clsid;
This->originatorOS = hdr.dwOSVer;
if (PROPSETHDR_OSVER_KIND(hdr.dwOSVer) == PROPSETHDR_OSVER_KIND_MAC)
WARN("File comes from a Mac, strings will probably be screwed up\n");
......@@ -1969,7 +1969,7 @@ static HRESULT PropertyStorage_BaseConstruct(IStream *stm,
InitializeCriticalSection(&(*pps)->cs);
(*pps)->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PropertyStorage_impl.cs");
(*pps)->stm = stm;
memcpy(&(*pps)->fmtid, rfmtid, sizeof((*pps)->fmtid));
(*pps)->fmtid = *rfmtid;
(*pps)->grfMode = grfMode;
hr = PropertyStorage_CreateDictionaries(*pps);
......@@ -2314,7 +2314,7 @@ static HRESULT create_EnumSTATPROPSETSTG(
statpss.atime = stat.atime;
statpss.ctime = stat.ctime;
statpss.grfFlags = stat.grfMode;
memcpy(&statpss.clsid, &stat.clsid, sizeof stat.clsid);
statpss.clsid = stat.clsid;
enumx_add_element(enumx, &statpss);
}
CoTaskMemFree(stat.pwcsName);
......@@ -2570,12 +2570,12 @@ HRESULT WINAPI PropStgNameToFmtId(const LPOLESTR str, FMTID *rfmtid)
if (!lstrcmpiW(str, szDocSummaryInfo))
{
memcpy(rfmtid, &FMTID_DocSummaryInformation, sizeof(*rfmtid));
*rfmtid = FMTID_DocSummaryInformation;
hr = S_OK;
}
else if (!lstrcmpiW(str, szSummaryInfo))
{
memcpy(rfmtid, &FMTID_SummaryInformation, sizeof(*rfmtid));
*rfmtid = FMTID_SummaryInformation;
hr = S_OK;
}
else
......
......@@ -7908,7 +7908,7 @@ HRESULT WINAPI ReadClassStm(IStream *pStm,CLSID *pclsid)
return E_INVALIDARG;
/* clear the output args */
memcpy(pclsid, &CLSID_NULL, sizeof(*pclsid));
*pclsid = CLSID_NULL;
res = IStream_Read(pStm,(void*)pclsid,sizeof(CLSID),&nbByte);
......
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