ReactOS 0.4.16-dev-1946-g52006dd
appcompat.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Shell
3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4 * PURPOSE: Shell application compatibility flags
5 * COPYRIGHT: Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "precomp.h"
9#include <winreg.h>
10#include <winver.h>
11#include <commctrl.h>
12#include <shlwapi_undoc.h>
13
15
16// Indicates if the compatibility system has been initialized
18
19static DWORD g_dwAppCompatFlags = 0; // Cached compatibility flags
20
21// SHACF flags and their corresponding names
22typedef struct tagFLAGMAP
23{
28{
29 { SHACF_CONTEXTMENU, "CONTEXTMENU" },
30 { SHACF_CORELINTERNETENUM, "CORELINTERNETENUM" },
31 { SHACF_OLDCREATEVIEWWND, "OLDCREATEVIEWWND" },
32 { SHACF_WIN95DEFVIEW, "WIN95DEFVIEW" },
33 { SHACF_DOCOBJECT, "DOCOBJECT" },
34 { SHACF_FLUSHNOWAITALWAYS, "FLUSHNOWAITALWAYS" },
35 { SHACF_MYCOMPUTERFIRST, "MYCOMPUTERFIRST" },
36 { SHACF_OLDREGITEMGDN, "OLDREGITEMGDN" },
37 { SHACF_LOADCOLUMNHANDLER, "LOADCOLUMNHANDLER" },
38 { SHACF_ANSI, "ANSI" },
39 { SHACF_STAROFFICE5PRINTER, "STAROFFICE5PRINTER" },
40 { SHACF_NOVALIDATEFSIDS, "NOVALIDATEFSIDS" },
41 { SHACF_WIN95SHLEXEC, "WIN95SHLEXEC" },
42 { SHACF_FILEOPENNEEDSEXT, "FILEOPENNEEDSEXT" },
43 { SHACF_WIN95BINDTOOBJECT, "WIN95BINDTOOBJECT" },
44 { SHACF_IGNOREENUMRESET, "IGNOREENUMRESET" },
45 { SHACF_ANSIDISPLAYNAMES, "ANSIDISPLAYNAMES" },
46 { SHACF_FILEOPENBOGUSCTRLID, "FILEOPENBOGUSCTRLID" },
47 { SHACF_FORCELFNIDLIST, "FORCELFNIDLIST" },
48};
49
50// Get compatibility flags from registry values
51static DWORD
53{
54 DWORD flags = 0;
55 for (UINT iEntry = 0; iEntry < nEntries; ++iEntry)
56 {
57 DWORD error = SHGetValueA(hKey, NULL, pEntries[iEntry].name, NULL, NULL, NULL);
58 if (error == ERROR_SUCCESS)
59 flags |= pEntries[iEntry].flags;
60 }
61 return flags;
62}
63
64#define MAJOR_VER_ONLY "\x01" // A mark to indicate that only major version will be compared.
65
66// App compatibility info
67// Extracted from: https://www.geoffchappell.com/studies/windows/shell/shlwapi/api/util/getappcompatflags.htm
68typedef struct tagAPPCOMPATINFO
69{
75{
76 { "abcmm.exe", NULL, SHACF_LOADCOLUMNHANDLER },
77 { "autorun.exe", "4.00.950", SHACF_ANSI },
78 { "autorun.exe", "4.10.1998", SHACF_ANSI },
79 { "coreldrw.exe", MAJOR_VER_ONLY "7", SHACF_OLDREGITEMGDN },
80 { "dad9.exe", MAJOR_VER_ONLY "9", SHACF_CORELINTERNETENUM },
81 { "filler51.exe", NULL, SHACF_OLDREGITEMGDN },
82 { "hotdog4.exe", NULL, SHACF_DOCOBJECT },
83 { "msmoney.exe", "7.05.1107", SHACF_WIN95SHLEXEC },
89 { "powerpnt.exe", MAJOR_VER_ONLY "8", SHACF_WIN95SHLEXEC },
90 { "pp70.exe", NULL, SHACF_LOADCOLUMNHANDLER },
91 { "pp80.exe", NULL, SHACF_LOADCOLUMNHANDLER },
94 { "prwin9.exe", MAJOR_VER_ONLY "9", SHACF_CORELINTERNETENUM },
96 { "ps80.exe", NULL, SHACF_OLDREGITEMGDN },
98 { "qpw.exe", MAJOR_VER_ONLY "7", SHACF_CONTEXTMENU },
100 { "qpw.exe", MAJOR_VER_ONLY "9", SHACF_CORELINTERNETENUM },
101 { "rnaapp.exe", NULL, SHACF_CONTEXTMENU },
104 { "smartctr.exe", "96.0", SHACF_CONTEXTMENU },
105 { "soffice.exe", MAJOR_VER_ONLY "5", SHACF_STAROFFICE5PRINTER },
107 { "ue32.exe", "2.00.0.0", SHACF_OLDREGITEMGDN },
110 { "wpwin9.exe", MAJOR_VER_ONLY "9", SHACF_CORELINTERNETENUM },
111};
112
113// Window class name and compatibility flags
114typedef struct tagWNDCOMPATINFO
115{
120{
121 // The first byte indicates the string length
122 { "\x09" "bosa_sdm_", SHACF_UNKNOWN1 | SHACF_UNKNOWN2 },
123 { "\x18" "File Open Message Window", SHACF_UNKNOWN1 | SHACF_UNKNOWN2 },
124};
125
126// Internal structure for SHLWAPI_WndCompatEnumProc
127typedef struct tagAPPCOMPATENUM
128{
134
135static BOOL CALLBACK
137{
139
140 CHAR szClass[256];
141 if (!pEnum->nItems || !GetClassNameA(hWnd, szClass, _countof(szClass)))
142 return TRUE; // Ignore and continue
143
144 // Search for the target window in pEnum
145 const INT cchClass = lstrlenA(szClass);
146 for (UINT iItem = 0; iItem < pEnum->nItems; ++iItem)
147 {
148 PCSTR pszLengthAndClassName = pEnum->pItems[iItem].pszLengthAndClassName;
149
150 INT cchLength = pszLengthAndClassName[0]; // The first byte represents the length
151 if (cchClass < cchLength)
152 cchLength = cchClass; // Ignore trailing characters
153
154 // Compare the string
155 if (StrCmpNA(szClass, &pszLengthAndClassName[1], cchLength) == 0) // Class name matched
156 {
157 // Get the process ID
160 if (dwProcessId == pEnum->dwProcessId) // Same process
161 {
162 pEnum->iFound = iItem; // Found
163 return FALSE; // Quit enumeration
164 }
165 }
166 }
167
168 return TRUE; // Continue enumeration
169}
170
171// English (US) UTF-16
172#define PRODUCT_VER_ENGLISH_US_UTF16 "\\StringFileInfo\\040904E4\\ProductVersion"
173// German (Germany) UTF-16
174#define PRODUCT_VER_GERMAN_UTF16 "\\StringFileInfo\\040704E4\\ProductVersion"
175// English (US) Western European
176#define PRODUCT_VER_ENGLISH_US_WE "\\StringFileInfo\\040904B0\\ProductVersion"
177// English (US) Neutral
178#define PRODUCT_VER_ENGLISH_US_NEUTRAL "\\StringFileInfo\\04090000\\ProductVersion"
179// Swedish (Sweden) Western European
180#define PRODUCT_VER_SWEDISH_WE "\\StringFileInfo\\041D04B0\\ProductVersion"
181
182typedef struct tagLANGANDCODEPAGE
183{
187
188static HRESULT
190{
191 DWORD dwHandle;
192 PBYTE pbData;
194
195 *ppszDest = NULL;
196
197 // Obtain the version info
199 if (!size)
200 {
201 TRACE("No version info\n");
202 return E_FAIL;
203 }
204 pbData = (PBYTE)LocalAlloc(LPTR, size);
205 if (!pbData)
206 {
207 ERR("E_OUTOFMEMORY\n");
208 return E_OUTOFMEMORY;
209 }
210 GetFileVersionInfoA(pszFileName, dwHandle, size, pbData);
211
212 // Getting the product version
213 HRESULT hr = E_FAIL;
219 {
220 // NOTE: *ppszDest must be freed using LocalFree later
221 *ppszDest = StrDupA((PSTR)pvData);
222 hr = *ppszDest ? S_OK : E_OUTOFMEMORY;
223 }
224 else if (VerQueryValueA(pbData, "\\VarFileInfo\\Translation", &pvData, &size))
225 {
226 PVOID pDataSaved = pvData;
228 for (; (PBYTE)pEntry + sizeof(LANGANDCODEPAGE) <= (PBYTE)pDataSaved + size; ++pEntry)
229 {
231 wnsprintfA(szPath, _countof(szPath), "\\StringFileInfo\\%04X%04X\\ProductVersion",
232 pEntry->wLanguage, pEntry->wCodePage);
233 if (VerQueryValueA(pbData, szPath, &pvData, &size) && size)
234 {
235 // NOTE: *ppszDest must be freed using LocalFree later
236 *ppszDest = StrDupA((PSTR)pvData);
237 hr = *ppszDest ? S_OK : E_OUTOFMEMORY;
238 }
239 }
240 }
241
242 if (FAILED(hr))
243 WARN("hr: 0x%lX\n", hr);
244
245 LocalFree(pbData);
246 return hr;
247}
248
249static BOOL
251{
252 if (!pszVersionPattern)
253 return TRUE;
254
255 PSTR pszModuleVersion = NULL;
256 HRESULT hr = SHLWAPI_GetModuleVersion(pszFileName, &pszModuleVersion);
257 if (FAILED(hr))
258 return FALSE;
259
260 BOOL ret = FALSE;
261 if (pszVersionPattern[0] == MAJOR_VER_ONLY[0]) // Special handling for major version only
262 {
263 // Truncate at comma (',') if present
264 PSTR pchComma = StrChrA(pszModuleVersion, ',');
265 if (pchComma)
266 *pchComma = ANSI_NULL;
267
268 // Truncate at dot ('.') if present
269 PSTR pchDot = StrChrA(pszModuleVersion, '.');
270 if (pchDot)
271 *pchDot = ANSI_NULL;
272
273 ret = (lstrcmpiA(pszModuleVersion, &pszVersionPattern[1]) == 0);
274 }
275 else // Otherwise, perform a normal match
276 {
277 PSTR pchAsterisk = StrChrA(pszVersionPattern, '*'); // Find an asterisk ('*')
278 if (pchAsterisk) // Asterisk found
279 {
280 // Check for a match, ignoring the substring after '*'
281 INT cchPrefix = (INT)(pchAsterisk - pszVersionPattern);
282 if (cchPrefix > 0)
283 ret = (StrCmpNIA(pszModuleVersion, pszVersionPattern, cchPrefix) == 0);
284 }
285
286 if (!ret)
287 ret = (lstrcmpiA(pszModuleVersion, pszVersionPattern) == 0); // Full match
288 }
289
290 LocalFree(pszModuleVersion);
291 return ret;
292}
293
294static DWORD
296{
297 // Build the path to the "application compatibility" registry key
298 CHAR szText[MAX_PATH];
299 wnsprintfA(szText, _countof(szText),
300 "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ShellCompatibility\\Applications\\%s",
301 PathFindFileNameA(pszPath));
302
303 // Open the key
304 HKEY hKey;
305 const REGSAM samDesired = KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS;
306 LSTATUS error = RegOpenKeyExA(HKEY_LOCAL_MACHINE, szText, 0, samDesired, &hKey);
307 if (error != ERROR_SUCCESS)
308 {
309 ERR("error: %lu\n", error);
310 return 0; // Failed
311 }
312
313 // Build the base directory
314 CHAR szBaseDir[MAX_PATH];
315 lstrcpynA(szBaseDir, pszPath, _countof(szBaseDir));
316 PathRemoveFileSpecA(szBaseDir);
317
318 // Search from the registry key
319 DWORD dwCompatFlags = 0;
320 szText[0] = ANSI_NULL; // The first attempt is for the non-subkey path
321 for (DWORD dwIndex = 0; error == ERROR_SUCCESS;)
322 {
323 HKEY hSubKey;
324 error = RegOpenKeyExA(hKey, szText, 0, KEY_QUERY_VALUE, &hSubKey);
325 if (error != ERROR_SUCCESS)
326 break;
327
328 // Get the "RequiredFile" value
329 CHAR szRequired[MAX_PATH];
330 DWORD cbData = sizeof(szRequired);
331 error = SHGetValueA(hSubKey, NULL, "RequiredFile", NULL, szRequired, &cbData);
332 BOOL bValueExists = (error == ERROR_SUCCESS);
333 BOOL bRequiredFileExists = FALSE;
334 if (bValueExists) // Does the "RequiredFile" value exist?
335 {
336 // Build required file path to szText
337 PathCombineA(szText, szBaseDir, szRequired);
338 TRACE("RequiredFile: %s\n", wine_dbgstr_a(szRequired));
339 TRACE("szText: %s\n", wine_dbgstr_a(szText));
340 // Now szText is a full path
341 bRequiredFileExists = (GetFileAttributesA(szText) != INVALID_FILE_ATTRIBUTES);
342 }
343
344 // If the "RequiredFile" value doesn't exist, or the file specified by szText exists:
345 if (!bValueExists || bRequiredFileExists)
346 {
347 // Check the "Version" value if necessary
348 error = SHGetValueA(hSubKey, NULL, "Version", NULL, szText, &cbData);
349 PCSTR pszVersionPattern = ((error == ERROR_SUCCESS) ? szText : NULL);
350 TRACE("pszVersionPattern: %s\n", wine_dbgstr_a(pszVersionPattern));
351
352 // Does the pattern match?
353 if (SHLWAPI_DoesModuleVersionMatch(pszPath, pszVersionPattern))
354 {
355 // Add additional flags from the registry key
356 dwCompatFlags |= SHLWAPI_GetMappedFlags(hSubKey, g_appCompatFlagMaps,
358 }
359 }
360
361 RegCloseKey(hSubKey);
362
363 // Go to the next sub-key
364 ++dwIndex;
365 error = RegEnumKeyA(hKey, dwIndex, szText, _countof(szText));
366 }
367
369
370 return dwCompatFlags;
371}
372
373static DWORD
375{
376 if (GetProcessVersion(0) >= MAKELONG(0, 5))
377 return 0; // Flags are not needed
378
379 // Get module pathname
380 CHAR szModulePathA[MAX_PATH];
381 if (!GetModuleFileNameA(NULL, szModulePathA, _countof(szModulePathA)))
382 return 0;
383
384 PCSTR pszFileName = PathFindFileNameA(szModulePathA); // Get the file title from the path
385
386 // Search the file title from g_appCompatInfo
387 DWORD dwAppCompatFlags = 0;
388 for (UINT iItem = 0; iItem < _countof(g_appCompatInfo); ++iItem)
389 {
390 const APPCOMPATINFO *pInfo = &g_appCompatInfo[iItem];
391 if (lstrcmpiA(pInfo->pszAppName, pszFileName) == 0 &&
393 {
394 // Found, set the flags
395 dwAppCompatFlags = g_appCompatInfo[iItem].dwCompatFlags;
396 break;
397 }
398 }
399
400 // Add additional flags from the registry
401 dwAppCompatFlags |= SHLWAPI_GetRegistryCompatFlags(pszFileName);
402
403 return dwAppCompatFlags;
404}
405
406// These flags require SHLWAPI_InitAppCompat
407#define SHACF_TO_INIT ( \
408 SHACF_CONTEXTMENU | \
409 SHACF_DOCOBJECT | \
410 SHACF_CORELINTERNETENUM | \
411 SHACF_MYCOMPUTERFIRST | \
412 SHACF_OLDREGITEMGDN | \
413 SHACF_LOADCOLUMNHANDLER | \
414 SHACF_ANSI | \
415 SHACF_WIN95SHLEXEC | \
416 SHACF_STAROFFICE5PRINTER | \
417 SHACF_NOVALIDATEFSIDS | \
418 SHACF_FILEOPENNEEDSEXT | \
419 SHACF_WIN95BINDTOOBJECT | \
420 SHACF_IGNOREENUMRESET | \
421 SHACF_ANSIDISPLAYNAMES | \
422 SHACF_FILEOPENBOGUSCTRLID | \
423 SHACF_FORCELFNIDLIST \
424)
425
426/*************************************************************************
427 * SHGetAppCompatFlags [SHLWAPI.461]
428 *
429 * Thanks to Geoff Chappell.
430 * @see https://www.geoffchappell.com/studies/windows/shell/shlwapi/api/util/getappcompatflags.htm
431 */
434{
435 TRACE("(0x%lX)\n", dwMask);
436
437 // Initialize and retrieve flags if necessary
438 if (dwMask & SHACF_TO_INIT)
439 {
441 {
442 DWORD dwAppCompatFlags = SHLWAPI_InitAppCompat();
443 InterlockedExchange((PLONG)&g_dwAppCompatFlags, dwAppCompatFlags);
444
445 g_fAppCompatInitialized = TRUE; // Mark as initialized
446 }
447 }
448
449 // Retrieve additional flags if necessary
450 DWORD dwAppCompatFlags = g_dwAppCompatFlags;
451 if (dwAppCompatFlags && (dwMask & (SHACF_UNKNOWN1 | SHACF_UNKNOWN2)))
452 {
453 // Find the target window and its flags using g_wndCompatInfo
455 {
457 };
459
460 // Add the target flags if a match is found
461 if (data.iFound >= 0)
462 dwAppCompatFlags |= g_wndCompatInfo[data.iFound].dwCompatFlags;
463
464 dwAppCompatFlags |= SHACF_UNKNOWN3;
465
466 InterlockedExchange((PLONG)&g_dwAppCompatFlags, dwAppCompatFlags);
467 }
468
469 return dwAppCompatFlags;
470}
471
472// FIXME: SHGetObjectCompatFlags
#define InterlockedExchange
Definition: armddk.h:54
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define RegCloseKey(hKey)
Definition: registry.h:49
LPARAM lParam
Definition: combotst.c:139
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#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
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegEnumKeyA(HKEY hKey, DWORD dwIndex, LPSTR lpName, DWORD cbName)
Definition: reg.c:2368
INT WINAPI StrCmpNIA(LPCSTR lpszStr, LPCSTR lpszComp, INT iLen)
Definition: string.c:296
LPSTR WINAPI StrChrA(LPCSTR lpszStr, WORD ch)
Definition: string.c:266
INT WINAPI StrCmpNA(LPCSTR lpszStr, LPCSTR lpszComp, INT iLen)
Definition: string.c:489
#define lstrcpynA
Definition: compat.h:751
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
DWORD WINAPI GetProcessVersion(IN DWORD ProcessId)
Definition: proc.c:1768
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4227
BOOL WINAPI PathRemoveFileSpecA(char *path)
Definition: path.c:1108
char *WINAPI PathFindFileNameA(const char *path)
Definition: path.c:1684
char *WINAPI StrDupA(const char *str)
Definition: string.c:292
DWORD WINAPI GetFileVersionInfoSizeA(LPCSTR filename, LPDWORD handle)
Definition: version.c:746
BOOL WINAPI VerQueryValueA(LPCVOID pBlock, LPCSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1115
BOOL WINAPI GetFileVersionInfoA(LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:975
#define PRODUCT_VER_SWEDISH_WE
Definition: appcompat.c:180
struct tagAPPCOMPATINFO * PAPPCOMPATINFO
static BOOL SHLWAPI_DoesModuleVersionMatch(_In_ PCSTR pszFileName, _In_opt_ PCSTR pszVersionPattern)
Definition: appcompat.c:250
#define PRODUCT_VER_ENGLISH_US_WE
Definition: appcompat.c:176
static WNDCOMPATINFO g_wndCompatInfo[]
Definition: appcompat.c:119
#define PRODUCT_VER_ENGLISH_US_UTF16
Definition: appcompat.c:172
struct tagLANGANDCODEPAGE LANGANDCODEPAGE
struct tagWNDCOMPATINFO WNDCOMPATINFO
struct tagAPPCOMPATINFO APPCOMPATINFO
static DWORD SHLWAPI_GetRegistryCompatFlags(_In_ PCSTR pszPath)
Definition: appcompat.c:295
static DWORD SHLWAPI_GetMappedFlags(_In_ HKEY hKey, _In_ const FLAGMAP *pEntries, _In_ UINT nEntries)
Definition: appcompat.c:52
struct tagFLAGMAP * PFLAGMAP
static APPCOMPATINFO g_appCompatInfo[]
Definition: appcompat.c:74
static HRESULT SHLWAPI_GetModuleVersion(_In_ PCSTR pszFileName, _Out_ PSTR *ppszDest)
Definition: appcompat.c:189
static DWORD SHLWAPI_InitAppCompat(VOID)
Definition: appcompat.c:374
static BOOL CALLBACK SHLWAPI_WndCompatEnumProc(_In_ HWND hWnd, _In_ LPARAM lParam)
Definition: appcompat.c:136
#define MAJOR_VER_ONLY
Definition: appcompat.c:64
struct tagAPPCOMPATENUM APPCOMPATENUM
struct tagFLAGMAP FLAGMAP
DWORD WINAPI SHGetAppCompatFlags(_In_ DWORD dwMask)
Definition: appcompat.c:433
#define PRODUCT_VER_ENGLISH_US_NEUTRAL
Definition: appcompat.c:178
static DWORD g_dwAppCompatFlags
Definition: appcompat.c:19
static FLAGMAP g_appCompatFlagMaps[]
Definition: appcompat.c:27
#define SHACF_TO_INIT
Definition: appcompat.c:407
struct tagLANGANDCODEPAGE * PLANGANDCODEPAGE
struct tagAPPCOMPATENUM * PAPPCOMPATENUM
struct tagWNDCOMPATINFO * PWNDCOMPATINFO
#define PRODUCT_VER_GERMAN_UTF16
Definition: appcompat.c:174
static BOOL g_fAppCompatInitialized
Definition: appcompat.c:17
DWORD WINAPI SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1207
int WINAPIV wnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt,...)
Definition: wsprintf.c:547
return ret
Definition: mutex.c:146
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define LPTR
Definition: minwinbase.h:93
LONG_PTR LPARAM
Definition: minwindef.h:175
#define error(str)
Definition: mkdosfs.c:1605
LPCWSTR szPath
Definition: env.c:37
unsigned int UINT
Definition: ndis.h:50
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1022
#define ANSI_NULL
#define PathCombineA
Definition: pathcch.h:317
BYTE * PBYTE
Definition: pedump.c:66
#define INT
Definition: polytest.cpp:20
_In_ DWORD dwProcessId
Definition: shlwapi.h:193
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
Definition: debug.h:187
HRESULT hr
Definition: shlfolder.c:183
#define SHACF_OLDREGITEMGDN
#define SHACF_CONTEXTMENU
#define SHACF_LOADCOLUMNHANDLER
#define SHACF_FILEOPENBOGUSCTRLID
#define SHACF_WIN95DEFVIEW
#define SHACF_DOCOBJECT
#define SHACF_FILEOPENNEEDSEXT
#define SHACF_FLUSHNOWAITALWAYS
#define SHACF_FORCELFNIDLIST
#define SHACF_OLDCREATEVIEWWND
#define SHACF_STAROFFICE5PRINTER
#define SHACF_UNKNOWN1
#define SHACF_WIN95SHLEXEC
#define SHACF_NOVALIDATEFSIDS
#define SHACF_UNKNOWN3
#define SHACF_CORELINTERNETENUM
#define SHACF_MYCOMPUTERFIRST
#define SHACF_ANSIDISPLAYNAMES
#define SHACF_WIN95BINDTOOBJECT
#define SHACF_UNKNOWN2
#define SHACF_ANSI
#define SHACF_IGNOREENUMRESET
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
Definition: name.c:39
PWNDCOMPATINFO pItems
Definition: appcompat.c:129
DWORD dwCompatFlags
Definition: appcompat.c:72
PCSTR pszAppName
Definition: appcompat.c:70
PCSTR pszAppVersion
Definition: appcompat.c:71
DWORD flags
Definition: appcompat.c:24
LPCSTR name
Definition: appcompat.c:25
DWORD dwCompatFlags
Definition: appcompat.c:117
PCSTR pszLengthAndClassName
Definition: appcompat.c:116
char * PSTR
Definition: typedefs.h:51
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
const char * PCSTR
Definition: typedefs.h:52
int32_t * PLONG
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define WINAPI
Definition: msvc.h:6
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
ACCESS_MASK REGSAM
Definition: winreg.h:76
int WINAPI GetClassNameA(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPSTR lpClassName, _In_ int nMaxCount)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
const char * LPCSTR
Definition: xmlstorage.h:183
char CHAR
Definition: xmlstorage.h:175