Platform SDK: Performance Monitoring

Creating the Performance Extension DLL

Your application's extension DLL defines the counter and object data structures that it uses to pass performance data to performance monitoring applications. Your DLL also provides the following exported functions that are called by the system in response to requests for performance data.

Function Description
Open Initializes performance monitoring for the application.
Collect Reports performance data when requested.
Close Closes performance monitoring.

The prototypes for these functions, and the structures and constants used to define counters and counter objects, are defined in the Winperf.h file distributed with the Platform SDK.

Communication between an application and its performance DLL differs for user-mode and privileged-mode applications. The application's performance DLL executes in user mode. Because of this, user-mode applications, such as print and display applications, can use any technique for interprocess communication, such as named pipes, file mapping, or RPC. However, privileged-mode applications must provide an IOCTL interface that returns the performance data to the performance DLL.

Warning  Do not use COM as the IPC mechanism. The system cannot guarantee the COM initialization state of the thread calling the interface. Therefore, the DLL may not be able to successfully initialize COM and collect the data.