mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 18:54:25 +00:00
[BROWSEUI]
* Make failure codes print themselves. Helps debug. svn path=/branches/shell-experiments/; revision=63541
This commit is contained in:
parent
72aa759dd4
commit
9f33eab100
|
@ -57,9 +57,9 @@ HRESULT STDMETHODCALLTYPE CACLMulti::Append(IUnknown *punk)
|
|||
CoTaskMemRealloc(fObjects, sizeof(fObjects[0]) * (fObjectCount + 1)));
|
||||
fObjects[fObjectCount].punk = punk;
|
||||
punk->AddRef();
|
||||
if (FAILED(punk->QueryInterface(IID_PPV_ARG(IEnumString, &fObjects[fObjectCount].pEnum))))
|
||||
if (FAILED_UNEXPECTEDLY(punk->QueryInterface(IID_PPV_ARG(IEnumString, &fObjects[fObjectCount].pEnum))))
|
||||
fObjects[fObjectCount].pEnum = NULL;
|
||||
if (FAILED(punk->QueryInterface(IID_PPV_ARG(IACList, &fObjects[fObjectCount].pACL))))
|
||||
if (FAILED_UNEXPECTEDLY(punk->QueryInterface(IID_PPV_ARG(IACList, &fObjects[fObjectCount].pACL))))
|
||||
fObjects[fObjectCount].pACL = NULL;
|
||||
fObjectCount++;
|
||||
return S_OK;
|
||||
|
|
|
@ -126,7 +126,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::SetSite(IUnknown *pUnkSite)
|
|||
fSite.Release();
|
||||
|
||||
hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &fSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
// get window handle of parent
|
||||
|
@ -155,22 +155,22 @@ HRESULT STDMETHODCALLTYPE CAddressBand::SetSite(IUnknown *pUnkSite)
|
|||
#else
|
||||
hResult = E_FAIL;
|
||||
#endif
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
// instantiate new version
|
||||
hResult = CreateAddressEditBox(IID_PPV_ARG(IAddressEditBox, &fAddressEditBox));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
}
|
||||
|
||||
hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IShellService, &shellService));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = fAddressEditBox->Init(combobox, fEditControl, 8, pUnkSite /*(IAddressBand *)this*/);
|
||||
if (FAILED(hResult))
|
||||
hResult = fAddressEditBox->Init(combobox, fEditControl, 8, fSite /*(IAddressBand *)this*/);
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = shellService->SetOwner(pUnkSite);
|
||||
if (FAILED(hResult))
|
||||
hResult = shellService->SetOwner(fSite);
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
// TODO: properly initialize this from registry
|
||||
|
@ -285,7 +285,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::QueryStatus(
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &oleCommandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return oleCommandTarget->QueryStatus(pguidCmdGroup, cCmds, prgCmds, pCmdText);
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::UIActivateIO(BOOL fActivate, LPMSG lpMsg
|
|||
if (fActivate)
|
||||
{
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IInputObjectSite, &inputObjectSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = inputObjectSite->OnFocusChangeIS(static_cast<IDeskBand *>(this), fActivate);
|
||||
SetFocus();
|
||||
|
@ -361,7 +361,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::OnWinEvent(
|
|||
break;
|
||||
}
|
||||
hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return winEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::IsWindowOwner(HWND hWnd)
|
|||
if (fAddressEditBox)
|
||||
{
|
||||
hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return winEventHandler->IsWindowOwner(hWnd);
|
||||
}
|
||||
|
@ -387,7 +387,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::FileSysChange(long param8, long paramC)
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IAddressBand, &addressBand));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return addressBand->FileSysChange(param8, paramC);
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::Refresh(long param8)
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IAddressBand, &addressBand));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return addressBand->Refresh(param8);
|
||||
}
|
||||
|
@ -494,7 +494,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::Invoke(DISPID dispIdMember, REFIID riid,
|
|||
}
|
||||
|
||||
hr = IUnknown_QueryService(fSite, SID_STopLevelBrowser, IID_PPV_ARG(IBrowserService, &isb));
|
||||
if (FAILED(hr))
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return hr;
|
||||
isb->GetPidl(&absolutePIDL);
|
||||
|
||||
|
@ -677,7 +677,7 @@ HRESULT CreateAddressBand(REFIID riid, void **ppv)
|
|||
if (theMenuBar == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theMenuBar->QueryInterface(riid, reinterpret_cast<void **>(ppv));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
delete theMenuBar;
|
||||
return hResult;
|
||||
|
|
|
@ -144,7 +144,7 @@ HRESULT STDMETHODCALLTYPE CAddressEditBox::Execute(long paramC)
|
|||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = pisb->BrowseObject(pidlLastParsed, 0);
|
||||
if (FAILED(hr))
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
{
|
||||
HWND topLevelWindow;
|
||||
LPCITEMIDLIST pidlChild;
|
||||
|
@ -267,7 +267,7 @@ HRESULT CreateAddressEditBox(REFIID riid, void **ppv)
|
|||
if (theMenuBar == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theMenuBar->QueryInterface(riid, reinterpret_cast<void **>(ppv));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
delete theMenuBar;
|
||||
return hResult;
|
||||
|
|
|
@ -44,11 +44,11 @@ HRESULT CBandProxy::FindBrowserWindow(IUnknown **browser)
|
|||
if (browser == NULL)
|
||||
return E_POINTER;
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = serviceProvider->QueryService(
|
||||
SID_IWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &webBrowser));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
*browser = webBrowser.Detach();
|
||||
return S_OK;
|
||||
|
@ -78,7 +78,7 @@ HRESULT STDMETHODCALLTYPE CBandProxy::IsConnected()
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = FindBrowserWindow(&webBrowser);
|
||||
if (FAILED(hResult) || webBrowser.p == NULL)
|
||||
if (FAILED_UNEXPECTEDLY(hResult) || webBrowser.p == NULL)
|
||||
return S_FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -96,10 +96,10 @@ HRESULT STDMETHODCALLTYPE CBandProxy::NavigateToPIDL(LPCITEMIDLIST pidl)
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = FindBrowserWindow(&webBrowserUnknown);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = webBrowserUnknown->QueryInterface(IID_PPV_ARG(IWebBrowser2, &webBrowser));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = webBrowser->put_Visible(TRUE);
|
||||
hResult = webBrowser->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
|
||||
|
@ -121,7 +121,7 @@ HRESULT STDMETHODCALLTYPE CBandProxy::NavigateToPIDL(LPCITEMIDLIST pidl)
|
|||
return E_OUTOFMEMORY;
|
||||
memcpy(V_ARRAY(&args)->pvData, pidl, arraySize);
|
||||
hResult = webBrowser->Navigate2(&args, &emptyVariant, &emptyVariant, &emptyVariant, &emptyVariant);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ HRESULT CreateBandProxy(REFIID riid, void **ppv)
|
|||
if (theBandProxy == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theBandProxy->QueryInterface(riid, reinterpret_cast<void **>(ppv));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
delete theBandProxy;
|
||||
return hResult;
|
||||
|
|
|
@ -202,7 +202,7 @@ HRESULT CBandSiteBase::UpdateAllBands()
|
|||
if (fBands[i].DeskBand != NULL)
|
||||
{
|
||||
hRet = UpdateSingleBand(&fBands[i]);
|
||||
if (FAILED(hRet))
|
||||
if (FAILED_UNEXPECTEDLY(hRet))
|
||||
return hRet;
|
||||
}
|
||||
}
|
||||
|
@ -628,11 +628,11 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::SetDeskBarSite(IUnknown *pUnk)
|
|||
fOleWindow.Release();
|
||||
|
||||
hRet = pUnk->QueryInterface(IID_PPV_ARG(IOleWindow, &fOleWindow));
|
||||
if (FAILED(hRet))
|
||||
if (FAILED_UNEXPECTEDLY(hRet))
|
||||
return E_FAIL;
|
||||
|
||||
hRet = fOleWindow->GetWindow(&hWndParent);
|
||||
if (FAILED(hRet))
|
||||
if (FAILED_UNEXPECTEDLY(hRet))
|
||||
return E_FAIL;
|
||||
|
||||
style = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | RBS_VARHEIGHT |
|
||||
|
|
|
@ -180,10 +180,10 @@ HRESULT CBaseBar::ReserveBorderSpace()
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &dockingWindowSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = dockingWindowSite->GetBorderDW(static_cast<IDeskBar *>(this), &availableBorderSpace);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
memset(&neededBorderSpace, 0, sizeof(neededBorderSpace));
|
||||
if (fVisible)
|
||||
|
@ -194,7 +194,7 @@ HRESULT CBaseBar::ReserveBorderSpace()
|
|||
neededBorderSpace.bottom = fNeededSize + GetSystemMetrics(SM_CXFRAME);
|
||||
}
|
||||
hResult = dockingWindowSite->SetBorderSpaceDW(static_cast<IDeskBar *>(this), &neededBorderSpace);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ HRESULT STDMETHODCALLTYPE CBaseBar::QueryService(REFGUID guidService, REFIID rii
|
|||
if (fSite == NULL)
|
||||
return E_FAIL;
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
// called for SID_STopLevelBrowser, IID_IBrowserService to find top level browser
|
||||
// called for SID_IWebBrowserApp, IID_IConnectionPointContainer
|
||||
|
@ -310,13 +310,13 @@ HRESULT STDMETHODCALLTYPE CBaseBar::SetClient(IUnknown *punkClient)
|
|||
else
|
||||
{
|
||||
hResult = punkClient->QueryInterface(IID_PPV_ARG(IUnknown, &fClient));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = oleWindow->GetWindow(&ownerWindow);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
Create(ownerWindow, 0, NULL,
|
||||
WS_VISIBLE | WS_CHILDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_TOOLWINDOW);
|
||||
|
@ -524,7 +524,7 @@ HRESULT CreateBaseBar(REFIID riid, void **ppv)
|
|||
if (theBaseBar == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theBaseBar->QueryInterface (riid, reinterpret_cast<void **>(ppv));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
delete theBaseBar;
|
||||
return hResult;
|
||||
|
|
|
@ -171,22 +171,22 @@ HRESULT CBaseBarSite::InsertBar(IUnknown *newBar)
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = newBar->QueryInterface(IID_PPV_ARG(IPersist, &persist));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = newBar->QueryInterface(IID_PPV_ARG(IObjectWithSite, &site));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = newBar->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = newBar->QueryInterface(IID_PPV_ARG(IDeskBand, &deskBand));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = newBar->QueryInterface(IID_PPV_ARG(IDockingWindow, &dockingWindow));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = site->SetSite(static_cast<IOleWindow *>(this));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
ATLTRY(newInfo = new CBarInfo);
|
||||
if (newInfo == NULL)
|
||||
|
@ -224,7 +224,7 @@ HRESULT CBaseBarSite::InsertBar(IUnknown *newBar)
|
|||
|
||||
// this call is what makes the tree fill with contents
|
||||
hResult = dockingWindow->ShowDW(TRUE);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
// for now
|
||||
fCurrentActiveBar = newInfo;
|
||||
|
@ -267,7 +267,7 @@ HRESULT STDMETHODCALLTYPE CBaseBarSite::QueryService(REFGUID guidService, REFIID
|
|||
if (fDeskBarSite == NULL)
|
||||
return E_FAIL;
|
||||
hResult = fDeskBarSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
// called for SID_STopLevelBrowser, IID_IBrowserService to find top level browser
|
||||
// called for SID_IWebBrowserApp, IID_IConnectionPointContainer
|
||||
|
@ -326,13 +326,13 @@ HRESULT STDMETHODCALLTYPE CBaseBarSite::SetDeskBarSite(IUnknown *punkSite)
|
|||
else
|
||||
{
|
||||
hResult = punkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = punkSite->QueryInterface(IID_PPV_ARG(IUnknown, &fDeskBarSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = oleWindow->GetWindow(&ownerWindow);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
m_hWnd = CreateWindow(REBARCLASSNAMEW, NULL, WS_VISIBLE | WS_CHILDWINDOW | WS_CLIPSIBLINGS |
|
||||
WS_CLIPCHILDREN |
|
||||
|
@ -487,7 +487,7 @@ HRESULT CreateBaseBarSite(REFIID riid, void **ppv)
|
|||
if (theBaseBarSite == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theBaseBarSite->QueryInterface(riid, reinterpret_cast<void **>(ppv));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
delete theBaseBarSite;
|
||||
return hResult;
|
||||
|
|
|
@ -171,7 +171,7 @@ HRESULT STDMETHODCALLTYPE CBrandBand::SetSite(IUnknown* pUnkSite)
|
|||
|
||||
// get window handle of parent
|
||||
hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &fSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
parentWindow = NULL;
|
||||
hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
|
||||
|
@ -356,7 +356,7 @@ HRESULT STDMETHODCALLTYPE CBrandBand::QueryService(REFGUID guidService, REFIID r
|
|||
if (IsEqualIID(guidService, SID_SBrandBand))
|
||||
return this->QueryInterface(riid, ppvObject);
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return serviceProvider->QueryService(guidService, riid, ppvObject);
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ HRESULT CreateBrandBand(REFIID riid, void **ppv)
|
|||
if (theMenuBar == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theMenuBar->QueryInterface(riid, reinterpret_cast<void **>(ppv));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
delete theMenuBar;
|
||||
return hResult;
|
||||
|
|
|
@ -78,7 +78,7 @@ HRESULT IUnknown_HasFocusIO(IUnknown * punk)
|
|||
CComPtr<IInputObject> pio;
|
||||
HRESULT hr;
|
||||
hr = punk->QueryInterface(IID_PPV_ARG(IInputObject, &pio));
|
||||
if (FAILED(hr))
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return hr;
|
||||
return pio->HasFocusIO();
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ HRESULT IUnknown_TranslateAcceleratorIO(IUnknown * punk, MSG * pmsg)
|
|||
if (!punk)
|
||||
return E_FAIL;
|
||||
hr = punk->QueryInterface(IID_PPV_ARG(IInputObject, &pio));
|
||||
if (FAILED(hr))
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return hr;
|
||||
return pio->TranslateAcceleratorIO(pmsg);
|
||||
}
|
||||
|
@ -228,10 +228,10 @@ HRESULT CDockSite::Initialize(IUnknown *containedBand, CInternetToolbar *browser
|
|||
fBandID = bandID;
|
||||
fFlags = flags;
|
||||
hResult = IUnknown_SetSite(containedBand, static_cast<IOleWindow *>(this));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = IUnknown_GetWindow(containedBand, &fChildWindow);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
memset(&bandInfo, 0, sizeof(bandInfo));
|
||||
|
@ -252,7 +252,7 @@ HRESULT CDockSite::GetRBBandInfo(REBARBANDINFOW &bandInfo)
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fContainedBand->QueryInterface(IID_PPV_ARG(IDeskBand, &deskBand));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
fDeskBandInfo.dwMask = DBIM_BKCOLOR | DBIM_MODEFLAGS | DBIM_TITLE | DBIM_ACTUAL |
|
||||
|
@ -365,7 +365,7 @@ HRESULT STDMETHODCALLTYPE CDockSite::Exec(const GUID *pguidCmdGroup, DWORD nCmdI
|
|||
bandInfo.lpText = textBuffer;
|
||||
bandInfo.cch = sizeof(textBuffer) / sizeof(TCHAR);
|
||||
hResult = GetRBBandInfo(bandInfo);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
index = (int)SendMessage(fRebarWindow, RB_IDTOINDEX, fBandID, 0);
|
||||
SendMessage(fRebarWindow, RB_SETBANDINFOW, index, (LPARAM)&bandInfo);
|
||||
|
@ -415,10 +415,10 @@ HRESULT STDMETHODCALLTYPE CMenuCallback::GetObject(LPSMDATA psmd, REFIID riid, v
|
|||
{
|
||||
// create favorites menu
|
||||
hResult = psmd->punk->QueryInterface(IID_PPV_ARG(IShellMenu, &parentMenu));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = parentMenu->GetMenu(&parentHMenu, &ownerWindow, NULL);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
favoritesHMenu = GetSubMenu(parentHMenu, 3);
|
||||
if (favoritesHMenu == NULL)
|
||||
|
@ -440,19 +440,19 @@ HRESULT STDMETHODCALLTYPE CMenuCallback::GetObject(LPSMDATA psmd, REFIID riid, v
|
|||
hResult = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARG(IShellMenu, &newMenu));
|
||||
#endif
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = newMenu->Initialize(this, FCIDM_MENU_FAVORITES, -1, SMINIT_VERTICAL | SMINIT_CACHED);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = newMenu->SetMenu(favoritesHMenu, ownerWindow, SMSET_TOP | SMSET_DONTOWN);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = SHGetSpecialFolderLocation(NULL, CSIDL_FAVORITES, &favoritesPIDL);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = SHBindToFolder(favoritesPIDL, &favoritesFolder);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
RegCreateKeyEx(HKEY_CURRENT_USER, szFavoritesKey,
|
||||
0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &orderRegKey, &disposition);
|
||||
|
@ -571,10 +571,10 @@ HRESULT CInternetToolbar::ReserveBorderSpace(LONG maxHeight)
|
|||
RECT availableBorderSpace;
|
||||
|
||||
HRESULT hResult = fSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &dockingWindowSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = dockingWindowSite->GetBorderDW(static_cast<IDockingWindow *>(this), &availableBorderSpace);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
if (availableBorderSpace.top > maxHeight)
|
||||
|
@ -615,7 +615,7 @@ HRESULT CInternetToolbar::CreateMenuBar(IShellMenu **menuBar)
|
|||
hResult = E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
hResult = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARG(IShellMenu, menuBar));
|
||||
|
@ -624,33 +624,33 @@ HRESULT CInternetToolbar::CreateMenuBar(IShellMenu **menuBar)
|
|||
hResult = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARG(IShellMenu, menuBar));
|
||||
#endif
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = fMenuCallback.QueryInterface(IID_PPV_ARG(IShellMenuCallback, &callback));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = (*menuBar)->Initialize(callback, -1, ANCESTORDEFAULT, SMINIT_HORIZONTAL | SMINIT_TOPLEVEL);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = oleWindow->GetWindow(&ownerWindow);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &siteCommandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = siteCommandTarget->Exec(&CGID_Explorer, 0x35, 0, NULL, &menuOut);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
if (V_VT(&menuOut) != VT_INT_PTR || V_INTREF(&menuOut) == NULL)
|
||||
return E_FAIL;
|
||||
hResult = (*menuBar)->SetMenu((HMENU)V_INTREF(&menuOut), ownerWindow, SMSET_DONTOWN);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = IUnknown_Exec(*menuBar, CGID_MenuBand, 3, 1, NULL, NULL);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -744,16 +744,16 @@ HRESULT CInternetToolbar::CreateAndInitBandProxy()
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = serviceProvider->QueryService(SID_IBandProxy, IID_PPV_ARG(IBandProxy, &fBandProxy));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
hResult = CreateBandProxy(IID_PPV_ARG(IBandProxy, &fBandProxy));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = fBandProxy->SetSite(fSite);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
}
|
||||
return S_OK;
|
||||
|
@ -938,15 +938,15 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::ResizeBorderDW(LPCRECT prcBorder,
|
|||
CComPtr<IDockingWindowSite> dockingWindowSite;
|
||||
|
||||
HRESULT hResult = fSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &dockingWindowSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
hResult = dockingWindowSite->RequestBorderSpaceDW(static_cast<IDockingWindow *>(this), &neededBorderSpace);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
hResult = dockingWindowSite->SetBorderSpaceDW(static_cast<IDockingWindow *>(this), &neededBorderSpace);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
return S_OK;
|
||||
|
@ -990,7 +990,7 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
|
|||
|
||||
/* Create and attach the menubar to the rebar */
|
||||
hResult = CreateMenuBar(&menuBar);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
AddDockItem(menuBar, ITBBID_MENUBAND, CDockSite::ITF_NOTITLE | CDockSite::ITF_NEWBANDALWAYS | CDockSite::ITF_GRIPPERALWAYS);
|
||||
|
||||
|
@ -1002,7 +1002,7 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
|
|||
#if 0
|
||||
/* Create and attach the brand/logo to the rebar */
|
||||
hResult = CreateBrandBand(&logoBar);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
AddDockItem(logoBar, ITBBID_BRANDBAND, CDockSite::ITF_NOGRIPPER | CDockSite::ITF_NOTITLE | CDockSite::ITF_FIXEDSIZE);
|
||||
fLogoBar.Attach(logoBar.Detach()); // transfer the ref count
|
||||
|
@ -1010,17 +1010,17 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
|
|||
|
||||
/* Create and attach the standard toolbar to the rebar */
|
||||
hResult = CreateToolsBar(&toolsBar);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
AddDockItem(toolsBar, ITBBID_TOOLSBAND, CDockSite::ITF_NOTITLE | CDockSite::ITF_NEWBANDALWAYS | CDockSite::ITF_GRIPPERALWAYS);
|
||||
fControlsBar.Attach(toolsBar.Detach()); // transfer the ref count
|
||||
hResult = IUnknown_GetWindow(fControlsBar, &fToolbarWindow);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
/* Create and attach the address/navigation toolbar to the rebar */
|
||||
hResult = CreateAddressBand(&navigationBar);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
AddDockItem(navigationBar, ITBBID_ADDRESSBAND, CDockSite::ITF_NEWBANDALWAYS | CDockSite::ITF_GRIPPERALWAYS);
|
||||
fNavigationBar.Attach(navigationBar.Detach());
|
||||
|
@ -1163,7 +1163,7 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::SetCommandTarget(IUnknown *theTarget
|
|||
|
||||
fCommandTarget.Release();
|
||||
hResult = theTarget->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &fCommandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
fCommandCategory = *category;
|
||||
return S_OK;
|
||||
|
@ -1269,10 +1269,10 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::SetSite(IUnknown *pUnkSite)
|
|||
{
|
||||
// get window handle of owner
|
||||
hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = oleWindow->GetWindow(&ownerWindow);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
if (ownerWindow == NULL)
|
||||
return E_FAIL;
|
||||
|
@ -1326,7 +1326,7 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::QueryService(REFGUID guidService, RE
|
|||
if (fBandProxy.p == NULL)
|
||||
{
|
||||
hResult = CreateAndInitBandProxy();
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
}
|
||||
return fBandProxy->QueryInterface(riid, ppvObject);
|
||||
|
@ -1396,26 +1396,31 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::QueryBand(DWORD dwBandID,
|
|||
|
||||
HRESULT STDMETHODCALLTYPE CInternetToolbar::SetBandState(DWORD dwBandID, DWORD dwMask, DWORD dwState)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CInternetToolbar::RemoveBand(DWORD dwBandID)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CInternetToolbar::GetBandObject(DWORD dwBandID, REFIID riid, void **ppv)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CInternetToolbar::SetBandSiteInfo(const BANDSITEINFO *pbsinfo)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CInternetToolbar::GetBandSiteInfo(BANDSITEINFO *pbsinfo)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
@ -1426,11 +1431,11 @@ LRESULT CInternetToolbar::OnTravelBack(WORD wNotifyCode, WORD wID, HWND hWndCtl,
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = serviceProvider->QueryService(SID_SShellBrowser,
|
||||
IID_PPV_ARG(IWebBrowser, &webBrowser));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = webBrowser->GoBack();
|
||||
return 1;
|
||||
|
@ -1443,11 +1448,11 @@ LRESULT CInternetToolbar::OnTravelForward(WORD wNotifyCode, WORD wID, HWND hWndC
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = serviceProvider->QueryService(
|
||||
SID_SShellBrowser, IID_PPV_ARG(IWebBrowser, &webBrowser));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = webBrowser->GoForward();
|
||||
return 1;
|
||||
|
@ -1459,7 +1464,7 @@ LRESULT CInternetToolbar::OnUpLevel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &oleCommandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = oleCommandTarget->Exec(&CGID_ShellBrowser, IDM_GOTO_UPONELEVEL, 0, NULL, NULL);
|
||||
return 1;
|
||||
|
@ -1483,13 +1488,13 @@ LRESULT CInternetToolbar::OnSearch(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOO
|
|||
|
||||
hResult = CoCreateInstance(CLSID_ShellSearchExt, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARG(IContextMenu, &contextMenu));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = contextMenu->QueryInterface(IID_PPV_ARG(IObjectWithSite, &objectWithSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = objectWithSite->SetSite(fSite);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = contextMenu->InvokeCommand(&commandInfo);
|
||||
hResult = objectWithSite->SetSite(NULL);
|
||||
|
@ -1502,7 +1507,7 @@ LRESULT CInternetToolbar::OnFolders(WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fSite->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &oleCommandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = oleCommandTarget->Exec(&CGID_Explorer, 0x23, 0, NULL, NULL);
|
||||
return 1;
|
||||
|
@ -1752,7 +1757,7 @@ LRESULT CInternetToolbar::OnTipText(UINT idControl, NMHDR *pNMHDR, BOOL &bHandle
|
|||
hResult = travelLog->GetToolTipText(browserService,
|
||||
(nID == (UINT)IDM_GOTO_BACK) ? TLOG_BACK : TLOG_FORE,
|
||||
0, tempString, 299);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
bHandled = FALSE;
|
||||
return 0;
|
||||
|
@ -1866,7 +1871,7 @@ HRESULT CreateInternetToolbar(REFIID riid, void **ppv)
|
|||
if (theToolbar == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theToolbar->QueryInterface (riid, reinterpret_cast<void **>(ppv));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
delete theToolbar;
|
||||
return hResult;
|
||||
|
|
|
@ -203,7 +203,7 @@ HRESULT WINAPI SHBindToFolder(LPCITEMIDLIST path, IShellFolder **newFolder)
|
|||
CComPtr<IShellFolder> desktop;
|
||||
|
||||
HRESULT hr = ::SHGetDesktopFolder(&desktop);
|
||||
if (FAILED(hr))
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return E_FAIL;
|
||||
if (path == NULL || path->mkid.cb == 0)
|
||||
{
|
||||
|
@ -752,11 +752,11 @@ HRESULT CShellBrowser::Initialize(LPITEMIDLIST pidl, long b, long c, long d)
|
|||
|
||||
#if 0
|
||||
hResult = CoCreateInstance(CLSID_InternetToolbar, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IUnknown, &fClientBars[BIInternetToolbar].clientBar));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
#else
|
||||
hResult = CreateInternetToolbar(IID_PPV_ARG(IUnknown, &clientBar));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
#endif
|
||||
|
||||
|
@ -768,11 +768,11 @@ HRESULT CShellBrowser::Initialize(LPITEMIDLIST pidl, long b, long c, long d)
|
|||
return hResult;
|
||||
|
||||
hResult = IUnknown_SetSite(clientBar, static_cast<IShellBrowser *>(this));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
hResult = IUnknown_Exec(clientBar, CGID_PrivCITCommands, 1, 1 /* or 0 */, NULL, NULL);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
// TODO: create settingsStream from registry entry
|
||||
|
@ -785,7 +785,7 @@ HRESULT CShellBrowser::Initialize(LPITEMIDLIST pidl, long b, long c, long d)
|
|||
//else
|
||||
{
|
||||
hResult = persistStreamInit->InitNew();
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
}
|
||||
|
||||
|
@ -805,7 +805,7 @@ HRESULT CShellBrowser::Initialize(LPITEMIDLIST pidl, long b, long c, long d)
|
|||
|
||||
// browse
|
||||
hResult = BrowseToPIDL(pidl, BTP_UPDATE_NEXT_HISTORY);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
ShowWindow(SW_SHOWNORMAL);
|
||||
|
@ -822,13 +822,13 @@ 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(pidl, &newFolder);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
newFolderSettings.ViewMode = FVM_ICON;
|
||||
newFolderSettings.fFlags = 0;
|
||||
hResult = BrowseToPath(newFolder, pidl, &newFolderSettings, flags);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -937,7 +937,7 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
|
|||
return E_INVALIDARG;
|
||||
|
||||
hResult = GetTravelLog(&travelLog);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
// update history
|
||||
|
@ -955,7 +955,7 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
|
|||
|
||||
// create view object
|
||||
hResult = newShellFolder->CreateViewObject(m_hWnd, IID_PPV_ARG(IShellView, &newShellView));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
previousView = fCurrentShellViewWindow;
|
||||
|
||||
|
@ -986,7 +986,7 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
|
|||
// create view window
|
||||
hResult = newShellView->CreateViewWindow(saveCurrentShellView, folderSettings,
|
||||
this, &shellViewWindowBounds, &newShellViewWindow);
|
||||
if (FAILED(hResult) || newShellViewWindow == NULL)
|
||||
if (FAILED_UNEXPECTEDLY(hResult) || newShellViewWindow == NULL)
|
||||
{
|
||||
fCurrentShellView = saveCurrentShellView;
|
||||
fCurrentShellFolder = saveCurrentShellFolder;
|
||||
|
@ -1086,7 +1086,7 @@ HRESULT CShellBrowser::GetMenuBand(REFIID riid, void **shellMenu)
|
|||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = bandSite->QueryBand(1, &deskBand, NULL, NULL, 0);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return deskBand->QueryInterface(riid, shellMenu);
|
||||
}
|
||||
|
@ -1108,34 +1108,34 @@ HRESULT CShellBrowser::GetBaseBar(bool vertical, IUnknown **theBaseBar)
|
|||
if (*cache == NULL)
|
||||
{
|
||||
hResult = CreateBaseBar(IID_PPV_ARG(IUnknown, &newBaseBar));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = CreateBaseBarSite(IID_PPV_ARG(IUnknown, &newBaseBarSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
// tell the new base bar about the shell browser
|
||||
hResult = newBaseBar->QueryInterface(IID_PPV_ARG(IObjectWithSite, &objectWithSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = objectWithSite->SetSite(static_cast<IDropTarget *>(this));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
// tell the new base bar about the new base bar site
|
||||
hResult = newBaseBar->QueryInterface(IID_PPV_ARG(IDeskBar, &deskBar));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = deskBar->SetClient(newBaseBarSite);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
// tell the new base bar site about the new base bar
|
||||
hResult = newBaseBarSite->QueryInterface(IID_PPV_ARG(IDeskBarClient, &deskBarClient));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = deskBarClient->SetDeskBarSite(newBaseBar);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
*cache = newBaseBar.Detach();
|
||||
|
@ -1157,30 +1157,30 @@ HRESULT CShellBrowser::ShowBand(const CLSID &classID, bool vertical)
|
|||
__debugbreak();
|
||||
|
||||
hResult = GetBaseBar(vertical, (IUnknown **)&theBaseBar);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = CoCreateInstance(classID, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IUnknown, &newBand));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = theBaseBar->QueryInterface(IID_PPV_ARG(IDeskBar, &deskBar));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = deskBar->GetClient(&baseBarSite);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = theBaseBar->QueryInterface(IID_PPV_ARG(IDockingWindow, &dockingWindow));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = baseBarSite->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &oleCommandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
V_VT(&vaIn) = VT_UNKNOWN;
|
||||
V_UNKNOWN(&vaIn) = newBand.p;
|
||||
hResult = oleCommandTarget->Exec(&CGID_IDeskBand, 1, 1, &vaIn, NULL);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = dockingWindow->ShowDW(TRUE);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -1196,7 +1196,7 @@ HRESULT CShellBrowser::NavigateToParent()
|
|||
ILRemoveLastID(newDirectory);
|
||||
hResult = BrowseToPIDL(newDirectory, BTP_UPDATE_CUR_HISTORY | BTP_UPDATE_NEXT_HISTORY);
|
||||
ILFree(newDirectory);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -1229,7 +1229,7 @@ HRESULT CShellBrowser::DoFolderOptions()
|
|||
// create sheet object
|
||||
hResult = CoCreateInstance(CLSID_ShellFldSetExt, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARG(IShellPropSheetExt, &folderOptionsSheet));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return E_FAIL;
|
||||
|
||||
// must set site in order for Apply to all Folders on Advanced page to be enabled
|
||||
|
@ -1240,23 +1240,23 @@ HRESULT CShellBrowser::DoFolderOptions()
|
|||
|
||||
#if 0
|
||||
hResult = CoCreateInstance(CLSID_GlobalFolderSettings, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IGlobalFolderSettings, &globalSettings));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return E_FAIL;
|
||||
hResult = globalSettings->Get(&shellState, sizeof(shellState));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return E_FAIL;
|
||||
#endif
|
||||
|
||||
// add pages
|
||||
hResult = folderOptionsSheet->AddPages(AddFolderOptionsPage, reinterpret_cast<LPARAM>(&m_PropSheet));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return E_FAIL;
|
||||
|
||||
if (fCurrentShellView != NULL)
|
||||
{
|
||||
hResult = fCurrentShellView->AddPropertySheetPages(
|
||||
0, AddFolderOptionsPage, reinterpret_cast<LPARAM>(&m_PropSheet));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
@ -1484,7 +1484,7 @@ HRESULT CShellBrowser::UpdateForwardBackState()
|
|||
canGoBack = false;
|
||||
canGoForward = false;
|
||||
hResult = GetTravelLog(&travelLog);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = travelLog->GetTravelEntry(static_cast<IDropTarget *>(this), TLOG_BACK, &unusedEntry);
|
||||
if (SUCCEEDED(hResult))
|
||||
|
@ -1514,7 +1514,7 @@ void CShellBrowser::UpdateGotoMenu(HMENU theMenu)
|
|||
|
||||
position = GetMenuItemCount(theMenu);
|
||||
hResult = GetTravelLog(&travelLog);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return;
|
||||
hResult = travelLog->InsertMenuEntries(static_cast<IDropTarget *>(this), theMenu, position,
|
||||
IDM_GOTO_TRAVEL_FIRSTTARGET, IDM_GOTO_TRAVEL_LASTTARGET, TLMENUF_BACKANDFORTH | TLMENUF_CHECKCURRENT);
|
||||
|
@ -1553,7 +1553,7 @@ void CShellBrowser::UpdateViewMenu(HMENU theMenu)
|
|||
IID_PPV_ARG(IOleCommandTarget, &oleCommandTarget));
|
||||
if (SUCCEEDED(hResult))
|
||||
hResult = oleCommandTarget->QueryStatus(&CGID_PrivCITCommands, 5, commandList, NULL);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
DeleteMenu(theMenu, IDM_VIEW_TOOLBARS, MF_BYCOMMAND);
|
||||
else
|
||||
{
|
||||
|
@ -1595,10 +1595,10 @@ bool IUnknownIsEqual(IUnknown *int1, IUnknown *int2)
|
|||
if (int1 == NULL || int2 == NULL)
|
||||
return false;
|
||||
hResult = int1->QueryInterface(IID_PPV_ARG(IUnknown, &int1Retry));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return false;
|
||||
hResult = int2->QueryInterface(IID_PPV_ARG(IUnknown, &int2Retry));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return false;
|
||||
if (int1Retry == int2Retry)
|
||||
return true;
|
||||
|
@ -1856,10 +1856,10 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::SetMenuSB(HMENU hmenuShared, HOLEMENU h
|
|||
if (hmenuShared && IsMenu(hmenuShared) == FALSE)
|
||||
return E_FAIL;
|
||||
hResult = GetMenuBand(IID_PPV_ARG(IShellMenu, &shellMenu));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = shellMenu->SetMenu(hmenuShared, NULL, SMSET_DONTOWN);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
fCurrentMenuBar = hmenuShared;
|
||||
return S_OK;
|
||||
|
@ -2083,7 +2083,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::GetTravelLog(ITravelLog **pptl)
|
|||
if (fTravelLog.p == NULL)
|
||||
{
|
||||
hResult = CreateTravelLog(IID_PPV_ARG(ITravelLog, &fTravelLog));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
}
|
||||
*pptl = fTravelLog.p;
|
||||
|
@ -2572,7 +2572,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::GoBack()
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = GetTravelLog(&travelLog);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return travelLog->Travel(static_cast<IDropTarget *>(this), TLOG_BACK);
|
||||
}
|
||||
|
@ -2583,7 +2583,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::GoForward()
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = GetTravelLog(&travelLog);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return travelLog->Travel(static_cast<IDropTarget *>(this), TLOG_FORE);
|
||||
}
|
||||
|
@ -2619,7 +2619,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::Refresh2(VARIANT *Level)
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = fCurrentShellView->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &oleCommandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return oleCommandTarget->Exec(NULL, 22, 1, Level, NULL);
|
||||
}
|
||||
|
@ -2831,7 +2831,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::Navigate2(VARIANT *URL, VARIANT *Flags,
|
|||
return E_INVALIDARG;
|
||||
pidl = (LPITEMIDLIST)V_ARRAY(URL)->pvData;
|
||||
hResult = BrowseToPIDL((LPITEMIDLIST)pidl, BTP_UPDATE_CUR_HISTORY | BTP_UPDATE_NEXT_HISTORY);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -2975,7 +2975,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::LoadHistory(IStream *pStream, IBindCtx
|
|||
HRESULT hResult;
|
||||
|
||||
hResult = pStream->Read(&oldState, sizeof(oldState), &numRead);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
if (numRead != sizeof(oldState) || oldState.dwSize != sizeof(oldState))
|
||||
return E_FAIL;
|
||||
|
@ -2985,7 +2985,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::LoadHistory(IStream *pStream, IBindCtx
|
|||
if (pidl == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = pStream->Read(pidl, oldState.pidlSize, &numRead);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
ILFree(pidl);
|
||||
return hResult;
|
||||
|
@ -3005,7 +3005,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::LoadHistory(IStream *pStream, IBindCtx
|
|||
fHistoryStream = NULL;
|
||||
fHistoryBindContext = NULL;
|
||||
ILFree(pidl);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -3025,20 +3025,20 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::SaveHistory(IStream *pStream)
|
|||
if (viewPersistHistory.p != NULL)
|
||||
{
|
||||
hResult = viewPersistHistory->GetClassID(&newState.persistClass);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
}
|
||||
newState.pidlSize = ILGetSize(fCurrentDirectoryPIDL);
|
||||
hResult = pStream->Write(&newState, sizeof(newState), NULL);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
hResult = pStream->Write(fCurrentDirectoryPIDL, newState.pidlSize, NULL);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
if (viewPersistHistory.p != NULL)
|
||||
{
|
||||
hResult = viewPersistHistory->SaveHistory(pStream);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
}
|
||||
return S_OK;
|
||||
|
@ -3272,7 +3272,7 @@ LRESULT CShellBrowser::OnToggleToolbarLock(WORD wNotifyCode, WORD wID, HWND hWnd
|
|||
|
||||
hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
|
||||
IID_PPV_ARG(IOleCommandTarget, &commandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = commandTarget->Exec(&CGID_PrivCITCommands, ITID_TOOLBARLOCKED, 0, NULL, NULL);
|
||||
return 0;
|
||||
|
@ -3285,7 +3285,7 @@ LRESULT CShellBrowser::OnToggleToolbarBandVisible(WORD wNotifyCode, WORD wID, HW
|
|||
|
||||
hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
|
||||
IID_PPV_ARG(IOleCommandTarget, &commandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = commandTarget->Exec(&CGID_PrivCITCommands, ITID_TOOLBARBANDSHOWN, 0, NULL, NULL);
|
||||
return 0;
|
||||
|
@ -3298,7 +3298,7 @@ LRESULT CShellBrowser::OnToggleAddressBandVisible(WORD wNotifyCode, WORD wID, HW
|
|||
|
||||
hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
|
||||
IID_PPV_ARG(IOleCommandTarget, &commandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = commandTarget->Exec(&CGID_PrivCITCommands, ITID_ADDRESSBANDSHOWN, 0, NULL, NULL);
|
||||
return 0;
|
||||
|
@ -3311,7 +3311,7 @@ LRESULT CShellBrowser::OnToggleLinksBandVisible(WORD wNotifyCode, WORD wID, HWND
|
|||
|
||||
hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
|
||||
IID_PPV_ARG(IOleCommandTarget, &commandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = commandTarget->Exec(&CGID_PrivCITCommands, ITID_LINKSBANDSHOWN, 0, NULL, NULL);
|
||||
return 0;
|
||||
|
@ -3324,7 +3324,7 @@ LRESULT CShellBrowser::OnToggleTextLabels(WORD wNotifyCode, WORD wID, HWND hWndC
|
|||
|
||||
hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
|
||||
IID_PPV_ARG(IOleCommandTarget, &commandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = commandTarget->Exec(&CGID_PrivCITCommands, ITID_TEXTLABELS, 0, NULL, NULL);
|
||||
return 0;
|
||||
|
@ -3337,7 +3337,7 @@ LRESULT CShellBrowser::OnToolbarCustomize(WORD wNotifyCode, WORD wID, HWND hWndC
|
|||
|
||||
hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
|
||||
IID_PPV_ARG(IOleCommandTarget, &commandTarget));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
hResult = commandTarget->Exec(&CGID_PrivCITCommands, ITID_CUSTOMIZEENABLED, 0, NULL, NULL);
|
||||
return 0;
|
||||
|
@ -3369,7 +3369,7 @@ static HRESULT ExplorerMessageLoop(IEThreadParamBlock * parameters)
|
|||
}
|
||||
|
||||
hResult = theCabinet->Initialize(parameters->directoryPIDL, 0, 0, 0);
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
while ((Ret = GetMessage(&Msg, NULL, 0, 0)) != 0)
|
||||
|
|
|
@ -270,7 +270,7 @@ HRESULT STDMETHODCALLTYPE CToolsBand::SetSite(IUnknown* pUnkSite){
|
|||
if (pUnkSite == NULL)
|
||||
return S_OK;
|
||||
hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &fDockSite));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
parentWindow = NULL;
|
||||
hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
|
||||
|
@ -450,7 +450,7 @@ HRESULT CreateToolsBar(REFIID riid, void **ppv)
|
|||
if (theToolbar == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
hResult = theToolbar->QueryInterface(riid, reinterpret_cast<void **>(ppv));
|
||||
if (FAILED(hResult))
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
{
|
||||
delete theToolbar;
|
||||
return hResult;
|
||||
|
|
Loading…
Reference in a new issue