user3066515
user3066515

Reputation: 107

Debugging system/ole dll in windows

How do we debug a system dll in windows? say my application is using a third party dll that uses a system dll, and I want to know what exact params the third party dll is passing down to the system dll apis.

example, say myapp.exe uses a third party dll called xyz-wmi.dll which makes api call to SWbemLocator.ConnectServer which happens to be in Wbemdisp.dll.

I want to check what exact params are passed to SWbemLocator.ConnectServer in Wbemdisp.dll.

Is there a way to set breakpoint in function SWbemLocator.ConnectServer from Wbemdisp.dll and check params in debugger? How to do this?

Upvotes: 1

Views: 482

Answers (2)

buttercup
buttercup

Reputation: 1116

Please call:

CoInitializeEx(nil, COINIT_MULTITHREADED); // Added

WMIService = SWbemLocator.ConnectServer('localhost','root\CIMV2', '', '');

if calling WMI inside a DLL

Upvotes: 0

Alois Kraus
Alois Kraus

Reputation: 13545

Use ApiMonitor which can intercept nearly any Windows API. You can check out: http://www.rohitab.com/apimonitor

It has also support for COM Api monitoring which is exactly you are after. It can also set a breakpoint when specific values are passed to an API which makes it very easy to use in conjunction with a debugger.

Upvotes: 2

Related Questions