ReactOS 0.4.16-dev-61-ge128cbc
misc.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Applications Manager
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Misc functions
5 * COPYRIGHT: Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org)
6 * Copyright 2015 Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com)
7 * Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
8 */
9
10#include "rapps.h"
11#include "misc.h"
12
13static HANDLE hLog = NULL;
14
15VOID
17{
18 if (!OpenClipboard(NULL))
19 {
20 return;
21 }
22
23 HRESULT hr;
24 HGLOBAL ClipBuffer;
27
29 cchBuffer = wcslen(lpszText) + 1;
30 ClipBuffer = GlobalAlloc(GMEM_DDESHARE, cchBuffer * sizeof(WCHAR));
31
32 Buffer = (PWCHAR)GlobalLock(ClipBuffer);
33 hr = StringCchCopyW(Buffer, cchBuffer, lpszText);
34 GlobalUnlock(ClipBuffer);
35
36 if (SUCCEEDED(hr))
38
40}
41
42VOID
43ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem, POINT *Point)
44{
45 HMENU hMenu = NULL;
46 HMENU hPopupMenu;
47 MENUITEMINFO ItemInfo;
48 POINT pt;
49
50 if (MenuID)
51 {
52 hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(MenuID));
53 hPopupMenu = GetSubMenu(hMenu, 0);
54 }
55 else
56 {
57 hPopupMenu = GetMenu(hwnd);
58 }
59
60 ZeroMemory(&ItemInfo, sizeof(ItemInfo));
61 ItemInfo.cbSize = sizeof(ItemInfo);
62 ItemInfo.fMask = MIIM_STATE;
63
64 GetMenuItemInfoW(hPopupMenu, DefaultItem, FALSE, &ItemInfo);
65
66 if (!(ItemInfo.fState & MFS_GRAYED))
67 {
68 SetMenuDefaultItem(hPopupMenu, DefaultItem, FALSE);
69 }
70
71 if (!Point)
72 {
74 }
75
77 TrackPopupMenu(hPopupMenu, 0, Point->x, Point->y, 0, hwndOwner, NULL);
78
79 if (hMenu)
80 {
81 DestroyMenu(hMenu);
82 }
83}
84
85BOOL
87{
89 STARTUPINFOW si;
90 DWORD dwRet;
91 MSG msg;
92
93 ZeroMemory(&si, sizeof(si));
94 si.cb = sizeof(si);
97
98 // The Unicode version of CreateProcess can modify the contents of this string.
99 CStringW Tmp = Path;
100 BOOL fSuccess = CreateProcessW(NULL, Tmp.GetBuffer(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
101 Tmp.ReleaseBuffer();
102 if (!fSuccess)
103 {
104 return FALSE;
105 }
106
107 CloseHandle(pi.hThread);
108
109 if (Wait)
110 {
112 }
113
114 while (Wait)
115 {
116 dwRet = MsgWaitForMultipleObjects(1, &pi.hProcess, FALSE, INFINITE, QS_ALLEVENTS);
117 if (dwRet == WAIT_OBJECT_0 + 1)
118 {
119 while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
120 {
123 }
124 }
125 else
126 {
127 if (dwRet == WAIT_OBJECT_0 || dwRet == WAIT_FAILED)
128 break;
129 }
130 }
131
132 CloseHandle(pi.hProcess);
133
134 if (Wait)
135 {
139 }
140
141 return TRUE;
142}
143
144BOOL
146{
147 static CStringW CachedDirectory;
148 static BOOL CachedDirectoryInitialized = FALSE;
149
150 if (!CachedDirectoryInitialized)
151 {
152 LPWSTR DirectoryStr = CachedDirectory.GetBuffer(MAX_PATH);
153 BOOL bHasPath = SHGetSpecialFolderPathW(NULL, DirectoryStr, CSIDL_LOCAL_APPDATA, TRUE);
154 if (bHasPath)
155 {
156 PathAppendW(DirectoryStr, RAPPS_NAME);
157 }
158 CachedDirectory.ReleaseBuffer();
159
160 if (bHasPath)
161 {
162 if (!CreateDirectoryW(CachedDirectory, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
163 {
164 CachedDirectory.Empty();
165 }
166 }
167 else
168 {
169 CachedDirectory.Empty();
170 }
171
172 CachedDirectoryInitialized = TRUE;
173 }
174
175 Directory = CachedDirectory;
176 return !Directory.IsEmpty();
177}
178
179VOID
181{
183 {
184 return;
185 }
186
188 DWORD dwCategoryNum = 1;
189 DWORD dwDisp, dwData;
191
192 if (key.Create(
194 L"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\ReactOS Application Manager", REG_NONE,
196 {
197 return;
198 }
199
201 {
202 return;
203 }
204
206
207 if ((key.SetStringValue(L"EventMessageFile", szPath, REG_EXPAND_SZ) == ERROR_SUCCESS) &&
208 (key.SetStringValue(L"CategoryMessageFile", szPath, REG_EXPAND_SZ) == ERROR_SUCCESS) &&
209 (key.SetDWORDValue(L"TypesSupported", dwData) == ERROR_SUCCESS) &&
210 (key.SetDWORDValue(L"CategoryCount", dwCategoryNum) == ERROR_SUCCESS))
211
212 {
213 hLog = RegisterEventSourceW(NULL, L"ReactOS Application Manager");
214 }
215}
216
217VOID
219{
220 if (hLog)
221 {
223 }
224}
225
226BOOL
227WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
228{
230 {
231 return TRUE;
232 }
233
234 if (!ReportEventW(hLog, wType, 0, dwEventID, NULL, 1, 0, &lpMsg, NULL))
235 {
236 return FALSE;
237 }
238
239 return TRUE;
240}
241
242BOOL
243GetInstalledVersion_WowUser(CStringW *szVersionResult, const CStringW &szRegName, BOOL IsUserKey, REGSAM keyWow)
244{
245 BOOL bHasSucceded = FALSE;
248 CStringW szPath = CStringW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\") + szRegName;
249
250 if (key.Open(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, szPath.GetString(), keyWow | KEY_READ) !=
252 {
253 return FALSE;
254 }
255
256 if (szVersionResult != NULL)
257 {
258 ULONG dwSize = MAX_PATH * sizeof(WCHAR);
259
260 if (key.QueryStringValue(L"DisplayVersion", szVersion.GetBuffer(MAX_PATH), &dwSize) == ERROR_SUCCESS)
261 {
262 szVersion.ReleaseBuffer();
263 *szVersionResult = szVersion;
264 bHasSucceded = TRUE;
265 }
266 else
267 {
268 szVersion.ReleaseBuffer();
269 }
270 }
271 else
272 {
273 bHasSucceded = TRUE;
274 }
275
276 return bHasSucceded;
277}
278
279BOOL
280GetInstalledVersion(CStringW *pszVersion, const CStringW &szRegName)
281{
282 return (
283 !szRegName.IsEmpty() && (GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE, KEY_WOW64_32KEY) ||
284 GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE, KEY_WOW64_32KEY) ||
285 GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE, KEY_WOW64_64KEY) ||
286 GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE, KEY_WOW64_64KEY)));
287}
288
289BOOL
291{
292#ifdef _WIN64
293 return TRUE;
294#else
295 static UINT cache = 0;
296 if (!cache)
297 cache = 1 + (IsOS(OS_WOW6432) != FALSE);
298 return cache - 1;
299#endif
300}
301
302INT
304{
305 DEVMODEW pDevMode;
306 INT ColorDepth;
307
308 pDevMode.dmSize = sizeof(pDevMode);
309 pDevMode.dmDriverExtra = 0;
310
312 {
313 /* TODO: Error message */
314 return ILC_COLOR;
315 }
316
317 switch (pDevMode.dmBitsPerPel)
318 {
319 case 32:
320 ColorDepth = ILC_COLOR32;
321 break;
322 case 24:
323 ColorDepth = ILC_COLOR24;
324 break;
325 case 16:
326 ColorDepth = ILC_COLOR16;
327 break;
328 case 8:
329 ColorDepth = ILC_COLOR8;
330 break;
331 case 4:
332 ColorDepth = ILC_COLOR4;
333 break;
334 default:
335 ColorDepth = ILC_COLOR;
336 break;
337 }
338
339 return ColorDepth;
340}
341
342void
343UnixTimeToFileTime(DWORD dwUnixTime, LPFILETIME pFileTime)
344{
345 // Note that LONGLONG is a 64-bit value
346 LONGLONG ll;
347
348 ll = Int32x32To64(dwUnixTime, 10000000) + 116444736000000000;
349 pFileTime->dwLowDateTime = (DWORD)ll;
350 pFileTime->dwHighDateTime = ll >> 32;
351}
352
355{
356 CRegKey key;
357 LONG err = key.Open(hKey, Path, KEY_QUERY_VALUE | wowsam);
358 if (err == ERROR_SUCCESS)
359 {
360 WCHAR name[1];
361 DWORD cchname = _countof(name), cbsize = 0;
362 err = RegEnumValueW(key, 0, name, &cchname, NULL, NULL, NULL, &cbsize);
364 return S_FALSE;
365 if (err == ERROR_MORE_DATA)
367 }
368 return HRESULT_FROM_WIN32(err);
369}
370
373{
374 for (;;)
375 {
376 ULONG cb = 0, cch;
377 ULONG err = Key.QueryValue(Name, NULL, NULL, &cb);
378 if (err)
379 break;
380 cch = cb / sizeof(WCHAR);
381 LPWSTR p = Value.GetBuffer(cch + 1);
382 p[cch] = UNICODE_NULL;
383 err = Key.QueryValue(Name, NULL, (BYTE*)p, &cb);
384 if (err == ERROR_MORE_DATA)
385 continue;
386 if (err)
387 break;
388 Value.ReleaseBuffer();
389 return Value.GetString();
390 }
391 return NULL;
392}
393
394bool
396{
399 if (cch)
400 {
401 if (ExpandEnvironmentStringsW(Str, buf.GetBuffer(cch), cch) == cch)
402 {
403 buf.ReleaseBuffer(cch - 1);
404 Str = buf;
405 return true;
406 }
407 }
408 return false;
409}
410
411BOOL
412SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
413{
414 if (!*szNeedle)
415 return TRUE;
416 /* TODO: Improve pattern search beyond a simple case-insensitive substring search. */
417 return StrStrIW(szHaystack, szNeedle) != NULL;
418}
419
420BOOL
422{
423 CStringW from(Dir);
424 UINT cch = from.GetLength();
425 from.Append(L"00");
426 LPWSTR p = from.GetBuffer();
427 p[cch] = p[cch + 1] = L'\0'; // Double null-terminate
429 SHFILEOPSTRUCT shfos = { hwnd, FO_DELETE, p, NULL, (FILEOP_FLAGS)fof };
430 return SHFileOperationW(&shfos);
431}
432
433UINT
435{
437 return err == ERROR_ALREADY_EXISTS ? 0 : err;
438}
439
442{
443 CPathW dir = FullPath;
444 //int win = dir.ReverseFind(L'\\'), nix = dir.ReverseFind(L'/'), sep = max(win, nix);
445 int sep = dir.FindFileName();
446 CStringW file = dir.m_strPath.Mid(sep);
447 if (pDir)
448 *pDir = sep == -1 ? L"" : dir.m_strPath.Left(sep - 1);
449 return file;
450}
451
454{
455 if (!SHGetSpecialFolderPathW(hwnd, Path.GetBuffer(MAX_PATH), csidl, TRUE))
456 return E_FAIL;
457 Path.ReleaseBuffer();
458 return S_OK;
459}
460
463{
464 PWSTR p;
465 FARPROC f = GetProcAddress(LoadLibraryW(L"SHELL32"), "SHGetKnownFolderPath");
466 if (!f)
469 if (FAILED(hr))
470 return hr;
471 Path = p;
473 return hr;
474}
475
478{
479 if (!PerUser)
481
482 HRESULT hr = GetKnownPath(FOLDERID_UserProgramFiles, Path);
483 if (FAILED(hr))
484 {
486 // Use the correct path on NT6 (on NT5 the path becomes a bit long)
487 if (SUCCEEDED(hr) && LOBYTE(GetVersion()) >= 6)
488 {
489 Path = BuildPath(Path, L"Programs"); // Should not be localized
490 }
491 }
492 return hr;
493}
PRTL_UNICODE_STRING_BUFFER Path
unsigned int dir
Definition: maze.c:112
#define msg(x)
Definition: auth_time.c:54
#define CF_UNICODETEXT
Definition: constants.h:408
#define RAPPS_NAME
Definition: defines.h:34
static CStringW BuildPath(const T &Base, LPCWSTR Append)
Definition: misc.h:91
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
Definition: misc.cpp:227
bool ExpandEnvStrings(CStringW &Str)
Definition: misc.cpp:395
BOOL StartProcess(const CStringW &Path, BOOL Wait)
Definition: misc.cpp:86
BOOL GetInstalledVersion(CStringW *pszVersion, const CStringW &szRegName)
Definition: misc.cpp:280
HRESULT GetProgramFilesPath(CStringW &Path, BOOL PerUser, HWND hwnd)
Definition: misc.cpp:477
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem, POINT *Point)
Definition: misc.cpp:43
HRESULT GetKnownPath(REFKNOWNFOLDERID kfid, CStringW &Path, DWORD Flags)
Definition: misc.cpp:462
UINT CreateDirectoryTree(LPCWSTR Dir)
Definition: misc.cpp:434
static HANDLE hLog
Definition: misc.cpp:13
BOOL GetStorageDirectory(CStringW &Directory)
Definition: misc.cpp:145
BOOL GetInstalledVersion_WowUser(CStringW *szVersionResult, const CStringW &szRegName, BOOL IsUserKey, REGSAM keyWow)
Definition: misc.cpp:243
VOID InitLogs()
Definition: misc.cpp:180
VOID FreeLogs()
Definition: misc.cpp:218
INT GetSystemColorDepth()
Definition: misc.cpp:303
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:16
BOOL DeleteDirectoryTree(LPCWSTR Dir, HWND hwnd)
Definition: misc.cpp:421
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:412
LPCWSTR GetRegString(CRegKey &Key, LPCWSTR Name, CStringW &Value)
Definition: misc.cpp:372
HRESULT GetSpecialPath(UINT csidl, CStringW &Path, HWND hwnd)
Definition: misc.cpp:453
CStringW SplitFileAndDirectory(LPCWSTR FullPath, CStringW *pDir)
Definition: misc.cpp:441
BOOL IsSystem64Bit()
Definition: misc.cpp:290
void UnixTimeToFileTime(DWORD dwUnixTime, LPFILETIME pFileTime)
Definition: misc.cpp:343
HRESULT RegKeyHasValues(HKEY hKey, LPCWSTR Path, REGSAM wowsam)
Definition: misc.cpp:354
w ll
Definition: byte_order.h:167
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
void Empty() noexcept
Definition: atlsimpstr.h:253
Definition: bufpool.h:45
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
BOOL WINAPI ReportEventW(IN HANDLE hEventLog, IN WORD wType, IN WORD wCategory, IN DWORD dwEventID, IN PSID lpUserSid, IN WORD wNumStrings, IN DWORD dwDataSize, IN LPCWSTR *lpStrings, IN LPVOID lpRawData)
Definition: eventlog.c:1516
BOOL WINAPI DeregisterEventSource(IN HANDLE hEventLog)
Definition: eventlog.c:473
HANDLE WINAPI RegisterEventSourceW(IN LPCWSTR lpUNCServerName, IN LPCWSTR lpSourceName)
Definition: eventlog.c:1295
LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
Definition: string.c:380
#define CloseHandle
Definition: compat.h:739
int(* FARPROC)()
Definition: compat.h:36
#define GetProcAddress(x, y)
Definition: compat.h:753
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define MAX_PATH
Definition: compat.h:34
#define LoadLibraryW(x)
Definition: compat.h:747
static DWORD cchBuffer
Definition: fusion.c:85
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4598
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3092
BOOL WINAPI IsOS(DWORD feature)
Definition: ordinal.c:4107
#define pt(x, y)
Definition: drawing.c:79
#define INFINITE
Definition: serial.h:102
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
FxAutoRegKey hKey
GLfloat f
Definition: glext.h:7540
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define LOBYTE(W)
Definition: jmemdos.c:487
#define f
Definition: ke_i.h:83
HWND hMainWnd
Definition: magnifier.c:32
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
LPCWSTR szPath
Definition: env.c:37
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
static LPCWSTR szVersion
Definition: asmcache.c:748
static HANDLE ULONG_PTR dwData
Definition: file.c:35
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static refpint_t pi[]
Definition: server.c:96
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
CAtlStringW CStringW
Definition: atlstr.h:130
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define KEY_WRITE
Definition: nt_native.h:1031
#define DWORD
Definition: nt_native.h:44
#define REG_NONE
Definition: nt_native.h:1492
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define Int32x32To64(a, b)
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
#define PathAppendW
Definition: pathcch.h:309
long LONG
Definition: pedump.c:60
#define ILC_COLOR4
Definition: commctrl.h:354
#define ILC_COLOR16
Definition: commctrl.h:356
#define ILC_COLOR8
Definition: commctrl.h:355
#define ILC_COLOR32
Definition: commctrl.h:358
#define ILC_COLOR24
Definition: commctrl.h:357
#define ILC_COLOR
Definition: commctrl.h:352
#define err(...)
DWORD WINAPI GetVersion()
Definition: redirtest.c:5
#define FO_DELETE
Definition: shellapi.h:138
#define FOF_NOERRORUI
Definition: shellapi.h:151
WORD FILEOP_FLAGS
Definition: shellapi.h:213
#define FOF_NOCONFIRMATION
Definition: shellapi.h:145
#define FOF_SILENT
Definition: shellapi.h:143
int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
Definition: shlfileop.cpp:1988
int WINAPI SHCreateDirectory(HWND hWnd, LPCWSTR path)
Definition: shlfileop.cpp:848
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_PROGRAM_FILES
Definition: shlobj.h:2210
#define CSIDL_LOCAL_APPDATA
Definition: shlobj.h:2200
#define OS_WOW6432
Definition: shlwapi.h:2048
KNOWNFOLDERID * REFKNOWNFOLDERID
Definition: shtypes.idl:147
#define _countof(array)
Definition: sndvol32.h:70
CardRegion * from
Definition: spigame.cpp:19
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
base for all directory entries
Definition: entries.h:138
BOOL bLogEnabled
Definition: settings.h:9
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65
DWORD cb
Definition: winbase.h:852
DWORD dwFlags
Definition: winbase.h:863
WORD wShowWindow
Definition: winbase.h:864
DWORD dmBitsPerPel
Definition: wingdi.h:1647
WORD dmDriverExtra
Definition: wingdi.h:1621
WORD dmSize
Definition: wingdi.h:1620
Definition: cache.c:49
Definition: fci.c:127
Definition: copy.c:22
Definition: name.c:39
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint16_t * PWSTR
Definition: typedefs.h:56
int64_t LONGLONG
Definition: typedefs.h:68
PVOID HANDLE
Definition: typedefs.h:73
int32_t INT
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define STARTF_USESHOWWINDOW
Definition: winbase.h:491
#define WAIT_OBJECT_0
Definition: winbase.h:406
#define WAIT_FAILED
Definition: winbase.h:413
#define GMEM_DDESHARE
Definition: winbase.h:298
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_OLD_WIN_VERSION
Definition: winerror.h:672
#define EVENTLOG_ERROR_TYPE
Definition: winnt_old.h:2834
#define EVENTLOG_INFORMATION_TYPE
Definition: winnt_old.h:2836
#define EVENTLOG_WARNING_TYPE
Definition: winnt_old.h:2835
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
ACCESS_MASK REGSAM
Definition: winreg.h:69
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
#define QS_ALLEVENTS
Definition: winuser.h:905
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2714
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define MIIM_STATE
Definition: winuser.h:724
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define MFS_GRAYED
Definition: winuser.h:754
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1199
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define SW_SHOW
Definition: winuser.h:778
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
HMENU WINAPI GetMenu(_In_ HWND)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193