From ed736d630eedb999e4a1e14821d6545d7db01412 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Mon, 17 Feb 2014 16:53:41 +0000 Subject: [PATCH] [SHELL32] - Fix some broken casts & stack corruption svn path=/trunk/; revision=62229 --- reactos/dll/win32/shell32/filedefext.cpp | 16 ++++++++-------- reactos/dll/win32/shell32/filedefext.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reactos/dll/win32/shell32/filedefext.cpp b/reactos/dll/win32/shell32/filedefext.cpp index ddbaa3fb94b..ac053c8cd0e 100644 --- a/reactos/dll/win32/shell32/filedefext.cpp +++ b/reactos/dll/win32/shell32/filedefext.cpp @@ -95,7 +95,7 @@ LPCWSTR CFileVersionInfo::GetString(LPCWSTR pwszName) return pwszResult; } - + VS_FIXEDFILEINFO *CFileVersionInfo::GetFixedInfo() { if (!m_pInfo) @@ -532,15 +532,15 @@ CFileDefExt::InitFileAttr(HWND hwndDlg) { /* 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 (HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * MAX_PATH)); + data->pwszBuf = static_cast(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 (CFileDefExt::_CountFolderAndFilesThreadProc), reinterpret_cast (data), NULL, NULL); + + SHCreateThread(CFileDefExt::_CountFolderAndFilesThreadProc, data, NULL, NULL); /* Update size field */ if (SH_FormatFileSizeWithBytes(&m_DirSize, wszBuf, _countof(wszBuf))) @@ -683,7 +683,7 @@ CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!MoveFileW(pFileDefExt->m_wszPath, wszBuf)) ERR("MoveFileW failed\n"); } - + SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR); return TRUE; } @@ -866,7 +866,7 @@ CFileDefExt::CFileDefExt(): CFileDefExt::~CFileDefExt() { - + } HRESULT WINAPI @@ -976,7 +976,7 @@ CFileDefExt::GetSite(REFIID iid, void **ppvSite) return E_NOTIMPL; } -DWORD +DWORD WINAPI CFileDefExt::_CountFolderAndFilesThreadProc(LPVOID lpParameter) { _CountFolderAndFilesData *data = reinterpret_cast<_CountFolderAndFilesData*>(lpParameter); diff --git a/reactos/dll/win32/shell32/filedefext.h b/reactos/dll/win32/shell32/filedefext.h index 04f537edd8e..4a1c7100656 100644 --- a/reactos/dll/win32/shell32/filedefext.h +++ b/reactos/dll/win32/shell32/filedefext.h @@ -83,7 +83,7 @@ private: DWORD m_cFolders; ULARGE_INTEGER m_DirSize; - static DWORD _CountFolderAndFilesThreadProc(LPVOID lpParameter); + static DWORD WINAPI _CountFolderAndFilesThreadProc(LPVOID lpParameter); public: CFileDefExt(); -- 2.17.1