| Index: chrome_frame/protocol_sink_wrap.cc
|
| ===================================================================
|
| --- chrome_frame/protocol_sink_wrap.cc (revision 180481)
|
| +++ chrome_frame/protocol_sink_wrap.cc (working copy)
|
| @@ -38,6 +38,8 @@
|
| static const int kInternetProtocolStartExIndex = 13;
|
| static const int kInternetProtocolLockRequestIndex = 11;
|
| static const int kInternetProtocolUnlockRequestIndex = 12;
|
| +static const int kInternetProtocolAbortIndex = 5;
|
| +static const int kInternetProtocolTerminateIndex = 6;
|
|
|
|
|
| // IInternetProtocol/Ex patches.
|
| @@ -64,17 +66,29 @@
|
| ULONG* size_read);
|
|
|
| STDMETHODIMP Hook_LockRequest(InternetProtocol_LockRequest_Fn orig_req,
|
| - IInternetProtocol* protocol, DWORD dwOptions);
|
| + IInternetProtocol* protocol,
|
| + DWORD options);
|
|
|
| STDMETHODIMP Hook_UnlockRequest(InternetProtocol_UnlockRequest_Fn orig_req,
|
| IInternetProtocol* protocol);
|
|
|
| +STDMETHODIMP Hook_Abort(InternetProtocol_Abort_Fn orig_req,
|
| + IInternetProtocol* protocol,
|
| + HRESULT hr,
|
| + DWORD options);
|
| +
|
| +STDMETHODIMP Hook_Terminate(InternetProtocol_Terminate_Fn orig_req,
|
| + IInternetProtocol* protocol,
|
| + DWORD options);
|
| +
|
| /////////////////////////////////////////////////////////////////////////////
|
| BEGIN_VTABLE_PATCHES(CTransaction)
|
| VTABLE_PATCH_ENTRY(kInternetProtocolStartIndex, Hook_Start)
|
| VTABLE_PATCH_ENTRY(kInternetProtocolReadIndex, Hook_Read)
|
| VTABLE_PATCH_ENTRY(kInternetProtocolLockRequestIndex, Hook_LockRequest)
|
| VTABLE_PATCH_ENTRY(kInternetProtocolUnlockRequestIndex, Hook_UnlockRequest)
|
| + VTABLE_PATCH_ENTRY(kInternetProtocolAbortIndex, Hook_Abort)
|
| + VTABLE_PATCH_ENTRY(kInternetProtocolTerminateIndex, Hook_Terminate)
|
| END_VTABLE_PATCHES()
|
|
|
| BEGIN_VTABLE_PATCHES(CTransaction2)
|
| @@ -807,7 +821,8 @@
|
| }
|
|
|
| STDMETHODIMP Hook_LockRequest(InternetProtocol_LockRequest_Fn orig_req,
|
| - IInternetProtocol* protocol, DWORD options) {
|
| + IInternetProtocol* protocol,
|
| + DWORD options) {
|
| DCHECK(orig_req);
|
|
|
| scoped_refptr<ProtData> prot_data = ProtData::DataFromProtocol(protocol);
|
| @@ -838,6 +853,33 @@
|
| return orig_req(protocol);
|
| }
|
|
|
| +STDMETHODIMP Hook_Abort(InternetProtocol_Abort_Fn orig_req,
|
| + IInternetProtocol* protocol,
|
| + HRESULT hr,
|
| + DWORD options) {
|
| + scoped_refptr<ProtData> prot_data = ProtData::DataFromProtocol(protocol);
|
| + if (prot_data)
|
| + prot_data->Invalidate();
|
| +
|
| + // We are just pass through at this point, avoid false positive crash
|
| + // reports.
|
| + ExceptionBarrierReportOnlyModule barrier;
|
| + return orig_req(protocol, hr, options);
|
| +}
|
| +
|
| +STDMETHODIMP Hook_Terminate(InternetProtocol_Terminate_Fn orig_req,
|
| + IInternetProtocol* protocol,
|
| + DWORD options) {
|
| + scoped_refptr<ProtData> prot_data = ProtData::DataFromProtocol(protocol);
|
| + if (prot_data)
|
| + prot_data->Invalidate();
|
| +
|
| + // We are just pass through at this point, avoid false positive crash
|
| + // reports.
|
| + ExceptionBarrierReportOnlyModule barrier;
|
| + return orig_req(protocol, options);
|
| +}
|
| +
|
| // Patching / Hooking code.
|
| class FakeProtocol : public CComObjectRootEx<CComSingleThreadModel>,
|
| public IInternetProtocol {
|
|
|