The information in this article applies to:
SYMPTOMSA 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. RESOLUTIONBecause 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 this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATION
When using RegQueryValueEx to query performance data, exactly how much buffer space is needed for the data is not known. To determine how much space is needed, an arbitrary buffer size is tried and if RegQueryValueEx returns ERROR_MORE_DATA, a larger buffer is tried until RegQueryValueEx does not return ERROR_MORE_DATA.
When RegQueryValueEx requires an application to provide a larger buffer, it is supposed to return ERROR_MORE_DATA but not change the value in BufferSize.When the bug occurs, RegQueryValueEx returns ERROR_MORE_DATA and also modifies the value in BufferSize to the original value divided by two, thus, if BYTEINCREMENT is less than the half the original value of BufferSize, then the loop will repeat endlessly and converge the BufferSize value to two times BYTEINCREMENT. REFERENCESFor more information on Windows NT Performance data see the Platform SDK Documentation in Windows Base Services, Performance Monitoring. Additional query words: bug hang corrupt
Keywords : kbAPI kbKernBase kbRegistry kbfaq kbDSupport kbGrpKernBase |
Last Reviewed: January 3, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |