FIX: ExpandEnvironmentStringsA Returns Wrong Byte Count (234874)
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 Q234874 SYMPTOMSExpandEnvironmentStringsA, which is the ANSI version of ExpandEnvironmentStrings, returns double the number of bytes that are in the string. For example, if the string is 10 characters long, ExpandEnvironmentStringsA returns 20 characters. In fact, ExpandEnvironmentStringsA returns the Unicode byte count, instead of returning the ANSI byte count.
RESOLUTIONA supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem. To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site: Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Date Time Size File name
--------------------------------------------
15-Mar-2002 17:59 68,415 File1.htc
02-Mar-2002 18:52 32,333 File2.asp
Workaround
To work around this issue, 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 that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 10/19/2005 |
---|
Keywords: | kbHotfixServer kbQFE kbAPI kbbug kbfix kbKernBase KB234874 |
---|
|