Controlling the disabling of Performance Monitor extensions (249138)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows XP

This article was previously published under Q249138

SUMMARY

Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry



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.

MORE INFORMATION

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.

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.
To control this feature, set a REG_DWORD value named Configuration Flags in: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Perflib If 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

REFERENCES

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.


Modification Type:MajorLast Reviewed:7/19/2005
Keywords:kbAPI kbinfo kbKernBase kbPerfMon KB249138