msctf: Implement ITfInputProcessorProfiles::GetDefaultLanguageProfile.

This commit is contained in:
Aric Stewart 2009-06-26 17:03:30 +09:00 committed by Alexandre Julliard
parent b3ccbc63e6
commit 6e7145d64e
3 changed files with 41 additions and 2 deletions

View File

@ -47,6 +47,11 @@ static const WCHAR szwEnable[] = {'E','n','a','b','l','e',0};
static const WCHAR szwTipfmt[] = {'%','s','\\','%','s',0};
static const WCHAR szwFullLangfmt[] = {'%','s','\\','%','s','\\','%','s','\\','0','x','%','0','8','x','\\','%','s',0};
static const WCHAR szwAssemblies[] = {'A','s','s','e','m','b','l','i','e','s',0};
static const WCHAR szwDefault[] = {'D','e','f','a','u','l','t',0};
static const WCHAR szwProfile[] = {'P','r','o','f','i','l','e',0};
static const WCHAR szwDefaultFmt[] = {'%','s','\\','%','s','\\','0','x','%','0','8','x','\\','%','s',0};
typedef struct tagInputProcessorProfilesSink {
struct list entry;
union {
@ -312,9 +317,41 @@ static HRESULT WINAPI InputProcessorProfiles_GetDefaultLanguageProfile(
ITfInputProcessorProfiles *iface, LANGID langid, REFGUID catid,
CLSID *pclsid, GUID *pguidProfile)
{
WCHAR fullkey[168];
WCHAR buf[39];
HKEY hkey;
DWORD count;
ULONG res;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
TRACE("%p) %x %s %p %p\n",This, langid, debugstr_guid(catid),pclsid,pguidProfile);
if (!catid || !pclsid || !pguidProfile)
return E_INVALIDARG;
StringFromGUID2(catid, buf, 39);
sprintfW(fullkey, szwDefaultFmt, szwSystemCTFKey, szwAssemblies, langid, buf);
if (RegOpenKeyExW(HKEY_CURRENT_USER, fullkey, 0, KEY_READ | KEY_WRITE,
&hkey ) != ERROR_SUCCESS)
return S_FALSE;
count = sizeof(buf);
res = RegQueryValueExW(hkey, szwDefault, 0, NULL, (LPBYTE)buf, &count);
if (res != ERROR_SUCCESS)
{
RegCloseKey(hkey);
return S_FALSE;
}
CLSIDFromString(buf,pclsid);
res = RegQueryValueExW(hkey, szwProfile, 0, NULL, (LPBYTE)buf, &count);
if (res == ERROR_SUCCESS)
CLSIDFromString(buf,pguidProfile);
RegCloseKey(hkey);
return S_OK;
}
static HRESULT WINAPI InputProcessorProfiles_SetDefaultLanguageProfile(

View File

@ -77,6 +77,7 @@ TfClientId processId = 0;
ITfCompartmentMgr *globalCompartmentMgr = NULL;
const WCHAR szwSystemTIPKey[] = {'S','O','F','T','W','A','R','E','\\','M','i','c','r','o','s','o','f','t','\\','C','T','F','\\','T','I','P',0};
const WCHAR szwSystemCTFKey[] = {'S','O','F','T','W','A','R','E','\\','M','i','c','r','o','s','o','f','t','\\','C','T','F',0};
typedef HRESULT (*LPFNCONSTRUCTOR)(IUnknown *pUnkOuter, IUnknown **ppvOut);

View File

@ -63,4 +63,5 @@ extern HRESULT get_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown** sin
extern HRESULT set_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown* sink);
extern const WCHAR szwSystemTIPKey[];
extern const WCHAR szwSystemCTFKey[];
#endif /* __WINE_MSCTF_I_H */