From 4971f2f687503ee9e879965ffa1f0117be5b3fbe Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Mon, 10 Mar 2008 21:58:39 +0000 Subject: [PATCH] ole32: Assign to structs instead of using memcpy. --- dlls/ole32/clipboard.c | 2 +- dlls/ole32/compobj.c | 2 +- dlls/ole32/datacache.c | 4 ++-- dlls/ole32/defaulthandler.c | 4 ++-- dlls/ole32/errorinfo.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 4e43e38bee3..ad15219a6aa 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -1365,7 +1365,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetCanonicalFormatEtc( if ( !pformatectIn || !pformatetcOut ) return E_INVALIDARG; - memcpy(pformatetcOut, pformatectIn, sizeof(FORMATETC)); + *pformatetcOut = *pformatectIn; return DATA_S_SAMEFORMATETC; } diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 1cb81833ad5..25a16296f2b 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -2855,7 +2855,7 @@ HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID clsidNew) LONG len = sizeof(szClsidNew); FIXME("(%s,%p)\n", debugstr_guid(clsidOld), clsidNew); - memcpy(clsidNew,clsidOld,sizeof(CLSID)); /* copy over old value */ + *clsidNew = *clsidOld; /* copy over old value */ res = COM_OpenKeyForCLSID(clsidOld, wszTreatAs, KEY_READ, &hkey); if (FAILED(res)) diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index beb6d932031..89035065485 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -1240,13 +1240,13 @@ static HRESULT WINAPI DataCache_GetClassID( HRESULT hr = IStorage_Stat(cache_entry->storage, &statstg, STATFLAG_NONAME); if (SUCCEEDED(hr)) { - memcpy(pClassID, &statstg.clsid, sizeof(*pClassID)); + *pClassID = statstg.clsid; return S_OK; } } } - memcpy(pClassID, &CLSID_NULL, sizeof(*pClassID)); + *pClassID = CLSID_NULL; return S_OK; } diff --git a/dlls/ole32/defaulthandler.c b/dlls/ole32/defaulthandler.c index 33e80cee80d..f9f676fe849 100644 --- a/dlls/ole32/defaulthandler.c +++ b/dlls/ole32/defaulthandler.c @@ -672,7 +672,7 @@ static HRESULT WINAPI DefaultHandler_GetUserClassID( if (!pClsid) return E_POINTER; - memcpy(pClsid, &This->clsid, sizeof(CLSID)); + *pClsid = This->clsid; return S_OK; } @@ -1744,7 +1744,7 @@ static DefaultHandler* DefaultHandler_Construct( /* * Initialize the other data members of the class. */ - memcpy(&This->clsid, clsid, sizeof(CLSID)); + This->clsid = *clsid; This->clientSite = NULL; This->oleAdviseHolder = NULL; This->dataAdviseHolder = NULL; diff --git a/dlls/ole32/errorinfo.c b/dlls/ole32/errorinfo.c index 7318a970f3f..e4a1c47ac53 100644 --- a/dlls/ole32/errorinfo.c +++ b/dlls/ole32/errorinfo.c @@ -250,7 +250,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetGUID( ErrorInfoImpl *This = impl_from_IErrorInfo(iface); TRACE("(%p)->(count=%u)\n",This,This->ref); if(!pGUID )return E_INVALIDARG; - memcpy(pGUID, &This->m_Guid, sizeof(GUID)); + *pGUID = This->m_Guid; return S_OK; } @@ -354,7 +354,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetGUID( { ErrorInfoImpl *This = impl_from_ICreateErrorInfo(iface); TRACE("(%p)->(%s)\n", This, debugstr_guid(rguid)); - memcpy(&This->m_Guid, rguid, sizeof(GUID)); + This->m_Guid = *rguid; return S_OK; } -- 2.11.4.GIT