Patent ID: 7784034

Claim:
A method for hooking a component object model (COM) interface comprising: receiving an identifier for a COM interface to be hooked; creating and executing a worker thread; wherein executing said worker thread comprises: generating a COM apartment model comprising: invoking a CoInitialize function to initialize a COM library and identify a concurrency model as a single-thread apartment; and invoking a CoCreateInstance to identify matching values for each COM interface of a plurality of COM interfaces; wherein said matching values include both a matching class identifier (CLSID) and an interface identifier (IID); determining one of said plurality of COM interfaces that matches the CLSID and IID of said COM interface to be hooked; wherein further comprising in response to said determining: identifying a virtual table (vtable) for said one of said plurality of COM interfaces; identifying an entry associated with an interface function from said vtable; and identifying an address of the interface function to which said entry points; hooking said one of said plurality of COM interfaces by hooking said interface function at said identified address; and performing a function based on said hooking of said interface function.