Autosyncing with Wine HEAD

svn path=/trunk/; revision=32847
This commit is contained in:
The Wine Synchronizer 2008-04-04 13:26:49 +00:00
parent d4fba75f4c
commit f59a940b00
3 changed files with 45 additions and 11 deletions

View file

@ -46,6 +46,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang);
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj);
static HRESULT EnumRfc1766_create(LANGID LangId, IEnumRfc1766 **ppEnum);
static DWORD MLANG_tls_index; /* to store various per thead data */
@ -761,6 +762,38 @@ static HRESULT lcid_from_rfc1766(IEnumRfc1766 *iface, LCID *lcid, LPCWSTR rfc176
return E_FAIL;
}
HRESULT WINAPI Rfc1766ToLcidW(LCID *pLocale, LPCWSTR pszRfc1766)
{
IEnumRfc1766 *enumrfc1766;
HRESULT hr;
TRACE("(%p, %s)\n", pLocale, debugstr_w(pszRfc1766));
if (!pLocale || !pszRfc1766)
return E_INVALIDARG;
*pLocale = 0;
hr = EnumRfc1766_create(0, &enumrfc1766);
if (FAILED(hr))
return hr;
hr = lcid_from_rfc1766(enumrfc1766, pLocale, pszRfc1766);
IEnumRfc1766_Release(enumrfc1766);
return hr;
}
HRESULT WINAPI Rfc1766ToLcidA(LCID *lcid, LPCSTR rfc1766A)
{
WCHAR rfc1766W[MAX_RFC1766_NAME + 1];
MultiByteToWideChar(CP_ACP, 0, rfc1766A, -1, rfc1766W, MAX_RFC1766_NAME);
rfc1766W[MAX_RFC1766_NAME] = 0;
return Rfc1766ToLcidW(lcid, rfc1766W);
}
/******************************************************************************
* MLANG ClassFactory
*/
@ -1868,13 +1901,12 @@ static BOOL CALLBACK enum_locales_proc(LPWSTR locale)
return TRUE;
}
static HRESULT EnumRfc1766_create(MLang_impl* mlang, LANGID LangId,
IEnumRfc1766 **ppEnum)
static HRESULT EnumRfc1766_create(LANGID LangId, IEnumRfc1766 **ppEnum)
{
EnumRfc1766_impl *rfc;
struct enum_locales_data data;
TRACE("%p, %04x, %p\n", mlang, LangId, ppEnum);
TRACE("%04x, %p\n", LangId, ppEnum);
rfc = HeapAlloc( GetProcessHeap(), 0, sizeof(EnumRfc1766_impl) );
rfc->vtbl_IEnumRfc1766 = &IEnumRfc1766_vtbl;
@ -1918,7 +1950,7 @@ static HRESULT WINAPI fnIMultiLanguage_EnumRfc1766(
ICOM_THIS_MULTI(MLang_impl, vtbl_IMultiLanguage, iface);
TRACE("%p %p\n", This, ppEnumRfc1766);
return EnumRfc1766_create(This, 0, ppEnumRfc1766);
return EnumRfc1766_create(0, ppEnumRfc1766);
}
/******************************************************************************/
@ -2243,7 +2275,7 @@ static HRESULT WINAPI fnIMultiLanguage2_EnumRfc1766(
ICOM_THIS_MULTI(MLang_impl, vtbl_IMultiLanguage, iface);
TRACE("%p %p\n", This, ppEnumRfc1766);
return EnumRfc1766_create(This, LangId, ppEnumRfc1766);
return EnumRfc1766_create(LangId, ppEnumRfc1766);
}
static HRESULT WINAPI fnIMultiLanguage2_GetRfc1766Info(

View file

@ -1,5 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<group>
<module name="mlang" type="win32dll" baseaddress="${BASEADDRESS_MLANG}" installbase="system32" installname="mlang.dll" allowwarnings="true">
<autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<importlibrary definition="mlang.spec.def" />
@ -8,16 +9,17 @@
<define name="__WINESRC__" />
<define name="WINVER">0x600</define>
<define name="_WIN32_WINNT">0x600</define>
<file>mlang.c</file>
<file>regsvr.c</file>
<file>mlang.spec</file>
<library>wine</library>
<library>ole32</library>
<library>user32</library>
<library>gdi32</library>
<library>advapi32</library>
<library>kernel32</library>
<library>ntdll</library>
<library>oleaut32</library>
<library>uuid</library>
<file>mlang.c</file>
<file>regsvr.c</file>
<file>mlang.spec</file>
<library>ntdll</library>
</module>
</group>

View file

@ -10,5 +10,5 @@
@ stdcall IsConvertINetStringAvailable(long long)
@ stdcall LcidToRfc1766A(long ptr long)
@ stdcall LcidToRfc1766W(long ptr long)
@ stub Rfc1766ToLcidA
@ stub Rfc1766ToLcidW
@ stdcall Rfc1766ToLcidA(ptr str)
@ stdcall Rfc1766ToLcidW(ptr wstr)