@@ -3163,19 +3163,41 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::v_CheckZoneCrossing(LPCITEMIDLIST pidl)
31633163HRESULT STDMETHODCALLTYPE CShellBrowser::GoBack ()
31643164{
31653165 CComPtr<ITravelLog> travelLog;
3166- HRESULT hResult = GetTravelLog (&travelLog);
3166+ CComPtr<ITravelEntry> unusedEntry;
3167+ HRESULT hResult;
3168+
3169+ hResult = GetTravelLog (&travelLog);
31673170 if (FAILED_UNEXPECTEDLY (hResult))
31683171 return hResult;
3169- return travelLog->Travel (static_cast <IDropTarget *>(this ), TLOG_BACK);
3172+
3173+ hResult = travelLog->GetTravelEntry (static_cast <IDropTarget *>(this ), TLOG_BACK, &unusedEntry);
3174+ if (SUCCEEDED (hResult))
3175+ {
3176+ unusedEntry.Release ();
3177+ return travelLog->Travel (static_cast <IDropTarget *>(this ), TLOG_BACK);
3178+ }
3179+
3180+ return hResult;
31703181}
31713182
31723183HRESULT STDMETHODCALLTYPE CShellBrowser::GoForward ()
31733184{
31743185 CComPtr<ITravelLog> travelLog;
3175- HRESULT hResult = GetTravelLog (&travelLog);
3186+ CComPtr<ITravelEntry> unusedEntry;
3187+ HRESULT hResult;
3188+
3189+ hResult = GetTravelLog (&travelLog);
31763190 if (FAILED_UNEXPECTEDLY (hResult))
31773191 return hResult;
3178- return travelLog->Travel (static_cast <IDropTarget *>(this ), TLOG_FORE);
3192+
3193+ hResult = travelLog->GetTravelEntry (static_cast <IDropTarget *>(this ), TLOG_FORE, &unusedEntry);
3194+ if (SUCCEEDED (hResult))
3195+ {
3196+ unusedEntry.Release ();
3197+ return travelLog->Travel (static_cast <IDropTarget *>(this ), TLOG_FORE);
3198+ }
3199+
3200+ return hResult;
31793201}
31803202
31813203HRESULT STDMETHODCALLTYPE CShellBrowser::GoHome ()
@@ -3953,10 +3975,14 @@ LRESULT CShellBrowser::OnGoHome(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &
39533975
39543976LRESULT CShellBrowser::OnBackspace (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
39553977{
3956- // FIXME: This does not appear to be what windows does.
3957- HRESULT hResult = NavigateToParent ();
3978+ HRESULT hResult;
3979+ if (LOBYTE (GetVersion ()) < 6 )
3980+ hResult = NavigateToParent ();
3981+ else if (FAILED (hResult = GoBack ()))
3982+ hResult = GoForward ();
3983+
39583984 if (FAILED (hResult))
3959- TRACE (" NavigateToParent failed with hResult=%08lx\n " , hResult);
3985+ TRACE (" Backspace navigation failed with hResult=%08lx\n " , hResult);
39603986 return 0 ;
39613987}
39623988
0 commit comments