BUG: Perflib Event 1001 Posted Erroneously (242973)
The information in this article applies to:
- Microsoft Win32 Application Programming Interface (API), when used with:
- the operating system: Microsoft Windows NT 4.0
This article was previously published under Q242973 SYMPTOMS
When using Performance Monitor or some tool that queries performance data, the system may post an event ID 1001 for the Perflib source in the Application Event Log.
CAUSE
Windows NT checks if the buffer amount used for performance data collection is equal or greater than the buffer supplied. If so it posts the event. However, it should post the event if the buffer amount used only exceeds the buffer amount supplied.
RESOLUTION
There are two approaches to resolve to this problem.
If you do not have any control of the named performance monitoring extension that causes the event log error use this workaround. A custom performance monitoring tool can supply a buffer that is more than necessary for the data collection. For example, if the amount of buffer used when collecting performance data is 1028 bytes, it should supply a buffer a little larger than that. Providing a buffer size of the precisely the necessary size may cause the problem. Note that Performance Monitor that comes with Windows NT would rarely use a buffer of precise size.
If you are the author of the performance monitoring extension use this workaround. Modify the performance monitoring extension when checking for available buffer size in the Collect procedure. The event occurs if a performance monitor extension returns status ERROR_SUCCESS if the supplied buffer amount is equal to the needed buffer space. To workaround the problem, the extension can be written to return ERROR_MORE_DATA if the supplied buffer amount is less than or equal to the needed buffer space.
An example of this workaround would be to have the following code in the Collect procedure of the performance monitoring extension.
if ( *lpcbTotalBytes <= SpaceNeeded ) {
*lpcbTotalBytes = (DWORD) 0;
*lpNumObjectTypes = (DWORD) 0;
return ERROR_MORE_DATA;
}
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Windows 2000. REFERENCES
Platform SDK;Windows Base Services;Performance Monitoring;Performance Data;Adding Performance Counters
Modification Type: | Major | Last Reviewed: | 10/23/2003 |
---|
Keywords: | kbbug kbKernBase kbpending kbPerfMon KB242973 |
---|
|