Article ID: 941089 - Last Review: September 21, 2007 - Revision: 1.3

FIX: The MultiByteToWideChar function returns an unexpected value on a Windows CE .NET 4.2-based device

On This Page

Expand all | Collapse all

SYMPTOMS

Consider the following scenario. On a Microsoft Windows CE .NET 4.2-based device, you call the MultiByteToWideChar function in your code. You set the value of the fourth parameter of the MultiByteToWideChar function to -1. In this scenario, the MultiByteToWideChar function returns an unexpected value.

For example, you run the following code on the Windows CE .NET 4.2-based device.
#define GB18030_CODEPAGE	(54936)
#define CHARSTR1		("abc")
len = MultiByteToWideChar(GB18030_CODEPAGE, 0, CHARSTR1, -1, NULL, 0);
You expect the MultiByteToWideChar function to return a value of 4 for the len variable. However, the MultiByteToWideChar function returns a value of 3 for the len variable.

RESOLUTION

Software update information

A supported software update is now available from Microsoft as Windows CE .NET 4.2 Platform Builder Monthly Update (September 2007). You can confirm this by scrolling to the "File information" section of this article. The package file name contains the product version, date, Knowledge Base article number, and processor type. The package file name format is:
Product version-yymmdd-kbnnnnnn-processor type
For example: Wincepb50-060503-kb917590-armv4i.msi is the ARMV4i Windows CE 5.0 Platform Builder fix that is documented in KB article 917590 and that is contained in the May 2006 monthly update. To resolve this problem immediately, click the following article number for information about obtaining Windows CE Platform Builder and core operating system software updates:
837392  (http://support.microsoft.com/kb/837392/ ) How to locate core operating system fixes for Microsoft Windows CE Platform Builder products

Prerequisites

This update is supported only if all previously issued updates for this product are also installed.

Restart requirement

After you apply this update, you must perform a clean build of the whole platform. To clean the platform, click Clean on the Build menu. To build the platform, click Build Platform on the Build menu. You do not have to restart the computer after you apply this update.

Update replacement information

This update does not replace any other updates.

File information

The English version of this package has the file attributes (or later file attributes) that are listed in the following table.
Collapse this tableExpand this table
File nameFile sizeDateTime
Wincepb42-070907-kb941089-armv4.msi7,685,12007-Sep-200721:35
Wincepb42-070907-kb941089-armv4i.msi7,685,12007-Sep-200721:35
Wincepb42-070907-kb941089-mipsii.msi7,686,65607-Sep-200721:35
Wincepb42-070907-kb941089-mipsii_fp.msi7,686,65607-Sep-200721:35
Wincepb42-070907-kb941089-mipsiv.msi7,686,65607-Sep-200721:35
Wincepb42-070907-kb941089-mipsiv_fp.msi7,686,65607-Sep-200721:35
Wincepb42-070907-kb941089-sh3.msi7,684,09607-Sep-200721:35
Wincepb42-070907-kb941089-sh4.msi7,684,09607-Sep-200721:35
Wincepb42-070907-kb941089-x86.msi7,682,04807-Sep-200721:35
The English version of this update has the file attributes (or later file attributes) 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 item in Control Panel.
Collapse this tableExpand this table
File nameFile sizeDateTimePath
Gb18030.lib246,64217-Aug-200722:26public\common\oak\lib\armv4\debug
Gb18030.lib241,85217-Aug-200722:26public\common\oak\lib\armv4\retail
Gb18030.lib246,67617-Aug-200722:26public\common\oak\lib\armv4i\debug
Gb18030.lib241,88017-Aug-200722:26public\common\oak\lib\armv4i\retail
Gb18030.lib245,56617-Aug-200722:26public\common\oak\lib\mipsii\debug
Gb18030.lib242,59017-Aug-200722:26public\common\oak\lib\mipsii\retail
Gb18030.lib245,58617-Aug-200722:26public\common\oak\lib\mipsii_fp\debug
Gb18030.lib242,60217-Aug-200722:26public\common\oak\lib\mipsii_fp\retail
Gb18030.lib246,09817-Aug-200722:26public\common\oak\lib\mipsiv\debug
Gb18030.lib243,26017-Aug-200722:26public\common\oak\lib\mipsiv\retail
Gb18030.lib246,11817-Aug-200722:26public\common\oak\lib\mipsiv_fp\debug
Gb18030.lib243,27217-Aug-200722:26public\common\oak\lib\mipsiv_fp\retail
Gb18030.lib242,09417-Aug-200722:26public\common\oak\lib\sh3\debug
Gb18030.lib238,98217-Aug-200722:26public\common\oak\lib\sh3\retail
Gb18030.lib242,09417-Aug-200722:26public\common\oak\lib\sh4\debug
Gb18030.lib238,95817-Aug-200722:26public\common\oak\lib\sh4\retail
Gb18030.lib240,51417-Aug-200722:26public\common\oak\lib\x86\debug
Gb18030.lib237,71217-Aug-200722:26public\common\oak\lib\x86\retail

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information about the MultiByteToWideChar function, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/ms961248.aspx (http://msdn2.microsoft.com/en-us/library/ms961248.aspx)
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684  (http://support.microsoft.com/kb/824684/LN/ ) Description of the standard terminology that is used to describe Microsoft software updates

APPLIES TO
  • Microsoft Windows CE .NET 4.2
Keywords: 
kbexpertiseadvanced kbfix kbpubtypekc kbqfe KB941089
 

Article Translations