ReactOS 0.4.17-dev-683-g0dafdc5
classes.c
Go to the documentation of this file.
1/*
2 * file type mapping
3 * (HKEY_CLASSES_ROOT - Stuff)
4 *
5 * Copyright 1998, 1999, 2000 Juergen Schmied
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include <wine/config.h>
23
24#include <stdio.h>
25
26#define WIN32_NO_STATUS
27#define _INC_WINDOWS
28#define COBJMACROS
29
30#include <windef.h>
31#include <winbase.h>
32#include <shlobj.h>
33#include <shlguid_undoc.h>
34#include <shlwapi.h>
35#include <wine/debug.h>
36#include <wine/unicode.h>
37#ifdef __REACTOS__
38#include <strsafe.h>
39#endif
40
41#include "pidl.h"
42#include "shell32_main.h"
43#include "shresdef.h"
44
46
47#define MAX_EXTENSION_LENGTH 20 // FIXME: The limit is 254?
48
50{
51 DWORD cb = sizeof(*Buffer) * cchBuf;
52 return RegGetValueW(hKey, SubKey, Name, RRF_RT_REG_SZ, NULL, Buffer, &cb);
53}
54
55HRESULT HCR_GetProgIdKeyOfExtension(PCWSTR szExtension, PHKEY phKey, BOOL AllowFallback)
56{
57 LONG err;
60 if (szExtension[0] != '.')
61 {
62 ext[0] = '.';
63 lstrcpynW(ext + 1, szExtension, _countof(ext) - 1);
64 szExtension = ext;
65 }
67 if (!err && progid[0] != UNICODE_NULL)
68 {
70 if (!err)
71 return err; /* A real ProgId key, return S_OK */
72 }
73 if (AllowFallback)
74 {
75 err = RegOpenKeyExW(HKEY_CLASSES_ROOT, szExtension, 0, KEY_READ, phKey);
76 if (!err)
77 return S_FALSE;
78 }
79 return HRESULT_FROM_WIN32(err);
80}
81
82BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
83{
84 HKEY hkey;
85 WCHAR szTemp[MAX_EXTENSION_LENGTH + 2];
86
87 TRACE("%s %p\n", debugstr_w(szExtension), szFileType);
88
89 /* added because we do not want to have double dots */
90 if (szExtension[0] == '.')
91 bPrependDot = FALSE;
92
93 if (bPrependDot)
94 szTemp[0] = '.';
95
96 lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
97
98 if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
99 {
100 return FALSE;
101 }
102
103 if (RegQueryValueW(hkey, NULL, szFileType, &len))
104 {
105 RegCloseKey(hkey);
106 return FALSE;
107 }
108
109 RegCloseKey(hkey);
110
111 TRACE("--UE;\n} %s\n", debugstr_w(szFileType));
112
113 return TRUE;
114}
115
116BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
117{
118 HKEY hkey;
119 char szTemp[MAX_EXTENSION_LENGTH + 2];
120
121 TRACE("%s %p\n", szExtension, szFileType);
122
123 /* added because we do not want to have double dots */
124 if (szExtension[0] == '.')
125 bPrependDot = FALSE;
126
127 if (bPrependDot)
128 szTemp[0] = '.';
129
130 lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
131
132 if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
133 {
134 return FALSE;
135 }
136
137 if (RegQueryValueA(hkey, NULL, szFileType, &len))
138 {
139 RegCloseKey(hkey);
140 return FALSE;
141 }
142
143 RegCloseKey(hkey);
144
145 TRACE("--UE;\n} %s\n", szFileType);
146
147 return TRUE;
148}
149
151
152BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len )
153{
154 WCHAR sTemp[MAX_PATH], verbs[MAX_PATH];
155 LONG size;
156 HKEY hkey;
157
158 TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest);
159
160 if (szVerb && *szVerb)
161 {
162 lstrcpynW(szDest, szVerb, len);
163 return TRUE;
164 }
165
166 /* MSDN says to first try the default verb */
168 if (!RegQueryValueW(hkeyClass, L"shell", verbs, &size) && *verbs)
169 {
170 for (UINT i = 0;; ++i)
171 {
173 break;
174 if (FAILED(StringCchPrintfW(sTemp, _countof(sTemp), L"shell\\%s\\command", szDest)))
175 break;
176 if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
177 {
178 RegCloseKey(hkey);
179 TRACE("default verb=%s\n", debugstr_w(szDest));
180 return TRUE;
181 }
182 }
183 }
184 *szDest = UNICODE_NULL;
185
186 /* then fallback to 'open' */
187#ifdef __REACTOS__
188 if (!RegOpenKeyExW(hkeyClass, L"shell\\open\\command", 0, KEY_READ, &hkey))
189#else
190 lstrcpyW(sTemp, L"shell\\open\\command");
191 if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
192#endif
193 {
194 RegCloseKey(hkey);
195 lstrcpynW(szDest, L"open", len);
196 TRACE("default verb=open\n");
197 return TRUE;
198 }
199
200 /* and then just use the first verb on Windows >= 2000 */
201#ifdef __REACTOS__
202 if (!RegOpenKeyExW(hkeyClass, L"shell", 0, KEY_READ, &hkey))
203 {
204 if (!RegEnumKeyW(hkey, 0, szDest, len) && *szDest)
205 {
206 TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
207 RegCloseKey(hkey);
208 return TRUE;
209 }
210 RegCloseKey(hkey);
211 }
212#else
213 if (!RegEnumKeyW(hkeyClass, 0, szDest, len) && *szDest)
214 {
215 TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
216 return TRUE;
217 }
218#endif
219
220 TRACE("no default verb!\n");
221 return FALSE;
222}
223
224BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len )
225{
226 WCHAR sTempVerb[MAX_PATH];
227 BOOL ret;
228
229 TRACE("%p %s %s %p\n", hkeyClass, debugstr_w(szClass), debugstr_w(szVerb), szDest);
230
231 if (szClass)
232 RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, KEY_READ, &hkeyClass);
233 if (!hkeyClass)
234 return FALSE;
235 ret = FALSE;
236
237 if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0])))
238 {
239 WCHAR sTemp[MAX_PATH];
240 lstrcpyW(sTemp, L"shell\\");
241 lstrcatW(sTemp, sTempVerb);
242 lstrcatW(sTemp, L"\\command");
243 ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len));
244 }
245 if (szClass)
246 RegCloseKey(hkeyClass);
247
248 TRACE("-- %s\n", debugstr_w(szDest) );
249 return ret;
250}
251
252/***************************************************************************************
253* HCR_GetDefaultIcon [internal]
254*
255* Gets the icon for a filetype
256*/
258{
259 char xriid[50];
260 sprintf( xriid, "CLSID\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
261 (UINT)riid->Data1, riid->Data2, riid->Data3,
262 riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
263 riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
264
265 TRACE("%s\n",xriid );
266
267 return !RegOpenKeyExA(HKEY_CLASSES_ROOT, xriid, 0, KEY_READ, hkey);
268}
269
270static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
271{
272 DWORD dwType, size = len * sizeof(WCHAR);
273 WCHAR sTemp[MAX_PATH];
274 WCHAR sNum[5];
275
276 if (!RegQueryValueExW(hkey, szName, 0, &dwType, (LPBYTE)szDest, &size))
277 {
278 if (dwType == REG_EXPAND_SZ)
279 {
280 ExpandEnvironmentStringsW(szDest, sTemp, MAX_PATH);
281 lstrcpynW(szDest, sTemp, len);
282 }
283 if (ParseFieldW (szDest, 2, sNum, _countof(sNum)))
284 *picon_idx = atoiW(sNum);
285 else
286 *picon_idx=0; /* sometimes the icon number is missing */
287 ParseFieldW (szDest, 1, szDest, len);
288 PathUnquoteSpacesW(szDest);
289 return TRUE;
290 }
291 return FALSE;
292}
293
294static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, int* picon_idx)
295{
296 DWORD dwType;
297 char sTemp[MAX_PATH];
298 char sNum[5];
299
300 if (!RegQueryValueExA(hkey, szName, 0, &dwType, (LPBYTE)szDest, &len))
301 {
302 if (dwType == REG_EXPAND_SZ)
303 {
304 ExpandEnvironmentStringsA(szDest, sTemp, MAX_PATH);
305 lstrcpynA(szDest, sTemp, len);
306 }
307 if (ParseFieldA (szDest, 2, sNum, 5))
308 *picon_idx=atoi(sNum);
309 else
310 *picon_idx=0; /* sometimes the icon number is missing */
311 ParseFieldA (szDest, 1, szDest, len);
312 PathUnquoteSpacesA(szDest);
313 return TRUE;
314 }
315 return FALSE;
316}
317
318BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
319{
320 HKEY hkey;
321 WCHAR sTemp[MAX_PATH];
322 BOOL ret = FALSE;
323
324 TRACE("%s\n",debugstr_w(szClass) );
325
326 lstrcpynW(sTemp, szClass, MAX_PATH);
327 lstrcatW(sTemp, L"\\DefaultIcon");
328
329 if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
330 {
331 ret = HCR_RegGetIconW(hkey, szDest, szName, len, picon_idx);
332 RegCloseKey(hkey);
333 }
334
335 if(ret)
336 TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
337 else
338 TRACE("-- not found\n");
339
340 return ret;
341}
342
343BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR szName, DWORD len, int* picon_idx)
344{
345 HKEY hkey;
346 char sTemp[MAX_PATH];
347 BOOL ret = FALSE;
348
349 TRACE("%s\n",szClass );
350
351 sprintf(sTemp, "%s\\DefaultIcon",szClass);
352
353 if (!RegOpenKeyExA(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
354 {
355 ret = HCR_RegGetIconA(hkey, szDest, szName, len, picon_idx);
356 RegCloseKey(hkey);
357 }
358
359 if (ret)
360 TRACE("-- %s %i\n", szDest, *picon_idx);
361 else
362 TRACE("-- not found\n");
363
364 return ret;
365}
366
367#ifdef __REACTOS__
368BOOL HCU_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
369{
370 HKEY hkey;
371 WCHAR sTemp[MAX_PATH];
372 BOOL ret = FALSE;
373
374 TRACE("%s\n", debugstr_w(szClass));
375
376 StringCchPrintfW(sTemp, _countof(sTemp), L"%s\\DefaultIcon", szClass);
377
378 if (!RegOpenKeyExW(HKEY_CURRENT_USER, sTemp, 0, KEY_READ, &hkey))
379 {
380 ret = HCR_RegGetIconW(hkey, szDest, szName, len, picon_idx);
381 RegCloseKey(hkey);
382 }
383
384 if (ret)
385 TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
386 else
387 TRACE("-- not found\n");
388
389 return ret;
390}
391
392BOOL HLM_GetIconW(int reg_idx, LPWSTR szDest, DWORD len, int* picon_idx)
393{
394 HKEY hkey;
395 WCHAR sTemp[5];
396 BOOL ret = FALSE;
397
398 TRACE("%d\n", reg_idx);
399
400 StringCchPrintfW(sTemp, _countof(sTemp), L"%d", reg_idx);
401
403 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons",
404 0,
405 KEY_READ,
406 &hkey))
407 {
408 ret = HCR_RegGetIconW(hkey, szDest, sTemp, len, picon_idx);
409 RegCloseKey(hkey);
410 }
411
412 if (ret)
413 TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
414 else
415 TRACE("-- not found\n");
416
417 return ret;
418}
419#endif
420
421/***************************************************************************************
422* HCR_GetClassName [internal]
423*
424* Gets the name of a registered class
425*/
427{
428 HKEY hkey;
429 BOOL ret = FALSE;
430 DWORD buflen = len;
431#ifdef __REACTOS__
432 WCHAR szName[100];
433 LPOLESTR pStr;
434#endif
435
436 szDest[0] = 0;
437
438#ifdef __REACTOS__
439 if (StringFromCLSID(riid, &pStr) == S_OK)
440 {
441 DWORD dwLen = buflen * sizeof(WCHAR);
442 swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
444 {
445 ret = TRUE;
446 }
447 CoTaskMemFree(pStr);
448 }
449 if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
450#else
451 if (HCR_RegOpenClassIDKey(riid, &hkey))
452#endif
453 {
454 if (!RegLoadMUIStringW(hkey, L"LocalizedString", szDest, len, NULL, 0, NULL) ||
455 !RegQueryValueExW(hkey, L"", 0, NULL, (LPBYTE)szDest, &len))
456 {
457 ret = TRUE;
458 }
459 RegCloseKey(hkey);
460 }
461
462 if (!ret || !szDest[0])
463 {
464 if(IsEqualIID(riid, &CLSID_ShellDesktop))
465 {
466 if (LoadStringW(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
467 ret = TRUE;
468 }
469 else if (IsEqualIID(riid, &CLSID_MyComputer))
470 {
471 if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
472 ret = TRUE;
473 }
474#ifdef __REACTOS__
475 else if (IsEqualIID(riid, &CLSID_MyDocuments))
476 {
477 if(LoadStringW(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
478 ret = TRUE;
479 }
480 else if (IsEqualIID(riid, &CLSID_RecycleBin))
481 {
483 ret = TRUE;
484 }
485 else if (IsEqualIID(riid, &CLSID_ControlPanel))
486 {
488 ret = TRUE;
489 }
491 {
493 ret = TRUE;
494 }
495#endif
496 }
497 TRACE("-- %s\n", debugstr_w(szDest));
498 return ret;
499}
500
502{ HKEY hkey;
503 BOOL ret = FALSE;
504 DWORD buflen = len;
505#ifdef __REACTOS__
506 CHAR szName[100];
507 LPOLESTR pStr;
508#endif
509
510 szDest[0] = 0;
511
512#ifdef __REACTOS__
513 if (StringFromCLSID(riid, &pStr) == S_OK)
514 {
515 DWORD dwLen = buflen * sizeof(CHAR);
516 sprintf(szName, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%S", pStr);
518 {
519 ret = TRUE;
520 }
521 CoTaskMemFree(pStr);
522 }
523 if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
524#else
525 if (HCR_RegOpenClassIDKey(riid, &hkey))
526#endif
527 {
528 if (!RegLoadMUIStringA(hkey,"LocalizedString",szDest,len,NULL,0,NULL) ||
529 !RegQueryValueExA(hkey,"",0,NULL,(LPBYTE)szDest,&len))
530 {
531 ret = TRUE;
532 }
533 RegCloseKey(hkey);
534 }
535
536 if (!ret || !szDest[0])
537 {
538 if(IsEqualIID(riid, &CLSID_ShellDesktop))
539 {
540 if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
541 ret = TRUE;
542 }
543 else if (IsEqualIID(riid, &CLSID_MyComputer))
544 {
545 if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
546 ret = TRUE;
547 }
548#ifdef __REACTOS__
549 else if (IsEqualIID(riid, &CLSID_MyDocuments))
550 {
551 if(LoadStringA(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
552 ret = TRUE;
553 }
554 else if (IsEqualIID(riid, &CLSID_RecycleBin))
555 {
557 ret = TRUE;
558 }
559 else if (IsEqualIID(riid, &CLSID_ControlPanel))
560 {
562 ret = TRUE;
563 }
565 {
567 ret = TRUE;
568 }
569#endif
570 }
571
572 TRACE("-- (%s)\n", szDest);
573
574 return ret;
575}
576
577/******************************************************************************
578 * HCR_GetFolderAttributes [Internal]
579 *
580 * Query the registry for a shell folders' attributes
581 *
582 * PARAMS
583 * pidlFolder [I] A simple pidl of type PT_GUID.
584 * pdwAttributes [IO] In: Attributes to be queried, OUT: Resulting attributes.
585 *
586 * RETURNS
587 * TRUE: Found information for the attributes in the registry
588 * FALSE: No attribute information found
589 *
590 * NOTES
591 * If queried for an attribute, which is set in the CallForAttributes registry
592 * value, the function binds to the shellfolder objects and queries it.
593 */
595{
596 HKEY hSFKey;
597 LPOLESTR pwszCLSID;
598 LONG lResult;
599 DWORD dwTemp, dwLen;
600 WCHAR wszShellFolderKey[] = L"CLSID\\{00021400-0000-0000-C000-000000000046}\\ShellFolder";
601
602 TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes);
603
604 if (!_ILIsPidlSimple(pidlFolder)) {
605 static BOOL firstHit = TRUE;
606 if (firstHit) {
607 ERR("should be called for simple PIDL's only!\n");
608 firstHit = FALSE;
609 }
610 return FALSE;
611 }
612
613 if (!_ILIsDesktop(pidlFolder)) {
614 if (FAILED(StringFromCLSID(_ILGetGUIDPointer(pidlFolder), &pwszCLSID))) return FALSE;
615 memcpy(&wszShellFolderKey[6], pwszCLSID, 38 * sizeof(WCHAR));
616 CoTaskMemFree(pwszCLSID);
617 }
618
619 lResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, wszShellFolderKey, 0, KEY_READ, &hSFKey);
620#ifdef __REACTOS__
621 if (lResult != ERROR_SUCCESS)
622 {
623 ERR("Cannot open key: %ls\n", wszShellFolderKey);
624 return FALSE;
625 }
626#else
627 if (lResult != ERROR_SUCCESS) return FALSE;
628#endif
629
630 dwLen = sizeof(DWORD);
631 lResult = RegQueryValueExW(hSFKey, L"CallForAttributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
632 if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) {
633 LPSHELLFOLDER psfDesktop, psfFolder;
634 HRESULT hr;
635
636 RegCloseKey(hSFKey);
637 hr = SHGetDesktopFolder(&psfDesktop);
638 if (SUCCEEDED(hr)) {
639 hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder,
640 (LPVOID*)&psfFolder);
641 if (SUCCEEDED(hr)) {
642 hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes);
643 IShellFolder_Release(psfFolder);
644 }
645 IShellFolder_Release(psfDesktop);
646 }
647 if (FAILED(hr)) return FALSE;
648 } else {
649 lResult = RegQueryValueExW(hSFKey, L"Attributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
650 RegCloseKey(hSFKey);
651 if (lResult == ERROR_SUCCESS) {
652 *pdwAttributes &= dwTemp;
653 } else {
654 return FALSE;
655 }
656 }
657
658 TRACE("-- *pdwAttributes == 0x%08x\n", *pdwAttributes);
659
660 return TRUE;
661}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define shell32_hInstance
UINT cchMax
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define CHAR(Char)
#define ERR(fmt,...)
Definition: precomp.h:57
#define EXTERN_C
Definition: basetyps.h:12
#define RegCloseKey(hKey)
Definition: registry.h:49
Verb verbs[]
Definition: certutil.cpp:21
Definition: bufpool.h:45
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_SUCCESS
Definition: deptool.c:10
LPWSTR Name
Definition: desk.c:124
LONG RegLoadMUIStringW(IN HKEY hKey, IN LPCWSTR pszValue OPTIONAL, OUT LPWSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCWSTR pszDirectory OPTIONAL)
Definition: muireg.c:53
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_PERSONAL
Definition: desktop.c:27
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
Definition: reg.c:4212
LSTATUS WINAPI RegGetValueA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:2037
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4241
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
LONG WINAPI RegLoadMUIStringA(IN HKEY hKey, IN LPCSTR pszValue OPTIONAL, OUT LPSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCSTR pszDirectory OPTIONAL)
Definition: reg.c:5268
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2393
HRESULT WINAPI StringFromCLSID(REFCLSID clsid, LPOLESTR *str)
Definition: combase.c:1515
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define lstrcpynA
Definition: compat.h:751
#define MAX_PATH
Definition: compat.h:34
#define lstrcpyW
Definition: compat.h:749
#define lstrcpynW
Definition: compat.h:738
static const WCHAR *const ext[]
Definition: module.c:53
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
Definition: environ.c:372
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:492
void WINAPI PathUnquoteSpacesW(WCHAR *path)
Definition: path.c:1982
void WINAPI PathUnquoteSpacesA(char *path)
Definition: path.c:1964
INT WINAPI DECLSPEC_HOTPATCH LoadStringA(HINSTANCE instance, UINT resource_id, LPSTR buffer, INT buflen)
Definition: string.c:1307
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
_ACRTIMP int __cdecl atoi(const char *)
Definition: string.c:1720
DWORD WINAPI SHGetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD *type, void *data, DWORD *data_len)
Definition: main.c:2222
const GUID CLSID_AdminFolderShortcut
#define swprintf
Definition: precomp.h:40
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
#define progid(str)
Definition: exdisp.idl:31
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLsizeiptr size
Definition: glext.h:5919
GLenum GLsizei len
Definition: glext.h:6722
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
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define sprintf
Definition: sprintf.c:45
#define KEY_READ
Definition: nt_native.h:1026
#define DWORD
Definition: nt_native.h:44
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
#define UNICODE_NULL
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
char CHAR
Definition: pedump.c:57
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2416
static const WCHAR szName[]
Definition: powrprof.c:45
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
_In_ UINT cchBuf
Definition: shlwapi.h:378
#define err(...)
#define LoadStringW
Definition: utils.h:64
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:426
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:116
BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
Definition: classes.c:594
static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:270
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:318
static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:294
#define MAX_EXTENSION_LENGTH
Definition: classes.c:47
BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len)
Definition: classes.c:152
BOOL HCR_GetExecuteCommandW(HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len)
Definition: classes.c:224
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:82
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
Definition: classes.c:257
EXTERN_C HRESULT SHELL32_EnumDefaultVerbList(LPCWSTR List, UINT Index, LPWSTR Verb, SIZE_T cchMax)
static LONG GetRegString(HKEY hKey, PCWSTR SubKey, PCWSTR Name, PWSTR Buffer, UINT cchBuf)
Definition: classes.c:49
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len)
Definition: classes.c:501
BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:343
HRESULT HCR_GetProgIdKeyOfExtension(PCWSTR szExtension, PHKEY phKey, BOOL AllowFallback)
Definition: classes.c:55
DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len) DECLSPEC_HIDDEN
Definition: shellord.c:83
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) DECLSPEC_HIDDEN
Definition: shellord.c:117
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#define IDS_DESKTOP
Definition: shresdef.h:71
#define IDS_MYCOMPUTER
Definition: shresdef.h:283
#define IDS_CONTROLPANEL
Definition: shresdef.h:139
#define IDS_ADMINISTRATIVETOOLS
Definition: shresdef.h:278
#define IDS_RECYCLEBIN_FOLDER_NAME
Definition: shresdef.h:272
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define max(a, b)
Definition: svc.c:63
uint16_t * PWSTR
Definition: typedefs.h:56
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * PCWSTR
Definition: typedefs.h:57
const uint16_t * LPCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
char * LPSTR
Definition: typedefs.h:51
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
#define atoiW(s)
Definition: unicode.h:54
#define S_FALSE
Definition: winerror.h:3451
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RRF_RT_REG_SZ
Definition: winreg.h:58
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10