ReactOS 0.4.15-dev-8434-g155a7c7
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
48
49BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
50{
51 HKEY hkey;
52 WCHAR szTemp[MAX_EXTENSION_LENGTH + 2];
53
54 TRACE("%s %p\n", debugstr_w(szExtension), szFileType);
55
56 /* added because we do not want to have double dots */
57 if (szExtension[0] == '.')
58 bPrependDot = FALSE;
59
60 if (bPrependDot)
61 szTemp[0] = '.';
62
63 lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
64
65 if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
66 {
67 return FALSE;
68 }
69
70#ifdef __REACTOS__
71 if (!RegLoadMUIStringW(hkey, L"FriendlyTypeName", szFileType, len, NULL, 0, NULL))
72 {
73 RegCloseKey(hkey);
74 return TRUE;
75 }
76#endif
77
78 if (RegQueryValueW(hkey, NULL, szFileType, &len))
79 {
80 RegCloseKey(hkey);
81 return FALSE;
82 }
83
84 RegCloseKey(hkey);
85
86 TRACE("--UE;\n} %s\n", debugstr_w(szFileType));
87
88 return TRUE;
89}
90
91BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
92{
93 HKEY hkey;
94 char szTemp[MAX_EXTENSION_LENGTH + 2];
95
96 TRACE("%s %p\n", szExtension, szFileType);
97
98 /* added because we do not want to have double dots */
99 if (szExtension[0] == '.')
100 bPrependDot = FALSE;
101
102 if (bPrependDot)
103 szTemp[0] = '.';
104
105 lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
106
107 if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
108 {
109 return FALSE;
110 }
111
112#ifdef __REACTOS__
113 if (!RegLoadMUIStringA(hkey, "FriendlyTypeName", szFileType, len, NULL, 0, NULL))
114 {
115 RegCloseKey(hkey);
116 return TRUE;
117 }
118#endif
119
120 if (RegQueryValueA(hkey, NULL, szFileType, &len))
121 {
122 RegCloseKey(hkey);
123 return FALSE;
124 }
125
126 RegCloseKey(hkey);
127
128 TRACE("--UE;\n} %s\n", szFileType);
129
130 return TRUE;
131}
132
134
135BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len )
136{
137 WCHAR sTemp[MAX_PATH], verbs[MAX_PATH];
138 LONG size;
139 HKEY hkey;
140
141 TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest);
142
143 if (szVerb && *szVerb)
144 {
145 lstrcpynW(szDest, szVerb, len);
146 return TRUE;
147 }
148
149 /* MSDN says to first try the default verb */
150 size = _countof(verbs);
151 if (!RegQueryValueW(hkeyClass, L"shell", verbs, &size) && *verbs)
152 {
153 for (UINT i = 0;; ++i)
154 {
155 if (FAILED(SHELL32_EnumDefaultVerbList(verbs, i, szDest, len)))
156 break;
157 if (FAILED(StringCchPrintfW(sTemp, _countof(sTemp), L"shell\\%s\\command", szDest)))
158 break;
159 if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
160 {
161 RegCloseKey(hkey);
162 TRACE("default verb=%s\n", debugstr_w(szDest));
163 return TRUE;
164 }
165 }
166 }
167 *szDest = UNICODE_NULL;
168
169 /* then fallback to 'open' */
170 lstrcpyW(sTemp, L"shell\\open\\command");
171 if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
172 {
173 RegCloseKey(hkey);
174 lstrcpynW(szDest, L"open", len);
175 TRACE("default verb=open\n");
176 return TRUE;
177 }
178
179 /* and then just use the first verb on Windows >= 2000 */
180#ifdef __REACTOS__
181 if (!RegOpenKeyExW(hkeyClass, L"shell", 0, KEY_READ, &hkey))
182 {
183 if (!RegEnumKeyW(hkey, 0, szDest, len) && *szDest)
184 {
185 TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
186 RegCloseKey(hkey);
187 return TRUE;
188 }
189 RegCloseKey(hkey);
190 }
191#else
192 if (!RegEnumKeyW(hkeyClass, 0, szDest, len) && *szDest)
193 {
194 TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
195 return TRUE;
196 }
197#endif
198
199 TRACE("no default verb!\n");
200 return FALSE;
201}
202
203BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len )
204{
205 WCHAR sTempVerb[MAX_PATH];
206 BOOL ret;
207
208 TRACE("%p %s %s %p\n", hkeyClass, debugstr_w(szClass), debugstr_w(szVerb), szDest);
209
210 if (szClass)
211 RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, KEY_READ, &hkeyClass);
212 if (!hkeyClass)
213 return FALSE;
214 ret = FALSE;
215
216 if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0])))
217 {
218 WCHAR sTemp[MAX_PATH];
219 lstrcpyW(sTemp, L"shell\\");
220 lstrcatW(sTemp, sTempVerb);
221 lstrcatW(sTemp, L"\\command");
222 ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len));
223 }
224 if (szClass)
225 RegCloseKey(hkeyClass);
226
227 TRACE("-- %s\n", debugstr_w(szDest) );
228 return ret;
229}
230
231/***************************************************************************************
232* HCR_GetDefaultIcon [internal]
233*
234* Gets the icon for a filetype
235*/
237{
238 char xriid[50];
239 sprintf( xriid, "CLSID\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
240 riid->Data1, riid->Data2, riid->Data3,
241 riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
242 riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
243
244 TRACE("%s\n",xriid );
245
246 return !RegOpenKeyExA(HKEY_CLASSES_ROOT, xriid, 0, KEY_READ, hkey);
247}
248
249static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
250{
251 DWORD dwType, size = len * sizeof(WCHAR);
252 WCHAR sTemp[MAX_PATH];
253 WCHAR sNum[5];
254
255 if (!RegQueryValueExW(hkey, szName, 0, &dwType, (LPBYTE)szDest, &size))
256 {
257 if (dwType == REG_EXPAND_SZ)
258 {
259 ExpandEnvironmentStringsW(szDest, sTemp, MAX_PATH);
260 lstrcpynW(szDest, sTemp, len);
261 }
262 if (ParseFieldW (szDest, 2, sNum, _countof(sNum)))
263 *picon_idx = atoiW(sNum);
264 else
265 *picon_idx=0; /* sometimes the icon number is missing */
266 ParseFieldW (szDest, 1, szDest, len);
267 PathUnquoteSpacesW(szDest);
268 return TRUE;
269 }
270 return FALSE;
271}
272
273static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, int* picon_idx)
274{
275 DWORD dwType;
276 char sTemp[MAX_PATH];
277 char sNum[5];
278
279 if (!RegQueryValueExA(hkey, szName, 0, &dwType, (LPBYTE)szDest, &len))
280 {
281 if (dwType == REG_EXPAND_SZ)
282 {
283 ExpandEnvironmentStringsA(szDest, sTemp, MAX_PATH);
284 lstrcpynA(szDest, sTemp, len);
285 }
286 if (ParseFieldA (szDest, 2, sNum, 5))
287 *picon_idx=atoi(sNum);
288 else
289 *picon_idx=0; /* sometimes the icon number is missing */
290 ParseFieldA (szDest, 1, szDest, len);
291 PathUnquoteSpacesA(szDest);
292 return TRUE;
293 }
294 return FALSE;
295}
296
297BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
298{
299 HKEY hkey;
300 WCHAR sTemp[MAX_PATH];
301 BOOL ret = FALSE;
302
303 TRACE("%s\n",debugstr_w(szClass) );
304
305 lstrcpynW(sTemp, szClass, MAX_PATH);
306 lstrcatW(sTemp, L"\\DefaultIcon");
307
308 if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
309 {
310 ret = HCR_RegGetIconW(hkey, szDest, szName, len, picon_idx);
311 RegCloseKey(hkey);
312 }
313
314 if(ret)
315 TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
316 else
317 TRACE("-- not found\n");
318
319 return ret;
320}
321
322BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR szName, DWORD len, int* picon_idx)
323{
324 HKEY hkey;
325 char sTemp[MAX_PATH];
326 BOOL ret = FALSE;
327
328 TRACE("%s\n",szClass );
329
330 sprintf(sTemp, "%s\\DefaultIcon",szClass);
331
332 if (!RegOpenKeyExA(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
333 {
334 ret = HCR_RegGetIconA(hkey, szDest, szName, len, picon_idx);
335 RegCloseKey(hkey);
336 }
337
338 if (ret)
339 TRACE("-- %s %i\n", szDest, *picon_idx);
340 else
341 TRACE("-- not found\n");
342
343 return ret;
344}
345
346#ifdef __REACTOS__
347BOOL HCU_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
348{
349 HKEY hkey;
350 WCHAR sTemp[MAX_PATH];
351 BOOL ret = FALSE;
352
353 TRACE("%s\n", debugstr_w(szClass));
354
355 StringCchPrintfW(sTemp, _countof(sTemp), L"%s\\DefaultIcon", szClass);
356
357 if (!RegOpenKeyExW(HKEY_CURRENT_USER, sTemp, 0, KEY_READ, &hkey))
358 {
359 ret = HCR_RegGetIconW(hkey, szDest, szName, len, picon_idx);
360 RegCloseKey(hkey);
361 }
362
363 if (ret)
364 TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
365 else
366 TRACE("-- not found\n");
367
368 return ret;
369}
370
371BOOL HLM_GetIconW(int reg_idx, LPWSTR szDest, DWORD len, int* picon_idx)
372{
373 HKEY hkey;
374 WCHAR sTemp[5];
375 BOOL ret = FALSE;
376
377 TRACE("%d\n", reg_idx);
378
379 StringCchPrintfW(sTemp, _countof(sTemp), L"%d", reg_idx);
380
382 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons",
383 0,
384 KEY_READ,
385 &hkey))
386 {
387 ret = HCR_RegGetIconW(hkey, szDest, sTemp, len, picon_idx);
388 RegCloseKey(hkey);
389 }
390
391 if (ret)
392 TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
393 else
394 TRACE("-- not found\n");
395
396 return ret;
397}
398#endif
399
400/***************************************************************************************
401* HCR_GetClassName [internal]
402*
403* Gets the name of a registered class
404*/
406{
407 HKEY hkey;
408 BOOL ret = FALSE;
409 DWORD buflen = len;
410#ifdef __REACTOS__
411 WCHAR szName[100];
412 LPOLESTR pStr;
413#endif
414
415 szDest[0] = 0;
416
417#ifdef __REACTOS__
418 if (StringFromCLSID(riid, &pStr) == S_OK)
419 {
420 DWORD dwLen = buflen * sizeof(WCHAR);
421 swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
423 {
424 ret = TRUE;
425 }
426 CoTaskMemFree(pStr);
427 }
428 if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
429#else
430 if (HCR_RegOpenClassIDKey(riid, &hkey))
431#endif
432 {
433 if (!RegLoadMUIStringW(hkey, L"LocalizedString", szDest, len, NULL, 0, NULL) ||
434 !RegQueryValueExW(hkey, L"", 0, NULL, (LPBYTE)szDest, &len))
435 {
436 ret = TRUE;
437 }
438 RegCloseKey(hkey);
439 }
440
441 if (!ret || !szDest[0])
442 {
443 if(IsEqualIID(riid, &CLSID_ShellDesktop))
444 {
445 if (LoadStringW(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
446 ret = TRUE;
447 }
448 else if (IsEqualIID(riid, &CLSID_MyComputer))
449 {
450 if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
451 ret = TRUE;
452 }
453#ifdef __REACTOS__
454 else if (IsEqualIID(riid, &CLSID_MyDocuments))
455 {
456 if(LoadStringW(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
457 ret = TRUE;
458 }
459 else if (IsEqualIID(riid, &CLSID_RecycleBin))
460 {
462 ret = TRUE;
463 }
464 else if (IsEqualIID(riid, &CLSID_ControlPanel))
465 {
467 ret = TRUE;
468 }
470 {
472 ret = TRUE;
473 }
474#endif
475 }
476 TRACE("-- %s\n", debugstr_w(szDest));
477 return ret;
478}
479
481{ HKEY hkey;
482 BOOL ret = FALSE;
483 DWORD buflen = len;
484#ifdef __REACTOS__
485 CHAR szName[100];
486 LPOLESTR pStr;
487#endif
488
489 szDest[0] = 0;
490
491#ifdef __REACTOS__
492 if (StringFromCLSID(riid, &pStr) == S_OK)
493 {
494 DWORD dwLen = buflen * sizeof(CHAR);
495 sprintf(szName, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%S", pStr);
497 {
498 ret = TRUE;
499 }
500 CoTaskMemFree(pStr);
501 }
502 if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
503#else
504 if (HCR_RegOpenClassIDKey(riid, &hkey))
505#endif
506 {
507 if (!RegLoadMUIStringA(hkey,"LocalizedString",szDest,len,NULL,0,NULL) ||
508 !RegQueryValueExA(hkey,"",0,NULL,(LPBYTE)szDest,&len))
509 {
510 ret = TRUE;
511 }
512 RegCloseKey(hkey);
513 }
514
515 if (!ret || !szDest[0])
516 {
517 if(IsEqualIID(riid, &CLSID_ShellDesktop))
518 {
519 if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
520 ret = TRUE;
521 }
522 else if (IsEqualIID(riid, &CLSID_MyComputer))
523 {
524 if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
525 ret = TRUE;
526 }
527#ifdef __REACTOS__
528 else if (IsEqualIID(riid, &CLSID_MyDocuments))
529 {
530 if(LoadStringA(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
531 ret = TRUE;
532 }
533 else if (IsEqualIID(riid, &CLSID_RecycleBin))
534 {
536 ret = TRUE;
537 }
538 else if (IsEqualIID(riid, &CLSID_ControlPanel))
539 {
541 ret = TRUE;
542 }
544 {
546 ret = TRUE;
547 }
548#endif
549 }
550
551 TRACE("-- (%s)\n", szDest);
552
553 return ret;
554}
555
556/******************************************************************************
557 * HCR_GetFolderAttributes [Internal]
558 *
559 * Query the registry for a shell folders' attributes
560 *
561 * PARAMS
562 * pidlFolder [I] A simple pidl of type PT_GUID.
563 * pdwAttributes [IO] In: Attributes to be queried, OUT: Resulting attributes.
564 *
565 * RETURNS
566 * TRUE: Found information for the attributes in the registry
567 * FALSE: No attribute information found
568 *
569 * NOTES
570 * If queried for an attribute, which is set in the CallForAttributes registry
571 * value, the function binds to the shellfolder objects and queries it.
572 */
574{
575 HKEY hSFKey;
576 LPOLESTR pwszCLSID;
577 LONG lResult;
578 DWORD dwTemp, dwLen;
579 WCHAR wszShellFolderKey[] = L"CLSID\\{00021400-0000-0000-C000-000000000046}\\ShellFolder";
580
581 TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes);
582
583 if (!_ILIsPidlSimple(pidlFolder)) {
584 static BOOL firstHit = TRUE;
585 if (firstHit) {
586 ERR("should be called for simple PIDL's only!\n");
587 firstHit = FALSE;
588 }
589 return FALSE;
590 }
591
592 if (!_ILIsDesktop(pidlFolder)) {
593 if (FAILED(StringFromCLSID(_ILGetGUIDPointer(pidlFolder), &pwszCLSID))) return FALSE;
594 memcpy(&wszShellFolderKey[6], pwszCLSID, 38 * sizeof(WCHAR));
595 CoTaskMemFree(pwszCLSID);
596 }
597
598 lResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, wszShellFolderKey, 0, KEY_READ, &hSFKey);
599#ifdef __REACTOS__
600 if (lResult != ERROR_SUCCESS)
601 {
602 ERR("Cannot open key: %ls\n", wszShellFolderKey);
603 return FALSE;
604 }
605#else
606 if (lResult != ERROR_SUCCESS) return FALSE;
607#endif
608
609 dwLen = sizeof(DWORD);
610 lResult = RegQueryValueExW(hSFKey, L"CallForAttributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
611 if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) {
612 LPSHELLFOLDER psfDesktop, psfFolder;
613 HRESULT hr;
614
615 RegCloseKey(hSFKey);
616 hr = SHGetDesktopFolder(&psfDesktop);
617 if (SUCCEEDED(hr)) {
618 hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder,
619 (LPVOID*)&psfFolder);
620 if (SUCCEEDED(hr)) {
621 hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes);
622 IShellFolder_Release(psfFolder);
623 }
624 IShellFolder_Release(psfDesktop);
625 }
626 if (FAILED(hr)) return FALSE;
627 } else {
628 lResult = RegQueryValueExW(hSFKey, L"Attributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
629 RegCloseKey(hSFKey);
630 if (lResult == ERROR_SUCCESS) {
631 *pdwAttributes &= dwTemp;
632 } else {
633 return FALSE;
634 }
635 }
636
637 TRACE("-- *pdwAttributes == 0x%08x\n", *pdwAttributes);
638
639 return TRUE;
640}
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
#define ERROR_SUCCESS
Definition: deptool.c:10
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
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
#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
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
Definition: environ.c:399
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
#define RRF_RT_REG_SZ
Definition: driver.c:575
const GUID CLSID_AdminFolderShortcut
VOID WINAPI PathUnquoteSpacesA(LPSTR lpszPath)
Definition: path.c:1012
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
Definition: path.c:1034
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
#define swprintf
Definition: precomp.h:40
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
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(buf, format,...)
Definition: sprintf.c:55
static LPOLESTR
Definition: stg_prop.c:27
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define DWORD
Definition: nt_native.h:44
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2292
static const WCHAR szName[]
Definition: powrprof.c:45
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define atoiW(s)
Definition: unicode.h:60
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:405
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:91
BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
Definition: classes.c:573
static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:249
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:297
static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:273
#define MAX_EXTENSION_LENGTH
Definition: classes.c:47
BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len)
Definition: classes.c:135
BOOL HCR_GetExecuteCommandW(HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len)
Definition: classes.c:203
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:49
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
Definition: classes.c:236
EXTERN_C HRESULT SHELL32_EnumDefaultVerbList(LPCWSTR List, UINT Index, LPWSTR Verb, SIZE_T cchMax)
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len)
Definition: classes.c:480
BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:322
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
HRESULT hr
Definition: shlfolder.c:183
#define IDS_DESKTOP
Definition: shresdef.h:73
#define IDS_MYCOMPUTER
Definition: shresdef.h:282
#define IDS_CONTROLPANEL
Definition: shresdef.h:141
#define IDS_ADMINISTRATIVETOOLS
Definition: shresdef.h:277
#define IDS_RECYCLEBIN_FOLDER_NAME
Definition: shresdef.h:271
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
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
int ret
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175