views:

40

answers:

1

Greetings all,

I have a pointer to a COM object that implements an undocumented interface. I would really, really like to be able to use said interface. All I have is the IID though. Master software analyst Geoff Chappell has documented a host of these undocumented COM interfaces on his site; see IListView for example. Somehow he even managed to get the function names and signatures. How is something like that even possible? Are they guesses?

Can someone point me in the right direction as to how I would go about something like this? I know the risks of using anything undocumented.

EDIT: To elaborate, the object I'm interested in is ExplorerFrame.dll's notoriously undocumented ItemsView. By setting an API hook on CoCreateInstance, I can see that the object is created with a certain undocumented IID as its main interface. I'm assuming this is the interface that through which the control is manipulated, hence my interest in figuring out its members.

A: 

If your pointer impls IDispatch (which is quite likely) you can QueryInterface for that and then GetIDsOfNames. You likely end up guessing what interfaces it might use and calling QI just to see what works :)

seand
Sadly, it does not implement IDispatch. Urgh, that sounds like a really useful function too...
Paul Accisano
You might just have to do trial and error; if you have a guess of what it could be, QI for it and see if it says yes.
seand
QueryInterface(IID_IDispatch) returns E_NOINTERFACE. But, I already know what the interface is; what I don't know is the methods it defines or what their params are. I guess I could just start calling them with random params and see what crashes and what doesn't, but I'm hoping there's a more civilized way...
Paul Accisano
Good luck. Yep you can try calling into the various vtable positions and see what happens. With a debugger you should be able to see the functions clean the stack which will help you deduce the param count. I once wrote a COM vtable interceptor so I've been involved in craziness before.
seand