You are currently offline, waiting for your internet to reconnect

Controlling the disabling of Performance Monitor extensions

This article was previously published under Q249138

When developing and debugging your Performance Monitor extensible counter on Microsoft Windows 2000 and Microsoft Windows XP, you may find that the system automatically disables it. This article provides information about how to configure the registry to disable this feature during the development of your extensible counter.
In versions of Windows NT prior to Windows 2000 and Windows XP, one bad or defective performance DLL is able to render the performance monitoring features of the operating system inoperative. To maintain the integrity of the performance data and to improve the reliability of Windows 2000 and WIndows XP, the performance library disables any performance DLL that returns data in the incorrect format, that causes an unhandled program fault, or that takes too long to return the performance data (this is usually the cause of a library being disabled).

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
248993 Performance object is not displayed in Performance Monitor
This feature can affect the development of your performance extension DLL. The system will mark your extensible counter DLL as disabled because you are taking time to single-step through the Collect procedure in a debugger.

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows

To control this feature, set a REG_DWORD value named Configuration Flags in:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\PerflibIf this value is not present, you can add it. The following lists the values and their meanings:
0x00 - Test for data buffer alignment errors.
0x01 - Do not test for data buffer alignment errors. Suppresses 1016 event.
0x02 - Do not disable DLLs when a critical error occurs but still post the events.
0x04 - Disable all perf counter function testing regardless of testing level. Critical errors will still disable DLLs.
0x08 - Enable the disabling of DLLs if timeouts are exceeded. Normally only other critical errors would disable DLLs.
0x10 - Enable the collection of statistics for each performance DLL. This is the default of Configuration Flags, if the value is not present.
These values can be combined by adding or using the bitwise OR operator. For example, a combination of 0x08 and 0x02 is 0x0A. However, some values may override other values. For example, if the value is set to 0x0A, a combination of 0x08 and 0x02, then 0x02 will overrule.

A specific example of using the Configuration Flags registry value when you have to single-step debug the performance extension is to set it to 0x02.

The change in this registry value takes effect after restarting the process that is collecting performance data, such as Performance Monitor.

In the earlier list of values, there are references to event log messages and the ExtCounterTestLevel registry value.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
226494 Events for Performance Monitor extensions
For more information about implementing extensible counters, see the Platform SDK documentation in Base Services:
Performance Monitoring; Performance Monitoring; Using Performance Monitoring; Using Registry Interface; Adding Performance Counters.

Article ID: 249138 - Last Review: 11/21/2006 15:28:39 - Revision: 5.3

Microsoft Win32 Application Programming Interface

  • kbapi kbinfo kbkernbase kbperfmon KB249138