ReactOS 0.4.15-dev-8119-g4fb2fdb
utils.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS msctf.dll
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Text Framework Services
5 * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include <stdlib.h>
9
10#define WIN32_LEAN_AND_MEAN
11#define WIN32_NO_STATUS
12#define COBJMACROS
13#define INITGUID
14#define _EXTYPES_H
15
16#include <windows.h>
17#include <sddl.h>
18#include <imm.h>
19#include <cguid.h>
20#include <tchar.h>
21#include <msctf.h>
22#include <ctffunc.h>
23#include <shlwapi.h>
24#include <strsafe.h>
25
26#include <cicarray.h>
27#include <cicreg.h>
28#include <cicmutex.h>
29#include <cicfmap.h>
30
31#include "mlng.h"
32
33#include <wine/debug.h>
34
36
44UINT g_uACP = CP_ACP; // Active Code Page
45DWORD g_dwOSInfo = 0; // See cicGetOSInfo
52
53// Messages
66
67// Unique names
74
75// Mutexes
81
82// File mapping
84
85// Hot-Keys
92
97{
98 HANDLE hToken = NULL;
100 if (!hToken)
101 return NULL;
102
103 DWORD dwLengthNeeded = 0;
104 GetTokenInformation(hToken, TokenUser, NULL, 0, &dwLengthNeeded);
105 PTOKEN_USER pTokenUser = (PTOKEN_USER)cicMemAllocClear(dwLengthNeeded);
106 if (!pTokenUser)
107 {
108 CloseHandle(hToken);
109 return NULL;
110 }
111
112 LPTSTR StringSid = NULL;
113 if (!GetTokenInformation(hToken, TokenUser, pTokenUser, dwLengthNeeded, &dwLengthNeeded) ||
114 !ConvertSidToStringSid(pTokenUser->User.Sid, &StringSid))
115 {
116 if (StringSid)
117 {
118 LocalFree(StringSid);
119 StringSid = NULL;
120 }
121 }
122
123 cicMemFree(pTokenUser);
124 CloseHandle(hToken);
125 return StringSid;
126}
127
132{
134 return TRUE;
135
136 LPTSTR pszUserSID = GetUserSIDString();
137 if (!pszUserSID)
138 return FALSE;
139
142 LocalFree(pszUserSID);
143 return TRUE;
144}
145
150{
151 g_szUserUnique[0] = TEXT('\0');
152
154 HDESK hDesk = GetThreadDesktop(dwThreadId);
155
156 DWORD nLengthNeeded;
158 if (hDesk && GetUserObjectInformation(hDesk, UOI_NAME, szName, _countof(szName), &nLengthNeeded))
160
161 if (!InitUserSidString())
162 return FALSE;
163
165 return TRUE;
166}
167
168void
170 _In_ LPCTSTR pszName,
171 _Out_ LPTSTR pszBuff,
172 _In_ UINT cchBuff)
173{
174 StringCchCopy(pszBuff, cchBuff, pszName);
175 StringCchCat(pszBuff, cchBuff, g_szUserUnique);
176}
177
178BOOL StringFromGUID2A(REFGUID rguid, LPSTR pszGUID, INT cchGUID)
179{
180 pszGUID[0] = ANSI_NULL;
181
182 WCHAR szWide[40];
183 szWide[0] = UNICODE_NULL;
184 BOOL ret = StringFromGUID2(rguid, szWide, _countof(szWide));
185 ::WideCharToMultiByte(CP_ACP, 0, szWide, -1, pszGUID, cchGUID, NULL, NULL);
186 return ret;
187}
188
189#ifdef UNICODE
190 #define StringFromGUID2T StringFromGUID2
191 #define debugstr_t debugstr_w
192#else
193 #define StringFromGUID2T StringFromGUID2A
194 #define debugstr_t debugstr_a
195#endif
196
197BOOL FullPathExec(LPCTSTR pszExeFile, LPCTSTR pszCmdLine, UINT nCmdShow, BOOL bSysWinDir)
198{
199 STARTUPINFO si;
201 CicSystemModulePath ModPath;
202 TCHAR szCommandLine[2 * MAX_PATH];
203
204 ModPath.Init(pszExeFile, bSysWinDir);
205 if (!ModPath.m_cchPath)
206 {
207 ERR("%s\n", debugstr_t(pszExeFile));
208 return FALSE;
209 }
210
211 StringCchCopy(szCommandLine, _countof(szCommandLine), pszCmdLine);
212
213 ZeroMemory(&si, sizeof(si));
214 si.cb = sizeof(si);
215 si.wShowWindow = nCmdShow;
217 if (!CreateProcess(ModPath.m_szPath, szCommandLine, NULL, NULL, FALSE,
219 {
220 ERR("%s, %s\n", debugstr_t(ModPath.m_szPath), debugstr_t(szCommandLine));
221 return FALSE;
222 }
223
224 CloseHandle(pi.hProcess);
225 CloseHandle(pi.hThread);
226 return TRUE;
227}
228
229static inline BOOL
231{
232 if (!pszCmdLine)
233 return FALSE;
234
235 return FullPathExec(TEXT("rundll32.exe"), pszCmdLine, SW_SHOWMINNOACTIVE, FALSE);
236}
237
238/***********************************************************************
239 * TF_RegisterLangBarAddIn (MSCTF.@)
240 *
241 * @implemented
242 */
245 _In_ REFGUID rguid,
246 _In_ LPCWSTR pszFilePath,
248{
249 TRACE("(%s, %s, 0x%lX)\n", debugstr_guid(&rguid), debugstr_w(pszFilePath), dwFlags);
250
251 if (!pszFilePath || IsEqualGUID(rguid, GUID_NULL))
252 {
253 ERR("E_INVALIDARG\n");
254 return E_INVALIDARG;
255 }
256
257 TCHAR szBuff[MAX_PATH], szGUID[40];
258 StringCchCopy(szBuff, _countof(szBuff), TEXT("SOFTWARE\\Microsoft\\CTF\\LangBarAddIn\\"));
259 StringFromGUID2T(rguid, szGUID, _countof(szGUID));
260 StringCchCat(szBuff, _countof(szBuff), szGUID);
261
262 CicRegKey regKey;
263 HKEY hBaseKey = ((dwFlags & 1) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER);
264 LSTATUS error = regKey.Create(hBaseKey, szBuff);
265 if (error == ERROR_SUCCESS)
266 {
267 error = regKey.SetSzW(L"FilePath", pszFilePath);
268 if (error == ERROR_SUCCESS)
269 error = regKey.SetDword(TEXT("Enable"), !!(dwFlags & 4));
270 }
271
272 return ((error == ERROR_SUCCESS) ? S_OK : E_FAIL);
273}
274
275/***********************************************************************
276 * TF_UnregisterLangBarAddIn (MSCTF.@)
277 *
278 * @implemented
279 */
282 _In_ REFGUID rguid,
284{
285 TRACE("(%s, 0x%lX)\n", debugstr_guid(&rguid), dwFlags);
286
287 if (IsEqualGUID(rguid, GUID_NULL))
288 {
289 ERR("E_INVALIDARG\n");
290 return E_INVALIDARG;
291 }
292
293 TCHAR szSubKey[MAX_PATH];
294 StringCchCopy(szSubKey, _countof(szSubKey), TEXT("SOFTWARE\\Microsoft\\CTF\\LangBarAddIn\\"));
295
296 CicRegKey regKey;
297 HKEY hBaseKey = ((dwFlags & 1) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER);
298 LSTATUS error = regKey.Open(hBaseKey, szSubKey, KEY_ALL_ACCESS);
299 HRESULT hr = E_FAIL;
300 if (error == ERROR_SUCCESS)
301 {
302 TCHAR szGUID[40];
303 StringFromGUID2T(rguid, szGUID, _countof(szGUID));
304 regKey.RecurseDeleteKey(szGUID);
305 hr = S_OK;
306 }
307
308 return hr;
309}
310
311/***********************************************************************
312 * TF_RunInputCPL (MSCTF.@)
313 *
314 * @implemented
315 */
318{
319 CicSystemModulePath ModPath;
320 TCHAR szCmdLine[2 * MAX_PATH];
321
322 TRACE("()\n");
323
324 // NOTE: We don't support Win95/98/Me
326 ModPath.Init(TEXT("input.dll"), FALSE);
327 else
328 ModPath.Init(TEXT("input.cpl"), FALSE);
329
330 if (!ModPath.m_cchPath)
331 return E_FAIL;
332
333 StringCchPrintf(szCmdLine, _countof(szCmdLine),
334 TEXT("rundll32.exe shell32.dll,Control_RunDLL %s"), ModPath.m_szPath);
335 if (!RunCPLSetting(szCmdLine))
336 return E_FAIL;
337
338 return S_OK;
339}
340
341/***********************************************************************
342 * TF_IsCtfmonRunning (MSCTF.@)
343 *
344 * @implemented
345 */
348{
350 GetDesktopUniqueName(TEXT("CtfmonInstMutex"), szName, _countof(szName));
351
353 if (!hMutex)
354 return FALSE;
355
357 return TRUE;
358}
359
364{
365 CicRegKey regKey;
366 TCHAR szLanguage[2], szLayout[2];
368
369 szLanguage[0] = szLayout[0] = TEXT('3');
370 szLanguage[1] = szLayout[1] = TEXT('\0');
371
372 error = regKey.Open(HKEY_CURRENT_USER, TEXT("Keyboard Layout\\Toggle"));
373 if (error == ERROR_SUCCESS)
374 {
375 error = regKey.QuerySz(TEXT("Language Hotkey"), szLanguage, _countof(szLanguage));
376 if (error != ERROR_SUCCESS)
377 {
379 {
380 error = regKey.QuerySz(TEXT("Hotkey"), szLanguage, _countof(szLanguage));
381 if (error != ERROR_SUCCESS)
382 szLanguage[0] = TEXT('1');
383 }
384 else
385 {
386 error = regKey.QuerySz(NULL, szLanguage, _countof(szLanguage));
387 if (error != ERROR_SUCCESS)
388 szLanguage[0] = TEXT('1');
389 }
390
392 szLanguage[0] = TEXT('1');
393 }
394
395 error = regKey.QuerySz(TEXT("Layout Hotkey"), szLayout, _countof(szLayout));
396 if (error != ERROR_SUCCESS)
397 {
398 szLayout[0] = TEXT('1');
399 if (szLanguage[0] != TEXT('2'))
400 szLayout[0] = TEXT('2');
402 szLayout[0] = TEXT('3');
403 }
404
405 szLanguage[1] = TEXT('\0');
406 szLayout[1] = TEXT('\0');
407 }
408
409 if (szLanguage[0] == szLayout[0])
410 {
411 if (szLanguage[0] == TEXT('1'))
412 szLayout[0] = TEXT('2');
413 else if (szLanguage[0] == TEXT('2'))
414 szLayout[0] = TEXT('1');
415 else
416 szLayout[0] = TEXT('3');
417 }
418
420
421 switch (szLanguage[0])
422 {
423 case TEXT('2'):
427 break;
428
429 case TEXT('3'):
433 break;
434
435 case TEXT('4'):
439 break;
440
441 case TEXT('1'):
442 default:
446 break;
447 }
448
449 switch (szLayout[0])
450 {
451 case TEXT('2'):
455 break;
456
457 case TEXT('3'):
461 break;
462
463 case TEXT('4'):
467 break;
468
469 case TEXT('1'):
470 default:
474 break;
475 }
476
478
479 TRACE("HotKey: %c, %c\n", szLanguage[0], szLayout[0]);
480 return TRUE;
481}
482
487{
488 //FIXME
489}
490
492{
493 CicRegKey regKey1;
495
496 error = regKey1.Open(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\CTF\\SystemShared\\"));
497 if (error == ERROR_SUCCESS)
498 {
499 DWORD dwValue;
500 error = regKey1.QueryDword(TEXT("CUAS"), &dwValue);
501 if (error == ERROR_SUCCESS)
502 g_fCUAS = !!dwValue;
503 }
504
505 g_szCUASImeFile[0] = TEXT('\0');
506
507 if (!g_fCUAS)
508 return;
509
510 TCHAR szImeFile[16];
511 CicRegKey regKey2;
512 error = regKey2.Open(HKEY_LOCAL_MACHINE,
513 TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\IMM"));
514 if (error == ERROR_SUCCESS)
515 {
516 error = regKey2.QuerySz(TEXT("IME File"), szImeFile, _countof(szImeFile));
517 if (error == ERROR_SUCCESS)
518 {
519 g_szCUASImeFile[_countof(g_szCUASImeFile) - 1] = TEXT('\0'); // Avoid buffer overrun
521 }
522 }
523}
524
526{
527 // Do nothing
528}
529
533BOOL ProcessAttach(HINSTANCE hinstDLL) // FIXME: Call me from DllMain
534{
536
540
542 g_hInst = hinstDLL;
545 if (g_dwTLSIndex == (DWORD)-1)
546 return FALSE;
547
548 g_msgPrivate = ::RegisterWindowMessageA("MSUIM.Msg.Private");
549 g_msgSetFocus = ::RegisterWindowMessageA("MSUIM.Msg.SetFocus");
550 g_msgThreadTerminate = ::RegisterWindowMessageA("MSUIM.Msg.ThreadTerminate");
551 g_msgThreadItemChange = ::RegisterWindowMessageA("MSUIM.Msg.ThreadItemChange");
552 g_msgLBarModal = ::RegisterWindowMessageA("MSUIM.Msg.LangBarModal");
553 g_msgRpcSendReceive = ::RegisterWindowMessageA("MSUIM.Msg.RpcSendReceive");
554 g_msgThreadMarshal = ::RegisterWindowMessageA("MSUIM.Msg.ThreadMarshal");
555 g_msgCheckThreadInputIdel = ::RegisterWindowMessageA("MSUIM.Msg.CheckThreadInputIdel");
556 g_msgStubCleanUp = ::RegisterWindowMessageA("MSUIM.Msg.StubCleanUp");
557 g_msgShowFloating = ::RegisterWindowMessageA("MSUIM.Msg.ShowFloating");
558 g_msgLBUpdate = ::RegisterWindowMessageA("MSUIM.Msg.LBUpdate");
559 g_msgNuiMgrDirtyUpdate = ::RegisterWindowMessageA("MSUIM.Msg.MuiMgrDirtyUpdate");
560 if (!g_msgPrivate ||
561 !g_msgSetFocus ||
570 !g_msgLBUpdate ||
572 {
573 return FALSE;
574 }
575
577 TRACE("cicGetOSInfo: %u, 0x%lX\n", g_uACP, g_dwOSInfo);
578
580
581 //FIXME
582
584
585 //FIXME
586
587 InitCUASFlag();
588
589 //FIXME
590
594
595 //FIXME
596
598
599 //FIXME
600
602
603 return TRUE;
604}
605
609VOID ProcessDetach(HINSTANCE hinstDLL) // FIXME: Call me from DllMain
610{
611 if (!gf_CRT_INIT)
612 {
614 return;
615 }
616
617 if (gfSharedMemory)
618 {
619 if (g_cRefDll != -1 )
620 TFUninitLib();
621 //FIXME
622 }
623
624 UninitINAT();
625
626 //FIXME
627
628 //TF_UninitThreadSystem();
629
630 //FIXME
631
632 if (g_dwTLSIndex != (DWORD)-1)
633 {
635 g_dwTLSIndex = (DWORD)-1;
636 }
637
638 //FIXME
639
640 if (gfSharedMemory)
641 {
645 //FIXME
648 //FIXME
650 }
651
653
657
659}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define EXTERN_C
Definition: basetyps.h:12
#define ERR(fmt,...)
Definition: debug.h:113
EXTERN_C BOOL cicIsWow64(VOID)
Definition: cicbase.cpp:58
EXTERN_C void cicGetOSInfo(LPUINT puACP, LPDWORD pdwOSInfo)
Definition: cicbase.cpp:82
static void cicMemFree(LPVOID ptr)
Definition: cicbase.h:27
#define CIC_OSINFO_NT
Definition: cicbase.h:44
#define CIC_OSINFO_XPPLUS
Definition: cicbase.h:51
static LPVOID cicMemAllocClear(SIZE_T size)
Definition: cicbase.h:15
void Uninit()
Definition: cicmutex.h:31
LSTATUS QuerySz(LPCTSTR pszValueName, LPTSTR pszValue, DWORD cchValueMax)
Definition: cicreg.h:84
LSTATUS SetDword(LPCTSTR pszValueName, DWORD dwValue)
Definition: cicreg.h:67
LSTATUS Open(HKEY hKey, LPCTSTR lpSubKey, REGSAM samDesired=KEY_READ)
Definition: cicreg.h:51
LSTATUS RecurseDeleteKey(LPCTSTR lpSubKey)
Definition: cicreg.h:113
LSTATUS Create(HKEY hKey, LPCTSTR lpSubKey)
Definition: cicreg.h:56
LSTATUS SetSzW(LPCWSTR pszValueName, LPCWSTR pszValue)
Definition: cicreg.h:78
LSTATUS QueryDword(LPCTSTR pszValueName, LPDWORD pdwValue)
Definition: cicreg.h:61
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:411
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define CloseHandle
Definition: compat.h:739
#define CP_ACP
Definition: compat.h:109
#define GetCurrentProcess()
Definition: compat.h:759
#define MAX_PATH
Definition: compat.h:34
#define WideCharToMultiByte
Definition: compat.h:111
DWORD WINAPI TlsAlloc(VOID)
Definition: thread.c:1100
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1166
LCID WINAPI GetSystemDefaultLCID(void)
Definition: locale.c:1229
CicMutex g_mutexLBES
Definition: utils.cpp:76
TCHAR g_szCUASImeFile[16]
Definition: utils.cpp:51
EXTERN_C VOID TFUninitLib(VOID)
Definition: utils.cpp:525
UINT g_msgPrivate
Definition: utils.cpp:54
BOOL StringFromGUID2A(REFGUID rguid, LPSTR pszGUID, INT cchGUID)
Definition: utils.cpp:178
BOOL g_fCUAS
Definition: utils.cpp:50
CicMutex g_mutexLayouts
Definition: utils.cpp:79
DWORD g_dwOSInfo
Definition: utils.cpp:45
VOID InitCUASFlag(VOID)
Definition: utils.cpp:491
UINT g_uKeyTipHotKeyVKey
Definition: utils.cpp:90
VOID CheckAnchorStores(VOID)
Definition: utils.cpp:486
EXTERN_C HRESULT WINAPI TF_UnregisterLangBarAddIn(_In_ REFGUID rguid, _In_ DWORD dwFlags)
Definition: utils.cpp:281
HKL g_hklDefault
Definition: utils.cpp:46
CicMutex g_mutexAsm
Definition: utils.cpp:78
UINT g_msgLBUpdate
Definition: utils.cpp:64
UINT g_uLangHotKeyVKey2
Definition: utils.cpp:88
LONG g_cRefDll
Definition: utils.cpp:49
UINT g_msgCheckThreadInputIdel
Definition: utils.cpp:61
BOOL g_bOnWow64
Definition: utils.cpp:43
UINT g_msgThreadMarshal
Definition: utils.cpp:60
CicMutex g_mutexTMD
Definition: utils.cpp:80
BOOL gfSharedMemory
Definition: utils.cpp:48
LPTSTR GetUserSIDString(void)
Definition: utils.cpp:96
CRITICAL_SECTION g_csDelayLoad
Definition: utils.cpp:41
TCHAR g_szUserUnique[MAX_PATH]
Definition: utils.cpp:70
static BOOL RunCPLSetting(LPCTSTR pszCmdLine)
Definition: utils.cpp:230
CRITICAL_SECTION g_cs
Definition: utils.cpp:39
BOOL ProcessAttach(HINSTANCE hinstDLL)
Definition: utils.cpp:533
EXTERN_C HRESULT WINAPI TF_RegisterLangBarAddIn(_In_ REFGUID rguid, _In_ LPCWSTR pszFilePath, _In_ DWORD dwFlags)
Definition: utils.cpp:244
UINT g_uLangHotKeyModifiers
Definition: utils.cpp:86
UINT g_msgStubCleanUp
Definition: utils.cpp:62
CicMutex g_mutexCompart
Definition: utils.cpp:77
UINT g_msgShowFloating
Definition: utils.cpp:63
UINT g_msgNuiMgrDirtyUpdate
Definition: utils.cpp:65
UINT g_msgRpcSendReceive
Definition: utils.cpp:59
void GetDesktopUniqueName(_In_ LPCTSTR pszName, _Out_ LPTSTR pszBuff, _In_ UINT cchBuff)
Definition: utils.cpp:169
UINT g_uACP
Definition: utils.cpp:44
EXTERN_C HRESULT WINAPI TF_RunInputCPL(VOID)
Definition: utils.cpp:317
#define debugstr_t
Definition: utils.cpp:194
UINT g_msgThreadTerminate
Definition: utils.cpp:56
BOOL InitLangChangeHotKey(VOID)
Definition: utils.cpp:363
UINT g_uKeyTipHotKeyVKey2
Definition: utils.cpp:91
UINT g_msgSetFocus
Definition: utils.cpp:55
TCHAR g_szAsmListCache[MAX_PATH]
Definition: utils.cpp:71
BOOL InitUserSidString(void)
Definition: utils.cpp:131
BOOL InitUniqueString(void)
Definition: utils.cpp:149
CicFileMappingStatic g_SharedMemory
Definition: utils.cpp:83
TCHAR g_szTimListCache[MAX_PATH]
Definition: utils.cpp:72
UINT g_uKeyTipHotKeyModifiers
Definition: utils.cpp:89
UINT g_msgThreadItemChange
Definition: utils.cpp:57
EXTERN_C BOOL WINAPI TF_IsCtfmonRunning(VOID)
Definition: utils.cpp:347
BOOL FullPathExec(LPCTSTR pszExeFile, LPCTSTR pszCmdLine, UINT nCmdShow, BOOL bSysWinDir)
Definition: utils.cpp:197
BOOL gf_CRT_INIT
Definition: utils.cpp:37
UINT g_uLangHotKeyVKey
Definition: utils.cpp:87
VOID ProcessDetach(HINSTANCE hinstDLL)
Definition: utils.cpp:609
BOOL g_fDllProcessDetached
Definition: utils.cpp:38
#define StringFromGUID2T
Definition: utils.cpp:193
CRITICAL_SECTION g_csInDllMain
Definition: utils.cpp:40
DWORD g_dwTLSIndex
Definition: utils.cpp:47
UINT g_msgLBarModal
Definition: utils.cpp:58
BOOL g_fUserSidString
Definition: utils.cpp:68
HINSTANCE g_hInst
Definition: utils.cpp:42
TCHAR g_szUserSidString[MAX_PATH]
Definition: utils.cpp:69
TCHAR g_szLayoutsCache[MAX_PATH]
Definition: utils.cpp:73
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
DWORD dwThreadId
Definition: fdebug.c:31
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define MOD_ALT
Definition: imm.h:184
#define MOD_SHIFT
Definition: imm.h:186
#define MOD_CONTROL
Definition: imm.h:185
#define S_OK
Definition: intsafe.h:52
#define TEXT(s)
Definition: k32.h:26
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define GUID_NULL
Definition: ks.h:106
#define error(str)
Definition: mkdosfs.c:1605
VOID UninitINAT(VOID)
@implemented
Definition: mlng.cpp:354
HANDLE hMutex
Definition: mutex.c:11
static refpint_t pi[]
Definition: server.c:96
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
UINT_PTR HKL
Definition: msctf.idl:143
unsigned int UINT
Definition: ndis.h:50
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define DWORD
Definition: nt_native.h:44
#define UNICODE_NULL
#define ANSI_NULL
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
static const WCHAR szName[]
Definition: powrprof.c:45
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define ConvertSidToStringSid
Definition: sddl.h:160
#define LANG_CHINESE
Definition: nls.h:42
#define PRIMARYLANGID(l)
Definition: nls.h:16
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
#define StringCchCopy
Definition: strsafe.h:139
#define StringCchPrintf
Definition: strsafe.h:517
#define StringCchCat
Definition: strsafe.h:317
Definition: scsiwmi.h:51
DWORD dwFlags
Definition: winbase.h:842
DWORD cb
Definition: winbase.h:831
WORD wShowWindow
Definition: winbase.h:843
SID_AND_ATTRIBUTES User
Definition: setypes.h:1010
BOOL WINAPI InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount)
Definition: synch.c:765
int32_t INT
Definition: typedefs.h:58
int ret
#define CreateProcess
Definition: winbase.h:3758
#define NORMAL_PRIORITY_CLASS
Definition: winbase.h:181
#define ZeroMemory
Definition: winbase.h:1712
#define STARTF_USESHOWWINDOW
Definition: winbase.h:491
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MUTEX_ALL_ACCESS
Definition: winbase.h:158
#define OpenMutex
Definition: winbase.h:3888
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define WINAPI
Definition: msvc.h:6
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
HDESK WINAPI GetThreadDesktop(_In_ DWORD)
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
UINT WINAPI RegisterWindowMessageA(_In_ LPCSTR)
#define SM_MIDEASTENABLED
Definition: winuser.h:1034
#define UOI_NAME
Definition: winuser.h:1084
#define VK_CONTROL
Definition: winuser.h:2203
#define VK_NUMPAD0
Definition: winuser.h:2239
#define VK_SHIFT
Definition: winuser.h:2202
#define VK_OEM_3
Definition: winuser.h:2316
int WINAPI GetSystemMetrics(_In_ int)
#define SW_SHOWMINNOACTIVE
Definition: winuser.h:777
#define GetUserObjectInformation
Definition: winuser.h:5795
#define VK_MENU
Definition: winuser.h:2204
struct _TOKEN_USER * PTOKEN_USER
#define TOKEN_QUERY
Definition: setypes.h:928
@ TokenUser
Definition: setypes.h:966
char TCHAR
Definition: xmlstorage.h:189
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185