BUG: ANSI Version of RegQueryValueEx Can Cause Application Hang (226371)
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 Q226371 SYMPTOMS
A Win32 application calling the ANSI version of RegQueryValueEx Win32 API with HKEY_PERFORMANCE_DATA can return incorrect information for lpcbData, the sixth parameter. In a buffer size retry loop, this can cause an application to stop responding. Because Dr. Watson for Windows NT and the TLIST sample from the Platform SDK both enumerate processes by querying performance data using the ANSI version of RegQueryValueEx, these tools may exhibit this symptom.
RESOLUTION
Because the performance data block returned by RegQueryValueExA is the same as RegQueryValueExW (Unicode version), the best resolution is to call RegQueryValueExW directly, even from an ANSI build of an application. The problem does not occur in the Unicode version of RegQueryValueEx. This requires passing a Unicode string for lpValueName, the second parameter of RegQueryValueEx.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCES
For more information on Windows NT Performance data see the Platform SDK Documentation in Windows Base Services, Performance Monitoring.
Modification Type: | Major | Last Reviewed: | 10/23/2003 |
---|
Keywords: | kbAPI kbbug kbFAQ kbfix kbKernBase kbRegistry KB226371 |
---|
|