Retrieves the execution statistics for the current context.
A pointer to a DWORD that contains the current notification.
A pointer to a DWORD that contains the tick count for the start of the current notification.
A pointer to a string that contains the name of the current module.
A pointer to a DWORD that contains the tick count for the start of the current module.
A pointer to a DWORD that contains the current asynchronous notification.
A pointer to a DWORD that contains the tick count for the start of an asynchronous notification.
An HRESULT. Possible values include, but are not limited to, those in the following table.
Indicates that the operation was successful.
Indicates that a specified parameter is not valid.
Developers can use the GetCurrentExecutionStats method to retrieve specific execution information for the current context. For example, the pdwNotification and pdwAsyncNotification parameters contain the values for the current synchronous or asynchronous notification, and the ppszModule parameter contains the name of the module for the current context.
Three of the return parameters, pdwModuleStartTickCount, pdwNotificationStartTickCount, and pdwAsyncNotificationStartTickCount, respectively, contain the tick counts for the start of the module and the start of the current synchronous and asynchronous notifications.
The tick count is the number of milliseconds that have elapsed since the system was started. For more information about retrieving tick counts, see the GetTickCount method.
The following code example demonstrates how to create an HTTP module that performs the following tasks:
When a Web client requests a URL, IIS calls the module's OnBeginRequest, OnMapRequestHandler, and OnSendResponse methods. Each of these methods calls a private method named RetrieveExecutionStats that performs the following tasks:
Retrieves the execution statistics by using the GetCurrentExecutionStats method and tests for an error.
Creates a string that contains the tick count for the start of the current notification.
Pauses for one second.
Creates a string that contains the elapsed tick count from the start of the current notification.
Writes the execution statistics as an event to the application log of the Event Viewer.
The module removes the CHttpModule class from memory and then exits.