ReactOS 0.4.17-dev-769-g1500a35
AssocQueryKey.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Tests for AssocQueryKey
5 * COPYRIGHT: Copyright 2026 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
6 * Copyright 2026 Whindmar Saksit <whindsaks@proton.me>
7 */
8
9#include <apitest.h>
10#include <windef.h>
11#include <shlwapi.h>
12#include <pseh/pseh2.h>
13#include <shlobj.h> // LPDBLIST, LPSHELLFOLDER, OLECMD for shlwapi_undoc.h:
14#include <shlwapi_undoc.h>
15#if NTDDI_VERSION < NTDDI_WIN10_RS1
16#define ASSOCF_PER_MACHINE_ONLY 0x00008000
17#endif
18
19static const WCHAR pszUniqueExt[] = L".RosTestExtShlwapi";
20static const WCHAR pszUniquePid[] = L"FEF31D544EA64C8EBC50B8719887688A";
21static const WCHAR pszUniquePid2[] = L"88FDE0879CD24AEBBEB690988BD87706";
22
23static void Cleanup(void)
24{
28}
29
30enum
31{
38};
39
41{
47
49{
53
54// ntdll!NtQueryKey can get the key path from HKEY
57
59{
60 HMODULE hNTDLL = GetModuleHandleW(L"ntdll.dll");
61 if (!hNTDLL) return FALSE;
62 g_NtQueryKey = (FN_NtQueryKey)GetProcAddress(hNTDLL, "NtQueryKey");
63 return g_NtQueryKey != NULL;
64}
65
66// Get path of HKEY
68{
69 if (!g_NtQueryKey || !hKey)
70 return NULL;
71
72 ULONG needed = 0;
74
75 if (!needed)
76 return NULL;
77
78 SIZE_T cb = needed + sizeof(WCHAR);
79 PBYTE buf = (PBYTE)_alloca(cb);
81
82 ULONG returned = 0;
84
85 if (status < 0)
86 return NULL;
87
89 return StrDupW(info->Name); // needs LocalFree
90}
91
93{
95 if (!path)
96 return FALSE;
97 if (path == StrStrIW(path, L"\\REGISTRY\\MACHINE\\SOFTWARE\\Classes\\"))
98 return TRUE;
99 base = StrStrIW(path, L"\\REGISTRY\\USER\\");
100 return base && StrStrIW(path, L"_CLASSES\\") > base;
101}
102
104{
105 ULONG err = SHSetValueW(hKey, pszSubKey, pszName, Type, pszData, (lstrlenW(pszData) + 1) * sizeof(*pszData));
106 return HRESULT_FROM_WIN32(err);
107}
108
109static HRESULT AQS(ASSOCF flags, ASSOCSTR str, LPCWSTR pszAsso, LPCWSTR pszExtra, LPWSTR pszOut)
110{
112 return AssocQueryStringW(flags, str, pszAsso, pszExtra, pszOut, &cch);
113}
114
115static HRESULT GetAqkPath(UINT InitF, ASSOCKEY AssocKey, LPCWSTR pszInit, LPCWSTR pszExtra, LPWSTR *ppszKey)
116{
117 HKEY hKey = NULL;
118 HRESULT hr = AssocQueryKeyW((ASSOCF)InitF, AssocKey, pszInit, pszExtra, &hKey);
119 if (ppszKey)
120 *ppszKey = GetKeyPath(hKey);
121 if (SUCCEEDED(hr) && hKey)
123 return hr == S_OK && !hKey ? S_FALSE : hr;
124}
125
126#define ok_AqkPath(InitF, AssocKey, pszInit, pszExtra, hrExpected, pszExpectedWin32) do \
127{ \
128 LPCWSTR pszExpected = L"\\REGISTRY\\MACHINE\\" pszExpectedWin32; \
129 LPWSTR pszPath; \
130 HRESULT hr = GetAqkPath((InitF), (AssocKey), (pszInit), (pszExtra), &pszPath); \
131 ok_hr(hr, (hrExpected)); \
132 if (SUCCEEDED(hr)) \
133 { \
134 ok(pszPath && !_wcsicmp(pszPath, pszExpected), "Got \"%s\", expected \"%s\"\n", \
135 wine_dbgstr_w(pszPath), wine_dbgstr_w(pszExpected)); \
136 } \
137 LocalFree(pszPath); \
138} while (0)
139
141{
143 return hRoot;
144 if (RegCreateKeyExW(hRoot, L"Software\\Classes", 0, NULL, 0, KEY_WRITE | KEY_READ, NULL, &hRoot, NULL))
145 return NULL;
146 return hRoot;
147}
148
150{
152 if (hRoot && pszSubKey)
153 {
154 HKEY hSubKey;
158 return err ? NULL : hSubKey;
159 }
160 return hRoot;
161}
162
163static void TestClassKey(ASSOCKEY AssocKey)
164{
165 BOOL nt5 = LOBYTE(GetVersion()) < 6;
166 HKEY hSource, hClass, hClass2;
167 HRESULT hr, hrExpect;
168 WCHAR buf[MAX_PATH], *pszPath;
169 Cleanup();
170
171 // A ProgId that does not exist
173 hrExpect = nt5 ? (E_FAIL) : (AssocKey == ASSOCKEY_SHELLEXECCLASS ? HR_NOASSOC : HR_NF);
174 ok_hr(hr, hrExpect);
175
176 // An extension that does not exist (could map to Unknown)
178 hrExpect = nt5 ? E_FAIL : S_OK;
179 ok_hr(hr, hrExpect);
180
181 // An extension that does not exist
183 hrExpect = nt5 ? E_FAIL : (AssocKey == ASSOCKEY_SHELLEXECCLASS ? HR_NOASSOC : S_OK);
184 ok_hr(hr, hrExpect);
185
187 if (!hSource)
188 {
189 skip("Could not create test key\n");
190 return;
191 }
192
193 // An extension with no ProgId (could map to Unknown)
195 hrExpect = nt5 && AssocKey == ASSOCKEY_SHELLEXECCLASS ? HR_FNF : S_OK;
196 ok_hr(hr, hrExpect);
197
198 // An extension with no ProgId
200 hrExpect = AssocKey == ASSOCKEY_SHELLEXECCLASS ? (nt5 ? HR_FNF : HR_NOASSOC) : S_OK;
201 ok_hr(hr, hrExpect);
202
203 // An extension with only a fallback command
204 if (SHELL_SetRegString(hSource, L"shell\\open\\command", NULL, REG_SZ, L"calc.exe"))
205 {
206 skip("Could not create test key\n");
207 }
208 else
209 {
211 ok_hr(hr, S_OK);
212
214 ok_hr(hr, S_OK);
215
217 ok_hr(hr, S_OK); // Strange but true
218
219 hr = GetAqkPath(ASSOCF_INIT_IGNOREUNKNOWN, AssocKey, pszUniqueExt, L"badverb", NULL);
220 hrExpect = AssocKey == ASSOCKEY_SHELLEXECCLASS ? (nt5 ? HR_FNF : HR_NOASSOC) : S_OK;
221 ok_hr(hr, hrExpect);
222 SHDeleteKeyW(hSource, L"shell");
223 }
224
225 // ProgId
227 {
228 skip("Could not create test key\n");
229 }
230 else
231 {
233 if (SHELL_SetRegString(hClass, L"shell\\calcverb\\command", NULL, REG_SZ, L"calc.exe"))
234 {
235 skip("Could not create test key\n");
236 goto skip_progidtests;
237 }
238
240 ok_hr(hr, S_OK);
241
242 hr = GetAqkPath(ASSOCF_INIT_IGNOREUNKNOWN, AssocKey, pszUniqueExt, L"calcverb", NULL);
243 ok_hr(hr, S_OK);
244
246 hrExpect = AssocKey == ASSOCKEY_SHELLEXECCLASS ? (nt5 ? HR_FNF : HR_NOASSOC) : S_OK;
247 ok_hr(hr, hrExpect);
248
250 ok_hr(hr, S_OK);
251
252 // CurVer redirection
254 {
255 skip("Could not create test key\n");
256 goto skip_progidtests;
257 }
258 else
259 {
260 LPCWSTR pszExe2 = L"calc.exe";
261 ASSOCMAKEVERB verbs2[] =
262 {
263 { L"calcverb2", NULL, NULL, pszExe2, L"CurVerParam" },
264 };
265 ASSOCMAKESHELL shell2 = { verbs2, _countof(verbs2), 0 };
266 AssocMakeShell(0, hClass2, pszExe2, &shell2);
267 SHELL_SetRegString(hClass, L"CurVer", NULL, REG_SZ, pszUniquePid2);
268
269 hr = GetAqkPath(ASSOCF_NONE, AssocKey, pszUniqueExt, NULL, &pszPath);
270 ok_hr(hr, S_OK);
271 ok(pszPath && StrStrIW(pszPath, pszUniquePid2), "CurVer ProgId redirection\n");
272 LocalFree(pszPath), pszPath = NULL;
273
275 ok(SUCCEEDED(hr) && StrStrIW(buf, verbs2[0].pszArgs), "CurVer ProgId redirection\n");
276
277 SHDeleteKeyW(hClass2, L"");
278 RegCloseKey(hClass2);
279 }
280
281skip_progidtests:
282 SHDeleteKeyW(hClass, L"");
283 RegCloseKey(hClass);
284 }
285
286 if (hSource)
287 {
288 SHDeleteKeyW(hSource, L"");
289 RegCloseKey(hSource);
290 }
291}
292
293// Test ASSOCKEYs
294static void TEST_AssocKeys(void)
295{
296 {
297 HKEY hKey = NULL;
299 ok_hr(hr, S_OK);
300
302 if (hKey)
304
305 ok(path &&
306 (StrStrIW(path, L"\\REGISTRY\\MACHINE\\") || StrStrIW(path, L"\\REGISTRY\\USER\\")) &&
307 StrStrIW(path, L"regfile"),
308 "path was %s\n", wine_dbgstr_w(path));
310 }
311
312 {
313 HKEY hKey = NULL;
315 ok_hr(hr, S_OK);
316
318 if (hKey)
320
321 ok(path && StrStrIW(path,
322 L"\\REGISTRY\\MACHINE\\SOFTWARE\\Classes\\Applications\\regedit.exe"),
323 "path was %s\n", wine_dbgstr_w(path));
325 }
326
327 {
328 HKEY hKey = NULL;
330 ok_hr(hr, S_OK);
331
333 if (hKey)
335
336 ok(path &&
337 (StrStrIW(path, L"\\REGISTRY\\MACHINE\\") || StrStrIW(path, L"\\REGISTRY\\USER\\")) &&
338 StrStrIW(path, L"Classes\\regfile"),
339 "path was %s\n", wine_dbgstr_w(path));
341 }
342
343 {
344 HKEY hKey = NULL;
346 ok_hr(hr, S_OK);
347
349 if (hKey)
351
352 ok(path && !_wcsicmp(path, L"\\REGISTRY\\MACHINE\\SOFTWARE\\Classes\\exefile"),
353 "path was %s\n", wine_dbgstr_w(path));
355 }
356}
357
358// Test ASSOCF flags
359static void TEST_AssocF_Flags(void)
360{
361 const ASSOCF cases[] =
362 {
377 };
378
379 for (size_t i = 0; i < _countof(cases); ++i)
380 {
381 HKEY hKey = NULL;
382 HRESULT hr = AssocQueryKeyW(cases[i], ASSOCKEY_CLASS, L".reg", NULL, &hKey);
383 ok_hr(hr, S_OK);
384
386 if (hKey)
388
389 LPCWSTR pszExpectedLM = L"\\REGISTRY\\MACHINE\\";
390 LPCWSTR pszExpectedCU = L"\\REGISTRY\\USER\\";
391 if (cases[i] & ASSOCF_PER_MACHINE_ONLY)
392 pszExpectedCU = pszExpectedLM;
393 ok(path &&
394 (StrStrIW(path, pszExpectedLM) || StrStrIW(path, pszExpectedCU)),
395 "path was %s\n", wine_dbgstr_w(path));
397 }
398}
399
400// Test pszAssoc
401static void TEST_PszAssoc(void)
402{
403 const wchar_t* exts[] =
404 {
405 L".txt", L".htm", L".reg", L".xml", L".png", L".jpg", L".zip"
406 };
407
408 for (size_t i = 0; i < _countof(exts); ++i)
409 {
410 HKEY hKey = NULL;
412 ok_hr(hr, S_OK);
413
415 if (hKey)
417
418 ok(path &&
419 (StrStrIW(path, L"\\REGISTRY\\MACHINE\\") || StrStrIW(path, L"\\REGISTRY\\USER\\")),
420 "path was %s\n", wine_dbgstr_w(path));
422 }
423
424 // Direct ProgID
425 {
426 HKEY hKey = NULL;
428 ok_hr(hr, S_OK);
429
431 if (hKey)
433
434 ok(path &&
435 (StrStrIW(path, L"\\REGISTRY\\MACHINE\\") || StrStrIW(path, L"\\REGISTRY\\USER\\")) &&
436 StrStrIW(path, L"regfile"),
437 "path was %s\n", wine_dbgstr_w(path));
439 }
440 {
441 HKEY hKey = NULL;
443 ok_hr(hr, S_OK);
444
446 if (hKey)
448
449 ok(path && !_wcsicmp(path, L"\\REGISTRY\\MACHINE\\SOFTWARE\\Classes\\exefile"),
450 "path was %s\n", wine_dbgstr_w(path));
452 }
453
454 // ProgID: InternetShortcut
455 {
456 HKEY hKey = NULL;
457 HRESULT hr = AssocQueryKeyW(ASSOCF_NONE, ASSOCKEY_CLASS, L"InternetShortcut", NULL, &hKey);
458 ok_hr(hr, S_OK);
459 if (hKey)
461 }
462}
463
464// Test invalid arguments
465static void TEST_InvalidArgs(void)
466{
467 // phkeyOut == NULL
468 {
469 BOOL threw = FALSE;
471
473 {
475 }
477 {
478 hr = 0xDEADFACE;
479 threw = TRUE;
480 }
481 _SEH2_END;
482
483 ok_hr(hr, 0xDEADFACE);
484 ok_int(threw, TRUE);
485 }
486
487 // pszAssoc == NULL
488 {
489 BOOL threw = FALSE;
491 HKEY hKey = NULL;
492
494 {
496 }
498 {
499 hr = 0xDEADFACE;
500 threw = TRUE;
501 }
502 _SEH2_END;
503
504 ok(hKey == NULL, "hKey was not NULL\n");
505 if (hKey)
507
509 ok_int(threw, FALSE);
510 }
511
512 // pszAssoc == ""
513 {
514 HKEY hKey = NULL;
516 if (hKey)
519 }
520
521 // Invalid ASSOCKEY value
522 {
523 HKEY hKey = NULL;
524 BOOL threw = FALSE;
526
528 {
529 hr = AssocQueryKeyW(ASSOCF_NONE, (ASSOCKEY)0xFFFF, L".txt", NULL, &hKey);
530 }
532 {
533 hr = 0xDEADFACE;
534 threw = TRUE;
535 }
536 _SEH2_END;
537
538 ok(hKey == NULL, "hKey was not NULL\n");
539 if (hKey)
541
543 ok_int(threw, FALSE);
544 }
545}
546
547static void TEST_ByExeName(void)
548{
549 HRESULT hr;
550 BOOL nt5 = LOBYTE(GetVersion()) < 6;
551 WCHAR notepadPath[MAX_PATH];
552 GetSystemDirectoryW(notepadPath, MAX_PATH);
553 lstrcatW(notepadPath, L"\\notepad.exe");
554
555 // Full path
557 S_OK, L"SOFTWARE\\Classes\\Applications\\notepad.exe");
558
559 // Filename.exe
561 S_OK, L"SOFTWARE\\Classes\\Applications\\regedit.exe");
562
563 // Filename (no extension)
565 S_OK, L"SOFTWARE\\Classes\\Applications\\regedit.exe");
566
567 // Filename.exe with Extra
568 ok_AqkPath(ASSOCF_OPEN_BYEXENAME, ASSOCKEY_APP, L"regedit.exe", L"Extra",
569 S_OK, L"SOFTWARE\\Classes\\Applications\\regedit.exe");
570
571 // Non existent
572 ok_AqkPath(ASSOCF_INIT_BYEXENAME, ASSOCKEY_APP, L"__does_not_exist__.exe", NULL,
573 nt5 ? HR_FNF : HR_NOASSOC, -0);
574
575 // Without BYEXENAME
576 hr = GetAqkPath(ASSOCF_NONE, ASSOCKEY_APP, L"regedit.exe", NULL, NULL);
577 ok_hr(hr, nt5 ? E_FAIL : HR_NOASSOC);
578}
579
580// Check ASSOCKEY_CLASS
581static void TEST_Class(void)
582{
584}
585
586// Check ASSOCKEY_BASECLASS
587static void TEST_BaseClass(void)
588{
589 ok_AqkPath(AF_DEFSTAR, ASSOCKEY_BASECLASS, pszUniqueExt, NULL, S_OK, L"SOFTWARE\\Classes\\*");
590 ok_AqkPath(AF_DEFFOLDER, ASSOCKEY_BASECLASS, L"Folder", NULL, S_OK, L"SOFTWARE\\Classes\\Folder");
591 ok_AqkPath(AF_DEFFOLDER, ASSOCKEY_BASECLASS, L"Directory", NULL, S_OK, L"SOFTWARE\\Classes\\Folder");
592}
593
594
595// Check ASSOCKEY_SHELLEXECCLASS
596static void TEST_ShellExecClass(void)
597{
598 static const LPCWSTR cases[] = { L".txt", L".htm", L".html", L"txtfile" };
599 for (size_t i = 0; i < _countof(cases); ++i)
600 {
601 HKEY hKey = NULL;
603 ok_hr(hr, S_OK);
604
606 if (hKey)
608
609 ok(IsValidClassesRootPath(path), "path was %s\n", wine_dbgstr_w(path));
611 }
612
614 // TODO: ASSOCF_VERIFY
615}
616
618{
619 if (!InitNtQueryKey())
620 {
621 skip("NtQueryKey not found\n");
622 return;
623 }
624
625 HRESULT hrCoInit = CoInitialize(NULL);
626
632 TEST_Class();
635
636 Cleanup();
637 if (SUCCEEDED(hrCoInit))
639}
#define ok_hr(status, expected)
Definition: ACListISF.cpp:31
static void Cleanup(void)
Definition: AssocQueryKey.c:23
static BOOL InitNtQueryKey(VOID)
Definition: AssocQueryKey.c:58
static void TEST_Class(void)
static HRESULT AQS(ASSOCF flags, ASSOCSTR str, LPCWSTR pszAsso, LPCWSTR pszExtra, LPWSTR pszOut)
static void TEST_ByExeName(void)
static FN_NtQueryKey g_NtQueryKey
Definition: AssocQueryKey.c:56
static const WCHAR pszUniquePid2[]
Definition: AssocQueryKey.c:21
@ HR_NOASSOC
Definition: AssocQueryKey.c:34
@ HR_FNF
Definition: AssocQueryKey.c:32
@ HR_NF
Definition: AssocQueryKey.c:33
@ AF_DEFFOLDER
Definition: AssocQueryKey.c:37
@ HR_ACCDENIED
Definition: AssocQueryKey.c:35
@ AF_DEFSTAR
Definition: AssocQueryKey.c:36
static void TEST_ShellExecClass(void)
struct _MY_KEY_NAME_INFORMATION * PMY_KEY_NAME_INFORMATION
struct _MY_KEY_NAME_INFORMATION MY_KEY_NAME_INFORMATION
_MY_KEY_INFORMATION_CLASS
Definition: AssocQueryKey.c:41
@ MyKeyNodeInformation
Definition: AssocQueryKey.c:43
@ MyKeyNameInformation
Definition: AssocQueryKey.c:45
@ MyKeyBasicInformation
Definition: AssocQueryKey.c:42
@ MyKeyFullInformation
Definition: AssocQueryKey.c:44
static void TEST_PszAssoc(void)
static const WCHAR pszUniqueExt[]
Definition: AssocQueryKey.c:19
static void TestClassKey(ASSOCKEY AssocKey)
static BOOL IsValidClassesRootPath(LPCWSTR path)
Definition: AssocQueryKey.c:92
static HKEY CreateClassesSubKey(HKEY hRoot, LPCWSTR pszSubKey)
#define ok_AqkPath(InitF, AssocKey, pszInit, pszExtra, hrExpected, pszExpectedWin32)
static void TEST_AssocKeys(void)
static HRESULT GetAqkPath(UINT InitF, ASSOCKEY AssocKey, LPCWSTR pszInit, LPCWSTR pszExtra, LPWSTR *ppszKey)
static void TEST_AssocF_Flags(void)
static HRESULT SHELL_SetRegString(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszName, UINT Type, LPCWSTR pszData)
static HKEY CreateClassesKey(HKEY hRoot)
static void TEST_BaseClass(void)
enum _MY_KEY_INFORMATION_CLASS MY_KEY_INFORMATION_CLASS
static const WCHAR pszUniquePid[]
Definition: AssocQueryKey.c:20
static LPWSTR GetKeyPath(HKEY hKey)
Definition: AssocQueryKey.c:67
NTSTATUS(__stdcall * FN_NtQueryKey)(HANDLE, MY_KEY_INFORMATION_CLASS, PVOID, ULONG, PULONG)
Definition: AssocQueryKey.c:55
static void TEST_InvalidArgs(void)
Type
Definition: Type.h:7
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
LONG NTSTATUS
Definition: precomp.h:26
#define RegCloseKey(hKey)
Definition: registry.h:49
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NTSTATUS
Definition: precomp.h:19
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
Definition: string.c:380
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define GetProcAddress(x, y)
Definition: compat.h:753
#define MAX_PATH
Definition: compat.h:34
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define lstrlenW
Definition: compat.h:750
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2232
WCHAR *WINAPI StrDupW(const WCHAR *str)
Definition: string.c:317
DWORD WINAPI GetVersion(void)
Definition: version.c:1458
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
#define __stdcall
Definition: corecrt.h:120
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:164
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
DWORD WINAPI SHSetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD type, const void *data, DWORD data_len)
Definition: main.c:2292
DWORD WINAPI SHDeleteKeyW(HKEY hkey, const WCHAR *subkey)
Definition: main.c:1886
HRESULT WINAPI AssocQueryKeyW(ASSOCF cfFlags, ASSOCKEY assockey, LPCWSTR pszAssoc, LPCWSTR pszExtra, HKEY *phkeyOut)
Definition: assoc.c:497
HRESULT WINAPI AssocQueryStringW(ASSOCF cfFlags, ASSOCSTR str, LPCWSTR pszAssoc, LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut)
Definition: assoc.c:569
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: sysinfo.c:13
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define LOBYTE(W)
Definition: jmemdos.c:487
#define wine_dbgstr_w
Definition: kernel32.h:34
#define REG_SZ
Definition: layer.c:22
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define ZeroMemory
Definition: minwinbase.h:31
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static HTREEITEM hRoot
Definition: treeview.c:383
static const struct encodedExtensions exts[]
Definition: encode.c:2738
#define KEY_READ
Definition: nt_native.h:1026
#define KEY_WRITE
Definition: nt_native.h:1034
BYTE * PBYTE
Definition: pedump.c:66
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
ASSOCSTR
Definition: shlwapi.h:885
@ ASSOCSTR_COMMAND
Definition: shlwapi.h:886
ASSOCKEY
Definition: shlwapi.h:918
@ ASSOCKEY_CLASS
Definition: shlwapi.h:921
@ ASSOCKEY_SHELLEXECCLASS
Definition: shlwapi.h:919
@ ASSOCKEY_BASECLASS
Definition: shlwapi.h:922
@ ASSOCKEY_APP
Definition: shlwapi.h:920
@ ASSOCF_REMAPRUNDLL
Definition: shlwapi.h:867
@ ASSOCF_NOFIXUPS
Definition: shlwapi.h:868
@ ASSOCF_INIT_DEFAULTTOSTAR
Definition: shlwapi.h:862
@ ASSOCF_PER_MACHINE_ONLY
Definition: shlwapi.h:878
@ ASSOCF_INIT_DEFAULTTOFOLDER
Definition: shlwapi.h:863
@ ASSOCF_IGNOREBASECLASS
Definition: shlwapi.h:869
@ ASSOCF_INIT_NOREMAPCLSID
Definition: shlwapi.h:859
@ ASSOCF_VERIFY
Definition: shlwapi.h:866
@ ASSOCF_INIT_IGNOREUNKNOWN
Definition: shlwapi.h:870
@ ASSOCF_NOUSERSETTINGS
Definition: shlwapi.h:864
@ ASSOCF_OPEN_BYEXENAME
Definition: shlwapi.h:861
@ ASSOCF_NONE
Definition: shlwapi.h:858
@ ASSOCF_NOTRUNCATE
Definition: shlwapi.h:865
@ ASSOCF_INIT_BYEXENAME
Definition: shlwapi.h:860
#define AssocQueryKey
Definition: shlwapi.h:1026
_In_opt_ LPCSTR pszSubKey
Definition: shlwapi.h:783
DWORD ASSOCF
Definition: shlwapi.h:967
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:104
#define _SEH2_END
Definition: pseh2_64.h:194
#define _SEH2_TRY
Definition: pseh2_64.h:93
#define err(...)
const WCHAR * str
_In_ UINT _In_ UINT cch
Definition: shellapi.h:432
HRESULT WINAPI AssocMakeShell(SIZE_T Unknown, _In_ HKEY hClass, _In_ LPCWSTR pszExe, _In_ const ASSOCMAKESHELL *pAMS)
#define _countof(array)
Definition: sndvol32.h:70
Definition: ps.c:97
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
void * PVOID
Definition: typedefs.h:50
PVOID HANDLE
Definition: typedefs.h:73
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59
#define S_FALSE
Definition: winerror.h:3451
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define ERROR_NO_ASSOCIATION
Definition: winerror.h:1001
#define E_UNEXPECTED
Definition: winerror.h:3528
#define ERROR_NOT_FOUND
Definition: winerror.h:1014
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10