msctf/tests: Skip tests if limited.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-06-28 12:33:23 +02:00 committed by Alexandre Julliard
parent e050c24998
commit b4843f29cb
2 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,5 @@
TESTDLL = msctf.dll
IMPORTS = ole32 user32
IMPORTS = ole32 user32 advapi32
C_SRCS = \
inputprocessor.c

View File

@ -943,7 +943,18 @@ DEFINE_GUID(GUID_COMPARTMENT_TIPUISTATUS, 0x148ca3ec,0x0366,0x401c,0x8
static HRESULT initialize(void)
{
HRESULT hr;
HKEY hkey;
CoInitialize(NULL);
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\CTF\\TIP", 0,
KEY_READ|KEY_WRITE, &hkey) != ERROR_SUCCESS)
{
skip("Not enough permission to register input processor\n");
return E_FAIL;
}
RegCloseKey(hkey);
hr = CoCreateInstance (&CLSID_TF_InputProcessorProfiles, NULL,
CLSCTX_INPROC_SERVER, &IID_ITfInputProcessorProfiles, (void**)&g_ipp);
if (SUCCEEDED(hr))