Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

79 lines
1.4 KiB

/*++
Copyright (c) 2001 Microsoft Corporation
Module Name:
CorelDraw9JPN.cpp
Abstract:
The App has some RTF files, seems the font and charset specified not correct
in it. When later on riched20 do ANSI-Unicode Code conversion, it used
English code-page. Fix this by checking the 1st parameter passed to
MultiByteToWideChar by richedit, if it's English, try to use CP_ACP, which
is always safe.
Notes:
This is an app specific shim.
History:
05/10/2001 xiaoz Created
--*/
#include "precomp.h"
IMPLEMENT_SHIM_BEGIN(CorelDraw9JPN)
#include "ShimHookMacro.h"
APIHOOK_ENUM_BEGIN
APIHOOK_ENUM_ENTRY(MultiByteToWideChar)
APIHOOK_ENUM_END
/*++
Correct the code page if required.
--*/
int
APIHOOK(MultiByteToWideChar)(
UINT CodePage,
DWORD dwFlags,
LPCSTR lpMultiByteStr,
int cbMultiByte,
LPWSTR lpWideCharStr,
int cchWideChar
)
{
if (1252 == CodePage) {
//
// Change the code page
//
CodePage = CP_ACP;
LOGN(eDbgLevelWarning, "Code page corrected");
}
return ORIGINAL_API(MultiByteToWideChar)(CodePage, dwFlags, lpMultiByteStr,
cbMultiByte, lpWideCharStr, cchWideChar);
}
/*++
Register hooked functions
--*/
HOOK_BEGIN
APIHOOK_ENTRY(KERNEL32.DLL, MultiByteToWideChar)
HOOK_END
IMPLEMENT_SHIM_END