Microsoft KB Archive/296481

From BetaArchive Wiki
Knowledge Base


INFO: Export Registry Value Type for a Performance Extension DLL

Article ID: 296481

Article Last Modified on 11/21/2006



APPLIES TO

  • Microsoft Win32 Application Programming Interface, when used with:
    • Microsoft Windows 2000 Standard Edition
    • Microsoft Windows XP Professional



This article was previously published under Q296481

SUMMARY

This article describes the registry value that is retrieved by the operating system and passed to the Open function of a performance extension DLL.

MORE INFORMATION

The Performance Library (PerfLib), which is contained within the system file Advapi32.dll, is responsible for calling the Open function of a performance extension DLL. PerfLib calls the Open function within a performance extension DLL when an application first connects to the registry to collect performance data. This Open function typically performs the initialization required for the library to provide performance data.

The following is the function prototype for the exported Open function in a performance extension DLL:

DWORD CALLBACK <OpenPerformanceData>(LPWSTR lpDeviceNames);

where the name <OpenPerformanceData> is merely a placeholder for an application-defined name.


When the system calls this Open function, the lpDeviceNames argument will point to a buffer containing the Unicode strings that are stored in the Export value within the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Application_Name\Linkage


On Microsoft Windows NT 4.0, PerfLib accepts any registry type for the Export value. However, on Microsoft Windows 2000 and Microsoft Windows XP, the type of the Export value must be either REG_SZ or REG_MULTI_SZ. If there are multiple strings, they should be separated by a UNICODE_NULL and terminated by two UNICODE_NULL characters. If the Export value does not conform to this specification on Windows 2000 and Windows XP, the Open procedure of a performance extension DLL will be called with NULL for the lpDeviceNames parameter.

REFERENCES

See the Platform SDK Documentation for Performance Monitoring in the MSDN Online Library:

Keywords: kbapi kbinfo kbkernbase kbperfmon KB296481