Author: dquintana Date: Wed Jun 4 18:08:35 2014 New Revision: 63541
URL: http://svn.reactos.org/svn/reactos?rev=63541&view=rev Log: [BROWSEUI] * Make failure codes print themselves. Helps debug.
Modified: branches/shell-experiments/dll/win32/browseui/aclmulti.cpp branches/shell-experiments/dll/win32/browseui/addressband.cpp branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp branches/shell-experiments/dll/win32/browseui/bandproxy.cpp branches/shell-experiments/dll/win32/browseui/bandsite.cpp branches/shell-experiments/dll/win32/browseui/basebar.cpp branches/shell-experiments/dll/win32/browseui/basebarsite.cpp branches/shell-experiments/dll/win32/browseui/brandband.cpp branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp branches/shell-experiments/dll/win32/browseui/toolsband.cpp
Modified: branches/shell-experiments/dll/win32/browseui/aclmulti.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/aclmulti.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/aclmulti.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -57,9 +57,9 @@ 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;
Modified: branches/shell-experiments/dll/win32/browseui/addressband.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -126,7 +126,7 @@ 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 @@ #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)) - return hResult; - hResult = fAddressEditBox->Init(combobox, fEditControl, 8, pUnkSite /*(IAddressBand *)this*/); - if (FAILED(hResult)) - return hResult; - hResult = shellService->SetOwner(pUnkSite); - if (FAILED(hResult)) + if (FAILED_UNEXPECTEDLY(hResult)) + return hResult; + hResult = fAddressEditBox->Init(combobox, fEditControl, 8, fSite /*(IAddressBand *)this*/); + if (FAILED_UNEXPECTEDLY(hResult)) + return hResult; + hResult = shellService->SetOwner(fSite); + if (FAILED_UNEXPECTEDLY(hResult)) return hResult;
// TODO: properly initialize this from registry @@ -285,7 +285,7 @@ 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 @@ 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 @@ 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 @@ 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 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 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 @@ }
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 @@ 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;
Modified: branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -144,7 +144,7 @@ if (SUCCEEDED(hr)) { hr = pisb->BrowseObject(pidlLastParsed, 0); - if (FAILED(hr)) + if (FAILED_UNEXPECTEDLY(hr)) { HWND topLevelWindow; LPCITEMIDLIST pidlChild; @@ -267,7 +267,7 @@ 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;
Modified: branches/shell-experiments/dll/win32/browseui/bandproxy.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/bandproxy.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/bandproxy.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -44,11 +44,11 @@ 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 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 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 @@ 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 @@ 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;
Modified: branches/shell-experiments/dll/win32/browseui/bandsite.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/bandsite.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/bandsite.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -202,7 +202,7 @@ if (fBands[i].DeskBand != NULL) { hRet = UpdateSingleBand(&fBands[i]); - if (FAILED(hRet)) + if (FAILED_UNEXPECTEDLY(hRet)) return hRet; } } @@ -628,11 +628,11 @@ 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 |
Modified: branches/shell-experiments/dll/win32/browseui/basebar.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/basebar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/basebar.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -180,10 +180,10 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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;
Modified: branches/shell-experiments/dll/win32/browseui/basebarsite.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/basebarsite.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/basebarsite.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -171,22 +171,22 @@ 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 @@
// 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 @@ 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 @@ 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 @@ 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;
Modified: branches/shell-experiments/dll/win32/browseui/brandband.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/brandband.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/brandband.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -171,7 +171,7 @@
// 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 @@ 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 @@ 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;
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -78,7 +78,7 @@ 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 @@ 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 @@ 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 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 @@ 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 @@ { // 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 = 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 @@ 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 = 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 = 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 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 @@ 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 @@
/* 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 @@ #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 @@
/* 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 @@
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 @@ { // 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 @@ 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::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 @@ 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 @@ 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 @@ 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 @@
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 @@ 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 @@ 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 @@ 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;
Modified: branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -203,7 +203,7 @@ 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 @@
#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 @@ 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 @@ //else { hResult = persistStreamInit->InitNew(); - if (FAILED(hResult)) + if (FAILED_UNEXPECTEDLY(hResult)) return hResult; }
@@ -805,7 +805,7 @@
// browse hResult = BrowseToPIDL(pidl, BTP_UPDATE_NEXT_HISTORY); - if (FAILED(hResult)) + if (FAILED_UNEXPECTEDLY(hResult)) return hResult;
ShowWindow(SW_SHOWNORMAL); @@ -822,13 +822,13 @@ // 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 @@ return E_INVALIDARG;
hResult = GetTravelLog(&travelLog); - if (FAILED(hResult)) + if (FAILED_UNEXPECTEDLY(hResult)) return hResult;
// update history @@ -955,7 +955,7 @@
// 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 @@ // 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 @@ 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 @@ 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 @@ __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 @@ 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 @@ // 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 @@
#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 @@ 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 @@
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 @@ 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 @@ 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 @@ 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 @@ 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 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 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 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 @@ 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 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 @@ 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 @@ fHistoryStream = NULL; fHistoryBindContext = NULL; ILFree(pidl); - if (FAILED(hResult)) + if (FAILED_UNEXPECTEDLY(hResult)) return hResult; return S_OK; } @@ -3025,20 +3025,20 @@ 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@ }
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)
Modified: branches/shell-experiments/dll/win32/browseui/toolsband.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/toolsband.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/toolsband.cpp [iso-8859-1] Wed Jun 4 18:08:35 2014 @@ -270,7 +270,7 @@ 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 @@ 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;