mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[BROWSEUI]
- Remove weird broken Get/SetWindowLongPtr wrapper functions (by Katayama Hirofumi MZ) - Fix some casts - Remove unnecessary ROS_Headers define svn path=/trunk/; revision=58879
This commit is contained in:
parent
f2139d0242
commit
32bc439366
5 changed files with 17 additions and 37 deletions
|
@ -2,8 +2,7 @@
|
|||
set_cpp()
|
||||
|
||||
add_definitions(
|
||||
-D__WINESRC__
|
||||
-DROS_Headers)
|
||||
-D__WINESRC__)
|
||||
|
||||
if (MSVC)
|
||||
add_compile_flags("/EHa-")
|
||||
|
|
|
@ -55,7 +55,7 @@ HRESULT STDMETHODCALLTYPE CACLMulti::Append(IUnknown *punk)
|
|||
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 @@ HRESULT STDMETHODCALLTYPE CACLMulti::Remove(IUnknown *punk)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -326,7 +326,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::AddBand(IUnknown *punk)
|
|||
}
|
||||
|
||||
|
||||
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 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::AddBand(IUnknown *punk)
|
|||
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;
|
||||
|
|
|
@ -60,7 +60,7 @@ TODO:
|
|||
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);
|
||||
|
|
|
@ -130,30 +130,11 @@ BOOL createNewStuff = false;
|
|||
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)
|
||||
{
|
||||
MENUITEMINFO menuItemInfo;
|
||||
|
@ -204,7 +185,7 @@ void DeleteMenuItems(HMENU theMenu, unsigned int firstIDToDelete, unsigned int l
|
|||
}
|
||||
}
|
||||
|
||||
HRESULT WINAPI SHBindToFolder(LPITEMIDLIST path, IShellFolder **newFolder)
|
||||
HRESULT WINAPI SHBindToFolder(LPCITEMIDLIST path, IShellFolder **newFolder)
|
||||
{
|
||||
CComPtr<IShellFolder> desktop;
|
||||
|
||||
|
@ -359,7 +340,7 @@ public:
|
|||
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 @@ HRESULT CShellBrowser::BrowseToPIDL(LPCITEMIDLIST pidl, long flags)
|
|||
|
||||
// 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 @@ long IEGetNameAndFlags(LPITEMIDLIST pidl, SHGDNF uFlags, LPWSTR pszBuf, UINT cch
|
|||
}
|
||||
|
||||
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::TranslateAcceleratorSB(MSG *pmsg, WORD
|
|||
|
||||
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 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::LoadHistory(IStream *pStream, IBindCtx
|
|||
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::OnFolderOptions(WORD wNotifyCode, WORD wID, HWND hWndCtl,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue