Commit 2cce0040 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

shell32: Assign to structs instead of using memcpy.

parent f0dd3efe
...@@ -997,7 +997,7 @@ static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW* iface, LP ...@@ -997,7 +997,7 @@ static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW* iface, LP
MultiByteToWideChar(CP_ACP, 0, pcpanel->szName+pcpanel->offsDispName, -1, params, MAX_PATH); MultiByteToWideChar(CP_ACP, 0, pcpanel->szName+pcpanel->offsDispName, -1, params, MAX_PATH);
memcpy(&sei_tmp, psei, sizeof(sei_tmp)); sei_tmp = *psei;
sei_tmp.lpFile = path; sei_tmp.lpFile = path;
sei_tmp.lpParameters = params; sei_tmp.lpParameters = params;
sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST;
...@@ -1078,7 +1078,7 @@ static HRESULT WINAPI IShellExecuteHookA_fnExecute(IShellExecuteHookA* iface, LP ...@@ -1078,7 +1078,7 @@ static HRESULT WINAPI IShellExecuteHookA_fnExecute(IShellExecuteHookA* iface, LP
lstrcatA(path, "\" "); lstrcatA(path, "\" ");
lstrcatA(path, pcpanel->szName+pcpanel->offsDispName); lstrcatA(path, pcpanel->szName+pcpanel->offsDispName);
memcpy(&sei_tmp, psei, sizeof(sei_tmp)); sei_tmp = *psei;
sei_tmp.lpFile = path; sei_tmp.lpFile = path;
sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST;
......
...@@ -554,7 +554,7 @@ static HRESULT WINAPI IEIPersistFile_fnGetClassID( ...@@ -554,7 +554,7 @@ static HRESULT WINAPI IEIPersistFile_fnGetClassID(
if (lpClassId==NULL) if (lpClassId==NULL)
return E_POINTER; return E_POINTER;
memcpy(lpClassId, &StdFolderID, sizeof(StdFolderID)); *lpClassId = StdFolderID;
return S_OK; return S_OK;
} }
......
...@@ -1444,7 +1444,7 @@ LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid) ...@@ -1444,7 +1444,7 @@ LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
{ {
LPPIDLDATA pData = _ILGetDataPointer(pidlOut); LPPIDLDATA pData = _ILGetDataPointer(pidlOut);
memcpy(&(pData->u.guid.guid), guid, sizeof(GUID)); pData->u.guid.guid = *guid;
TRACE("-- create GUID-pidl %s\n", TRACE("-- create GUID-pidl %s\n",
debugstr_guid(&(pData->u.guid.guid))); debugstr_guid(&(pData->u.guid.guid)));
} }
......
...@@ -332,7 +332,7 @@ static HRESULT WINAPI RecycleBin_GetClassID(IPersistFolder2 *This, CLSID *pClass ...@@ -332,7 +332,7 @@ static HRESULT WINAPI RecycleBin_GetClassID(IPersistFolder2 *This, CLSID *pClass
TRACE("(%p, %p)\n", This, pClassID); TRACE("(%p, %p)\n", This, pClassID);
if (This == NULL || pClassID == NULL) if (This == NULL || pClassID == NULL)
return E_INVALIDARG; return E_INVALIDARG;
memcpy(pClassID, &CLSID_RecycleBin, sizeof(CLSID)); *pClassID = CLSID_RecycleBin;
return S_OK; return S_OK;
} }
......
...@@ -320,7 +320,7 @@ static HRESULT ShellLink_GetClassID( IShellLinkImpl *This, CLSID *pclsid ) ...@@ -320,7 +320,7 @@ static HRESULT ShellLink_GetClassID( IShellLinkImpl *This, CLSID *pclsid )
{ {
TRACE("%p %p\n", This, pclsid); TRACE("%p %p\n", This, pclsid);
memcpy( pclsid, &CLSID_ShellLink, sizeof (CLSID) ); *pclsid = CLSID_ShellLink;
return S_OK; return S_OK;
} }
...@@ -1079,7 +1079,7 @@ static HRESULT WINAPI IPersistStream_fnSave( ...@@ -1079,7 +1079,7 @@ static HRESULT WINAPI IPersistStream_fnSave(
memset(&header, 0, sizeof(header)); memset(&header, 0, sizeof(header));
header.dwSize = sizeof(header); header.dwSize = sizeof(header);
header.fStartup = This->iShowCmd; header.fStartup = This->iShowCmd;
memcpy(&header.MagicGuid, &CLSID_ShellLink, sizeof(header.MagicGuid) ); header.MagicGuid = CLSID_ShellLink;
header.wHotKey = This->wHotKey; header.wHotKey = This->wHotKey;
header.nIcon = This->iIcoNdx; header.nIcon = This->iIcoNdx;
......
...@@ -1459,7 +1459,7 @@ static HRESULT WINAPI UnixFolder_IPersistFolder3_GetClassID(IPersistFolder3* ifa ...@@ -1459,7 +1459,7 @@ static HRESULT WINAPI UnixFolder_IPersistFolder3_GetClassID(IPersistFolder3* ifa
if (!pClassID) if (!pClassID)
return E_INVALIDARG; return E_INVALIDARG;
memcpy(pClassID, This->m_pCLSID, sizeof(CLSID)); *pClassID = *This->m_pCLSID;
return S_OK; return S_OK;
} }
......
...@@ -1470,7 +1470,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1470,7 +1470,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
BOOL appKnownSingular = FALSE; BOOL appKnownSingular = FALSE;
/* make a local copy of the LPSHELLEXECUTEINFO structure and work with this from now on */ /* make a local copy of the LPSHELLEXECUTEINFO structure and work with this from now on */
memcpy(&sei_tmp, sei, sizeof(sei_tmp)); sei_tmp = *sei;
TRACE("mask=0x%08x hwnd=%p verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s\n", TRACE("mask=0x%08x hwnd=%p verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s\n",
sei_tmp.fMask, sei_tmp.hwnd, debugstr_w(sei_tmp.lpVerb), sei_tmp.fMask, sei_tmp.hwnd, debugstr_w(sei_tmp.lpVerb),
......
...@@ -1112,7 +1112,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST ...@@ -1112,7 +1112,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles);
szFrom[lstrlenW(szFrom) + 1] = '\0'; szFrom[lstrlenW(szFrom) + 1] = '\0';
memcpy(&fileOp, op->req, sizeof(fileOp)); fileOp = *op->req;
fileOp.pFrom = szFrom; fileOp.pFrom = szFrom;
fileOp.pTo = szTo; fileOp.pTo = szTo;
fileOp.fFlags &= ~FOF_MULTIDESTFILES; /* we know we're copying to one dir */ fileOp.fFlags &= ~FOF_MULTIDESTFILES; /* we know we're copying to one dir */
...@@ -1373,7 +1373,7 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom ...@@ -1373,7 +1373,7 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
lstrcpyW(szTo, szDestPath); lstrcpyW(szTo, szDestPath);
szTo[lstrlenW(szDestPath) + 1] = '\0'; szTo[lstrlenW(szDestPath) + 1] = '\0';
memcpy(&fileOp, lpFileOp, sizeof(fileOp)); fileOp = *lpFileOp;
fileOp.pFrom = szFrom; fileOp.pFrom = szFrom;
fileOp.pTo = szTo; fileOp.pTo = szTo;
......
...@@ -207,7 +207,7 @@ static HRESULT WINAPI IFileSystemBindData_fnGetFindData( ...@@ -207,7 +207,7 @@ static HRESULT WINAPI IFileSystemBindData_fnGetFindData(
if (!pfd) if (!pfd)
return E_INVALIDARG; return E_INVALIDARG;
memcpy(pfd, &This->findFile, sizeof(WIN32_FIND_DATAW)); *pfd = This->findFile;
return NOERROR; return NOERROR;
} }
...@@ -218,7 +218,7 @@ static HRESULT WINAPI IFileSystemBindData_fnSetFindData( ...@@ -218,7 +218,7 @@ static HRESULT WINAPI IFileSystemBindData_fnSetFindData(
TRACE("(%p), %p\n", This, pfd); TRACE("(%p), %p\n", This, pfd);
if (pfd) if (pfd)
memcpy(&This->findFile, pfd, sizeof(WIN32_FIND_DATAW)); This->findFile = *pfd;
else else
memset(&This->findFile, 0, sizeof(WIN32_FIND_DATAW)); memset(&This->findFile, 0, sizeof(WIN32_FIND_DATAW));
return NOERROR; return NOERROR;
......
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