summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome_frame/chrome_frame_activex_base.h2
-rw-r--r--chrome_frame/utils.h7
2 files changed, 6 insertions, 3 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h
index 28ca868..5ba38f8 100644
--- a/chrome_frame/chrome_frame_activex_base.h
+++ b/chrome_frame/chrome_frame_activex_base.h
@@ -1005,7 +1005,7 @@ END_MSG_MAP()
HRESULT hr = S_FALSE;
ScopedComPtr<IBrowserService2> bs2;
if (S_OK == DoQueryService(SID_STopLevelBrowser, m_spInPlaceSite,
- bs2.Receive())) {
+ bs2.Receive()) && bs2.get()) {
hr = bs2->v_MayTranslateAccelerator(const_cast<MSG*>(&msg));
} else {
// IE8 doesn't support IBrowserService2 unless you enable a special,
diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h
index d10b7c0..ab25cf2 100644
--- a/chrome_frame/utils.h
+++ b/chrome_frame/utils.h
@@ -210,9 +210,12 @@ HRESULT DoQueryService(const IID& service_id, IUnknown* unk, T** service) {
ScopedComPtr<IServiceProvider> service_provider;
HRESULT hr = service_provider.QueryFrom(unk);
if (!service_provider)
- return hr;
+ return E_NOINTERFACE;
- return service_provider->QueryService(service_id, service);
+ hr = service_provider->QueryService(service_id, service);
+ if (*service == NULL)
+ return E_NOINTERFACE;
+ return hr;
}
// Get url (display name) from a moniker, |bind_context| is optional