- Change MultiByteToWideChar to match windows behavior. Fix part 1 of ? for bug #3740.

svn path=/trunk/; revision=39301
This commit is contained in:
Michael Martin 2009-02-03 09:09:06 +00:00
parent edf41d63c7
commit 0c9316bd54

View file

@ -523,6 +523,14 @@ IntMultiByteToWideCharCP(UINT CodePage,
if (WideCharCount == 0)
return MultiByteCount;
/* Fill the WideCharString buffer with what will fit: Verified on WinXP */
for (TempLength = (WideCharCount < MultiByteCount) ? WideCharCount : MultiByteCount;
TempLength > 0;
MultiByteString++, TempLength--)
{
*WideCharString++ = CodePageTable->MultiByteTable[(UCHAR)*MultiByteString];
}
/* Adjust buffer size. Wine trick ;-) */
if (WideCharCount < MultiByteCount)
{
@ -530,14 +538,6 @@ IntMultiByteToWideCharCP(UINT CodePage,
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return 0;
}
for (TempLength = MultiByteCount;
TempLength > 0;
MultiByteString++, TempLength--)
{
*WideCharString++ = CodePageTable->MultiByteTable[(UCHAR)*MultiByteString];
}
return MultiByteCount;
}
}