Recipe6.10.Viewing the APIs Called by a Process


Recipe 6.10. Viewing the APIs Called by a Process

Problem

You want to view the application programming interfaces (APIs) that a particular process invokes while running. This is useful for application developers who need to troubleshoot programs, but it can also be useful to system administrators who want to dig into the internals of a troublesome application.

Solution

Using a graphical user interface

  1. Open the API Monitoring tool (apimon.exe) from the Windows 2000 Resource Kit.

  2. From the menu, select File

    Browse to the executable you want to monitor and click OK.

  3. From the menu, select Tools DLLs In Use window and API Counters window. The API information will continue to be collected until you stop it.

  4. From the menu, select Tools Discussion

    If you have any Unix experience, you may be familiar with the truss utility. With truss, you can view all the system calls and APIs that a particular process is calling. Having this capability can be extremely beneficial when you are trying to debug why a particular application is failing or not behaving correctly. API Monitor provides similar functionality on the Windows platform. It displays the DLLs loaded by the target process, each function it calls, the number of times it calls a function, and the amount of time it took for each function call to complete.

    If the API Monitor is the kind of thing that gets you excited, then you'll want to take a look at the Dependency Walker (depends.exe) in the Support Tools, which provides even more information.



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net