Microsoft KB Archive/269225

{|
 * width="100%"|

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

 * }

Q269225

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API)

-

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 this to be a bug in the Microsoft products listed at the beginning of this article.

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

"unlodctr &quot;Performance Service Name&quot;" 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  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.