diff options
Diffstat (limited to 'ceee/ie/plugin/bho/webrequest_notifier.cc')
-rw-r--r-- | ceee/ie/plugin/bho/webrequest_notifier.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ceee/ie/plugin/bho/webrequest_notifier.cc b/ceee/ie/plugin/bho/webrequest_notifier.cc index c0487a3..beb4c60 100644 --- a/ceee/ie/plugin/bho/webrequest_notifier.cc +++ b/ceee/ie/plugin/bho/webrequest_notifier.cc @@ -34,14 +34,19 @@ WebRequestNotifier::WebRequestNotifier() initialize_state_(NOT_INITIALIZED), broker_rpc_client_(true), webrequest_events_funnel_(&broker_rpc_client_) { - HRESULT hr = broker_rpc_client_.Connect(true); - DCHECK(SUCCEEDED(hr)); } WebRequestNotifier::~WebRequestNotifier() { DCHECK_EQ(start_count_, 0); } +bool WebRequestNotifier::ConnectBroker() { + if (broker_rpc_client_.is_connected()) + return true; + HRESULT hr = broker_rpc_client_.Connect(true); + DCHECK(SUCCEEDED(hr)); + return SUCCEEDED(hr); +} bool WebRequestNotifier::RequestToStart() { { CComCritSecLock<CComAutoCriticalSection> lock(critical_section_); @@ -54,6 +59,9 @@ bool WebRequestNotifier::RequestToStart() { bool success = false; do { + if (!ConnectBroker()) + break; + // We are not going to unpatch any of the patched WinINet functions or the // status callback function. Instead, we pin our DLL in memory so that all // the patched functions can be accessed until the process goes away. |