Closed GoogleCodeExporter closed 9 years ago
What do you mean by "update hook" ?
Original comment by ismspi...@gmail.com
on 23 Jan 2015 at 7:45
I receive the same com object multiple times so if i only patch it once not all
events get received! It seems that library not patch the vtable? This StartEx
function get called multiple time.
So have to patch it multiple times but then i get error:
First chance exception at $75514598. Exception class Exception with message
'Exceed maximum allowed of hooks.'. Process Project.exe (7832)
Example:
class function TMonitor.StartEx(Self: IInternetProtocolRoot; Uri: IUri;
OIProtSink: IInternetProtocolSink; OIBindInfo: IInternetBindInfo; grfPI,
dwReserved: DWORD): HResult; stdcall;
begin
BeginHooks();
@Monitor.FSwitch := InterceptCreate(OIProtSink, 3, @TInternetProtocolSink.Switch);
@Monitor.FReportProgress := InterceptCreate(OIProtSink, 4, @TInternetProtocolSink.ReportProgress);
@Monitor.FReportData := InterceptCreate(OIProtSink, 5, @TInternetProtocolSink.ReportData);
@Monitor.FReportResult := InterceptCreate(OIProtSink, 6, @TInternetProtocolSink.ReportResult);
@Monitor.FGetBindString := InterceptCreate(OIBindInfo, 4, @TInternetBindInfo.GetBindString);
@Monitor.FGetBindInfo := InterceptCreate(OIBindInfo, 3, @TInternetBindInfo.GetBindInfo);
EndHooks();
Monitor.FInternetProtocolRoot := Self;
Monitor.FInternetProtocolSink := OIProtSink;
Monitor.FInternetBindInfo := OIBindInfo;
OIProtSink.QueryInterface(IServiceProvider, Monitor.FServiceProvider);
Result := Monitor.FStartEx(Self, Uri, OIProtSink, OIBindInfo, grfPI, dwReserved);
end;
Original comment by david.lo...@gmail.com
on 23 Jan 2015 at 7:48
<if i only patch it once not all events get received!
Please provide more details about this point.
<It seems that library not patch the vtable?
Yes the library does not patch the vtable.It patch the method inside the class
that implement the interface.
<So have to patch it multiple times but then i get error:
You don't need to do that .Once the hook is installed, the intercept proc will
get fired every time the original method is called.
Original comment by ismspi...@gmail.com
on 23 Jan 2015 at 8:01
If I provide my own IInternetProtocolSink all events get fired all the time.
But if I patch the original IInternetProtocolSink (OIProtSink) not all events
get fired.
Original comment by david.lo...@gmail.com
on 23 Jan 2015 at 8:04
I will send you project on email for verify. :)
Original comment by david.lo...@gmail.com
on 23 Jan 2015 at 8:06
Can you include the full example ?
Original comment by ismspi...@gmail.com
on 23 Jan 2015 at 8:06
Ok
Original comment by ismspi...@gmail.com
on 23 Jan 2015 at 8:07
Original comment by ismspi...@gmail.com
on 23 Jan 2015 at 9:29
Original issue reported on code.google.com by
david.lo...@gmail.com
on 23 Jan 2015 at 7:15