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