Author: tfaber
Date: Sun Apr 28 09:09:57 2013
New Revision: 58879
URL:
http://svn.reactos.org/svn/reactos?rev=58879&view=rev
Log:
[BROWSEUI]
- Remove weird broken Get/SetWindowLongPtr wrapper functions (by Katayama Hirofumi MZ)
- Fix some casts
- Remove unnecessary ROS_Headers define
Modified:
trunk/reactos/dll/win32/browseui/CMakeLists.txt
trunk/reactos/dll/win32/browseui/aclmulti.cpp
trunk/reactos/dll/win32/browseui/bandsite.cpp
trunk/reactos/dll/win32/browseui/internettoolbar.cpp
trunk/reactos/dll/win32/browseui/shellbrowser.cpp
Modified: trunk/reactos/dll/win32/browseui/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/browseui/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/CMakeLists.txt [iso-8859-1] Sun Apr 28 09:09:57 2013
@@ -2,8 +2,7 @@
set_cpp()
add_definitions(
- -D__WINESRC__
- -DROS_Headers)
+ -D__WINESRC__)
if (MSVC)
add_compile_flags("/EHa-")
Modified: trunk/reactos/dll/win32/browseui/aclmulti.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/aclmult…
==============================================================================
--- trunk/reactos/dll/win32/browseui/aclmulti.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/aclmulti.cpp [iso-8859-1] Sun Apr 28 09:09:57 2013
@@ -55,7 +55,7 @@
if (punk == NULL)
return E_FAIL;
- fObjects = reinterpret_cast<ACLMultiSublist *>(
+ fObjects = static_cast<ACLMultiSublist *>(
CoTaskMemRealloc(fObjects, sizeof(fObjects[0]) * (fObjectCount + 1)));
fObjects[fObjectCount].punk = punk;
punk->AddRef();
@@ -78,7 +78,7 @@
release_obj(&fObjects[i]);
MoveMemory(&fObjects[i], &fObjects[i + 1], (fObjectCount - i - 1) *
sizeof(ACLMultiSublist));
fObjectCount--;
- fObjects = reinterpret_cast<ACLMultiSublist *>(
+ fObjects = static_cast<ACLMultiSublist *>(
CoTaskMemRealloc(fObjects, sizeof(fObjects[0]) * fObjectCount));
return S_OK;
}
Modified: trunk/reactos/dll/win32/browseui/bandsite.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/bandsit…
==============================================================================
--- trunk/reactos/dll/win32/browseui/bandsite.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/bandsite.cpp [iso-8859-1] Sun Apr 28 09:09:57 2013
@@ -326,7 +326,7 @@
}
- NewBand = reinterpret_cast<struct BandObject *>(CoTaskMemAlloc(NewAllocated
* sizeof(struct BandObject)));
+ NewBand = static_cast<struct BandObject *>(CoTaskMemAlloc(NewAllocated *
sizeof(struct BandObject)));
if (NewBand == NULL)
{
hRet = E_OUTOFMEMORY;
@@ -351,7 +351,7 @@
ASSERT(fBandsCount == 0);
/* Allocate new array */
- fBands = reinterpret_cast<struct BandObject *>(CoTaskMemAlloc(8 *
sizeof(struct BandObject)));
+ fBands = static_cast<struct BandObject *>(CoTaskMemAlloc(8 * sizeof(struct
BandObject)));
if (fBands == NULL)
{
hRet = E_OUTOFMEMORY;
Modified: trunk/reactos/dll/win32/browseui/internettoolbar.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/interne…
==============================================================================
--- trunk/reactos/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Sun Apr 28 09:09:57
2013
@@ -60,7 +60,7 @@
Refactor drop down menu code to use a common function since code is so similar
*/
-extern HRESULT WINAPI SHBindToFolder(LPITEMIDLIST path, IShellFolder **newFolder);
+extern HRESULT WINAPI SHBindToFolder(LPCITEMIDLIST path, IShellFolder **newFolder);
extern HRESULT CreateToolsBar(REFIID riid, void **ppv);
extern HRESULT CreateBrandBand(REFIID riid, void **ppv);
extern HRESULT CreateBandProxy(REFIID riid, void **ppv);
Modified: trunk/reactos/dll/win32/browseui/shellbrowser.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellbr…
==============================================================================
--- trunk/reactos/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Sun Apr 28 09:09:57
2013
@@ -130,29 +130,10 @@
extern HRESULT CreateTravelLog(REFIID riid, void **ppv);
extern HRESULT CreateBaseBar(REFIID riid, void **ppv);
extern HRESULT CreateBaseBarSite(REFIID riid, void **ppv);
-#ifndef ROS_Headers
-SHSTDAPI_(void *) SHAlloc(SIZE_T cb);
-#endif
// temporary
extern HRESULT CreateInternetToolbar(REFIID riid, void **ppv);
-
-#ifdef SetWindowLongPtr
-#undef SetWindowLongPtr
-inline LONG_PTR SetWindowLongPtr(HWND hWnd, int nIndex, LONG_PTR dwNewLong)
-{
- return SetWindowLong(hWnd, nIndex, (LONG)dwNewLong);
-}
-#endif
-
-#ifdef GetWindowLongPtr
-#undef GetWindowLongPtr
-inline LONG_PTR GetWindowLongPtr(HWND hWnd, int nIndex)
-{
- return (LONG_PTR)GetWindowLong(hWnd, nIndex);
-}
-#endif
HMENU SHGetMenuFromID(HMENU topMenu, int theID)
{
@@ -204,7 +185,7 @@
}
}
-HRESULT WINAPI SHBindToFolder(LPITEMIDLIST path, IShellFolder **newFolder)
+HRESULT WINAPI SHBindToFolder(LPCITEMIDLIST path, IShellFolder **newFolder)
{
CComPtr<IShellFolder> desktop;
@@ -359,7 +340,7 @@
HRESULT Initialize(LPITEMIDLIST pidl, long b, long c, long d);
public:
HRESULT BrowseToPIDL(LPCITEMIDLIST pidl, long flags);
- HRESULT BrowseToPath(IShellFolder *newShellFolder, LPITEMIDLIST absolutePIDL,
+ HRESULT BrowseToPath(IShellFolder *newShellFolder, LPCITEMIDLIST absolutePIDL,
FOLDERSETTINGS *folderSettings, long flags);
HRESULT GetMenuBand(REFIID riid, void **shellMenu);
HRESULT GetBaseBar(bool vertical, IUnknown **theBaseBar);
@@ -880,10 +861,10 @@
// called by shell view to browse to new folder
// also called by explorer band to navigate to new folder
- hResult = SHBindToFolder(const_cast<LPITEMIDLIST>(pidl), &newFolder);
+ hResult = SHBindToFolder(pidl, &newFolder);
newFolderSettings.ViewMode = FVM_LIST;
newFolderSettings.fFlags = 0;
- hResult = BrowseToPath(newFolder, const_cast<LPITEMIDLIST>(pidl),
&newFolderSettings, flags);
+ hResult = BrowseToPath(newFolder, pidl, &newFolderSettings, flags);
if (FAILED(hResult))
return hResult;
return S_OK;
@@ -974,7 +955,7 @@
}
HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
- LPITEMIDLIST absolutePIDL, FOLDERSETTINGS *folderSettings, long flags)
+ LPCITEMIDLIST absolutePIDL, FOLDERSETTINGS *folderSettings, long flags)
{
CComPtr<IOleCommandTarget> oleCommandTarget;
CComPtr<IObjectWithSite> objectWithSite;
@@ -1890,7 +1871,7 @@
HRESULT STDMETHODCALLTYPE CShellBrowser::BrowseObject(LPCITEMIDLIST pidl, UINT wFlags)
{
- return BrowseToPIDL(const_cast<LPITEMIDLIST>(pidl), BTP_UPDATE_CUR_HISTORY |
BTP_UPDATE_NEXT_HISTORY);
+ return BrowseToPIDL(pidl, BTP_UPDATE_CUR_HISTORY | BTP_UPDATE_NEXT_HISTORY);
}
HRESULT STDMETHODCALLTYPE CShellBrowser::GetViewStateStream(DWORD grfMode, IStream
**ppStrm)
@@ -2949,7 +2930,7 @@
return E_FAIL;
if (oldState.browseType != 2)
return E_FAIL;
- pidl = (LPITEMIDLIST)SHAlloc(oldState.pidlSize);
+ pidl = static_cast<LPITEMIDLIST>(CoTaskMemAlloc(oldState.pidlSize));
if (pidl == NULL)
return E_OUTOFMEMORY;
hResult = pStream->Read(pidl, oldState.pidlSize, &numRead);
@@ -3090,17 +3071,17 @@
LRESULT CShellBrowser::OnMapNetworkDrive(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL
&bHandled)
{
-#ifndef ROS_Headers
+#ifndef __REACTOS__
WNetConnectionDialog(m_hWnd, RESOURCETYPE_DISK);
-#endif
+#endif /* __REACTOS__ */
return 0;
}
LRESULT CShellBrowser::OnDisconnectNetworkDrive(WORD wNotifyCode, WORD wID, HWND hWndCtl,
BOOL &bHandled)
{
-#ifndef ROS_Headers
+#ifndef __REACTOS__
WNetDisconnectDialog(m_hWnd, RESOURCETYPE_DISK);
-#endif
+#endif /* __REACTOS__ */
return 0;
}