Author: tfaber
Date: Mon Feb 17 17:01:37 2014
New Revision: 62230
URL:
http://svn.reactos.org/svn/reactos?rev=62230&view=rev
Log:
[SHELL32]
- Fix more casts and stack corruption
Modified:
trunk/reactos/dll/win32/shell32/filedefext.cpp
trunk/reactos/dll/win32/shell32/folders/fs.cpp
trunk/reactos/dll/win32/shell32/folders/fs.h
trunk/reactos/dll/win32/shell32/shellole.cpp
Modified: trunk/reactos/dll/win32/shell32/filedefext.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefe…
==============================================================================
--- trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] Mon Feb 17 17:01:37 2014
@@ -979,7 +979,7 @@
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);
Modified: trunk/reactos/dll/win32/shell32/folders/fs.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] Mon Feb 17 17:01:37 2014
@@ -1427,7 +1427,7 @@
{
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 @@
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 @@
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);
Modified: trunk/reactos/dll/win32/shell32/folders/fs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/fs.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/fs.h [iso-8859-1] Mon Feb 17 17:01:37 2014
@@ -46,7 +46,7 @@
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:
Modified: trunk/reactos/dll/win32/shell32/shellole.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellole…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellole.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellole.cpp [iso-8859-1] Mon Feb 17 17:01:37 2014
@@ -600,7 +600,7 @@
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 @@
{
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