The information in this article applies to:
SYMPTOMSExpandEnvironmentStringsA, the ANSI version of ExpandEnvironmentStrings, returns twice the number of bytes that are in the string. For example, if the string is 10 characters long, ExpandEnvironmentStringsA returns 20. In fact, ExpandEnvironmentStringsA returns the Unicode byte count, not the ANSI byte count. RESOLUTIONTo work around this bug, you can determine the real length of the string by using lstrlenA(). Because ExpandEnvironmentStringsA returns a count that includes the trailing NULL, be sure to add 1 (one) to the count returned by lstrlenA(). STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATIONThe following code demonstrates how to reproduce and detect this behavior:
Additional query words: environment variables expand
Keywords : kbAPI kbKernBase kbSDKWin32 kbDSupport kbGrpKernBase |
Last Reviewed: December 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |