Author: tfaber
Date: Mon Feb 17 16:53:41 2014
New Revision: 62229

URL: http://svn.reactos.org/svn/reactos?rev=62229&view=rev
Log:
[SHELL32]
- Fix some broken casts & stack corruption

Modified:
    trunk/reactos/dll/win32/shell32/filedefext.cpp
    trunk/reactos/dll/win32/shell32/filedefext.h

Modified: trunk/reactos/dll/win32/shell32/filedefext.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefext.cpp?rev=62229&r1=62228&r2=62229&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/filedefext.cpp      [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/filedefext.cpp      [iso-8859-1] Mon Feb 17 
16:53:41 2014
@@ -95,7 +95,7 @@
 
     return pwszResult;
 }
-        
+
 VS_FIXEDFILEINFO *CFileVersionInfo::GetFixedInfo()
 {
     if (!m_pInfo)
@@ -532,15 +532,15 @@
     {
         /* For directories files have to be counted */
 
-        _CountFolderAndFilesData *data = 
reinterpret_cast<_CountFolderAndFilesData*> (HeapAlloc(GetProcessHeap(), 0, 
sizeof(_CountFolderAndFilesData)));
+        _CountFolderAndFilesData *data = 
static_cast<_CountFolderAndFilesData*>(HeapAlloc(GetProcessHeap(), 0, 
sizeof(_CountFolderAndFilesData)));
         data->This = this;
-        data->pwszBuf = reinterpret_cast<LPWSTR> (HeapAlloc(GetProcessHeap(), 
0, sizeof(WCHAR) * MAX_PATH));
+        data->pwszBuf = static_cast<LPWSTR>(HeapAlloc(GetProcessHeap(), 0, 
sizeof(WCHAR) * MAX_PATH));
         data->cchBufMax = MAX_PATH;
         data->hwndDlg = hwndDlg;
         this->AddRef();
         StringCchCopyW(data->pwszBuf, MAX_PATH, m_wszPath);
-        
-        SHCreateThread(reinterpret_cast<LPTHREAD_START_ROUTINE> 
(CFileDefExt::_CountFolderAndFilesThreadProc), reinterpret_cast<LPVOID> (data), 
NULL, NULL); 
+
+        SHCreateThread(CFileDefExt::_CountFolderAndFilesThreadProc, data, 
NULL, NULL);
 
         /* Update size field */
         if (SH_FormatFileSizeWithBytes(&m_DirSize, wszBuf, _countof(wszBuf)))
@@ -683,7 +683,7 @@
                     if (!MoveFileW(pFileDefExt->m_wszPath, wszBuf))
                         ERR("MoveFileW failed\n");
                 }
-                    
+
                 SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR);
                 return TRUE;
             }
@@ -866,7 +866,7 @@
 
 CFileDefExt::~CFileDefExt()
 {
-    
+
 }
 
 HRESULT WINAPI
@@ -976,7 +976,7 @@
     return E_NOTIMPL;
 }
 
-DWORD 
+DWORD WINAPI
 CFileDefExt::_CountFolderAndFilesThreadProc(LPVOID lpParameter)
 {
     _CountFolderAndFilesData *data = 
reinterpret_cast<_CountFolderAndFilesData*>(lpParameter);

Modified: trunk/reactos/dll/win32/shell32/filedefext.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefext.h?rev=62229&r1=62228&r2=62229&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/filedefext.h        [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/filedefext.h        [iso-8859-1] Mon Feb 17 
16:53:41 2014
@@ -83,7 +83,7 @@
     DWORD m_cFolders;
     ULARGE_INTEGER m_DirSize;
 
-    static DWORD _CountFolderAndFilesThreadProc(LPVOID lpParameter);
+    static DWORD WINAPI _CountFolderAndFilesThreadProc(LPVOID lpParameter);
 
 public:
        CFileDefExt();


Reply via email to