[SHELL32]
authorThomas Faber <thomas.faber@reactos.org>
Mon, 17 Feb 2014 17:01:37 +0000 (17:01 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Mon, 17 Feb 2014 17:01:37 +0000 (17:01 +0000)
- Fix more casts and stack corruption

svn path=/trunk/; revision=62230

reactos/dll/win32/shell32/filedefext.cpp
reactos/dll/win32/shell32/folders/fs.cpp
reactos/dll/win32/shell32/folders/fs.h
reactos/dll/win32/shell32/shellole.cpp

index ac053c8..e64c1c1 100644 (file)
@@ -979,7 +979,7 @@ CFileDefExt::GetSite(REFIID iid, void **ppvSite)
 DWORD WINAPI
 CFileDefExt::_CountFolderAndFilesThreadProc(LPVOID lpParameter)
 {
-    _CountFolderAndFilesData *data = reinterpret_cast<_CountFolderAndFilesData*>(lpParameter);
+    _CountFolderAndFilesData *data = static_cast<_CountFolderAndFilesData*>(lpParameter);
     DWORD ticks = 0;
     data->This->CountFolderAndFiles(data->hwndDlg, data->pwszBuf, data->cchBufMax, &ticks);
 
index da4b767..5e61e71 100644 (file)
@@ -1427,7 +1427,7 @@ HRESULT WINAPI CFSFolder::Drop(IDataObject *pDataObject,
     {
         if (SUCCEEDED(pAsyncOperation->GetAsyncMode(&fIsOpAsync)) && fIsOpAsync)
         {
-            _DoDropData *data = reinterpret_cast<_DoDropData*> (HeapAlloc(GetProcessHeap(), 0, sizeof(_DoDropData)));
+            _DoDropData *data = static_cast<_DoDropData*>(HeapAlloc(GetProcessHeap(), 0, sizeof(_DoDropData)));
             data->This = this;
             // Need to maintain this class in case the window is closed or the class exists temporarily (when dropping onto a folder).
             this->AddRef();
@@ -1439,7 +1439,7 @@ HRESULT WINAPI CFSFolder::Drop(IDataObject *pDataObject,
             data->pdwEffect = *pdwEffect;
             data->pDataObject->AddRef();
             data->pAsyncOperation->StartOperation(NULL);
-            SHCreateThread(reinterpret_cast<LPTHREAD_START_ROUTINE> (CFSFolder::_DoDropThreadProc), reinterpret_cast<void *> (data), NULL, NULL);
+            SHCreateThread(CFSFolder::_DoDropThreadProc, data, NULL, NULL);
             return S_OK;
         }
         else
@@ -1737,8 +1737,8 @@ HRESULT WINAPI CFSFolder::_DoDrop(IDataObject *pDataObject,
     return hr;
 }
 
-DWORD CFSFolder::_DoDropThreadProc(LPVOID lpParameter) {
-    _DoDropData *data = reinterpret_cast<_DoDropData*>(lpParameter);
+DWORD WINAPI CFSFolder::_DoDropThreadProc(LPVOID lpParameter) {
+    _DoDropData *data = static_cast<_DoDropData*>(lpParameter);
     HRESULT hr = data->This->_DoDrop(data->pDataObject, data->dwKeyState, data->pt, &data->pdwEffect);
     //Release the CFSFolder and data object holds in the copying thread.
     data->pAsyncOperation->EndOperation(hr, NULL, data->pdwEffect);
index 2321368..e32ab2b 100644 (file)
@@ -46,7 +46,7 @@ class CFSFolder :
         BOOL QueryDrop (DWORD dwKeyState, LPDWORD pdwEffect);
         void SF_RegisterClipFmt();
         BOOL GetUniqueFileName(LPWSTR pwszBasePath, LPCWSTR pwszExt, LPWSTR pwszTarget, BOOL bShortcut);
-        static DWORD _DoDropThreadProc(LPVOID lpParameter);
+        static DWORD WINAPI _DoDropThreadProc(LPVOID lpParameter);
         virtual HRESULT WINAPI _DoDrop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
 
     public:
index e659292..ef9e56b 100644 (file)
@@ -600,7 +600,7 @@ EXTERN_C HRESULT WINAPI SHPropStgCreate(IPropertySetStorage *psstg, REFFMTID fmt
          case CREATE_ALWAYS:
              if (SUCCEEDED(hres))
              {
-                 reinterpret_cast<IPropertyStorage*>(*ppstg)->Release();
+                 (*ppstg)->Release();
                  hres = psstg->Delete(fmtid);
                  if(FAILED(hres))
                      return hres;
@@ -620,7 +620,7 @@ EXTERN_C HRESULT WINAPI SHPropStgCreate(IPropertySetStorage *psstg, REFFMTID fmt
              {
                  prop.ulKind = PRSPEC_PROPID;
                  prop.propid = PID_CODEPAGE;
-                 hres = reinterpret_cast<IPropertyStorage*>(*ppstg)->ReadMultiple(1, &prop, &ret);
+                 hres = (*ppstg)->ReadMultiple(1, &prop, &ret);
                  if (FAILED(hres) || ret.vt!=VT_I2)
                      *puCodePage = 0;
                  else