ReactOS 0.4.16-dev-329-g9223134
mlang.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "ole2.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "mlang.h"
#include "mimeole.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "initguid.h"
Include dependency graph for mlang.c:

Go to the source code of this file.

Classes

struct  MIME_CP_INFO
 
struct  mlang_data
 
struct  font_list
 
struct  IClassFactoryImpl
 
struct  object_creation_info
 
struct  tagMLang_impl
 
struct  tagEnumCodePage_impl
 
struct  tagEnumScript_impl
 
struct  tagEnumRfc1766_impl
 
struct  enum_locales_data
 
struct  convert_charset
 

Macros

#define COBJMACROS
 
#define HANKATA(A)   ((A >= 161) && (A <= 223))
 
#define ISEUC(A)   ((A >= 161) && (A <= 254))
 
#define NOTEUC(A, B)   (((A >= 129) && (A <= 159)) && ((B >= 64) && (B <= 160)))
 
#define SJIS1(A)   (((A >= 129) && (A <= 159)) || ((A >= 224) && (A <= 239)))
 
#define SJIS2(A)   ((A >= 64) && (A <= 252))
 
#define ISMARU(A)   ((A >= 202) && (A <= 206))
 
#define ISNIGORI(A)   (((A >= 182) && (A <= 196)) || ((A >= 202) && (A <= 206)))
 

Typedefs

typedef struct tagMLang_impl MLang_impl
 
typedef struct tagEnumCodePage_impl EnumCodePage_impl
 
typedef struct tagEnumScript_impl EnumScript_impl
 
typedef struct tagEnumRfc1766_impl EnumRfc1766_impl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mlang)
 
static HRESULT MultiLanguage_create (IUnknown *pUnkOuter, LPVOID *ppObj)
 
static HRESULT MLangConvertCharset_create (IUnknown *outer, void **obj)
 
static HRESULT EnumRfc1766_create (LANGID LangId, IEnumRfc1766 **ppEnum)
 
static void fill_cp_info (const struct mlang_data *ml_data, UINT index, MIMECPINFO *mime_cp_info)
 
static UINT DetectJapaneseCode (LPCSTR input, DWORD count)
 
static void jis2sjis (unsigned char *p1, unsigned char *p2)
 
static void sjis2jis (unsigned char *p1, unsigned char *p2)
 
static int han2zen (unsigned char *p1, unsigned char *p2)
 
static UINT ConvertJIS2SJIS (LPCSTR input, DWORD count, LPSTR output)
 
static int exit_shift (LPSTR out, int c)
 
static int enter_shift (LPSTR out, int c)
 
static UINT ConvertSJIS2JIS (LPCSTR input, DWORD count, LPSTR output)
 
static UINT ConvertJISJapaneseToUnicode (LPCSTR input, DWORD count, LPWSTR output, DWORD out_count)
 
static UINT ConvertUnknownJapaneseToUnicode (LPCSTR input, DWORD count, LPWSTR output, DWORD out_count)
 
static UINT ConvertJapaneseUnicodeToJIS (LPCWSTR input, DWORD count, LPSTR output, DWORD out_count)
 
static void LockModule (void)
 
static void UnlockModule (void)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 
HRESULT WINAPI ConvertINetMultiByteToUnicode (LPDWORD pdwMode, DWORD dwEncoding, LPCSTR pSrcStr, LPINT pcSrcSize, LPWSTR pDstStr, LPINT pcDstSize)
 
HRESULT WINAPI ConvertINetUnicodeToMultiByte (LPDWORD pdwMode, DWORD dwEncoding, LPCWSTR pSrcStr, LPINT pcSrcSize, LPSTR pDstStr, LPINT pcDstSize)
 
HRESULT WINAPI ConvertINetString (LPDWORD pdwMode, DWORD dwSrcEncoding, DWORD dwDstEncoding, LPCSTR pSrcStr, LPINT pcSrcSize, LPSTR pDstStr, LPINT pcDstSize)
 
static HRESULT GetFamilyCodePage (UINT uiCodePage, UINT *puiFamilyCodePage)
 
HRESULT WINAPI IsConvertINetStringAvailable (DWORD dwSrcEncoding, DWORD dwDstEncoding)
 
static HRESULT lcid_to_rfc1766A (LCID lcid, LPSTR rfc1766, INT len)
 
static HRESULT lcid_to_rfc1766W (LCID lcid, LPWSTR rfc1766, INT len)
 
HRESULT WINAPI LcidToRfc1766A (LCID lcid, LPSTR pszRfc1766, INT nChar)
 
HRESULT WINAPI LcidToRfc1766W (LCID lcid, LPWSTR pszRfc1766, INT nChar)
 
static HRESULT lcid_from_rfc1766 (IEnumRfc1766 *iface, LCID *lcid, LPCWSTR rfc1766)
 
HRESULT WINAPI Rfc1766ToLcidW (LCID *pLocale, LPCWSTR pszRfc1766)
 
HRESULT WINAPI Rfc1766ToLcidA (LCID *lcid, LPCSTR rfc1766A)
 
static HRESULT map_font (HDC hdc, DWORD codepages, HFONT src_font, HFONT *dst_font)
 
static HRESULT release_font (HFONT font)
 
static HRESULT clear_font_cache (void)
 
static IClassFactoryImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI MLANGCF_QueryInterface (IClassFactory *iface, REFIID riid, void **ppobj)
 
static ULONG WINAPI MLANGCF_AddRef (IClassFactory *iface)
 
static ULONG WINAPI MLANGCF_Release (IClassFactory *iface)
 
static HRESULT WINAPI MLANGCF_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
 
static HRESULT WINAPI MLANGCF_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
static EnumCodePage_implimpl_from_IEnumCodePage (IEnumCodePage *iface)
 
static HRESULT WINAPI fnIEnumCodePage_QueryInterface (IEnumCodePage *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI fnIEnumCodePage_AddRef (IEnumCodePage *iface)
 
static ULONG WINAPI fnIEnumCodePage_Release (IEnumCodePage *iface)
 
static HRESULT WINAPI fnIEnumCodePage_Clone (IEnumCodePage *iface, IEnumCodePage **ppEnum)
 
static HRESULT WINAPI fnIEnumCodePage_Next (IEnumCodePage *iface, ULONG celt, PMIMECPINFO rgelt, ULONG *pceltFetched)
 
static HRESULT WINAPI fnIEnumCodePage_Reset (IEnumCodePage *iface)
 
static HRESULT WINAPI fnIEnumCodePage_Skip (IEnumCodePage *iface, ULONG celt)
 
static HRESULT EnumCodePage_create (MLang_impl *mlang, DWORD grfFlags, LANGID LangId, IEnumCodePage **ppEnumCodePage)
 
static EnumScript_implimpl_from_IEnumScript (IEnumScript *iface)
 
static HRESULT WINAPI fnIEnumScript_QueryInterface (IEnumScript *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI fnIEnumScript_AddRef (IEnumScript *iface)
 
static ULONG WINAPI fnIEnumScript_Release (IEnumScript *iface)
 
static HRESULT WINAPI fnIEnumScript_Clone (IEnumScript *iface, IEnumScript **ppEnum)
 
static HRESULT WINAPI fnIEnumScript_Next (IEnumScript *iface, ULONG celt, PSCRIPTINFO rgelt, ULONG *pceltFetched)
 
static HRESULT WINAPI fnIEnumScript_Reset (IEnumScript *iface)
 
static HRESULT WINAPI fnIEnumScript_Skip (IEnumScript *iface, ULONG celt)
 
static HRESULT EnumScript_create (MLang_impl *mlang, DWORD dwFlags, LANGID LangId, IEnumScript **ppEnumScript)
 
static MLang_implimpl_from_IMLangFontLink (IMLangFontLink *iface)
 
static HRESULT WINAPI fnIMLangFontLink_QueryInterface (IMLangFontLink *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI fnIMLangFontLink_AddRef (IMLangFontLink *iface)
 
static ULONG WINAPI fnIMLangFontLink_Release (IMLangFontLink *iface)
 
static HRESULT WINAPI fnIMLangFontLink_GetCharCodePages (IMLangFontLink *iface, WCHAR ch_src, DWORD *codepages)
 
static HRESULT WINAPI fnIMLangFontLink_GetStrCodePages (IMLangFontLink *iface, const WCHAR *src, LONG src_len, DWORD priority_cp, DWORD *codepages, LONG *ret_len)
 
static HRESULT WINAPI fnIMLangFontLink_CodePageToCodePages (IMLangFontLink *iface, UINT codepage, DWORD *codepages)
 
static HRESULT WINAPI fnIMLangFontLink_CodePagesToCodePage (IMLangFontLink *iface, DWORD codepages, UINT def_codepage, UINT *codepage)
 
static HRESULT WINAPI fnIMLangFontLink_GetFontCodePages (IMLangFontLink *iface, HDC hdc, HFONT hfont, DWORD *codepages)
 
static HRESULT WINAPI fnIMLangFontLink_MapFont (IMLangFontLink *iface, HDC hDC, DWORD dwCodePages, HFONT hSrcFont, HFONT *phDestFont)
 
static HRESULT WINAPI fnIMLangFontLink_ReleaseFont (IMLangFontLink *iface, HFONT hFont)
 
static HRESULT WINAPI fnIMLangFontLink_ResetFontMapping (IMLangFontLink *iface)
 
static MLang_implimpl_from_IMultiLanguage (IMultiLanguage *iface)
 
static HRESULT WINAPI fnIMultiLanguage_QueryInterface (IMultiLanguage *iface, REFIID riid, void **obj)
 
static ULONG WINAPI fnIMultiLanguage_AddRef (IMultiLanguage *iface)
 
static ULONG WINAPI fnIMultiLanguage_Release (IMultiLanguage *iface)
 
static HRESULT WINAPI fnIMultiLanguage_GetNumberOfCodePageInfo (IMultiLanguage *iface, UINT *cp)
 
static HRESULT WINAPI fnIMultiLanguage_GetCodePageInfo (IMultiLanguage *iface, UINT uiCodePage, PMIMECPINFO pCodePageInfo)
 
static HRESULT WINAPI fnIMultiLanguage_GetFamilyCodePage (IMultiLanguage *iface, UINT cp, UINT *family_cp)
 
static HRESULT WINAPI fnIMultiLanguage_EnumCodePages (IMultiLanguage *iface, DWORD grfFlags, IEnumCodePage **ppEnumCodePage)
 
static HRESULT WINAPI fnIMultiLanguage_GetCharsetInfo (IMultiLanguage *iface, BSTR Charset, PMIMECSETINFO pCharsetInfo)
 
static HRESULT WINAPI fnIMultiLanguage_IsConvertible (IMultiLanguage *iface, DWORD src_enc, DWORD dst_enc)
 
static HRESULT WINAPI fnIMultiLanguage_ConvertString (IMultiLanguage *iface, DWORD *mode, DWORD src_enc, DWORD dst_enc, BYTE *src, UINT *src_size, BYTE *dest, UINT *dest_size)
 
static HRESULT WINAPI fnIMultiLanguage_ConvertStringToUnicode (IMultiLanguage *iface, DWORD *mode, DWORD src_enc, CHAR *src, UINT *src_size, WCHAR *dest, UINT *dest_size)
 
static HRESULT WINAPI fnIMultiLanguage_ConvertStringFromUnicode (IMultiLanguage *iface, DWORD *mode, DWORD encoding, WCHAR *src, UINT *src_size, CHAR *dest, UINT *dest_size)
 
static HRESULT WINAPI fnIMultiLanguage_ConvertStringReset (IMultiLanguage *iface)
 
static HRESULT WINAPI fnIMultiLanguage_GetRfc1766FromLcid (IMultiLanguage *iface, LCID lcid, BSTR *pbstrRfc1766)
 
static HRESULT WINAPI fnIMultiLanguage_GetLcidFromRfc1766 (IMultiLanguage *iface, LCID *locale, BSTR rfc1766)
 
static EnumRfc1766_implimpl_from_IEnumRfc1766 (IEnumRfc1766 *iface)
 
static HRESULT WINAPI fnIEnumRfc1766_QueryInterface (IEnumRfc1766 *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI fnIEnumRfc1766_AddRef (IEnumRfc1766 *iface)
 
static ULONG WINAPI fnIEnumRfc1766_Release (IEnumRfc1766 *iface)
 
static HRESULT WINAPI fnIEnumRfc1766_Clone (IEnumRfc1766 *iface, IEnumRfc1766 **ppEnum)
 
static HRESULT WINAPI fnIEnumRfc1766_Next (IEnumRfc1766 *iface, ULONG celt, PRFC1766INFO rgelt, ULONG *pceltFetched)
 
static HRESULT WINAPI fnIEnumRfc1766_Reset (IEnumRfc1766 *iface)
 
static HRESULT WINAPI fnIEnumRfc1766_Skip (IEnumRfc1766 *iface, ULONG celt)
 
static BOOL CALLBACK enum_locales_proc (LPWSTR locale)
 
static HRESULT WINAPI fnIMultiLanguage_EnumRfc1766 (IMultiLanguage *iface, IEnumRfc1766 **ppEnumRfc1766)
 
static HRESULT WINAPI fnIMultiLanguage_GetRfc1766Info (IMultiLanguage *iface, LCID Locale, PRFC1766INFO pRfc1766Info)
 
static HRESULT WINAPI fnIMultiLanguage_CreateConvertCharset (IMultiLanguage *iface, UINT src_cp, UINT dst_cp, DWORD prop, IMLangConvertCharset **convert_charset)
 
static MLang_implimpl_from_IMultiLanguage3 (IMultiLanguage3 *iface)
 
static HRESULT WINAPI fnIMultiLanguage3_QueryInterface (IMultiLanguage3 *iface, REFIID riid, void **obj)
 
static ULONG WINAPI fnIMultiLanguage3_AddRef (IMultiLanguage3 *iface)
 
static ULONG WINAPI fnIMultiLanguage3_Release (IMultiLanguage3 *iface)
 
static HRESULT WINAPI fnIMultiLanguage3_GetNumberOfCodePageInfo (IMultiLanguage3 *iface, UINT *pcCodePage)
 
static HRESULT WINAPI fnIMultiLanguage3_GetCodePageInfo (IMultiLanguage3 *iface, UINT uiCodePage, LANGID LangId, PMIMECPINFO pCodePageInfo)
 
static HRESULT WINAPI fnIMultiLanguage3_GetFamilyCodePage (IMultiLanguage3 *iface, UINT uiCodePage, UINT *puiFamilyCodePage)
 
static HRESULT WINAPI fnIMultiLanguage3_EnumCodePages (IMultiLanguage3 *iface, DWORD grfFlags, LANGID LangId, IEnumCodePage **ppEnumCodePage)
 
static HRESULT WINAPI fnIMultiLanguage3_GetCharsetInfo (IMultiLanguage3 *iface, BSTR Charset, PMIMECSETINFO pCharsetInfo)
 
static HRESULT WINAPI fnIMultiLanguage3_IsConvertible (IMultiLanguage3 *iface, DWORD dwSrcEncoding, DWORD dwDstEncoding)
 
static HRESULT WINAPI fnIMultiLanguage3_ConvertString (IMultiLanguage3 *iface, DWORD *pdwMode, DWORD dwSrcEncoding, DWORD dwDstEncoding, BYTE *pSrcStr, UINT *pcSrcSize, BYTE *pDstStr, UINT *pcDstSize)
 
static HRESULT WINAPI fnIMultiLanguage3_ConvertStringToUnicode (IMultiLanguage3 *iface, DWORD *pdwMode, DWORD dwEncoding, CHAR *pSrcStr, UINT *pcSrcSize, WCHAR *pDstStr, UINT *pcDstSize)
 
static HRESULT WINAPI fnIMultiLanguage3_ConvertStringFromUnicode (IMultiLanguage3 *iface, DWORD *pdwMode, DWORD dwEncoding, WCHAR *pSrcStr, UINT *pcSrcSize, CHAR *pDstStr, UINT *pcDstSize)
 
static HRESULT WINAPI fnIMultiLanguage3_ConvertStringReset (IMultiLanguage3 *iface)
 
static HRESULT WINAPI fnIMultiLanguage3_GetRfc1766FromLcid (IMultiLanguage3 *iface, LCID lcid, BSTR *pbstrRfc1766)
 
static HRESULT WINAPI fnIMultiLanguage3_GetLcidFromRfc1766 (IMultiLanguage3 *iface, LCID *pLocale, BSTR bstrRfc1766)
 
static HRESULT WINAPI fnIMultiLanguage3_EnumRfc1766 (IMultiLanguage3 *iface, LANGID LangId, IEnumRfc1766 **ppEnumRfc1766)
 
static HRESULT WINAPI fnIMultiLanguage3_GetRfc1766Info (IMultiLanguage3 *iface, LCID Locale, LANGID LangId, PRFC1766INFO pRfc1766Info)
 
static HRESULT WINAPI fnIMultiLanguage3_CreateConvertCharset (IMultiLanguage3 *iface, UINT src_cp, UINT dst_cp, DWORD prop, IMLangConvertCharset **convert_charset)
 
static HRESULT WINAPI fnIMultiLanguage3_ConvertStringInIStream (IMultiLanguage3 *iface, DWORD *pdwMode, DWORD dwFlag, WCHAR *lpFallBack, DWORD dwSrcEncoding, DWORD dwDstEncoding, IStream *pstmIn, IStream *pstmOut)
 
static HRESULT WINAPI fnIMultiLanguage3_ConvertStringToUnicodeEx (IMultiLanguage3 *iface, DWORD *pdwMode, DWORD dwEncoding, CHAR *pSrcStr, UINT *pcSrcSize, WCHAR *pDstStr, UINT *pcDstSize, DWORD dwFlag, WCHAR *lpFallBack)
 
static HRESULT WINAPI fnIMultiLanguage3_ConvertStringFromUnicodeEx (IMultiLanguage3 *This, DWORD *pdwMode, DWORD dwEncoding, WCHAR *pSrcStr, UINT *pcSrcSize, CHAR *pDstStr, UINT *pcDstSize, DWORD dwFlag, WCHAR *lpFallBack)
 
static HRESULT WINAPI fnIMultiLanguage3_DetectCodepageInIStream (IMultiLanguage3 *iface, DWORD dwFlag, DWORD dwPrefWinCodePage, IStream *pstmIn, DetectEncodingInfo *lpEncoding, INT *pnScores)
 
static HRESULT WINAPI fnIMultiLanguage3_DetectInputCodepage (IMultiLanguage3 *iface, DWORD dwFlag, DWORD dwPrefWinCodePage, CHAR *pSrcStr, INT *pcSrcSize, DetectEncodingInfo *lpEncoding, INT *pnScores)
 
static HRESULT WINAPI fnIMultiLanguage3_ValidateCodePage (IMultiLanguage3 *iface, UINT uiCodePage, HWND hwnd)
 
static HRESULT WINAPI fnIMultiLanguage3_GetCodePageDescription (IMultiLanguage3 *iface, UINT uiCodePage, LCID lcid, LPWSTR lpWideCharStr, int cchWideChar)
 
static HRESULT WINAPI fnIMultiLanguage3_IsCodePageInstallable (IMultiLanguage3 *iface, UINT uiCodePage)
 
static HRESULT WINAPI fnIMultiLanguage3_SetMimeDBSource (IMultiLanguage3 *iface, MIMECONTF dwSource)
 
static HRESULT WINAPI fnIMultiLanguage3_GetNumberOfScripts (IMultiLanguage3 *iface, UINT *pnScripts)
 
static HRESULT WINAPI fnIMultiLanguage3_EnumScripts (IMultiLanguage3 *iface, DWORD dwFlags, LANGID LangId, IEnumScript **ppEnumScript)
 
static HRESULT WINAPI fnIMultiLanguage3_ValidateCodePageEx (IMultiLanguage3 *iface, UINT uiCodePage, HWND hwnd, DWORD dwfIODControl)
 
static HRESULT WINAPI fnIMultiLanguage3_DetectOutboundCodePage (IMultiLanguage3 *iface, DWORD dwFlags, LPCWSTR lpWideCharStr, UINT cchWideChar, UINT *puiPreferredCodePages, UINT nPreferredCodePages, UINT *puiDetectedCodePages, UINT *pnDetectedCodePages, WCHAR *lpSpecialChar)
 
static HRESULT WINAPI fnIMultiLanguage3_DetectOutboundCodePageInIStream (IMultiLanguage3 *iface, DWORD dwFlags, IStream *pStrIn, UINT *puiPreferredCodePages, UINT nPreferredCodePages, UINT *puiDetectedCodePages, UINT *pnDetectedCodePages, WCHAR *lpSpecialChar)
 
static MLang_implimpl_from_IMLangFontLink2 (IMLangFontLink2 *iface)
 
static HRESULT WINAPI fnIMLangFontLink2_QueryInterface (IMLangFontLink2 *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI fnIMLangFontLink2_AddRef (IMLangFontLink2 *iface)
 
static ULONG WINAPI fnIMLangFontLink2_Release (IMLangFontLink2 *iface)
 
static HRESULT WINAPI fnIMLangFontLink2_GetCharCodePages (IMLangFontLink2 *iface, WCHAR ch_src, DWORD *ret_codepages)
 
static HRESULT WINAPI fnIMLangFontLink2_GetStrCodePages (IMLangFontLink2 *iface, const WCHAR *src, LONG src_len, DWORD priority_cp, DWORD *codepages, LONG *ret_len)
 
static HRESULT WINAPI fnIMLangFontLink2_CodePageToCodePages (IMLangFontLink2 *iface, UINT codepage, DWORD *codepages)
 
static HRESULT WINAPI fnIMLangFontLink2_CodePagesToCodePage (IMLangFontLink2 *iface, DWORD codepages, UINT def_codepage, UINT *codepage)
 
static HRESULT WINAPI fnIMLangFontLink2_GetFontCodePages (IMLangFontLink2 *iface, HDC hdc, HFONT hfont, DWORD *codepages)
 
static HRESULT WINAPI fnIMLangFontLink2_ReleaseFont (IMLangFontLink2 *This, HFONT hFont)
 
static HRESULT WINAPI fnIMLangFontLink2_ResetFontMapping (IMLangFontLink2 *This)
 
static HRESULT WINAPI fnIMLangFontLink2_MapFont (IMLangFontLink2 *This, HDC hDC, DWORD dwCodePages, WCHAR chSrc, HFONT *pFont)
 
static HRESULT WINAPI fnIMLangFontLink2_GetFontUnicodeRanges (IMLangFontLink2 *This, HDC hDC, UINT *puiRanges, UNICODERANGE *pUranges)
 
static HRESULT WINAPI fnIMLangFontLink2_GetScriptFontInfo (IMLangFontLink2 *This, SCRIPT_ID sid, DWORD dwFlags, UINT *puiFonts, SCRIPTFONTINFO *pScriptFont)
 
static HRESULT WINAPI fnIMLangFontLink2_CodePageToScriptID (IMLangFontLink2 *This, UINT uiCodePage, SCRIPT_ID *pSid)
 
static MLang_implimpl_from_IMLangLineBreakConsole (IMLangLineBreakConsole *iface)
 
static HRESULT WINAPI fnIMLangLineBreakConsole_QueryInterface (IMLangLineBreakConsole *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI fnIMLangLineBreakConsole_AddRef (IMLangLineBreakConsole *iface)
 
static ULONG WINAPI fnIMLangLineBreakConsole_Release (IMLangLineBreakConsole *iface)
 
static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineML (IMLangLineBreakConsole *iface, IMLangString *pSrcMLStr, LONG lSrcPos, LONG lSrcLen, LONG cMinColumns, LONG cMaxColumns, LONG *plLineLen, LONG *plSkipLen)
 
static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineW (IMLangLineBreakConsole *iface, LCID locale, const WCHAR *pszSrc, LONG cchSrc, LONG cMaxColumns, LONG *pcchLine, LONG *pcchSkip)
 
static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineA (IMLangLineBreakConsole *iface, LCID locale, UINT uCodePage, const CHAR *pszSrc, LONG cchSrc, LONG cMaxColumns, LONG *pcchLine, LONG *pcchSkip)
 
static struct convert_charsetimpl_from_IMLangConvertCharset (IMLangConvertCharset *iface)
 
static HRESULT WINAPI MLangConvertCharset_QueryInterface (IMLangConvertCharset *iface, REFIID riid, void **obj)
 
static ULONG WINAPI MLangConvertCharset_AddRef (IMLangConvertCharset *iface)
 
static ULONG WINAPI MLangConvertCharset_Release (IMLangConvertCharset *iface)
 
static HRESULT WINAPI MLangConvertCharset_Initialize (IMLangConvertCharset *iface, UINT src_cp, UINT dst_cp, DWORD prop)
 
static HRESULT WINAPI MLangConvertCharset_GetSourceCodePage (IMLangConvertCharset *iface, UINT *src_cp)
 
static HRESULT WINAPI MLangConvertCharset_GetDestinationCodePage (IMLangConvertCharset *iface, UINT *dst_cp)
 
static HRESULT WINAPI MLangConvertCharset_GetProperty (IMLangConvertCharset *iface, DWORD *prop)
 
static HRESULT WINAPI MLangConvertCharset_DoConversion (IMLangConvertCharset *iface, BYTE *src, UINT *src_size, BYTE *dest, UINT *dest_size)
 
static HRESULT WINAPI MLangConvertCharset_DoConversionToUnicode (IMLangConvertCharset *iface, CHAR *src, UINT *src_size, WCHAR *dest, UINT *dest_size)
 
static HRESULT WINAPI MLangConvertCharset_DoConversionFromUnicode (IMLangConvertCharset *iface, WCHAR *src, UINT *src_size, CHAR *dest, UINT *dest_size)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
static BOOL register_codepages (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 
HRESULT WINAPI GetGlobalFontLinkObject (void **unknown)
 

Variables

static HINSTANCE instance
 
static DWORD MLANG_tls_index
 
static const MIME_CP_INFO arabic_cp []
 
static const MIME_CP_INFO baltic_cp []
 
static const MIME_CP_INFO chinese_simplified_cp []
 
static const MIME_CP_INFO chinese_traditional_cp []
 
static const MIME_CP_INFO central_european_cp []
 
static const MIME_CP_INFO cyrillic_cp []
 
static const MIME_CP_INFO greek_cp []
 
static const MIME_CP_INFO hebrew_cp []
 
static const MIME_CP_INFO japanese_cp []
 
static const MIME_CP_INFO korean_cp []
 
static const MIME_CP_INFO thai_cp []
 
static const MIME_CP_INFO turkish_cp []
 
static const MIME_CP_INFO vietnamese_cp []
 
static const WCHAR asciiW [] = {'a','s','c','i','i',0}
 
static const MIME_CP_INFO western_cp []
 
static const MIME_CP_INFO unicode_cp []
 
static const struct mlang_data mlang_data []
 
static struct list font_cache = LIST_INIT(font_cache)
 
static CRITICAL_SECTION font_cache_critical = { &font_cache_critical_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG font_cache_critical_debug
 
static LONG dll_count
 
static const struct object_creation_info object_creation []
 
static const IClassFactoryVtbl MLANGCF_Vtbl
 
static const IEnumCodePageVtbl IEnumCodePage_vtbl
 
static const IEnumScriptVtbl IEnumScript_vtbl
 
static const IMLangFontLinkVtbl IMLangFontLink_vtbl
 
static const IEnumRfc1766Vtbl IEnumRfc1766_vtbl
 
static const IMultiLanguageVtbl IMultiLanguage_vtbl
 
static const IMultiLanguage3Vtbl IMultiLanguage3_vtbl
 
static const IMLangFontLink2Vtbl IMLangFontLink2_vtbl
 
static const IMLangLineBreakConsoleVtbl IMLangLineBreakConsole_vtbl
 
static const IMLangConvertCharsetVtbl MLangConvertCharsetVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 28 of file mlang.c.

◆ HANKATA

#define HANKATA (   A)    ((A >= 161) && (A <= 223))

Definition at line 553 of file mlang.c.

◆ ISEUC

#define ISEUC (   A)    ((A >= 161) && (A <= 254))

Definition at line 554 of file mlang.c.

◆ ISMARU

#define ISMARU (   A)    ((A >= 202) && (A <= 206))

Definition at line 558 of file mlang.c.

◆ ISNIGORI

#define ISNIGORI (   A)    (((A >= 182) && (A <= 196)) || ((A >= 202) && (A <= 206)))

Definition at line 559 of file mlang.c.

◆ NOTEUC

#define NOTEUC (   A,
  B 
)    (((A >= 129) && (A <= 159)) && ((B >= 64) && (B <= 160)))

Definition at line 555 of file mlang.c.

◆ SJIS1

#define SJIS1 (   A)    (((A >= 129) && (A <= 159)) || ((A >= 224) && (A <= 239)))

Definition at line 556 of file mlang.c.

◆ SJIS2

#define SJIS2 (   A)    ((A >= 64) && (A <= 252))

Definition at line 557 of file mlang.c.

Typedef Documentation

◆ EnumCodePage_impl

◆ EnumRfc1766_impl

◆ EnumScript_impl

◆ MLang_impl

Function Documentation

◆ clear_font_cache()

static HRESULT clear_font_cache ( void  )
static

Definition at line 1428 of file mlang.c.

1429{
1430 struct font_list *font_list_entry;
1431 struct font_list *font_list_entry2;
1432
1434 LIST_FOR_EACH_ENTRY_SAFE(font_list_entry, font_list_entry2, &font_cache, struct font_list, list_entry)
1435 {
1436 list_remove(&font_list_entry->list_entry);
1437 DeleteObject(font_list_entry->font);
1438 HeapFree(GetProcessHeap(), 0, font_list_entry);
1439 }
1441
1442 return S_OK;
1443}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
static struct list font_cache
Definition: mlang.c:535
static CRITICAL_SECTION font_cache_critical
Definition: mlang.c:536
pKey DeleteObject()
#define S_OK
Definition: intsafe.h:52
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
HFONT font
Definition: mlang.c:531
struct list list_entry
Definition: mlang.c:529
Definition: list.h:27
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by fnIMLangFontLink2_ResetFontMapping(), and fnIMLangFontLink_ResetFontMapping().

◆ ConvertINetMultiByteToUnicode()

HRESULT WINAPI ConvertINetMultiByteToUnicode ( LPDWORD  pdwMode,
DWORD  dwEncoding,
LPCSTR  pSrcStr,
LPINT  pcSrcSize,
LPWSTR  pDstStr,
LPINT  pcDstSize 
)

Definition at line 952 of file mlang.c.

959{
960 INT src_len = -1;
961
962 TRACE("%p %d %s %p %p %p\n", pdwMode, dwEncoding,
963 debugstr_a(pSrcStr), pcSrcSize, pDstStr, pcDstSize);
964
965 if (!pcDstSize)
966 return E_FAIL;
967
968 if (!pcSrcSize)
969 pcSrcSize = &src_len;
970
971 if (!*pcSrcSize)
972 {
973 *pcDstSize = 0;
974 return S_OK;
975 }
976
977 /* forwarding euc-jp to EUC-JP */
978 if (dwEncoding == 51932)
979 dwEncoding = 20932;
980
981 switch (dwEncoding)
982 {
983 case CP_UNICODE:
984 if (*pcSrcSize == -1)
985 *pcSrcSize = lstrlenW((LPCWSTR)pSrcStr);
986 *pcDstSize = min(*pcSrcSize, *pcDstSize);
987 *pcSrcSize *= sizeof(WCHAR);
988 if (pDstStr)
989 memmove(pDstStr, pSrcStr, *pcDstSize * sizeof(WCHAR));
990 break;
991
992 case 50220:
993 case 50221:
994 case 50222:
995 *pcDstSize = ConvertJISJapaneseToUnicode(pSrcStr,*pcSrcSize,pDstStr,*pcDstSize);
996 break;
997 case 50932:
998 *pcDstSize = ConvertUnknownJapaneseToUnicode(pSrcStr,*pcSrcSize,pDstStr,*pcDstSize);
999 break;
1000
1001 default:
1002 if (*pcSrcSize == -1)
1003 *pcSrcSize = lstrlenA(pSrcStr);
1004
1005 if (pDstStr)
1006 *pcDstSize = MultiByteToWideChar(dwEncoding, 0, pSrcStr, *pcSrcSize, pDstStr, *pcDstSize);
1007 else
1008 *pcDstSize = MultiByteToWideChar(dwEncoding, 0, pSrcStr, *pcSrcSize, NULL, 0);
1009 break;
1010 }
1011
1012 if (!*pcDstSize)
1013 return E_FAIL;
1014
1015 return S_OK;
1016}
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
static UINT ConvertUnknownJapaneseToUnicode(LPCSTR input, DWORD count, LPWSTR output, DWORD out_count)
Definition: mlang.c:853
static UINT ConvertJISJapaneseToUnicode(LPCSTR input, DWORD count, LPWSTR output, DWORD out_count)
Definition: mlang.c:833
#define CP_UNICODE
Definition: stg_prop.c:74
#define debugstr_a
Definition: kernel32.h:31
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define min(a, b)
Definition: monoChain.cc:55
#define TRACE(s)
Definition: solgame.cpp:4
int32_t INT
Definition: typedefs.h:58
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ ConvertINetString()

HRESULT WINAPI ConvertINetString ( LPDWORD  pdwMode,
DWORD  dwSrcEncoding,
DWORD  dwDstEncoding,
LPCSTR  pSrcStr,
LPINT  pcSrcSize,
LPSTR  pDstStr,
LPINT  pcDstSize 
)

Definition at line 1103 of file mlang.c.

1112{
1113 TRACE("%p %d %d %s %p %p %p\n", pdwMode, dwSrcEncoding, dwDstEncoding,
1114 debugstr_a(pSrcStr), pcSrcSize, pDstStr, pcDstSize);
1115
1116 if (dwSrcEncoding == CP_UNICODE)
1117 {
1118 INT cSrcSizeW;
1119 if (pcSrcSize && *pcSrcSize != -1)
1120 {
1121 cSrcSizeW = *pcSrcSize / sizeof(WCHAR);
1122 pcSrcSize = &cSrcSizeW;
1123 }
1124 return ConvertINetUnicodeToMultiByte(pdwMode, dwDstEncoding, (LPCWSTR)pSrcStr, pcSrcSize, pDstStr, pcDstSize);
1125 }
1126 else if (dwDstEncoding == CP_UNICODE)
1127 {
1128 HRESULT hr = ConvertINetMultiByteToUnicode(pdwMode, dwSrcEncoding, pSrcStr, pcSrcSize, (LPWSTR)pDstStr, pcDstSize);
1129 *pcDstSize *= sizeof(WCHAR);
1130 return hr;
1131 }
1132 else
1133 {
1134 INT cDstSizeW;
1135 LPWSTR pDstStrW;
1136 HRESULT hr;
1137
1138 TRACE("convert %s from %d to %d\n", debugstr_a(pSrcStr), dwSrcEncoding, dwDstEncoding);
1139
1140 hr = ConvertINetMultiByteToUnicode(pdwMode, dwSrcEncoding, pSrcStr, pcSrcSize, NULL, &cDstSizeW);
1141 if (hr != S_OK)
1142 return hr;
1143
1144 pDstStrW = HeapAlloc(GetProcessHeap(), 0, cDstSizeW * sizeof(WCHAR));
1145 hr = ConvertINetMultiByteToUnicode(pdwMode, dwSrcEncoding, pSrcStr, pcSrcSize, pDstStrW, &cDstSizeW);
1146 if (hr == S_OK)
1147 hr = ConvertINetUnicodeToMultiByte(pdwMode, dwDstEncoding, pDstStrW, &cDstSizeW, pDstStr, pcDstSize);
1148
1149 HeapFree(GetProcessHeap(), 0, pDstStrW);
1150 return hr;
1151 }
1152}
#define HeapAlloc
Definition: compat.h:733
HRESULT hr
Definition: shlfolder.c:183
static CONVERTINETMULTIBYTETOUNICODE ConvertINetMultiByteToUnicode
Definition: win_iconv.c:705
static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte
Definition: win_iconv.c:706
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ ConvertINetUnicodeToMultiByte()

HRESULT WINAPI ConvertINetUnicodeToMultiByte ( LPDWORD  pdwMode,
DWORD  dwEncoding,
LPCWSTR  pSrcStr,
LPINT  pcSrcSize,
LPSTR  pDstStr,
LPINT  pcDstSize 
)

Definition at line 1018 of file mlang.c.

1025{
1026 INT destsz, size;
1027 INT src_len = -1;
1028
1029 TRACE("%p %d %s %p %p %p\n", pdwMode, dwEncoding,
1030 debugstr_w(pSrcStr), pcSrcSize, pDstStr, pcDstSize);
1031
1032 if (!pcDstSize)
1033 return S_OK;
1034
1035 if (!pcSrcSize)
1036 pcSrcSize = &src_len;
1037
1038 destsz = (pDstStr) ? *pcDstSize : 0;
1039 *pcDstSize = 0;
1040
1041 if (!pSrcStr || !*pcSrcSize)
1042 return S_OK;
1043
1044 if (*pcSrcSize == -1)
1045 *pcSrcSize = lstrlenW(pSrcStr);
1046
1047 /* forwarding euc-jp to EUC-JP */
1048 if (dwEncoding == 51932)
1049 dwEncoding = 20932;
1050
1051 if (dwEncoding == CP_UNICODE)
1052 {
1053 if (*pcSrcSize == -1)
1054 *pcSrcSize = lstrlenW(pSrcStr);
1055
1056 size = min(*pcSrcSize, destsz) * sizeof(WCHAR);
1057 if (pDstStr)
1058 memmove(pDstStr, pSrcStr, size);
1059
1060 if (size >= destsz)
1061 goto fail;
1062 }
1063 else if (dwEncoding == 50220 || dwEncoding == 50221 || dwEncoding == 50222)
1064 {
1065 size = ConvertJapaneseUnicodeToJIS(pSrcStr, *pcSrcSize, NULL, 0);
1066 if (!size)
1067 goto fail;
1068
1069 if (pDstStr)
1070 {
1071 size = ConvertJapaneseUnicodeToJIS(pSrcStr, *pcSrcSize, pDstStr,
1072 destsz);
1073 if (!size)
1074 goto fail;
1075 }
1076
1077 }
1078 else
1079 {
1080 size = WideCharToMultiByte(dwEncoding, 0, pSrcStr, *pcSrcSize,
1081 NULL, 0, NULL, NULL);
1082 if (!size)
1083 goto fail;
1084
1085 if (pDstStr)
1086 {
1087 size = WideCharToMultiByte(dwEncoding, 0, pSrcStr, *pcSrcSize,
1088 pDstStr, destsz, NULL, NULL);
1089 if (!size)
1090 goto fail;
1091 }
1092 }
1093
1094 *pcDstSize = size;
1095 return S_OK;
1096
1097fail:
1098 *pcSrcSize = 0;
1099 *pcDstSize = 0;
1100 return E_FAIL;
1101}
#define WideCharToMultiByte
Definition: compat.h:111
static UINT ConvertJapaneseUnicodeToJIS(LPCWSTR input, DWORD count, LPSTR output, DWORD out_count)
Definition: mlang.c:901
GLsizeiptr size
Definition: glext.h:5919
#define debugstr_w
Definition: kernel32.h:32

◆ ConvertJapaneseUnicodeToJIS()

static UINT ConvertJapaneseUnicodeToJIS ( LPCWSTR  input,
DWORD  count,
LPSTR  output,
DWORD  out_count 
)
static

Definition at line 901 of file mlang.c.

903{
904 CHAR *sjis_string;
905 INT len;
906 UINT rc = 0;
907
909 sjis_string = HeapAlloc(GetProcessHeap(),0,len);
910 WideCharToMultiByte(932,0,input,count,sjis_string,len,NULL,NULL);
911 TRACE("%s\n",debugstr_an(sjis_string,len));
912
913 rc = ConvertSJIS2JIS(sjis_string, len, NULL);
914 if (out_count >= rc)
915 {
916 ConvertSJIS2JIS(sjis_string, len, output);
917 }
918 HeapFree(GetProcessHeap(),0,sjis_string);
919 return rc;
920
921}
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
static UINT ConvertSJIS2JIS(LPCSTR input, DWORD count, LPSTR output)
Definition: mlang.c:742
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
GLenum GLenum GLenum input
Definition: glext.h:9031
static UINT UINT * out_count
Definition: clipboard.c:35
unsigned int UINT
Definition: ndis.h:50
char CHAR
Definition: xmlstorage.h:175

Referenced by ConvertINetUnicodeToMultiByte().

◆ ConvertJIS2SJIS()

static UINT ConvertJIS2SJIS ( LPCSTR  input,
DWORD  count,
LPSTR  output 
)
static

Definition at line 674 of file mlang.c.

675{
676 DWORD i = 0;
677 int j = 0;
678 unsigned char p2,p;
679 BOOL shifted = FALSE;
680
681 while (i < count)
682 {
683 p = input[i];
684 if (p == 0x1b /* ESC */)
685 {
686 i++;
687 if (i >= count)
688 return 0;
689 p2 = input[i];
690 if (p2 == '$' || p2 =='(')
691 i++;
692 if (p2 == 'K' || p2 =='$')
693 shifted = TRUE;
694 else
695 shifted = FALSE;
696 }
697 else
698 {
699 if (shifted)
700 {
701 i++;
702 if (i >= count)
703 return 0;
704 p2 = input[i];
705 jis2sjis(&p,&p2);
706 output[j++]=p;
707 output[j++]=p2;
708 }
709 else
710 {
711 output[j++] = p;
712 }
713 }
714 i++;
715 }
716 return j;
717}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static void jis2sjis(unsigned char *p1, unsigned char *p2)
Definition: mlang.c:606
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLfloat GLfloat p
Definition: glext.h:8902
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250

Referenced by ConvertJISJapaneseToUnicode(), and ConvertUnknownJapaneseToUnicode().

◆ ConvertJISJapaneseToUnicode()

static UINT ConvertJISJapaneseToUnicode ( LPCSTR  input,
DWORD  count,
LPWSTR  output,
DWORD  out_count 
)
static

Definition at line 833 of file mlang.c.

835{
836 CHAR *sjis_string;
837 UINT rc = 0;
838 sjis_string = HeapAlloc(GetProcessHeap(),0,count);
839 rc = ConvertJIS2SJIS(input,count,sjis_string);
840 if (rc)
841 {
842 TRACE("%s\n",debugstr_an(sjis_string,rc));
843 if (output)
844 rc = MultiByteToWideChar(932,0,sjis_string,rc,output,out_count);
845 else
846 rc = MultiByteToWideChar(932,0,sjis_string,rc,0,0);
847 }
848 HeapFree(GetProcessHeap(),0,sjis_string);
849 return rc;
850
851}
static UINT ConvertJIS2SJIS(LPCSTR input, DWORD count, LPSTR output)
Definition: mlang.c:674

Referenced by ConvertINetMultiByteToUnicode().

◆ ConvertSJIS2JIS()

static UINT ConvertSJIS2JIS ( LPCSTR  input,
DWORD  count,
LPSTR  output 
)
static

Definition at line 742 of file mlang.c.

743{
744 DWORD i = 0;
745 int j = 0;
746 unsigned char p2,p;
747 BOOL shifted = FALSE;
748
749 while (i < count)
750 {
751 p = input[i] & 0xff;
752 if (p == 10 || p == 13) /* NL and CR */
753 {
754 if (shifted)
755 {
756 shifted = FALSE;
757 j += exit_shift(output,j);
758 }
759 if (output)
760 output[j++] = p;
761 else
762 j++;
763 }
764 else
765 {
766 if (SJIS1(p))
767 {
768 i++;
769 if (i >= count)
770 return 0;
771 p2 = input[i] & 0xff;
772 if (SJIS2(p2))
773 {
774 sjis2jis(&p,&p2);
775 if (!shifted)
776 {
777 shifted = TRUE;
778 j+=enter_shift(output,j);
779 }
780 }
781
782 if (output)
783 {
784 output[j++]=p;
785 output[j++]=p2;
786 }
787 else
788 j+=2;
789 }
790 else
791 {
792 if (HANKATA(p))
793 {
794 if ((i+1) >= count)
795 return 0;
796 p2 = input[i+1] & 0xff;
797 i+=han2zen(&p,&p2);
798 sjis2jis(&p,&p2);
799 if (!shifted)
800 {
801 shifted = TRUE;
802 j+=enter_shift(output,j);
803 }
804 if (output)
805 {
806 output[j++]=p;
807 output[j++]=p2;
808 }
809 else
810 j+=2;
811 }
812 else
813 {
814 if (shifted)
815 {
816 shifted = FALSE;
817 j += exit_shift(output,j);
818 }
819 if (output)
820 output[j++]=p;
821 else
822 j++;
823 }
824 }
825 }
826 i++;
827 }
828 if (shifted)
829 j += exit_shift(output,j);
830 return j;
831}
static int exit_shift(LPSTR out, int c)
Definition: mlang.c:719
#define SJIS2(A)
Definition: mlang.c:557
static int enter_shift(LPSTR out, int c)
Definition: mlang.c:730
#define SJIS1(A)
Definition: mlang.c:556
static int han2zen(unsigned char *p1, unsigned char *p2)
Definition: mlang.c:629
#define HANKATA(A)
Definition: mlang.c:553
static void sjis2jis(unsigned char *p1, unsigned char *p2)
Definition: mlang.c:617

Referenced by ConvertJapaneseUnicodeToJIS().

◆ ConvertUnknownJapaneseToUnicode()

static UINT ConvertUnknownJapaneseToUnicode ( LPCSTR  input,
DWORD  count,
LPWSTR  output,
DWORD  out_count 
)
static

Definition at line 853 of file mlang.c.

855{
856 CHAR *sjis_string;
857 UINT rc = 0;
859 TRACE("Japanese code %i\n",code);
860
861 switch (code)
862 {
863 case 0:
864 if (output)
866 else
868 break;
869
870 case 932:
871 if (output)
872 rc = MultiByteToWideChar(932,0,input,count,output,out_count);
873 else
874 rc = MultiByteToWideChar(932,0,input,count,0,0);
875 break;
876
877 case 51932:
878 if (output)
879 rc = MultiByteToWideChar(20932,0,input,count,output,out_count);
880 else
881 rc = MultiByteToWideChar(20932,0,input,count,0,0);
882 break;
883
884 case 50220:
885 sjis_string = HeapAlloc(GetProcessHeap(),0,count);
886 rc = ConvertJIS2SJIS(input,count,sjis_string);
887 if (rc)
888 {
889 TRACE("%s\n",debugstr_an(sjis_string,rc));
890 if (output)
891 rc = MultiByteToWideChar(932,0,sjis_string,rc,output,out_count);
892 else
893 rc = MultiByteToWideChar(932,0,sjis_string,rc,0,0);
894 }
895 HeapFree(GetProcessHeap(),0,sjis_string);
896 break;
897 }
898 return rc;
899}
#define CP_ACP
Definition: compat.h:109
static UINT DetectJapaneseCode(LPCSTR input, DWORD count)
Definition: mlang.c:561
Definition: inflate.c:139

Referenced by ConvertINetMultiByteToUnicode().

◆ DetectJapaneseCode()

static UINT DetectJapaneseCode ( LPCSTR  input,
DWORD  count 
)
static

Definition at line 561 of file mlang.c.

562{
563 UINT code = 0;
564 DWORD i = 0;
565 unsigned char c1,c2;
566
567 while ((code == 0 || code == 51932) && i < count)
568 {
569 c1 = input[i];
570 if (c1 == 0x1b /* ESC */)
571 {
572 i++;
573 if (i >= count)
574 return code;
575 c1 = input[i];
576 if (c1 == '$')
577 {
578 i++;
579 if (i >= count)
580 return code;
581 c1 = input[i];
582 if (c1 =='B' || c1 == '@')
583 code = 50220;
584 }
585 if (c1 == 'K')
586 code = 50220;
587 }
588 else if (c1 >= 129)
589 {
590 i++;
591 if (i >= count)
592 return code;
593 c2 = input[i];
594 if NOTEUC(c1,c2)
595 code = 932;
596 else if (ISEUC(c1) && ISEUC(c2))
597 code = 51932;
598 else if (((c1 == 142)) && HANKATA(c2))
599 code = 51932;
600 }
601 i++;
602 }
603 return code;
604}
#define NOTEUC(A, B)
Definition: mlang.c:555
#define ISEUC(A)
Definition: mlang.c:554

Referenced by ConvertUnknownJapaneseToUnicode().

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 3924 of file mlang.c.

3925{
3926 return dll_count == 0 ? S_OK : S_FALSE;
3927}
static LONG dll_count
Definition: mlang.c:547
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  iid,
LPVOID ppv 
)

Definition at line 1550 of file mlang.c.

1551{
1552 unsigned int i;
1554
1555 TRACE("%s %s %p\n",debugstr_guid(rclsid), debugstr_guid(iid), ppv);
1556
1557 if ( !IsEqualGUID( &IID_IClassFactory, iid )
1558 && ! IsEqualGUID( &IID_IUnknown, iid) )
1559 return E_NOINTERFACE;
1560
1561 for (i = 0; i < ARRAY_SIZE(object_creation); i++)
1562 {
1563 if (IsEqualGUID(object_creation[i].clsid, rclsid))
1564 break;
1565 }
1566
1568 {
1569 FIXME("%s: no class found.\n", debugstr_guid(rclsid));
1571 }
1572
1573 TRACE("Creating a class factory for %s\n",object_creation[i].szClassName);
1574
1575 factory = HeapAlloc(GetProcessHeap(), 0, sizeof(*factory));
1576 if (factory == NULL) return E_OUTOFMEMORY;
1577
1579 factory->ref = 1;
1580
1581 factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
1582
1584
1585 TRACE("(%p) <- %p\n", ppv, &factory->IClassFactory_iface);
1586
1587 return S_OK;
1588}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const GUID IID_IClassFactory
static const WCHAR szClassName[]
Definition: clipbrd.c:11
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IClassFactoryVtbl MLANGCF_Vtbl
Definition: mlang.c:1538
static const struct object_creation_info object_creation[]
Definition: mlang.c:1466
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
REFCLSID clsid
Definition: msctf.c:82
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
Definition: main.c:439
IClassFactory IClassFactory_iface
Definition: main.c:440
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  lpv 
)

Definition at line 936 of file mlang.c.

937{
938 switch(fdwReason) {
940 instance = hInstDLL;
943 break;
945 if (lpv) break;
947 break;
948 }
949 return TRUE;
950}
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
DWORD WINAPI TlsAlloc(VOID)
Definition: thread.c:1100
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1166
static DWORD MLANG_tls_index
Definition: mlang.c:52
static HINSTANCE instance
Definition: mlang.c:51

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 3984 of file mlang.c.

3985{
3986 if(!register_codepages())
3987 return E_FAIL;
3989}
static BOOL register_codepages(void)
Definition: mlang.c:3929
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 3994 of file mlang.c.

3995{
3997}
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ enter_shift()

static int enter_shift ( LPSTR  out,
int  c 
)
inlinestatic

Definition at line 730 of file mlang.c.

731{
732 if (out)
733 {
734 out[c] = 0x1b;
735 out[c+1] = '$';
736 out[c+2] = 'B';
737 }
738 return 3;
739}
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
static FILE * out
Definition: regtests2xml.c:44

Referenced by ConvertSJIS2JIS().

◆ enum_locales_proc()

static BOOL CALLBACK enum_locales_proc ( LPWSTR  locale)
static

Definition at line 2410 of file mlang.c.

2411{
2412 WCHAR *end;
2414 RFC1766INFO *info;
2415
2416 TRACE("%s\n", debugstr_w(locale));
2417
2418 if (data->total >= data->allocated)
2419 {
2420 data->allocated += 32;
2421 data->info = HeapReAlloc(GetProcessHeap(), 0, data->info, data->allocated * sizeof(RFC1766INFO));
2422 if (!data->info) return FALSE;
2423 }
2424
2425 info = &data->info[data->total];
2426
2427 info->lcid = wcstol(locale, &end, 16);
2428 if (*end) /* invalid number */
2429 return FALSE;
2430
2431 info->wszRfc1766[0] = 0;
2432 lcid_to_rfc1766W( info->lcid, info->wszRfc1766, MAX_RFC1766_NAME );
2433
2434 info->wszLocaleName[0] = 0;
2435 GetLocaleInfoW(info->lcid, LOCALE_SLANGUAGE, info->wszLocaleName, MAX_LOCALE_NAME);
2436 TRACE("ISO639: %s SLANGUAGE: %s\n", wine_dbgstr_w(info->wszRfc1766), wine_dbgstr_w(info->wszLocaleName));
2437
2438 data->total++;
2439
2440 return TRUE;
2441}
Definition: _locale.h:75
#define HeapReAlloc
Definition: compat.h:734
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1240
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1666
static HRESULT lcid_to_rfc1766W(LCID lcid, LPWSTR rfc1766, INT len)
Definition: mlang.c:1226
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define wine_dbgstr_w
Definition: kernel32.h:34
RFC1766INFO * info
Definition: mlang.c:2406
#define LOCALE_SLANGUAGE
Definition: winnls.h:26

Referenced by EnumRfc1766_create().

◆ EnumCodePage_create()

static HRESULT EnumCodePage_create ( MLang_impl mlang,
DWORD  grfFlags,
LANGID  LangId,
IEnumCodePage **  ppEnumCodePage 
)
static

Definition at line 1751 of file mlang.c.

1753{
1754 EnumCodePage_impl *ecp;
1755 MIMECPINFO *cpinfo;
1756 UINT i, n;
1757
1758 TRACE("%p, %08x, %04x, %p\n", mlang, grfFlags, LangId, ppEnumCodePage);
1759
1760 if (!grfFlags) /* enumerate internal data base of encodings */
1761 grfFlags = MIMECONTF_MIME_LATEST;
1762
1763 ecp = HeapAlloc( GetProcessHeap(), 0, sizeof (EnumCodePage_impl) );
1765 ecp->ref = 1;
1766 ecp->pos = 0;
1767 ecp->total = 0;
1768 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
1769 {
1770 for (n = 0; n < mlang_data[i].number_of_cp; n++)
1771 {
1772 if (mlang_data[i].mime_cp_info[n].flags & grfFlags)
1773 ecp->total++;
1774 }
1775 }
1776
1777 ecp->cpinfo = HeapAlloc(GetProcessHeap(), 0,
1778 sizeof(MIMECPINFO) * ecp->total);
1779 cpinfo = ecp->cpinfo;
1780
1781 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
1782 {
1783 for (n = 0; n < mlang_data[i].number_of_cp; n++)
1784 {
1785 if (mlang_data[i].mime_cp_info[n].flags & grfFlags)
1786 fill_cp_info(&mlang_data[i], n, cpinfo++);
1787 }
1788 }
1789
1790 TRACE("enumerated %d codepages with flags %08x\n", ecp->total, grfFlags);
1791
1792 *ppEnumCodePage = &ecp->IEnumCodePage_iface;
1793
1794 return S_OK;
1795}
static const IEnumCodePageVtbl IEnumCodePage_vtbl
Definition: mlang.c:1740
static void fill_cp_info(const struct mlang_data *ml_data, UINT index, MIMECPINFO *mime_cp_info)
Definition: mlang.c:2656
static IMultiLanguage2 * mlang
Definition: main.c:43
GLdouble n
Definition: glext.h:7729
GLbitfield flags
Definition: glext.h:7161
UINT number_of_cp
Definition: mlang.c:488
MIMECPINFO * cpinfo
Definition: mlang.c:1610
IEnumCodePage IEnumCodePage_iface
Definition: mlang.c:1608

Referenced by fnIMultiLanguage3_EnumCodePages(), and fnIMultiLanguage_EnumCodePages().

◆ EnumRfc1766_create()

static HRESULT EnumRfc1766_create ( LANGID  LangId,
IEnumRfc1766 **  ppEnum 
)
static

Definition at line 2443 of file mlang.c.

2444{
2445 EnumRfc1766_impl *rfc;
2446 struct enum_locales_data data;
2447
2448 TRACE("%04x, %p\n", LangId, ppEnum);
2449
2450 rfc = HeapAlloc( GetProcessHeap(), 0, sizeof(EnumRfc1766_impl) );
2452 rfc->ref = 1;
2453 rfc->pos = 0;
2454 rfc->total = 0;
2455
2456 data.total = 0;
2457 data.allocated = 160;
2458 data.info = HeapAlloc(GetProcessHeap(), 0, data.allocated * sizeof(RFC1766INFO));
2459 if (!data.info)
2460 {
2461 HeapFree(GetProcessHeap(), 0, rfc);
2462 return E_OUTOFMEMORY;
2463 }
2464
2466 EnumSystemLocalesW(enum_locales_proc, 0/*LOCALE_SUPPORTED*/);
2468
2469 TRACE("enumerated %d rfc1766 structures\n", data.total);
2470
2471 if (!data.total)
2472 {
2473 HeapFree(GetProcessHeap(), 0, data.info);
2474 HeapFree(GetProcessHeap(), 0, rfc);
2475 return E_FAIL;
2476 }
2477
2478 rfc->info = data.info;
2479 rfc->total = data.total;
2480
2481 *ppEnum = &rfc->IEnumRfc1766_iface;
2482 return S_OK;
2483}
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1276
BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW lpfnLocaleEnum, DWORD dwFlags)
Definition: locale.c:2999
static const IEnumRfc1766Vtbl IEnumRfc1766_vtbl
Definition: mlang.c:2393
static BOOL CALLBACK enum_locales_proc(LPWSTR locale)
Definition: mlang.c:2410
RFC1766INFO * info
Definition: mlang.c:2269
IEnumRfc1766 IEnumRfc1766_iface
Definition: mlang.c:2267

Referenced by fnIMultiLanguage3_EnumRfc1766(), fnIMultiLanguage_EnumRfc1766(), and Rfc1766ToLcidW().

◆ EnumScript_create()

static HRESULT EnumScript_create ( MLang_impl mlang,
DWORD  dwFlags,
LANGID  LangId,
IEnumScript **  ppEnumScript 
)
static

Definition at line 1929 of file mlang.c.

1931{
1933 UINT i;
1934
1935 TRACE("%p, %08x, %04x, %p\n", mlang, dwFlags, LangId, ppEnumScript);
1936
1937 if (!dwFlags) /* enumerate all available scripts */
1938 dwFlags = SCRIPTCONTF_SCRIPT_USER | SCRIPTCONTF_SCRIPT_HIDE | SCRIPTCONTF_SCRIPT_SYSTEM;
1939
1940 es = HeapAlloc( GetProcessHeap(), 0, sizeof (EnumScript_impl) );
1941 es->IEnumScript_iface.lpVtbl = &IEnumScript_vtbl;
1942 es->ref = 1;
1943 es->pos = 0;
1944 /* do not enumerate unicode flavours */
1945 es->total = ARRAY_SIZE(mlang_data) - 1;
1946 es->script_info = HeapAlloc(GetProcessHeap(), 0, sizeof(SCRIPTINFO) * es->total);
1947
1948 for (i = 0; i < es->total; i++)
1949 {
1950 es->script_info[i].ScriptId = i;
1951 es->script_info[i].uiCodePage = mlang_data[i].family_codepage;
1953 es->script_info[i].wszDescription, MAX_SCRIPT_NAME);
1954 MultiByteToWideChar(CP_ACP, 0, mlang_data[i].fixed_font, -1,
1955 es->script_info[i].wszFixedWidthFont, MAX_MIMEFACE_NAME);
1956 MultiByteToWideChar(CP_ACP, 0, mlang_data[i].proportional_font, -1,
1957 es->script_info[i].wszProportionalFont, MAX_MIMEFACE_NAME);
1958 }
1959
1960 TRACE("enumerated %d scripts with flags %08x\n", es->total, dwFlags);
1961
1962 *ppEnumScript = &es->IEnumScript_iface;
1963
1964 return S_OK;
1965}
static const IEnumScriptVtbl IEnumScript_vtbl
Definition: mlang.c:1918
#define es
Definition: i386-dis.c:440
UINT family_codepage
Definition: mlang.c:487
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
const char * description
Definition: directx.c:2497

Referenced by fnIMultiLanguage3_EnumScripts().

◆ exit_shift()

static int exit_shift ( LPSTR  out,
int  c 
)
inlinestatic

Definition at line 719 of file mlang.c.

720{
721 if (out)
722 {
723 out[c] = 0x1b;
724 out[c+1] = '(';
725 out[c+2] = 'B';
726 }
727 return 3;
728}

Referenced by ConvertSJIS2JIS().

◆ fill_cp_info()

static void fill_cp_info ( const struct mlang_data ml_data,
UINT  index,
MIMECPINFO *  mime_cp_info 
)
static

Definition at line 2656 of file mlang.c.

2657{
2658 CHARSETINFO csi;
2659
2662 mime_cp_info->bGDICharset = csi.ciCharset;
2663 else
2664 mime_cp_info->bGDICharset = DEFAULT_CHARSET;
2665
2666 mime_cp_info->dwFlags = ml_data->mime_cp_info[index].flags;
2667 mime_cp_info->uiCodePage = ml_data->mime_cp_info[index].cp;
2668 mime_cp_info->uiFamilyCodePage = ml_data->family_codepage;
2670 mime_cp_info->wszDescription, ARRAY_SIZE(mime_cp_info->wszDescription));
2672 mime_cp_info->wszWebCharset, ARRAY_SIZE(mime_cp_info->wszWebCharset));
2674 mime_cp_info->wszHeaderCharset, ARRAY_SIZE(mime_cp_info->wszHeaderCharset));
2676 mime_cp_info->wszBodyCharset, ARRAY_SIZE(mime_cp_info->wszBodyCharset));
2677
2678 MultiByteToWideChar(CP_ACP, 0, ml_data->fixed_font, -1,
2679 mime_cp_info->wszFixedWidthFont, ARRAY_SIZE(mime_cp_info->wszFixedWidthFont));
2681 mime_cp_info->wszProportionalFont, ARRAY_SIZE(mime_cp_info->wszProportionalFont));
2682
2683 TRACE("%08x %u %u %s %s %s %s %s %s %d\n",
2684 mime_cp_info->dwFlags, mime_cp_info->uiCodePage,
2685 mime_cp_info->uiFamilyCodePage,
2686 wine_dbgstr_w(mime_cp_info->wszDescription),
2687 wine_dbgstr_w(mime_cp_info->wszWebCharset),
2688 wine_dbgstr_w(mime_cp_info->wszHeaderCharset),
2689 wine_dbgstr_w(mime_cp_info->wszBodyCharset),
2690 wine_dbgstr_w(mime_cp_info->wszFixedWidthFont),
2691 wine_dbgstr_w(mime_cp_info->wszProportionalFont),
2692 mime_cp_info->bGDICharset);
2693}
#define index(s, c)
Definition: various.h:29
GLuint index
Definition: glext.h:6031
const char * header_charset
Definition: mlang.c:65
UINT cp
Definition: mlang.c:62
const char * body_charset
Definition: mlang.c:66
const char * description
Definition: mlang.c:61
DWORD flags
Definition: mlang.c:63
const char * web_charset
Definition: mlang.c:64
const MIME_CP_INFO * mime_cp_info
Definition: mlang.c:489
const char * fixed_font
Definition: mlang.c:490
const char * proportional_font
Definition: mlang.c:491
UINT ciCharset
Definition: wingdi.h:1546
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define DEFAULT_CHARSET
Definition: wingdi.h:384
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
#define TCI_SRCCODEPAGE
Definition: wingdi.h:962

Referenced by EnumCodePage_create(), fnIMultiLanguage3_GetCodePageInfo(), and fnIMultiLanguage_GetCodePageInfo().

◆ fnIEnumCodePage_AddRef()

static ULONG WINAPI fnIEnumCodePage_AddRef ( IEnumCodePage *  iface)
static

Definition at line 1641 of file mlang.c.

1643{
1645 return InterlockedIncrement(&This->ref);
1646}
#define InterlockedIncrement
Definition: armddk.h:53
static EnumCodePage_impl * impl_from_IEnumCodePage(IEnumCodePage *iface)
Definition: mlang.c:1614

◆ fnIEnumCodePage_Clone()

static HRESULT WINAPI fnIEnumCodePage_Clone ( IEnumCodePage *  iface,
IEnumCodePage **  ppEnum 
)
static

Definition at line 1665 of file mlang.c.

1668{
1670 FIXME("%p %p\n", This, ppEnum);
1671 return E_NOTIMPL;
1672}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ fnIEnumCodePage_Next()

static HRESULT WINAPI fnIEnumCodePage_Next ( IEnumCodePage *  iface,
ULONG  celt,
PMIMECPINFO  rgelt,
ULONG pceltFetched 
)
static

Definition at line 1674 of file mlang.c.

1679{
1680 ULONG i;
1682
1683 TRACE("%p %u %p %p\n", This, celt, rgelt, pceltFetched);
1684
1685 if (!pceltFetched) return S_FALSE;
1686 *pceltFetched = 0;
1687
1688 if (!rgelt) return S_FALSE;
1689
1690 if (This->pos + celt > This->total)
1691 celt = This->total - This->pos;
1692
1693 if (!celt) return S_FALSE;
1694
1695 memcpy(rgelt, This->cpinfo + This->pos, celt * sizeof(MIMECPINFO));
1696 *pceltFetched = celt;
1697 This->pos += celt;
1698
1699 for (i = 0; i < celt; i++)
1700 {
1701 TRACE("#%u: %08x %u %u %s %s %s %s %s %s %d\n",
1702 i, rgelt[i].dwFlags, rgelt[i].uiCodePage,
1703 rgelt[i].uiFamilyCodePage,
1704 wine_dbgstr_w(rgelt[i].wszDescription),
1705 wine_dbgstr_w(rgelt[i].wszWebCharset),
1706 wine_dbgstr_w(rgelt[i].wszHeaderCharset),
1707 wine_dbgstr_w(rgelt[i].wszBodyCharset),
1708 wine_dbgstr_w(rgelt[i].wszFixedWidthFont),
1709 wine_dbgstr_w(rgelt[i].wszProportionalFont),
1710 rgelt[i].bGDICharset);
1711 }
1712 return S_OK;
1713}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
uint32_t ULONG
Definition: typedefs.h:59

◆ fnIEnumCodePage_QueryInterface()

static HRESULT WINAPI fnIEnumCodePage_QueryInterface ( IEnumCodePage *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1619 of file mlang.c.

1623{
1625
1626 TRACE("%p -> %s\n", This, debugstr_guid(riid) );
1627
1629 || IsEqualGUID(riid, &IID_IEnumCodePage))
1630 {
1631 IEnumCodePage_AddRef(iface);
1632 TRACE("Returning IID_IEnumCodePage %p ref = %d\n", This, This->ref);
1633 *ppvObject = &This->IEnumCodePage_iface;
1634 return S_OK;
1635 }
1636
1637 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
1638 return E_NOINTERFACE;
1639}
#define WARN(fmt,...)
Definition: precomp.h:61
REFIID riid
Definition: atlbase.h:39
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ fnIEnumCodePage_Release()

static ULONG WINAPI fnIEnumCodePage_Release ( IEnumCodePage *  iface)
static

Definition at line 1648 of file mlang.c.

1650{
1653
1654 TRACE("%p ref = %d\n", This, ref);
1655 if (ref == 0)
1656 {
1657 TRACE("Destroying %p\n", This);
1658 HeapFree(GetProcessHeap(), 0, This->cpinfo);
1660 }
1661
1662 return ref;
1663}
#define InterlockedDecrement
Definition: armddk.h:52
Definition: send.c:48

◆ fnIEnumCodePage_Reset()

static HRESULT WINAPI fnIEnumCodePage_Reset ( IEnumCodePage *  iface)
static

Definition at line 1715 of file mlang.c.

1717{
1719
1720 TRACE("%p\n", This);
1721
1722 This->pos = 0;
1723 return S_OK;
1724}

◆ fnIEnumCodePage_Skip()

static HRESULT WINAPI fnIEnumCodePage_Skip ( IEnumCodePage *  iface,
ULONG  celt 
)
static

Definition at line 1726 of file mlang.c.

1729{
1731
1732 TRACE("%p %u\n", This, celt);
1733
1734 if (celt >= This->total) return S_FALSE;
1735
1736 This->pos += celt;
1737 return S_OK;
1738}

◆ fnIEnumRfc1766_AddRef()

static ULONG WINAPI fnIEnumRfc1766_AddRef ( IEnumRfc1766 *  iface)
static

Definition at line 2300 of file mlang.c.

2302{
2304 return InterlockedIncrement(&This->ref);
2305}
static EnumRfc1766_impl * impl_from_IEnumRfc1766(IEnumRfc1766 *iface)
Definition: mlang.c:2273

◆ fnIEnumRfc1766_Clone()

static HRESULT WINAPI fnIEnumRfc1766_Clone ( IEnumRfc1766 *  iface,
IEnumRfc1766 **  ppEnum 
)
static

Definition at line 2323 of file mlang.c.

2326{
2328
2329 FIXME("%p %p\n", This, ppEnum);
2330 return E_NOTIMPL;
2331}

◆ fnIEnumRfc1766_Next()

static HRESULT WINAPI fnIEnumRfc1766_Next ( IEnumRfc1766 *  iface,
ULONG  celt,
PRFC1766INFO  rgelt,
ULONG pceltFetched 
)
static

Definition at line 2333 of file mlang.c.

2338{
2339 ULONG i;
2341
2342 TRACE("%p %u %p %p\n", This, celt, rgelt, pceltFetched);
2343
2344 if (!pceltFetched) return S_FALSE;
2345 *pceltFetched = 0;
2346
2347 if (!rgelt) return S_FALSE;
2348
2349 if (This->pos + celt > This->total)
2350 celt = This->total - This->pos;
2351
2352 if (!celt) return S_FALSE;
2353
2354 memcpy(rgelt, This->info + This->pos, celt * sizeof(RFC1766INFO));
2355 *pceltFetched = celt;
2356 This->pos += celt;
2357
2358 for (i = 0; i < celt; i++)
2359 {
2360 TRACE("#%u: %08x %s %s\n",
2361 i, rgelt[i].lcid,
2362 wine_dbgstr_w(rgelt[i].wszRfc1766),
2363 wine_dbgstr_w(rgelt[i].wszLocaleName));
2364 }
2365 return S_OK;
2366}

◆ fnIEnumRfc1766_QueryInterface()

static HRESULT WINAPI fnIEnumRfc1766_QueryInterface ( IEnumRfc1766 *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 2278 of file mlang.c.

2282{
2284
2285 TRACE("%p -> %s\n", This, debugstr_guid(riid) );
2286
2288 || IsEqualGUID(riid, &IID_IEnumRfc1766))
2289 {
2290 IEnumRfc1766_AddRef(iface);
2291 TRACE("Returning IID_IEnumRfc1766 %p ref = %d\n", This, This->ref);
2292 *ppvObject = &This->IEnumRfc1766_iface;
2293 return S_OK;
2294 }
2295
2296 WARN("(%p) -> (%s,%p), not found\n",This,debugstr_guid(riid),ppvObject);
2297 return E_NOINTERFACE;
2298}

◆ fnIEnumRfc1766_Release()

static ULONG WINAPI fnIEnumRfc1766_Release ( IEnumRfc1766 *  iface)
static

Definition at line 2307 of file mlang.c.

2309{
2312
2313 TRACE("%p ref = %d\n", This, ref);
2314 if (ref == 0)
2315 {
2316 TRACE("Destroying %p\n", This);
2317 HeapFree(GetProcessHeap(), 0, This->info);
2319 }
2320 return ref;
2321}

◆ fnIEnumRfc1766_Reset()

static HRESULT WINAPI fnIEnumRfc1766_Reset ( IEnumRfc1766 *  iface)
static

Definition at line 2368 of file mlang.c.

2370{
2372
2373 TRACE("%p\n", This);
2374
2375 This->pos = 0;
2376 return S_OK;
2377}

◆ fnIEnumRfc1766_Skip()

static HRESULT WINAPI fnIEnumRfc1766_Skip ( IEnumRfc1766 *  iface,
ULONG  celt 
)
static

Definition at line 2379 of file mlang.c.

2382{
2384
2385 TRACE("%p %u\n", This, celt);
2386
2387 if (celt >= This->total) return S_FALSE;
2388
2389 This->pos += celt;
2390 return S_OK;
2391}

◆ fnIEnumScript_AddRef()

static ULONG WINAPI fnIEnumScript_AddRef ( IEnumScript *  iface)
static

Definition at line 1834 of file mlang.c.

1836{
1838 return InterlockedIncrement(&This->ref);
1839}
static EnumScript_impl * impl_from_IEnumScript(IEnumScript *iface)
Definition: mlang.c:1807

◆ fnIEnumScript_Clone()

static HRESULT WINAPI fnIEnumScript_Clone ( IEnumScript *  iface,
IEnumScript **  ppEnum 
)
static

Definition at line 1858 of file mlang.c.

1861{
1863 FIXME("%p %p: stub!\n", This, ppEnum);
1864 return E_NOTIMPL;
1865}

◆ fnIEnumScript_Next()

static HRESULT WINAPI fnIEnumScript_Next ( IEnumScript *  iface,
ULONG  celt,
PSCRIPTINFO  rgelt,
ULONG pceltFetched 
)
static

Definition at line 1867 of file mlang.c.

1872{
1874
1875 TRACE("%p %u %p %p\n", This, celt, rgelt, pceltFetched);
1876
1877 if (!pceltFetched || !rgelt) return E_FAIL;
1878
1879 *pceltFetched = 0;
1880
1881 if (This->pos + celt > This->total)
1882 celt = This->total - This->pos;
1883
1884 if (!celt) return S_FALSE;
1885
1886 memcpy(rgelt, This->script_info + This->pos, celt * sizeof(SCRIPTINFO));
1887 *pceltFetched = celt;
1888 This->pos += celt;
1889
1890 return S_OK;
1891}

◆ fnIEnumScript_QueryInterface()

static HRESULT WINAPI fnIEnumScript_QueryInterface ( IEnumScript *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1812 of file mlang.c.

1816{
1818
1819 TRACE("%p -> %s\n", This, debugstr_guid(riid) );
1820
1822 || IsEqualGUID(riid, &IID_IEnumScript))
1823 {
1824 IEnumScript_AddRef(iface);
1825 TRACE("Returning IID_IEnumScript %p ref = %d\n", This, This->ref);
1826 *ppvObject = &This->IEnumScript_iface;
1827 return S_OK;
1828 }
1829
1830 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
1831 return E_NOINTERFACE;
1832}

◆ fnIEnumScript_Release()

static ULONG WINAPI fnIEnumScript_Release ( IEnumScript *  iface)
static

Definition at line 1841 of file mlang.c.

1843{
1846
1847 TRACE("%p ref = %d\n", This, ref);
1848 if (ref == 0)
1849 {
1850 TRACE("Destroying %p\n", This);
1851 HeapFree(GetProcessHeap(), 0, This->script_info);
1853 }
1854
1855 return ref;
1856}

◆ fnIEnumScript_Reset()

static HRESULT WINAPI fnIEnumScript_Reset ( IEnumScript *  iface)
static

Definition at line 1893 of file mlang.c.

1895{
1897
1898 TRACE("%p\n", This);
1899
1900 This->pos = 0;
1901 return S_OK;
1902}

◆ fnIEnumScript_Skip()

static HRESULT WINAPI fnIEnumScript_Skip ( IEnumScript *  iface,
ULONG  celt 
)
static

Definition at line 1904 of file mlang.c.

1907{
1909
1910 TRACE("%p %u\n", This, celt);
1911
1912 if (celt >= This->total) return S_FALSE;
1913
1914 This->pos += celt;
1915 return S_OK;
1916}

◆ fnIMLangFontLink2_AddRef()

static ULONG WINAPI fnIMLangFontLink2_AddRef ( IMLangFontLink2 *  iface)
static

Definition at line 3318 of file mlang.c.

3319{
3321 return IMultiLanguage3_AddRef( &This->IMultiLanguage3_iface );
3322}
static MLang_impl * impl_from_IMLangFontLink2(IMLangFontLink2 *iface)
Definition: mlang.c:3304

◆ fnIMLangFontLink2_CodePagesToCodePage()

static HRESULT WINAPI fnIMLangFontLink2_CodePagesToCodePage ( IMLangFontLink2 *  iface,
DWORD  codepages,
UINT  def_codepage,
UINT codepage 
)
static

Definition at line 3421 of file mlang.c.

3423{
3425 DWORD mask = 0;
3427 BOOL rc;
3428 UINT i;
3429
3430 TRACE("(%p)->(0x%x %u %p)\n", This, codepages, def_codepage, codepage);
3431
3432 *codepage = 0;
3433
3434 rc = TranslateCharsetInfo((DWORD*)(DWORD_PTR)def_codepage, &cs, TCI_SRCCODEPAGE);
3435 if (rc && (codepages & cs.fs.fsCsb[0]))
3436 {
3437 TRACE("Found Default Codepage\n");
3438 *codepage = def_codepage;
3439 return S_OK;
3440 }
3441
3442 for (i = 0; i < 32; i++)
3443 {
3444 mask = 1 << i;
3445 if (codepages & mask)
3446 {
3447 DWORD Csb[2];
3448 Csb[0] = mask;
3449 Csb[1] = 0x0;
3451 if (!rc)
3452 continue;
3453
3454 TRACE("Falling back to least significant found CodePage %u\n",
3455 cs.ciACP);
3456 *codepage = cs.ciACP;
3457 return S_OK;
3458 }
3459 }
3460
3461 TRACE("no codepage found\n");
3462 return E_FAIL;
3463}
GLenum GLint GLuint mask
Definition: glext.h:6028
#define cs
Definition: i386-dis.c:442
int codepage
Definition: win_iconv.c:156
#define TCI_SRCFONTSIG
Definition: wingdi.h:963

◆ fnIMLangFontLink2_CodePageToCodePages()

static HRESULT WINAPI fnIMLangFontLink2_CodePageToCodePages ( IMLangFontLink2 *  iface,
UINT  codepage,
DWORD codepages 
)
static

Definition at line 3398 of file mlang.c.

3401{
3404 BOOL rc;
3405
3406 TRACE("(%p)->(%u %p)\n", This, codepage, codepages);
3407
3409 if (rc)
3410 {
3411 *codepages = cs.fs.fsCsb[0];
3412 TRACE("resulting codepages 0x%x\n", *codepages);
3413 return S_OK;
3414 }
3415
3416 TRACE("codepage not found\n");
3417 *codepages = 0;
3418 return E_FAIL;
3419}

◆ fnIMLangFontLink2_CodePageToScriptID()

static HRESULT WINAPI fnIMLangFontLink2_CodePageToScriptID ( IMLangFontLink2 *  This,
UINT  uiCodePage,
SCRIPT_ID *  pSid 
)
static

Definition at line 3587 of file mlang.c.

3589{
3590 UINT i;
3591
3592 TRACE("(%p)->%i %p\n", This, uiCodePage, pSid);
3593
3594 if (uiCodePage == CP_UNICODE) return E_FAIL;
3595
3596 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
3597 {
3598 if (uiCodePage == mlang_data[i].family_codepage)
3599 {
3600 if (pSid) *pSid = mlang_data[i].sid;
3601 return S_OK;
3602 }
3603 }
3604 return E_FAIL;
3605}
static PSID pSid
Definition: security.c:74
SCRIPT_ID sid
Definition: mlang.c:492

◆ fnIMLangFontLink2_GetCharCodePages()

static HRESULT WINAPI fnIMLangFontLink2_GetCharCodePages ( IMLangFontLink2 *  iface,
WCHAR  ch_src,
DWORD ret_codepages 
)
static

Definition at line 3330 of file mlang.c.

3332{
3334 unsigned int i;
3335
3336 TRACE("(%p)->(%s %p)\n", This, debugstr_wn(&ch_src, 1), ret_codepages);
3337
3338 *ret_codepages = 0;
3339
3340 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
3341 {
3342 BOOL used_dc;
3343 CHAR buf;
3344
3346 &ch_src, 1, &buf, 1, NULL, &used_dc);
3347
3348 /* If default char is not used, current codepage include the given symbol */
3349 if (!used_dc)
3350 {
3351 DWORD codepages;
3352
3353 IMLangFontLink2_CodePageToCodePages(iface,
3354 mlang_data[i].family_codepage, &codepages);
3355 *ret_codepages |= codepages;
3356 }
3357 }
3358 return S_OK;
3359}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define WC_NO_BEST_FIT_CHARS
Definition: unicode.h:46
#define debugstr_wn
Definition: kernel32.h:33

◆ fnIMLangFontLink2_GetFontCodePages()

static HRESULT WINAPI fnIMLangFontLink2_GetFontCodePages ( IMLangFontLink2 *  iface,
HDC  hdc,
HFONT  hfont,
DWORD codepages 
)
static

Definition at line 3465 of file mlang.c.

3467{
3469 FONTSIGNATURE fontsig;
3470 HFONT old_font;
3471
3472 TRACE("(%p)->(%p %p %p)\n", This, hdc, hfont, codepages);
3473
3474 old_font = SelectObject(hdc, hfont);
3475 GetTextCharsetInfo(hdc, &fontsig, 0);
3476 SelectObject(hdc, old_font);
3477
3478 *codepages = fontsig.fsCsb[0];
3479 TRACE("ret 0x%x\n", fontsig.fsCsb[0]);
3480
3481 return S_OK;
3482}
static HFONT hfont
HDC hdc
Definition: main.c:9
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
DWORD fsCsb[2]
Definition: wingdi.h:1543
int WINAPI GetTextCharsetInfo(_In_ HDC, _Out_opt_ LPFONTSIGNATURE, _In_ DWORD)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546

◆ fnIMLangFontLink2_GetFontUnicodeRanges()

static HRESULT WINAPI fnIMLangFontLink2_GetFontUnicodeRanges ( IMLangFontLink2 *  This,
HDC  hDC,
UINT puiRanges,
UNICODERANGE *  pUranges 
)
static

Definition at line 3521 of file mlang.c.

3523{
3524 DWORD size;
3525 GLYPHSET *gs;
3526
3527 TRACE("(%p)->%p %p %p\n", This, hDC, puiRanges, pUranges);
3528
3529 if (!puiRanges) return E_INVALIDARG;
3530 if (!(size = GetFontUnicodeRanges(hDC, NULL))) return E_FAIL;
3531 if (!(gs = HeapAlloc(GetProcessHeap(), 0, size))) return E_OUTOFMEMORY;
3532
3533 GetFontUnicodeRanges(hDC, gs);
3534 *puiRanges = gs->cRanges;
3535 if (pUranges)
3536 {
3537 UINT i;
3538 for (i = 0; i < gs->cRanges; i++)
3539 {
3540 if (i >= *puiRanges) break;
3541 pUranges[i].wcFrom = gs->ranges[i].wcLow;
3542 pUranges[i].wcTo = gs->ranges[i].wcLow + gs->ranges[i].cGlyphs;
3543 }
3544 *puiRanges = i;
3545 }
3546 HeapFree(GetProcessHeap(), 0, gs);
3547 return S_OK;
3548}
static HDC hDC
Definition: 3dtext.c:33
#define E_INVALIDARG
Definition: ddrawi.h:101
#define gs
Definition: i386-dis.c:445

◆ fnIMLangFontLink2_GetScriptFontInfo()

static HRESULT WINAPI fnIMLangFontLink2_GetScriptFontInfo ( IMLangFontLink2 *  This,
SCRIPT_ID  sid,
DWORD  dwFlags,
UINT puiFonts,
SCRIPTFONTINFO *  pScriptFont 
)
static

Definition at line 3550 of file mlang.c.

3553{
3554 UINT i, j;
3555
3556 TRACE("(%p)->%u %x %p %p\n", This, sid, dwFlags, puiFonts, pScriptFont);
3557
3558 if (!dwFlags) dwFlags = SCRIPTCONTF_PROPORTIONAL_FONT;
3559
3560 for (i = 0, j = 0; i < ARRAY_SIZE(mlang_data); i++)
3561 {
3562 if (sid == mlang_data[i].sid)
3563 {
3564 if (pScriptFont)
3565 {
3566 if (j >= *puiFonts) break;
3567
3568 pScriptFont[j].scripts = (SCRIPT_IDS)1 << mlang_data[i].sid;
3569 if (dwFlags == SCRIPTCONTF_FIXED_FONT)
3570 {
3571 MultiByteToWideChar(CP_ACP, 0, mlang_data[i].fixed_font, -1,
3572 pScriptFont[j].wszFont, MAX_MIMEFACE_NAME);
3573 }
3574 else if (dwFlags == SCRIPTCONTF_PROPORTIONAL_FONT)
3575 {
3576 MultiByteToWideChar(CP_ACP, 0, mlang_data[i].proportional_font, -1,
3577 pScriptFont[j].wszFont, MAX_MIMEFACE_NAME);
3578 }
3579 }
3580 j++;
3581 }
3582 }
3583 *puiFonts = j;
3584 return S_OK;
3585}
FT_UInt sid
Definition: cffcmap.c:139

◆ fnIMLangFontLink2_GetStrCodePages()

static HRESULT WINAPI fnIMLangFontLink2_GetStrCodePages ( IMLangFontLink2 *  iface,
const WCHAR src,
LONG  src_len,
DWORD  priority_cp,
DWORD codepages,
LONG ret_len 
)
static

Definition at line 3361 of file mlang.c.

3364{
3366 LONG i;
3367 DWORD cps = 0;
3368
3369 TRACE("(%p)->(%s:%d %x %p %p)\n", This, debugstr_wn(src, src_len), src_len, priority_cp,
3370 codepages, ret_len);
3371
3372 if (codepages) *codepages = 0;
3373 if (ret_len) *ret_len = 0;
3374
3375 if (!src || !src_len || src_len < 0)
3376 return E_INVALIDARG;
3377
3378 for (i = 0; i < src_len; i++)
3379 {
3380 DWORD cp;
3381 HRESULT ret;
3382
3383 ret = IMLangFontLink2_GetCharCodePages(iface, src[i], &cp);
3384 if (ret != S_OK) return E_FAIL;
3385
3386 if (!cps) cps = cp;
3387 else cps &= cp;
3388
3389 /* FIXME: not tested */
3390 if (priority_cp & cps) break;
3391 }
3392
3393 if (codepages) *codepages = cps;
3394 if (ret_len) *ret_len = min( i + 1, src_len );
3395 return S_OK;
3396}
GLenum src
Definition: glext.h:6340
POINT cp
Definition: magnifier.c:59
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:79
long LONG
Definition: pedump.c:60
int ret

◆ fnIMLangFontLink2_MapFont()

static HRESULT WINAPI fnIMLangFontLink2_MapFont ( IMLangFontLink2 *  This,
HDC  hDC,
DWORD  dwCodePages,
WCHAR  chSrc,
HFONT pFont 
)
static

Definition at line 3499 of file mlang.c.

3501{
3502 HFONT old_font;
3503
3504 TRACE("(%p)->%p %08x %04x %p\n",This, hDC, dwCodePages, chSrc, pFont);
3505
3506 if (!hDC) return E_FAIL;
3507
3508 if (dwCodePages != 0)
3509 {
3510 old_font = GetCurrentObject(hDC, OBJ_FONT);
3511 return map_font(hDC, dwCodePages, old_font, pFont);
3512 }
3513 else
3514 {
3515 if (pFont == NULL) return E_INVALIDARG;
3516 FIXME("the situation where dwCodepages is set to zero is not implemented\n");
3517 return E_FAIL;
3518 }
3519}
static HRESULT map_font(HDC hdc, DWORD codepages, HFONT src_font, HFONT *dst_font)
Definition: mlang.c:1332
#define OBJ_FONT
Definition: objidl.idl:1414
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:428

◆ fnIMLangFontLink2_QueryInterface()

static HRESULT WINAPI fnIMLangFontLink2_QueryInterface ( IMLangFontLink2 *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3309 of file mlang.c.

3313{
3315 return IMultiLanguage3_QueryInterface( &This->IMultiLanguage3_iface, riid, ppvObject );
3316}

◆ fnIMLangFontLink2_Release()

static ULONG WINAPI fnIMLangFontLink2_Release ( IMLangFontLink2 *  iface)
static

Definition at line 3324 of file mlang.c.

3325{
3327 return IMultiLanguage3_Release( &This->IMultiLanguage3_iface );
3328}

◆ fnIMLangFontLink2_ReleaseFont()

static HRESULT WINAPI fnIMLangFontLink2_ReleaseFont ( IMLangFontLink2 *  This,
HFONT  hFont 
)
static

Definition at line 3484 of file mlang.c.

3486{
3487 TRACE("(%p)->%p\n",This, hFont);
3488
3489 return release_font(hFont);
3490}
HFONT hFont
Definition: main.c:53
static HRESULT release_font(HFONT font)
Definition: mlang.c:1405

◆ fnIMLangFontLink2_ResetFontMapping()

static HRESULT WINAPI fnIMLangFontLink2_ResetFontMapping ( IMLangFontLink2 *  This)
static

Definition at line 3492 of file mlang.c.

3493{
3494 TRACE("(%p)\n",This);
3495
3496 return clear_font_cache();
3497}
static HRESULT clear_font_cache(void)
Definition: mlang.c:1428

◆ fnIMLangFontLink_AddRef()

static ULONG WINAPI fnIMLangFontLink_AddRef ( IMLangFontLink *  iface)
static

Definition at line 1983 of file mlang.c.

1985{
1987 return IMultiLanguage3_AddRef( &This->IMultiLanguage3_iface );
1988}
static MLang_impl * impl_from_IMLangFontLink(IMLangFontLink *iface)
Definition: mlang.c:1969

◆ fnIMLangFontLink_CodePagesToCodePage()

static HRESULT WINAPI fnIMLangFontLink_CodePagesToCodePage ( IMLangFontLink *  iface,
DWORD  codepages,
UINT  def_codepage,
UINT codepage 
)
static

Definition at line 2028 of file mlang.c.

2033{
2035 return IMLangFontLink2_CodePagesToCodePage(&This->IMLangFontLink2_iface, codepages,
2036 def_codepage, codepage);
2037}

◆ fnIMLangFontLink_CodePageToCodePages()

static HRESULT WINAPI fnIMLangFontLink_CodePageToCodePages ( IMLangFontLink *  iface,
UINT  codepage,
DWORD codepages 
)
static

Definition at line 2019 of file mlang.c.

2023{
2025 return IMLangFontLink2_CodePageToCodePages(&This->IMLangFontLink2_iface, codepage, codepages);
2026}

◆ fnIMLangFontLink_GetCharCodePages()

static HRESULT WINAPI fnIMLangFontLink_GetCharCodePages ( IMLangFontLink *  iface,
WCHAR  ch_src,
DWORD codepages 
)
static

Definition at line 1997 of file mlang.c.

2001{
2003 return IMLangFontLink2_GetCharCodePages(&This->IMLangFontLink2_iface, ch_src, codepages);
2004}

◆ fnIMLangFontLink_GetFontCodePages()

static HRESULT WINAPI fnIMLangFontLink_GetFontCodePages ( IMLangFontLink *  iface,
HDC  hdc,
HFONT  hfont,
DWORD codepages 
)
static

Definition at line 2039 of file mlang.c.

2044{
2046 return IMLangFontLink2_GetFontCodePages(&This->IMLangFontLink2_iface, hdc, hfont, codepages);
2047}

◆ fnIMLangFontLink_GetStrCodePages()

static HRESULT WINAPI fnIMLangFontLink_GetStrCodePages ( IMLangFontLink *  iface,
const WCHAR src,
LONG  src_len,
DWORD  priority_cp,
DWORD codepages,
LONG ret_len 
)
static

Definition at line 2006 of file mlang.c.

2013{
2015 return IMLangFontLink2_GetStrCodePages(&This->IMLangFontLink2_iface, src, src_len, priority_cp,
2016 codepages, ret_len);
2017}

◆ fnIMLangFontLink_MapFont()

static HRESULT WINAPI fnIMLangFontLink_MapFont ( IMLangFontLink *  iface,
HDC  hDC,
DWORD  dwCodePages,
HFONT  hSrcFont,
HFONT phDestFont 
)
static

Definition at line 2049 of file mlang.c.

2055{
2056 TRACE("(%p)->%p %08x %p %p\n",iface, hDC, dwCodePages, hSrcFont, phDestFont);
2057
2058 return map_font(hDC, dwCodePages, hSrcFont, phDestFont);
2059}

◆ fnIMLangFontLink_QueryInterface()

static HRESULT WINAPI fnIMLangFontLink_QueryInterface ( IMLangFontLink *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1974 of file mlang.c.

1978{
1980 return IMultiLanguage3_QueryInterface( &This->IMultiLanguage3_iface, riid, ppvObject );
1981}

◆ fnIMLangFontLink_Release()

static ULONG WINAPI fnIMLangFontLink_Release ( IMLangFontLink *  iface)
static

Definition at line 1990 of file mlang.c.

1992{
1994 return IMultiLanguage3_Release( &This->IMultiLanguage3_iface );
1995}

◆ fnIMLangFontLink_ReleaseFont()

static HRESULT WINAPI fnIMLangFontLink_ReleaseFont ( IMLangFontLink *  iface,
HFONT  hFont 
)
static

Definition at line 2061 of file mlang.c.

2064{
2065 TRACE("(%p)->%p\n",iface, hFont);
2066
2067 return release_font(hFont);
2068}

◆ fnIMLangFontLink_ResetFontMapping()

static HRESULT WINAPI fnIMLangFontLink_ResetFontMapping ( IMLangFontLink *  iface)
static

Definition at line 2070 of file mlang.c.

2072{
2073 TRACE("(%p)\n",iface);
2074
2075 return clear_font_cache();
2076}

◆ fnIMLangLineBreakConsole_AddRef()

static ULONG WINAPI fnIMLangLineBreakConsole_AddRef ( IMLangLineBreakConsole *  iface)
static

Definition at line 3641 of file mlang.c.

3643{
3645 return IMultiLanguage3_AddRef( &This->IMultiLanguage3_iface );
3646}
static MLang_impl * impl_from_IMLangLineBreakConsole(IMLangLineBreakConsole *iface)
Definition: mlang.c:3627

◆ fnIMLangLineBreakConsole_BreakLineA()

static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineA ( IMLangLineBreakConsole *  iface,
LCID  locale,
UINT  uCodePage,
const CHAR pszSrc,
LONG  cchSrc,
LONG  cMaxColumns,
LONG pcchLine,
LONG pcchSkip 
)
static

Definition at line 3685 of file mlang.c.

3694{
3695 LONG i, line = cchSrc, skip = 0;
3696
3697 FIXME("(%p)->%i %i %s %i %i %p %p\n", iface, locale, uCodePage, debugstr_an(pszSrc,cchSrc), cchSrc, cMaxColumns, pcchLine, pcchSkip);
3698
3699 if (uCodePage == CP_USASCII && cchSrc > cMaxColumns)
3700 {
3701 for (line = cMaxColumns, i = cMaxColumns - 1; i >= 0; i--)
3702 {
3703 if (pszSrc[i] == ' ')
3704 {
3705 while (i >= 0 && pszSrc[i] == ' ')
3706 {
3707 i--;
3708 line--;
3709 skip++;
3710 }
3711 break;
3712 }
3713 }
3714 }
3715 *pcchLine = line;
3716 *pcchSkip = skip;
3717 return S_OK;
3718}
#define skip(...)
Definition: atltest.h:64
Definition: parser.c:49

◆ fnIMLangLineBreakConsole_BreakLineML()

static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineML ( IMLangLineBreakConsole *  iface,
IMLangString *  pSrcMLStr,
LONG  lSrcPos,
LONG  lSrcLen,
LONG  cMinColumns,
LONG  cMaxColumns,
LONG plLineLen,
LONG plSkipLen 
)
static

Definition at line 3655 of file mlang.c.

3664{
3665 FIXME("(%p)->%p %i %i %i %i %p %p\n", iface, pSrcMLStr, lSrcPos, lSrcLen, cMinColumns, cMaxColumns, plLineLen, plSkipLen);
3666 return E_NOTIMPL;
3667}

◆ fnIMLangLineBreakConsole_BreakLineW()

static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineW ( IMLangLineBreakConsole *  iface,
LCID  locale,
const WCHAR pszSrc,
LONG  cchSrc,
LONG  cMaxColumns,
LONG pcchLine,
LONG pcchSkip 
)
static

Definition at line 3669 of file mlang.c.

3677{
3678 FIXME("(%p)->%i %s %i %i %p %p\n", iface, locale, debugstr_wn(pszSrc,cchSrc), cchSrc, cMaxColumns, pcchLine, pcchSkip);
3679
3680 *pcchLine = cchSrc;
3681 *pcchSkip = 0;
3682 return S_OK;
3683}

◆ fnIMLangLineBreakConsole_QueryInterface()

static HRESULT WINAPI fnIMLangLineBreakConsole_QueryInterface ( IMLangLineBreakConsole *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3632 of file mlang.c.

3636{
3638 return IMultiLanguage3_QueryInterface( &This->IMultiLanguage3_iface, riid, ppvObject );
3639}

◆ fnIMLangLineBreakConsole_Release()

static ULONG WINAPI fnIMLangLineBreakConsole_Release ( IMLangLineBreakConsole *  iface)
static

Definition at line 3648 of file mlang.c.

3650{
3652 return IMultiLanguage3_Release( &This->IMultiLanguage3_iface );
3653}

◆ fnIMultiLanguage3_AddRef()

static ULONG WINAPI fnIMultiLanguage3_AddRef ( IMultiLanguage3 *  iface)
static

Definition at line 2621 of file mlang.c.

2622{
2624 return InterlockedIncrement(&This->ref);
2625}
static MLang_impl * impl_from_IMultiLanguage3(IMultiLanguage3 *iface)
Definition: mlang.c:2573

◆ fnIMultiLanguage3_ConvertString()

static HRESULT WINAPI fnIMultiLanguage3_ConvertString ( IMultiLanguage3 *  iface,
DWORD pdwMode,
DWORD  dwSrcEncoding,
DWORD  dwDstEncoding,
BYTE pSrcStr,
UINT pcSrcSize,
BYTE pDstStr,
UINT pcDstSize 
)
static

Definition at line 2811 of file mlang.c.

2820{
2821 return ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding,
2822 (LPCSTR)pSrcStr, (LPINT)pcSrcSize, (LPSTR)pDstStr, (LPINT)pcDstSize);
2823}
static CONVERTINETSTRING ConvertINetString
Definition: win_iconv.c:704
int * LPINT
Definition: windef.h:178
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182

◆ fnIMultiLanguage3_ConvertStringFromUnicode()

static HRESULT WINAPI fnIMultiLanguage3_ConvertStringFromUnicode ( IMultiLanguage3 *  iface,
DWORD pdwMode,
DWORD  dwEncoding,
WCHAR pSrcStr,
UINT pcSrcSize,
CHAR pDstStr,
UINT pcDstSize 
)
static

Definition at line 2838 of file mlang.c.

2846{
2847 return ConvertINetUnicodeToMultiByte(pdwMode, dwEncoding,
2848 pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize);
2849}

◆ fnIMultiLanguage3_ConvertStringFromUnicodeEx()

static HRESULT WINAPI fnIMultiLanguage3_ConvertStringFromUnicodeEx ( IMultiLanguage3 *  This,
DWORD pdwMode,
DWORD  dwEncoding,
WCHAR pSrcStr,
UINT pcSrcSize,
CHAR pDstStr,
UINT pcDstSize,
DWORD  dwFlag,
WCHAR lpFallBack 
)
static

Definition at line 3061 of file mlang.c.

3071{
3072 FIXME("\n");
3073 return ConvertINetUnicodeToMultiByte(pdwMode, dwEncoding,
3074 pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize);
3075}

◆ fnIMultiLanguage3_ConvertStringInIStream()

static HRESULT WINAPI fnIMultiLanguage3_ConvertStringInIStream ( IMultiLanguage3 *  iface,
DWORD pdwMode,
DWORD  dwFlag,
WCHAR lpFallBack,
DWORD  dwSrcEncoding,
DWORD  dwDstEncoding,
IStream pstmIn,
IStream pstmOut 
)
static

Definition at line 2976 of file mlang.c.

2985{
2986 char *src, *dst = NULL;
2987 INT srclen, dstlen;
2988 STATSTG stat;
2989 HRESULT hr;
2990
2991 TRACE("%p %0x8 %s %u %u %p %p\n",
2992 pdwMode, dwFlag, debugstr_w(lpFallBack), dwSrcEncoding, dwDstEncoding, pstmIn, pstmOut);
2993
2994 FIXME("dwFlag and lpFallBack not handled\n");
2995
2996 hr = IStream_Stat(pstmIn, &stat, STATFLAG_NONAME);
2997 if (FAILED(hr)) return hr;
2998
2999 if (stat.cbSize.QuadPart > MAXLONG) return E_INVALIDARG;
3000 if (!(src = HeapAlloc(GetProcessHeap(), 0, stat.cbSize.QuadPart))) return E_OUTOFMEMORY;
3001
3002 hr = IStream_Read(pstmIn, src, stat.cbSize.QuadPart, (ULONG *)&srclen);
3003 if (FAILED(hr)) goto exit;
3004
3005 hr = ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, src, &srclen, NULL, &dstlen);
3006 if (FAILED(hr)) goto exit;
3007
3008 if (!(dst = HeapAlloc(GetProcessHeap(), 0, dstlen)))
3009 {
3010 hr = E_OUTOFMEMORY;
3011 goto exit;
3012 }
3013 hr = ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, src, &srclen, dst, &dstlen);
3014 if (FAILED(hr)) goto exit;
3015
3016 hr = IStream_Write(pstmOut, dst, dstlen, NULL);
3017
3018exit:
3021 return hr;
3022}
#define stat
Definition: acwin.h:99
GLenum GLenum dst
Definition: glext.h:6340
#define FAILED(hr)
Definition: intsafe.h:51
static DWORD LPDWORD LPCSTR DWORD srclen
Definition: directory.c:52
static DWORD dstlen
Definition: directory.c:51
#define exit(n)
Definition: config.h:202
Definition: stat.h:55
#define MAXLONG
Definition: umtypes.h:116

◆ fnIMultiLanguage3_ConvertStringReset()

static HRESULT WINAPI fnIMultiLanguage3_ConvertStringReset ( IMultiLanguage3 *  iface)
static

Definition at line 2851 of file mlang.c.

2853{
2854 FIXME("\n");
2855 return E_NOTIMPL;
2856}

◆ fnIMultiLanguage3_ConvertStringToUnicode()

static HRESULT WINAPI fnIMultiLanguage3_ConvertStringToUnicode ( IMultiLanguage3 *  iface,
DWORD pdwMode,
DWORD  dwEncoding,
CHAR pSrcStr,
UINT pcSrcSize,
WCHAR pDstStr,
UINT pcDstSize 
)
static

Definition at line 2825 of file mlang.c.

2833{
2834 return ConvertINetMultiByteToUnicode(pdwMode, dwEncoding,
2835 pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize);
2836}

◆ fnIMultiLanguage3_ConvertStringToUnicodeEx()

static HRESULT WINAPI fnIMultiLanguage3_ConvertStringToUnicodeEx ( IMultiLanguage3 *  iface,
DWORD pdwMode,
DWORD  dwEncoding,
CHAR pSrcStr,
UINT pcSrcSize,
WCHAR pDstStr,
UINT pcDstSize,
DWORD  dwFlag,
WCHAR lpFallBack 
)
static

Definition at line 3024 of file mlang.c.

3034{
3035 if (dwFlag || lpFallBack)
3036 FIXME("Ignoring dwFlag (0x%x/%d) and lpFallBack (%p)\n",
3037 dwFlag, dwFlag, lpFallBack);
3038
3039 return ConvertINetMultiByteToUnicode(pdwMode, dwEncoding,
3040 pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize);
3041}

◆ fnIMultiLanguage3_CreateConvertCharset()

static HRESULT WINAPI fnIMultiLanguage3_CreateConvertCharset ( IMultiLanguage3 *  iface,
UINT  src_cp,
UINT  dst_cp,
DWORD  prop,
IMLangConvertCharset **  convert_charset 
)
static

Definition at line 2959 of file mlang.c.

2965{
2966 HRESULT hr;
2967
2968 TRACE("(%u %u 0x%08x %p)\n", src_cp, dst_cp, prop, convert_charset);
2969
2971 if (FAILED(hr)) return hr;
2972
2973 return IMLangConvertCharset_Initialize(*convert_charset, src_cp, dst_cp, prop);
2974}
static HRESULT MLangConvertCharset_create(IUnknown *outer, void **obj)
Definition: mlang.c:3900

◆ fnIMultiLanguage3_DetectCodepageInIStream()

static HRESULT WINAPI fnIMultiLanguage3_DetectCodepageInIStream ( IMultiLanguage3 *  iface,
DWORD  dwFlag,
DWORD  dwPrefWinCodePage,
IStream pstmIn,
DetectEncodingInfo *  lpEncoding,
INT pnScores 
)
static

Definition at line 3077 of file mlang.c.

3084{
3085 FIXME("\n");
3086 return E_NOTIMPL;
3087}

◆ fnIMultiLanguage3_DetectInputCodepage()

static HRESULT WINAPI fnIMultiLanguage3_DetectInputCodepage ( IMultiLanguage3 *  iface,
DWORD  dwFlag,
DWORD  dwPrefWinCodePage,
CHAR pSrcStr,
INT pcSrcSize,
DetectEncodingInfo *  lpEncoding,
INT pnScores 
)
static

Definition at line 3089 of file mlang.c.

3097{
3098 FIXME("\n");
3099 return E_NOTIMPL;
3100}

◆ fnIMultiLanguage3_DetectOutboundCodePage()

static HRESULT WINAPI fnIMultiLanguage3_DetectOutboundCodePage ( IMultiLanguage3 *  iface,
DWORD  dwFlags,
LPCWSTR  lpWideCharStr,
UINT  cchWideChar,
UINT puiPreferredCodePages,
UINT  nPreferredCodePages,
UINT puiDetectedCodePages,
UINT pnDetectedCodePages,
WCHAR lpSpecialChar 
)
static

Definition at line 3215 of file mlang.c.

3225{
3227
3228 FIXME("(%p)->(%08x %s %p %u %p %p(%u) %s)\n", This, dwFlags, debugstr_w(lpWideCharStr),
3229 puiPreferredCodePages, nPreferredCodePages, puiDetectedCodePages,
3230 pnDetectedCodePages, pnDetectedCodePages ? *pnDetectedCodePages : 0,
3231 debugstr_w(lpSpecialChar));
3232
3233 if (!puiDetectedCodePages || !pnDetectedCodePages || !*pnDetectedCodePages)
3234 return E_INVALIDARG;
3235
3236 puiDetectedCodePages[0] = CP_UTF8;
3237 *pnDetectedCodePages = 1;
3238 return S_OK;
3239}
#define CP_UTF8
Definition: nls.h:20

◆ fnIMultiLanguage3_DetectOutboundCodePageInIStream()

static HRESULT WINAPI fnIMultiLanguage3_DetectOutboundCodePageInIStream ( IMultiLanguage3 *  iface,
DWORD  dwFlags,
IStream pStrIn,
UINT puiPreferredCodePages,
UINT  nPreferredCodePages,
UINT puiDetectedCodePages,
UINT pnDetectedCodePages,
WCHAR lpSpecialChar 
)
static

Definition at line 3241 of file mlang.c.

3250{
3252
3253 FIXME("(%p)->(%08x %p %p %u %p %p(%u) %s)\n", This, dwFlags, pStrIn,
3254 puiPreferredCodePages, nPreferredCodePages, puiDetectedCodePages,
3255 pnDetectedCodePages, pnDetectedCodePages ? *pnDetectedCodePages : 0,
3256 debugstr_w(lpSpecialChar));
3257
3258 if (!puiDetectedCodePages || !pnDetectedCodePages || !*pnDetectedCodePages)
3259 return E_INVALIDARG;
3260
3261 puiDetectedCodePages[0] = CP_UTF8;
3262 *pnDetectedCodePages = 1;
3263 return S_OK;
3264}

◆ fnIMultiLanguage3_EnumCodePages()

static HRESULT WINAPI fnIMultiLanguage3_EnumCodePages ( IMultiLanguage3 *  iface,
DWORD  grfFlags,
LANGID  LangId,
IEnumCodePage **  ppEnumCodePage 
)
static

Definition at line 2729 of file mlang.c.

2734{
2736
2737 TRACE("%p %08x %04x %p\n", This, grfFlags, LangId, ppEnumCodePage);
2738
2739 return EnumCodePage_create( This, grfFlags, LangId, ppEnumCodePage );
2740}
static HRESULT EnumCodePage_create(MLang_impl *mlang, DWORD grfFlags, LANGID LangId, IEnumCodePage **ppEnumCodePage)
Definition: mlang.c:1751

◆ fnIMultiLanguage3_EnumRfc1766()

static HRESULT WINAPI fnIMultiLanguage3_EnumRfc1766 ( IMultiLanguage3 *  iface,
LANGID  LangId,
IEnumRfc1766 **  ppEnumRfc1766 
)
static

Definition at line 2900 of file mlang.c.

2904{
2906
2907 TRACE("%p %p\n", This, ppEnumRfc1766);
2908
2909 return EnumRfc1766_create(LangId, ppEnumRfc1766);
2910}
static HRESULT EnumRfc1766_create(LANGID LangId, IEnumRfc1766 **ppEnum)
Definition: mlang.c:2443

◆ fnIMultiLanguage3_EnumScripts()

static HRESULT WINAPI fnIMultiLanguage3_EnumScripts ( IMultiLanguage3 *  iface,
DWORD  dwFlags,
LANGID  LangId,
IEnumScript **  ppEnumScript 
)
static

Definition at line 3170 of file mlang.c.

3175{
3177
3178 TRACE("%p %08x %04x %p\n", This, dwFlags, LangId, ppEnumScript);
3179
3180 return EnumScript_create( This, dwFlags, LangId, ppEnumScript );
3181}
static HRESULT EnumScript_create(MLang_impl *mlang, DWORD dwFlags, LANGID LangId, IEnumScript **ppEnumScript)
Definition: mlang.c:1929

◆ fnIMultiLanguage3_GetCharsetInfo()

static HRESULT WINAPI fnIMultiLanguage3_GetCharsetInfo ( IMultiLanguage3 *  iface,
BSTR  Charset,
PMIMECSETINFO  pCharsetInfo 
)
static

Definition at line 2742 of file mlang.c.

2746{
2747 UINT i, n;
2749
2750 TRACE("%p %s %p\n", This, debugstr_w(Charset), pCharsetInfo);
2751
2752 if (!pCharsetInfo) return E_FAIL;
2753
2754 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
2755 {
2756 for (n = 0; n < mlang_data[i].number_of_cp; n++)
2757 {
2758 WCHAR csetW[MAX_MIMECSET_NAME];
2759
2760 MultiByteToWideChar(CP_ACP, 0, mlang_data[i].mime_cp_info[n].web_charset, -1, csetW, MAX_MIMECSET_NAME);
2761 if (!lstrcmpiW(Charset, csetW))
2762 {
2763 pCharsetInfo->uiCodePage = mlang_data[i].family_codepage;
2764 pCharsetInfo->uiInternetEncoding = mlang_data[i].mime_cp_info[n].cp;
2765 lstrcpyW(pCharsetInfo->wszCharset, csetW);
2766 return S_OK;
2767 }
2768 if (mlang_data[i].mime_cp_info[n].alias && !lstrcmpiW(Charset, mlang_data[i].mime_cp_info[n].alias))
2769 {
2770 pCharsetInfo->uiCodePage = mlang_data[i].family_codepage;
2771 pCharsetInfo->uiInternetEncoding = mlang_data[i].mime_cp_info[n].cp;
2772 lstrcpyW(pCharsetInfo->wszCharset, mlang_data[i].mime_cp_info[n].alias);
2773 return S_OK;
2774 }
2775 }
2776 }
2777
2778 /* FIXME:
2779 * Since we do not support charsets like iso-2022-jp and do not have
2780 * them in our database as a primary (web_charset) encoding this loop
2781 * does an attempt to 'approximate' charset name by header_charset.
2782 */
2783 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
2784 {
2785 for (n = 0; n < mlang_data[i].number_of_cp; n++)
2786 {
2787 WCHAR csetW[MAX_MIMECSET_NAME];
2788
2789 MultiByteToWideChar(CP_ACP, 0, mlang_data[i].mime_cp_info[n].header_charset, -1, csetW, MAX_MIMECSET_NAME);
2790 if (!lstrcmpiW(Charset, csetW))
2791 {
2792 pCharsetInfo->uiCodePage = mlang_data[i].family_codepage;
2793 pCharsetInfo->uiInternetEncoding = mlang_data[i].mime_cp_info[n].cp;
2794 lstrcpyW(pCharsetInfo->wszCharset, csetW);
2795 return S_OK;
2796 }
2797 }
2798 }
2799
2800 return E_FAIL;
2801}
const WCHAR * alias
Definition: main.c:67
#define lstrcpyW
Definition: compat.h:749
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4262
const WCHAR * alias
Definition: mlang.c:67

◆ fnIMultiLanguage3_GetCodePageDescription()

static HRESULT WINAPI fnIMultiLanguage3_GetCodePageDescription ( IMultiLanguage3 *  iface,
UINT  uiCodePage,
LCID  lcid,
LPWSTR  lpWideCharStr,
int  cchWideChar 
)
static

Definition at line 3110 of file mlang.c.

3116{
3117 /* Find first instance */
3118 unsigned int i,n;
3119
3120 TRACE ("%u, %04x, %p, %d\n", uiCodePage, lcid, lpWideCharStr, cchWideChar);
3121 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
3122 {
3123 for (n = 0; n < mlang_data[i].number_of_cp; n++)
3124 {
3125 if (mlang_data[i].mime_cp_info[n].cp == uiCodePage)
3126 {
3128 mlang_data[i].mime_cp_info[n].description,
3129 -1, lpWideCharStr, cchWideChar);
3130 return S_OK;
3131 }
3132 }
3133 }
3134
3135 return S_FALSE;
3136}

◆ fnIMultiLanguage3_GetCodePageInfo()

static HRESULT WINAPI fnIMultiLanguage3_GetCodePageInfo ( IMultiLanguage3 *  iface,
UINT  uiCodePage,
LANGID  LangId,
PMIMECPINFO  pCodePageInfo 
)
static

Definition at line 2695 of file mlang.c.

2700{
2701 UINT i, n;
2703
2704 TRACE("%p, %u, %04x, %p\n", This, uiCodePage, LangId, pCodePageInfo);
2705
2706 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
2707 {
2708 for (n = 0; n < mlang_data[i].number_of_cp; n++)
2709 {
2710 if (mlang_data[i].mime_cp_info[n].cp == uiCodePage)
2711 {
2712 fill_cp_info(&mlang_data[i], n, pCodePageInfo);
2713 return S_OK;
2714 }
2715 }
2716 }
2717
2718 return S_FALSE;
2719}

◆ fnIMultiLanguage3_GetFamilyCodePage()

static HRESULT WINAPI fnIMultiLanguage3_GetFamilyCodePage ( IMultiLanguage3 *  iface,
UINT  uiCodePage,
UINT puiFamilyCodePage 
)
static

Definition at line 2721 of file mlang.c.

2725{
2726 return GetFamilyCodePage(uiCodePage, puiFamilyCodePage);
2727}
static HRESULT GetFamilyCodePage(UINT uiCodePage, UINT *puiFamilyCodePage)
Definition: mlang.c:1154

◆ fnIMultiLanguage3_GetLcidFromRfc1766()

static HRESULT WINAPI fnIMultiLanguage3_GetLcidFromRfc1766 ( IMultiLanguage3 *  iface,
LCID pLocale,
BSTR  bstrRfc1766 
)
static

Definition at line 2877 of file mlang.c.

2881{
2882 HRESULT hr;
2883 IEnumRfc1766 *rfc1766;
2884
2885 TRACE("%p %p %s\n", iface, pLocale, debugstr_w(bstrRfc1766));
2886
2887 if (!pLocale || !bstrRfc1766)
2888 return E_INVALIDARG;
2889
2890 hr = IMultiLanguage3_EnumRfc1766(iface, 0, &rfc1766);
2891 if (FAILED(hr))
2892 return hr;
2893
2894 hr = lcid_from_rfc1766(rfc1766, pLocale, bstrRfc1766);
2895
2896 IEnumRfc1766_Release(rfc1766);
2897 return hr;
2898}
static HRESULT lcid_from_rfc1766(IEnumRfc1766 *iface, LCID *lcid, LPCWSTR rfc1766)
Definition: mlang.c:1277

◆ fnIMultiLanguage3_GetNumberOfCodePageInfo()

static HRESULT WINAPI fnIMultiLanguage3_GetNumberOfCodePageInfo ( IMultiLanguage3 *  iface,
UINT pcCodePage 
)
static

Definition at line 2642 of file mlang.c.

2645{
2647
2648 TRACE("%p, %p\n", This, pcCodePage);
2649
2650 if (!pcCodePage) return E_INVALIDARG;
2651
2652 *pcCodePage = This->total_cp;
2653 return S_OK;
2654}

◆ fnIMultiLanguage3_GetNumberOfScripts()

static HRESULT WINAPI fnIMultiLanguage3_GetNumberOfScripts ( IMultiLanguage3 *  iface,
UINT pnScripts 
)
static

Definition at line 3156 of file mlang.c.

3159{
3161
3162 TRACE("%p %p\n", This, pnScripts);
3163
3164 if (!pnScripts) return S_FALSE;
3165
3166 *pnScripts = This->total_scripts;
3167 return S_OK;
3168}

◆ fnIMultiLanguage3_GetRfc1766FromLcid()

static HRESULT WINAPI fnIMultiLanguage3_GetRfc1766FromLcid ( IMultiLanguage3 *  iface,
LCID  lcid,
BSTR pbstrRfc1766 
)
static

Definition at line 2858 of file mlang.c.

2862{
2863 WCHAR buf[MAX_RFC1766_NAME];
2864
2865 TRACE("%p %04x %p\n", iface, lcid, pbstrRfc1766);
2866 if (!pbstrRfc1766)
2867 return E_INVALIDARG;
2868
2869 if (!lcid_to_rfc1766W( lcid, buf, MAX_RFC1766_NAME ))
2870 {
2871 *pbstrRfc1766 = SysAllocString( buf );
2872 return S_OK;
2873 }
2874 return E_FAIL;
2875}
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238

◆ fnIMultiLanguage3_GetRfc1766Info()

static HRESULT WINAPI fnIMultiLanguage3_GetRfc1766Info ( IMultiLanguage3 *  iface,
LCID  Locale,
LANGID  LangId,
PRFC1766INFO  pRfc1766Info 
)
static

Definition at line 2912 of file mlang.c.

2917{
2918 static LANGID last_lang = -1;
2920
2921 TRACE("(%p, 0x%04x, 0x%04x, %p)\n", iface, Locale, LangId, pRfc1766Info);
2922
2923 if (!pRfc1766Info)
2924 return E_INVALIDARG;
2925
2926 if ((PRIMARYLANGID(Locale) == LANG_ENGLISH) ||
2927 (PRIMARYLANGID(Locale) == LANG_CHINESE) ||
2928 (PRIMARYLANGID(Locale) == LANG_ARABIC)) {
2929
2930 if (!SUBLANGID(Locale))
2931 type = LOCALE_SENGLANGUAGE; /* suppress country */
2932 }
2933 else
2934 {
2935 if (!SUBLANGID(Locale)) {
2936 TRACE("SUBLANGID missing in 0x%04x\n", Locale);
2937 return E_FAIL;
2938 }
2939 }
2940
2941 pRfc1766Info->lcid = Locale;
2942 pRfc1766Info->wszRfc1766[0] = 0;
2943 pRfc1766Info->wszLocaleName[0] = 0;
2944
2945 if ((PRIMARYLANGID(LangId) != LANG_ENGLISH) &&
2946 (last_lang != LangId)) {
2947 FIXME("Only English names supported (requested: 0x%04x)\n", LangId);
2948 last_lang = LangId;
2949 }
2950
2951 if ((!lcid_to_rfc1766W(Locale, pRfc1766Info->wszRfc1766, MAX_RFC1766_NAME)) &&
2952 (GetLocaleInfoW(Locale, type, pRfc1766Info->wszLocaleName, MAX_LOCALE_NAME) > 0))
2953 return S_OK;
2954
2955 /* Locale not supported */
2956 return E_INVALIDARG;
2957}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
USHORT LANGID
Definition: mui.h:9
#define SUBLANGID(l)
Definition: nls.h:17
#define LANG_ENGLISH
Definition: nls.h:52
#define LANG_ARABIC
Definition: nls.h:29
#define LANG_CHINESE
Definition: nls.h:42
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define LOCALE_SENGLANGUAGE
Definition: winnls.h:27
DWORD LCTYPE
Definition: winnls.h:519

◆ fnIMultiLanguage3_IsCodePageInstallable()

static HRESULT WINAPI fnIMultiLanguage3_IsCodePageInstallable ( IMultiLanguage3 *  iface,
UINT  uiCodePage 
)
static

Definition at line 3138 of file mlang.c.

3141{
3142 TRACE("%u\n", uiCodePage);
3143
3144 /* FIXME: the installable set is usually larger than the set of valid codepages */
3145 return IMultiLanguage3_ValidateCodePageEx(iface, uiCodePage, NULL, CPIOD_PEEK);
3146}

◆ fnIMultiLanguage3_IsConvertible()

static HRESULT WINAPI fnIMultiLanguage3_IsConvertible ( IMultiLanguage3 *  iface,
DWORD  dwSrcEncoding,
DWORD  dwDstEncoding 
)
static

Definition at line 2803 of file mlang.c.

2807{
2808 return IsConvertINetStringAvailable(dwSrcEncoding, dwDstEncoding);
2809}
static ISCONVERTINETSTRINGAVAILABLE IsConvertINetStringAvailable
Definition: win_iconv.c:707

◆ fnIMultiLanguage3_QueryInterface()

static HRESULT WINAPI fnIMultiLanguage3_QueryInterface ( IMultiLanguage3 *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 2578 of file mlang.c.

2582{
2584
2585 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
2586
2587 if (IsEqualGUID(riid, &IID_IUnknown) ||
2588 IsEqualGUID(riid, &IID_IMultiLanguage))
2589 {
2590 *obj = &This->IMultiLanguage_iface;
2591 }
2592 else if (IsEqualGUID(riid, &IID_IMLangCodePages) ||
2593 IsEqualGUID(riid, &IID_IMLangFontLink))
2594 {
2595 *obj = &This->IMLangFontLink_iface;
2596 }
2597 else if (IsEqualGUID(riid, &IID_IMLangFontLink2))
2598 {
2599 *obj = &This->IMLangFontLink2_iface;
2600 }
2601 else if (IsEqualGUID(riid, &IID_IMultiLanguage2) ||
2602 IsEqualGUID(riid, &IID_IMultiLanguage3))
2603 {
2604 *obj = &This->IMultiLanguage3_iface;
2605 }
2606 else if (IsEqualGUID(riid, &IID_IMLangLineBreakConsole))
2607 {
2608 *obj = &This->IMLangLineBreakConsole_iface;
2609 }
2610 else
2611 {
2612 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), obj);
2613 *obj = NULL;
2614 return E_NOINTERFACE;
2615 }
2616
2617 IMultiLanguage3_AddRef(iface);
2618 return S_OK;
2619}

◆ fnIMultiLanguage3_Release()

static ULONG WINAPI fnIMultiLanguage3_Release ( IMultiLanguage3 *  iface)
static

Definition at line 2627 of file mlang.c.

2628{
2631
2632 TRACE("(%p)->(%d)\n", This, ref);
2633 if (ref == 0)
2634 {
2636 UnlockModule();
2637 }
2638
2639 return ref;
2640}
static void UnlockModule(void)
Definition: mlang.c:931

◆ fnIMultiLanguage3_SetMimeDBSource()

static HRESULT WINAPI fnIMultiLanguage3_SetMimeDBSource ( IMultiLanguage3 *  iface,
MIMECONTF  dwSource 
)
static

Definition at line 3148 of file mlang.c.

3151{
3152 FIXME("0x%08x\n", dwSource);
3153 return S_OK;
3154}

◆ fnIMultiLanguage3_ValidateCodePage()

static HRESULT WINAPI fnIMultiLanguage3_ValidateCodePage ( IMultiLanguage3 *  iface,
UINT  uiCodePage,
HWND  hwnd 
)
static

Definition at line 3102 of file mlang.c.

3106{
3107 return IMultiLanguage3_ValidateCodePageEx(iface,uiCodePage,hwnd,0);
3108}
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ fnIMultiLanguage3_ValidateCodePageEx()

static HRESULT WINAPI fnIMultiLanguage3_ValidateCodePageEx ( IMultiLanguage3 *  iface,
UINT  uiCodePage,
HWND  hwnd,
DWORD  dwfIODControl 
)
static

Definition at line 3183 of file mlang.c.

3188{
3189 unsigned int i;
3191
3192 TRACE("%p %u %p %08x\n", This, uiCodePage, hwnd, dwfIODControl);
3193
3194 /* quick check for kernel32 supported code pages */
3195 if (IsValidCodePage(uiCodePage))
3196 return S_OK;
3197
3198 /* check for mlang supported code pages */
3199 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
3200 {
3201 UINT n;
3202 for (n = 0; n < mlang_data[i].number_of_cp; n++)
3203 {
3204 if (mlang_data[i].mime_cp_info[n].cp == uiCodePage)
3205 return S_OK;
3206 }
3207 }
3208
3209 if (dwfIODControl != CPIOD_PEEK)
3210 FIXME("Request to install codepage language pack not handled\n");
3211
3212 return S_FALSE;
3213}
BOOL WINAPI IsValidCodePage(UINT codepage)
Definition: locale.c:2079

◆ fnIMultiLanguage_AddRef()

static ULONG WINAPI fnIMultiLanguage_AddRef ( IMultiLanguage *  iface)
static

Definition at line 2110 of file mlang.c.

2111{
2113 return IMultiLanguage3_AddRef(&This->IMultiLanguage3_iface);
2114}
static MLang_impl * impl_from_IMultiLanguage(IMultiLanguage *iface)
Definition: mlang.c:2096

◆ fnIMultiLanguage_ConvertString()

static HRESULT WINAPI fnIMultiLanguage_ConvertString ( IMultiLanguage *  iface,
DWORD mode,
DWORD  src_enc,
DWORD  dst_enc,
BYTE src,
UINT src_size,
BYTE dest,
UINT dest_size 
)
static

Definition at line 2195 of file mlang.c.

2204{
2206 return IMultiLanguage3_ConvertString(&This->IMultiLanguage3_iface, mode, src_enc,
2207 dst_enc, src, src_size, dest, dest_size);
2208}
GLenum mode
Definition: glext.h:6217
static char * dest
Definition: rtl.c:135

◆ fnIMultiLanguage_ConvertStringFromUnicode()

static HRESULT WINAPI fnIMultiLanguage_ConvertStringFromUnicode ( IMultiLanguage *  iface,
DWORD mode,
DWORD  encoding,
WCHAR src,
UINT src_size,
CHAR dest,
UINT dest_size 
)
static

Definition at line 2224 of file mlang.c.

2232{
2234 return IMultiLanguage3_ConvertStringFromUnicode(&This->IMultiLanguage3_iface,
2235 mode, encoding, src, src_size, dest, dest_size);
2236}
static char * encoding
Definition: xmllint.c:155

◆ fnIMultiLanguage_ConvertStringReset()

static HRESULT WINAPI fnIMultiLanguage_ConvertStringReset ( IMultiLanguage *  iface)
static

Definition at line 2238 of file mlang.c.

2240{
2242 return IMultiLanguage3_ConvertStringReset(&This->IMultiLanguage3_iface);
2243}

◆ fnIMultiLanguage_ConvertStringToUnicode()

static HRESULT WINAPI fnIMultiLanguage_ConvertStringToUnicode ( IMultiLanguage *  iface,
DWORD mode,
DWORD  src_enc,
CHAR src,
UINT src_size,
WCHAR dest,
UINT dest_size 
)
static

Definition at line 2210 of file mlang.c.

2218{
2220 return IMultiLanguage3_ConvertStringToUnicode(&This->IMultiLanguage3_iface,
2221 mode, src_enc, src, src_size, dest, dest_size);
2222}

◆ fnIMultiLanguage_CreateConvertCharset()

static HRESULT WINAPI fnIMultiLanguage_CreateConvertCharset ( IMultiLanguage *  iface,
UINT  src_cp,
UINT  dst_cp,
DWORD  prop,
IMLangConvertCharset **  convert_charset 
)
static

Definition at line 2537 of file mlang.c.

2543{
2545 return IMultiLanguage3_CreateConvertCharset(&This->IMultiLanguage3_iface, src_cp, dst_cp, prop, convert_charset);
2546}

◆ fnIMultiLanguage_EnumCodePages()

static HRESULT WINAPI fnIMultiLanguage_EnumCodePages ( IMultiLanguage *  iface,
DWORD  grfFlags,
IEnumCodePage **  ppEnumCodePage 
)
static

Definition at line 2165 of file mlang.c.

2169{
2171
2172 TRACE("%p %08x %p\n", This, grfFlags, ppEnumCodePage);
2173
2174 return EnumCodePage_create( This, grfFlags, 0, ppEnumCodePage );
2175}

◆ fnIMultiLanguage_EnumRfc1766()

static HRESULT WINAPI fnIMultiLanguage_EnumRfc1766 ( IMultiLanguage *  iface,
IEnumRfc1766 **  ppEnumRfc1766 
)
static

Definition at line 2485 of file mlang.c.

2488{
2490
2491 TRACE("%p %p\n", This, ppEnumRfc1766);
2492
2493 return EnumRfc1766_create(0, ppEnumRfc1766);
2494}

◆ fnIMultiLanguage_GetCharsetInfo()

static HRESULT WINAPI fnIMultiLanguage_GetCharsetInfo ( IMultiLanguage *  iface,
BSTR  Charset,
PMIMECSETINFO  pCharsetInfo 
)
static

Definition at line 2177 of file mlang.c.

2181{
2183 return IMultiLanguage3_GetCharsetInfo( &This->IMultiLanguage3_iface, Charset, pCharsetInfo );
2184}

◆ fnIMultiLanguage_GetCodePageInfo()

static HRESULT WINAPI fnIMultiLanguage_GetCodePageInfo ( IMultiLanguage *  iface,
UINT  uiCodePage,
PMIMECPINFO  pCodePageInfo 
)
static

Definition at line 2131 of file mlang.c.

2135{
2136 UINT i, n;
2138
2139 TRACE("%p, %u, %p\n", This, uiCodePage, pCodePageInfo);
2140
2141 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
2142 {
2143 for (n = 0; n < mlang_data[i].number_of_cp; n++)
2144 {
2145 if (mlang_data[i].mime_cp_info[n].cp == uiCodePage)
2146 {
2147 fill_cp_info(&mlang_data[i], n, pCodePageInfo);
2148 return S_OK;
2149 }
2150 }
2151 }
2152
2153 return S_FALSE;
2154}

◆ fnIMultiLanguage_GetFamilyCodePage()

static HRESULT WINAPI fnIMultiLanguage_GetFamilyCodePage ( IMultiLanguage *  iface,
UINT  cp,
UINT family_cp 
)
static

Definition at line 2156 of file mlang.c.

2160{
2162 return IMultiLanguage3_GetFamilyCodePage(&This->IMultiLanguage3_iface, cp, family_cp);
2163}

◆ fnIMultiLanguage_GetLcidFromRfc1766()

static HRESULT WINAPI fnIMultiLanguage_GetLcidFromRfc1766 ( IMultiLanguage *  iface,
LCID locale,
BSTR  rfc1766 
)
static

Definition at line 2254 of file mlang.c.

2258{
2260 return IMultiLanguage3_GetLcidFromRfc1766(&This->IMultiLanguage3_iface, locale, rfc1766);
2261}

◆ fnIMultiLanguage_GetNumberOfCodePageInfo()

static HRESULT WINAPI fnIMultiLanguage_GetNumberOfCodePageInfo ( IMultiLanguage *  iface,
UINT cp 
)
static

Definition at line 2122 of file mlang.c.

2125{
2127 TRACE("(%p, %p)\n", This, cp);
2128 return IMultiLanguage3_GetNumberOfCodePageInfo(&This->IMultiLanguage3_iface, cp);
2129}

◆ fnIMultiLanguage_GetRfc1766FromLcid()

static HRESULT WINAPI fnIMultiLanguage_GetRfc1766FromLcid ( IMultiLanguage *  iface,
LCID  lcid,
BSTR pbstrRfc1766 
)
static

Definition at line 2245 of file mlang.c.

2249{
2251 return IMultiLanguage3_GetRfc1766FromLcid(&This->IMultiLanguage3_iface, lcid, pbstrRfc1766);
2252}

◆ fnIMultiLanguage_GetRfc1766Info()

static HRESULT WINAPI fnIMultiLanguage_GetRfc1766Info ( IMultiLanguage *  iface,
LCID  Locale,
PRFC1766INFO  pRfc1766Info 
)
static

Definition at line 2498 of file mlang.c.

2502{
2504
2505 TRACE("(%p, 0x%04x, %p)\n", iface, Locale, pRfc1766Info);
2506
2507 if (!pRfc1766Info)
2508 return E_INVALIDARG;
2509
2510 if ((PRIMARYLANGID(Locale) == LANG_ENGLISH) ||
2511 (PRIMARYLANGID(Locale) == LANG_CHINESE) ||
2512 (PRIMARYLANGID(Locale) == LANG_ARABIC)) {
2513
2514 if (!SUBLANGID(Locale))
2515 type = LOCALE_SENGLANGUAGE; /* suppress country */
2516 }
2517 else
2518 {
2519 if (!SUBLANGID(Locale)) {
2520 TRACE("SUBLANGID missing in 0x%04x\n", Locale);
2521 return E_FAIL;
2522 }
2523 }
2524
2525 pRfc1766Info->lcid = Locale;
2526 pRfc1766Info->wszRfc1766[0] = 0;
2527 pRfc1766Info->wszLocaleName[0] = 0;
2528
2529 if ((!lcid_to_rfc1766W(Locale, pRfc1766Info->wszRfc1766, MAX_RFC1766_NAME)) &&
2530 (GetLocaleInfoW(Locale, type, pRfc1766Info->wszLocaleName, MAX_LOCALE_NAME) > 0))
2531 return S_OK;
2532
2533 /* Locale not supported */
2534 return E_INVALIDARG;
2535}

◆ fnIMultiLanguage_IsConvertible()

static HRESULT WINAPI fnIMultiLanguage_IsConvertible ( IMultiLanguage *  iface,
DWORD  src_enc,
DWORD  dst_enc 
)
static

Definition at line 2186 of file mlang.c.

2190{
2192 return IMultiLanguage3_IsConvertible(&This->IMultiLanguage3_iface, src_enc, dst_enc);
2193}

◆ fnIMultiLanguage_QueryInterface()

static HRESULT WINAPI fnIMultiLanguage_QueryInterface ( IMultiLanguage *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 2101 of file mlang.c.

2105{
2107 return IMultiLanguage3_QueryInterface(&This->IMultiLanguage3_iface, riid, obj);
2108}

◆ fnIMultiLanguage_Release()

static ULONG WINAPI fnIMultiLanguage_Release ( IMultiLanguage *  iface)
static

Definition at line 2116 of file mlang.c.

2117{
2119 return IMultiLanguage3_Release(&This->IMultiLanguage3_iface);
2120}

◆ GetFamilyCodePage()

static HRESULT GetFamilyCodePage ( UINT  uiCodePage,
UINT puiFamilyCodePage 
)
static

Definition at line 1154 of file mlang.c.

1157{
1158 UINT i, n;
1159
1160 TRACE("%u %p\n", uiCodePage, puiFamilyCodePage);
1161
1162 if (!puiFamilyCodePage) return S_FALSE;
1163
1164 for (i = 0; i < ARRAY_SIZE(mlang_data); i++)
1165 {
1166 for (n = 0; n < mlang_data[i].number_of_cp; n++)
1167 {
1168 if (mlang_data[i].mime_cp_info[n].cp == uiCodePage)
1169 {
1170 *puiFamilyCodePage = mlang_data[i].family_codepage;
1171 return S_OK;
1172 }
1173 }
1174 }
1175
1176 return S_FALSE;
1177}

Referenced by fnIMultiLanguage3_GetFamilyCodePage(), and IsConvertINetStringAvailable().

◆ GetGlobalFontLinkObject()

HRESULT WINAPI GetGlobalFontLinkObject ( void **  unknown)

Definition at line 3999 of file mlang.c.

4000{
4001 if (!unknown) return E_INVALIDARG;
4002
4003 FIXME("%p: stub\n", unknown);
4004
4005 return S_FALSE;
4006}
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605

Referenced by test_GetGlobalFontLinkObject().

◆ han2zen()

static int han2zen ( unsigned char p1,
unsigned char p2 
)
static

Definition at line 629 of file mlang.c.

630{
631 BOOL maru = FALSE;
632 BOOL nigori = FALSE;
633 static const unsigned char char1[] = {129,129,129,129,129,131,131,131,131,
634 131,131,131,131,131,131,129,131,131,131,131,131,131,131,131,131,131,
635 131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,
636 131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,
637 131,129,129 };
638 static const unsigned char char2[] = {66,117,118,65,69,146,64,66,68,70,
639 72,131,133,135,98,91,65,67,69,71,73,74,76,78,80,82,84,86,88,90,92,94,
640 96,99,101,103,105,106,107,108,109,110,113,116,119,122,125,126,128,
641 129,130,132,134,136,137,138,139,140,141,143,147,74,75};
642
643 if (( *p2 == 222) && ((ISNIGORI(*p1) || (*p1 == 179))))
644 nigori = TRUE;
645 else if ((*p2 == 223) && (ISMARU(*p1)))
646 maru = TRUE;
647
648 if (*p1 >= 161 && *p1 <= 223)
649 {
650 unsigned char index = *p1 - 161;
651 *p1 = char1[index];
652 *p2 = char2[index];
653 }
654
655 if (maru || nigori)
656 {
657 if (nigori)
658 {
659 if (((*p2 >= 74) && (*p2 <= 103)) || ((*p2 >= 110) && (*p2 <= 122)))
660 (*p2)++;
661 else if ((*p1 == 131) && (*p2 == 69))
662 *p2 = 148;
663 }
664 else if ((maru) && ((*p2 >= 110) && (*p2 <= 122)))
665 *p2+= 2;
666
667 return 1;
668 }
669
670 return 0;
671}
#define ISMARU(A)
Definition: mlang.c:558
#define ISNIGORI(A)
Definition: mlang.c:559

Referenced by ConvertSJIS2JIS().

◆ impl_from_IClassFactory()

static IClassFactoryImpl * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 1454 of file mlang.c.

1455{
1456 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
1457}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by MLANGCF_AddRef(), MLANGCF_CreateInstance(), and MLANGCF_Release().

◆ impl_from_IEnumCodePage()

static EnumCodePage_impl * impl_from_IEnumCodePage ( IEnumCodePage *  iface)
inlinestatic

◆ impl_from_IEnumRfc1766()

static EnumRfc1766_impl * impl_from_IEnumRfc1766 ( IEnumRfc1766 *  iface)
inlinestatic

◆ impl_from_IEnumScript()

static EnumScript_impl * impl_from_IEnumScript ( IEnumScript *  iface)
inlinestatic

◆ impl_from_IMLangConvertCharset()

◆ impl_from_IMLangFontLink()

◆ impl_from_IMLangFontLink2()

◆ impl_from_IMLangLineBreakConsole()

static MLang_impl * impl_from_IMLangLineBreakConsole ( IMLangLineBreakConsole *  iface)
inlinestatic

Definition at line 3627 of file mlang.c.

3628{
3629 return CONTAINING_RECORD( iface, MLang_impl, IMLangLineBreakConsole_iface );
3630}

Referenced by fnIMLangLineBreakConsole_AddRef(), fnIMLangLineBreakConsole_QueryInterface(), and fnIMLangLineBreakConsole_Release().

◆ impl_from_IMultiLanguage()

◆ impl_from_IMultiLanguage3()

◆ IsConvertINetStringAvailable()

HRESULT WINAPI IsConvertINetStringAvailable ( DWORD  dwSrcEncoding,
DWORD  dwDstEncoding 
)

Definition at line 1179 of file mlang.c.

1182{
1183 UINT src_family, dst_family;
1184
1185 TRACE("%d %d\n", dwSrcEncoding, dwDstEncoding);
1186
1187 if (GetFamilyCodePage(dwSrcEncoding, &src_family) != S_OK ||
1188 GetFamilyCodePage(dwDstEncoding, &dst_family) != S_OK)
1189 return S_FALSE;
1190
1191 if (src_family == dst_family) return S_OK;
1192
1193 /* we can convert any codepage to/from unicode */
1194 if (src_family == CP_UNICODE || dst_family == CP_UNICODE) return S_OK;
1195
1196 return S_FALSE;
1197}

◆ jis2sjis()

static void jis2sjis ( unsigned char p1,
unsigned char p2 
)
inlinestatic

Definition at line 606 of file mlang.c.

607{
608 unsigned char c1 = *p1;
609 unsigned char c2 = *p2;
610 int row = c1 < 95 ? 112 : 176;
611 int cell = c1 % 2 ? 31 + (c2 > 95) : 126;
612
613 *p1 = ((c1 + 1) >> 1) + row;
614 *p2 = c2 + cell;
615}
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

Referenced by ConvertJIS2SJIS().

◆ lcid_from_rfc1766()

static HRESULT lcid_from_rfc1766 ( IEnumRfc1766 *  iface,
LCID lcid,
LPCWSTR  rfc1766 
)
static

Definition at line 1277 of file mlang.c.

1278{
1279 RFC1766INFO info;
1280 ULONG num;
1281
1282 while (IEnumRfc1766_Next(iface, 1, &info, &num) == S_OK)
1283 {
1284 if (!wcsicmp(info.wszRfc1766, rfc1766))
1285 {
1286 *lcid = info.lcid;
1287 return S_OK;
1288 }
1289 if (lstrlenW(rfc1766) == 2 && !memcmp(info.wszRfc1766, rfc1766, 2 * sizeof(WCHAR)))
1290 {
1291 *lcid = PRIMARYLANGID(info.lcid);
1292 return S_OK;
1293 }
1294 }
1295
1296 return E_FAIL;
1297}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define wcsicmp
Definition: compat.h:15
GLuint GLuint num
Definition: glext.h:9618

Referenced by fnIMultiLanguage3_GetLcidFromRfc1766(), and Rfc1766ToLcidW().

◆ lcid_to_rfc1766A()

static HRESULT lcid_to_rfc1766A ( LCID  lcid,
LPSTR  rfc1766,
INT  len 
)
inlinestatic

Definition at line 1199 of file mlang.c.

1200{
1201 CHAR buffer[MAX_RFC1766_NAME];
1202 INT n = GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, buffer, MAX_RFC1766_NAME);
1203 INT i;
1204
1205 if (n)
1206 {
1207 i = PRIMARYLANGID(lcid);
1208 if ((((i == LANG_ENGLISH) || (i == LANG_CHINESE) || (i == LANG_ARABIC)) &&
1209 (SUBLANGID(lcid) == SUBLANG_DEFAULT)) ||
1210 (SUBLANGID(lcid) > SUBLANG_DEFAULT)) {
1211
1212 buffer[n - 1] = '-';
1213 i = GetLocaleInfoA(lcid, LOCALE_SISO3166CTRYNAME, buffer + n, MAX_RFC1766_NAME - n);
1214 if (!i)
1215 buffer[n - 1] = '\0';
1216 }
1217 else
1218 i = 0;
1219
1221 return ((n + i) > len) ? E_INVALIDARG : S_OK;
1222 }
1223 return E_FAIL;
1224}
INT WINAPI LCMapStringA(LCID lcid, DWORD flags, LPCSTR src, INT srclen, LPSTR dst, INT dstlen)
Definition: locale.c:3831
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
Definition: locale.c:1600
GLuint buffer
Definition: glext.h:5915
#define LOCALE_USER_DEFAULT
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define LOCALE_SISO639LANGNAME
Definition: winnls.h:128
#define LCMAP_LOWERCASE
Definition: winnls.h:186
#define LOCALE_SISO3166CTRYNAME
Definition: winnls.h:129

Referenced by LcidToRfc1766A().

◆ lcid_to_rfc1766W()

static HRESULT lcid_to_rfc1766W ( LCID  lcid,
LPWSTR  rfc1766,
INT  len 
)
inlinestatic

Definition at line 1226 of file mlang.c.

1227{
1228 WCHAR buffer[MAX_RFC1766_NAME];
1229 INT n = GetLocaleInfoW(lcid, LOCALE_SISO639LANGNAME, buffer, MAX_RFC1766_NAME);
1230 INT i;
1231
1232 if (n)
1233 {
1234 i = PRIMARYLANGID(lcid);
1235 if ((((i == LANG_ENGLISH) || (i == LANG_CHINESE) || (i == LANG_ARABIC)) &&
1236 (SUBLANGID(lcid) == SUBLANG_DEFAULT)) ||
1237 (SUBLANGID(lcid) > SUBLANG_DEFAULT)) {
1238
1239 buffer[n - 1] = '-';
1240 i = GetLocaleInfoW(lcid, LOCALE_SISO3166CTRYNAME, buffer + n, MAX_RFC1766_NAME - n);
1241 if (!i)
1242 buffer[n - 1] = '\0';
1243 }
1244 else
1245 i = 0;
1246
1248 return ((n + i) > len) ? E_INVALIDARG : S_OK;
1249 }
1250 return E_FAIL;
1251}
INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
Definition: locale.c:3805

Referenced by enum_locales_proc(), fnIMultiLanguage3_GetRfc1766FromLcid(), fnIMultiLanguage3_GetRfc1766Info(), fnIMultiLanguage_GetRfc1766Info(), and LcidToRfc1766W().

◆ LcidToRfc1766A()

HRESULT WINAPI LcidToRfc1766A ( LCID  lcid,
LPSTR  pszRfc1766,
INT  nChar 
)

Definition at line 1253 of file mlang.c.

1257{
1258 TRACE("%04x %p %u\n", lcid, pszRfc1766, nChar);
1259 if (!pszRfc1766)
1260 return E_INVALIDARG;
1261
1262 return lcid_to_rfc1766A(lcid, pszRfc1766, nChar);
1263}
static HRESULT lcid_to_rfc1766A(LCID lcid, LPSTR rfc1766, INT len)
Definition: mlang.c:1199

◆ LcidToRfc1766W()

HRESULT WINAPI LcidToRfc1766W ( LCID  lcid,
LPWSTR  pszRfc1766,
INT  nChar 
)

Definition at line 1265 of file mlang.c.

1269{
1270 TRACE("%04x %p %u\n", lcid, pszRfc1766, nChar);
1271 if (!pszRfc1766)
1272 return E_INVALIDARG;
1273
1274 return lcid_to_rfc1766W(lcid, pszRfc1766, nChar);
1275}

Referenced by GetAcceptLanguagesW().

◆ LockModule()

static void LockModule ( void  )
static

Definition at line 926 of file mlang.c.

927{
929}

Referenced by MLANGCF_LockServer(), MLangConvertCharset_create(), and MultiLanguage_create().

◆ map_font()

static HRESULT map_font ( HDC  hdc,
DWORD  codepages,
HFONT  src_font,
HFONT dst_font 
)
static

Definition at line 1332 of file mlang.c.

1333{
1334 struct font_list *font_list_entry;
1335 CHARSETINFO charset_info;
1336 HFONT new_font, old_font;
1337 LOGFONTW font_attr;
1338 DWORD mask, Csb[2];
1339 BOOL found_cached;
1340 UINT charset;
1341 BOOL ret;
1342 UINT i;
1343
1344 if (hdc == NULL || src_font == NULL) return E_FAIL;
1345
1346 for (i = 0; i < 32; i++)
1347 {
1348 mask = (DWORD)(1 << i);
1349 if (codepages & mask)
1350 {
1351 Csb[0] = mask;
1352 Csb[1] = 0x0;
1353 ret = TranslateCharsetInfo(Csb, &charset_info, TCI_SRCFONTSIG);
1354 if (!ret) continue;
1355
1356 /* use cached font if possible */
1357 found_cached = FALSE;
1359 LIST_FOR_EACH_ENTRY(font_list_entry, &font_cache, struct font_list, list_entry)
1360 {
1361 if (font_list_entry->charset == charset_info.ciCharset &&
1362 font_list_entry->base_font == src_font)
1363 {
1364 if (dst_font != NULL)
1365 *dst_font = font_list_entry->font;
1366 found_cached = TRUE;
1367 }
1368 }
1370 if (found_cached) return S_OK;
1371
1372 GetObjectW(src_font, sizeof(font_attr), &font_attr);
1373 font_attr.lfCharSet = (BYTE)charset_info.ciCharset;
1374 font_attr.lfWidth = 0;
1375 font_attr.lfFaceName[0] = 0;
1376 new_font = CreateFontIndirectW(&font_attr);
1377 if (new_font == NULL) continue;
1378
1379 old_font = SelectObject(hdc, new_font);
1381 SelectObject(hdc, old_font);
1382 if (charset == charset_info.ciCharset)
1383 {
1384 font_list_entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*font_list_entry));
1385 if (font_list_entry == NULL) return E_OUTOFMEMORY;
1386
1387 font_list_entry->base_font = src_font;
1388 font_list_entry->font = new_font;
1389 font_list_entry->charset = charset;
1390
1392 list_add_tail(&font_cache, &font_list_entry->list_entry);
1394
1395 if (dst_font != NULL)
1396 *dst_font = new_font;
1397 return S_OK;
1398 }
1399 }
1400 }
1401
1402 return