BUG: Unlodctr.exe May Exit with Error Code 2 Even Though Unloading Was Successful (269225)



The information in this article applies to:

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

This article was previously published under Q269225

SYMPTOMS

You can use Unlodctr.exe to remove performance counter names and descriptions from the registry before you delete a performance key. If Web-Based Enterprise Management (WBEM) is not installed or if the Windows Management Instrumentation (WMI) service is not running, Unlodctr.exe may report an exit code of 2 even though the performance information has been successfully unloaded.

CAUSE

After performance information is unloaded, Unlodctr.exe signals the WMI service that a performance service has been unloaded. It sends this signal by using a synchronization object. If WBEM is not installed or if the WMI service is not running, Unlodctr.exe cannot signal WMI because the synchronization object does not exist. In this case, an attempt to open the object is unsuccessful, with an error code of 2 (ERROR_FILE_NOT_FOUND). This error is propagated up and returned as an exit code from Unlodctr.exe.

Lodctr.exe does not show this same problem. Rather, Lodctr.exe silently ignores any errors that occur while signaling WMI that a performance service has been loaded.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

The command-line syntax for Unlodctr.exe is as follows:

unlodctr "Performance Service Name"

Starting Unlodctr.exe is equivalent to calling the UnloadPerfCounterTextStrings function.

When successful, Unlodctr.exe reports the following event in the application event log:

Event ID: 1001
Source:   LoadPerf
Message:  Performance counters for the <ABC> service were removed
          successfully. The Record Data contains the new values of
          the system Last Counter and Last Help registry entries.
					

It is important to note that Unlodctr.exe legitimately returns an exit code of 2 (ERROR_FILE_NOT_FOUND) if the name of the performance service that is specified in the command line does not exist in the registry. In this situation, event 1001 is not posted to the application event log.

REFERENCES

For additional information about the required parameters for the LoadPerfCounterTextStrings and UnloadPerfCounterTextStrings functions, click the article number below to view the article in the Microsoft Knowledge Base:

188769 BUG: LoadPerfCounterTextStrings Fails with Error 87


Modification Type:MajorLast Reviewed:11/3/2003
Keywords:kbbug kbGrpDSKernBase kbKernBase kbOSWin2000 kbPerfMon kbSDKWin32 KB269225 kbAudDeveloper