ReactOS 0.4.15-dev-7660-g0086d05
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
38#include "pidl.h"
39#include "shell32_main.h"
40#include "shresdef.h"
41
43
44#define MAX_EXTENSION_LENGTH 20
45
46BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
47{
48 HKEY hkey;
49 WCHAR szTemp[MAX_EXTENSION_LENGTH + 2];
50
51 TRACE("%s %p\n", debugstr_w(szExtension), szFileType);
52
53 /* added because we do not want to have double dots */
54 if (szExtension[0] == '.')
55 bPrependDot = FALSE;
56
57 if (bPrependDot)
58 szTemp[0] = '.';
59
60 lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
61
62 if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
63 {
64 return FALSE;
65 }
66
67#ifdef __REACTOS__
68 if (!RegLoadMUIStringW(hkey, L"FriendlyTypeName", szFileType, len, NULL, 0, NULL))
69 {
70 RegCloseKey(hkey);
71 return TRUE;
72 }
73#endif
74
75 if (RegQueryValueW(hkey, NULL, szFileType, &len))
76 {
77 RegCloseKey(hkey);
78 return FALSE;
79 }
80
81 RegCloseKey(hkey);
82
83 TRACE("--UE;\n} %s\n", debugstr_w(szFileType));
84
85 return TRUE;
86}
87
88BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
89{
90 HKEY hkey;
91 char szTemp[MAX_EXTENSION_LENGTH + 2];
92
93 TRACE("%s %p\n", szExtension, szFileType);
94
95 /* added because we do not want to have double dots */
96 if (szExtension[0] == '.')
97 bPrependDot = FALSE;
98
99 if (bPrependDot)
100 szTemp[0] = '.';
101
102 lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH);
103
104 if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hkey))
105 {
106 return FALSE;
107 }
108
109#ifdef __REACTOS__
110 if (!RegLoadMUIStringA(hkey, "FriendlyTypeName", szFileType, len, NULL, 0, NULL))
111 {
112 RegCloseKey(hkey);
113 return TRUE;
114 }
115#endif
116
117 if (RegQueryValueA(hkey, NULL, szFileType, &len))
118 {
119 RegCloseKey(hkey);
120 return FALSE;
121 }
122
123 RegCloseKey(hkey);
124
125 TRACE("--UE;\n} %s\n", szFileType);
126
127 return TRUE;
128}
129
130BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len )
131{
132 WCHAR sTemp[MAX_PATH];
133 LONG size;
134 HKEY hkey;
135
136 TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest);
137
138 if (szVerb && *szVerb)
139 {
140 lstrcpynW(szDest, szVerb, len);
141 return TRUE;
142 }
143
144 size=len;
145 *szDest='\0';
146 if (!RegQueryValueW(hkeyClass, L"shell\\", szDest, &size) && *szDest)
147 {
148 /* The MSDN says to first try the default verb */
149 lstrcpyW(sTemp, L"shell\\");
150 lstrcatW(sTemp, szDest);
151 lstrcatW(sTemp, L"\\command");
152 if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
153 {
154 RegCloseKey(hkey);
155 TRACE("default verb=%s\n", debugstr_w(szDest));
156 return TRUE;
157 }
158 }
159
160 /* then fallback to 'open' */
161 lstrcpyW(sTemp, L"shell\\open\\command");
162 if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey))
163 {
164 RegCloseKey(hkey);
165 lstrcpynW(szDest, L"open", len);
166 TRACE("default verb=open\n");
167 return TRUE;
168 }
169
170 /* and then just use the first verb on Windows >= 2000 */
171#ifdef __REACTOS__
172 if (!RegOpenKeyExW(hkeyClass, L"shell", 0, KEY_READ, &hkey))
173 {
174 if (!RegEnumKeyW(hkey, 0, szDest, len) && *szDest)
175 {
176 TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
177 RegCloseKey(hkey);
178 return TRUE;
179 }
180 RegCloseKey(hkey);
181 }
182#else
183 if (!RegEnumKeyW(hkeyClass, 0, szDest, len) && *szDest)
184 {
185 TRACE("default verb=first verb=%s\n", debugstr_w(szDest));
186 return TRUE;
187 }
188#endif
189
190 TRACE("no default verb!\n");
191 return FALSE;
192}
193
194BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len )
195{
196 WCHAR sTempVerb[MAX_PATH];
197 BOOL ret;
198
199 TRACE("%p %s %s %p\n", hkeyClass, debugstr_w(szClass), debugstr_w(szVerb), szDest);
200
201 if (szClass)
202 RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, KEY_READ, &hkeyClass);
203 if (!hkeyClass)
204 return FALSE;
205 ret = FALSE;
206
207 if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0])))
208 {
209 WCHAR sTemp[MAX_PATH];
210 lstrcpyW(sTemp, L"shell\\");
211 lstrcatW(sTemp, sTempVerb);
212 lstrcatW(sTemp, L"\\command");
213 ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len));
214 }
215 if (szClass)
216 RegCloseKey(hkeyClass);
217
218 TRACE("-- %s\n", debugstr_w(szDest) );
219 return ret;
220}
221
222/***************************************************************************************
223* HCR_GetDefaultIcon [internal]
224*
225* Gets the icon for a filetype
226*/
228{
229 char xriid[50];
230 sprintf( xriid, "CLSID\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
231 riid->Data1, riid->Data2, riid->Data3,
232 riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
233 riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
234
235 TRACE("%s\n",xriid );
236
237 return !RegOpenKeyExA(HKEY_CLASSES_ROOT, xriid, 0, KEY_READ, hkey);
238}
239
240static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
241{
242 DWORD dwType, size = len * sizeof(WCHAR);
243 WCHAR sTemp[MAX_PATH];
244 WCHAR sNum[5];
245
246 if (!RegQueryValueExW(hkey, szName, 0, &dwType, (LPBYTE)szDest, &size))
247 {
248 if (dwType == REG_EXPAND_SZ)
249 {
250 ExpandEnvironmentStringsW(szDest, sTemp, MAX_PATH);
251 lstrcpynW(szDest, sTemp, len);
252 }
253 if (ParseFieldW (szDest, 2, sNum, _countof(sNum)))
254 *picon_idx = atoiW(sNum);
255 else
256 *picon_idx=0; /* sometimes the icon number is missing */
257 ParseFieldW (szDest, 1, szDest, len);
258 PathUnquoteSpacesW(szDest);
259 return TRUE;
260 }
261 return FALSE;
262}
263
264static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, int* picon_idx)
265{
266 DWORD dwType;
267 char sTemp[MAX_PATH];
268 char sNum[5];
269
270 if (!RegQueryValueExA(hkey, szName, 0, &dwType, (LPBYTE)szDest, &len))
271 {
272 if (dwType == REG_EXPAND_SZ)
273 {
274 ExpandEnvironmentStringsA(szDest, sTemp, MAX_PATH);
275 lstrcpynA(szDest, sTemp, len);
276 }
277 if (ParseFieldA (szDest, 2, sNum, 5))
278 *picon_idx=atoi(sNum);
279 else
280 *picon_idx=0; /* sometimes the icon number is missing */
281 ParseFieldA (szDest, 1, szDest, len);
282 PathUnquoteSpacesA(szDest);
283 return TRUE;
284 }
285 return FALSE;
286}
287
288BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx)
289{
290 HKEY hkey;
291 WCHAR sTemp[MAX_PATH];
292 BOOL ret = FALSE;
293
294 TRACE("%s\n",debugstr_w(szClass) );
295
296 lstrcpynW(sTemp, szClass, MAX_PATH);
297 lstrcatW(sTemp, L"\\DefaultIcon");
298
299 if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
300 {
301 ret = HCR_RegGetIconW(hkey, szDest, szName, len, picon_idx);
302 RegCloseKey(hkey);
303 }
304
305 if(ret)
306 TRACE("-- %s %i\n", debugstr_w(szDest), *picon_idx);
307 else
308 TRACE("-- not found\n");
309
310 return ret;
311}
312
313BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR szName, DWORD len, int* picon_idx)
314{
315 HKEY hkey;
316 char sTemp[MAX_PATH];
317 BOOL ret = FALSE;
318
319 TRACE("%s\n",szClass );
320
321 sprintf(sTemp, "%s\\DefaultIcon",szClass);
322
323 if (!RegOpenKeyExA(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey))
324 {
325 ret = HCR_RegGetIconA(hkey, szDest, szName, len, picon_idx);
326 RegCloseKey(hkey);
327 }
328
329 if (ret)
330 TRACE("-- %s %i\n", szDest, *picon_idx);
331 else
332 TRACE("-- not found\n");
333
334 return ret;
335}
336
337/***************************************************************************************
338* HCR_GetClassName [internal]
339*
340* Gets the name of a registered class
341*/
343{
344 HKEY hkey;
345 BOOL ret = FALSE;
346 DWORD buflen = len;
347#ifdef __REACTOS__
348 WCHAR szName[100];
349 LPOLESTR pStr;
350#endif
351
352 szDest[0] = 0;
353
354#ifdef __REACTOS__
355 if (StringFromCLSID(riid, &pStr) == S_OK)
356 {
357 DWORD dwLen = buflen * sizeof(WCHAR);
358 swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);
360 {
361 ret = TRUE;
362 }
363 CoTaskMemFree(pStr);
364 }
365 if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
366#else
367 if (HCR_RegOpenClassIDKey(riid, &hkey))
368#endif
369 {
370 if (!RegLoadMUIStringW(hkey, L"LocalizedString", szDest, len, NULL, 0, NULL) ||
371 !RegQueryValueExW(hkey, L"", 0, NULL, (LPBYTE)szDest, &len))
372 {
373 ret = TRUE;
374 }
375 RegCloseKey(hkey);
376 }
377
378 if (!ret || !szDest[0])
379 {
380 if(IsEqualIID(riid, &CLSID_ShellDesktop))
381 {
382 if (LoadStringW(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
383 ret = TRUE;
384 }
385 else if (IsEqualIID(riid, &CLSID_MyComputer))
386 {
387 if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
388 ret = TRUE;
389 }
390#ifdef __REACTOS__
391 else if (IsEqualIID(riid, &CLSID_MyDocuments))
392 {
393 if(LoadStringW(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
394 ret = TRUE;
395 }
396 else if (IsEqualIID(riid, &CLSID_RecycleBin))
397 {
399 ret = TRUE;
400 }
401 else if (IsEqualIID(riid, &CLSID_ControlPanel))
402 {
404 ret = TRUE;
405 }
407 {
409 ret = TRUE;
410 }
411#endif
412 }
413 TRACE("-- %s\n", debugstr_w(szDest));
414 return ret;
415}
416
418{ HKEY hkey;
419 BOOL ret = FALSE;
420 DWORD buflen = len;
421#ifdef __REACTOS__
422 CHAR szName[100];
423 LPOLESTR pStr;
424#endif
425
426 szDest[0] = 0;
427
428#ifdef __REACTOS__
429 if (StringFromCLSID(riid, &pStr) == S_OK)
430 {
431 DWORD dwLen = buflen * sizeof(CHAR);
432 sprintf(szName, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%S", pStr);
434 {
435 ret = TRUE;
436 }
437 CoTaskMemFree(pStr);
438 }
439 if (!ret && HCR_RegOpenClassIDKey(riid, &hkey))
440#else
441 if (HCR_RegOpenClassIDKey(riid, &hkey))
442#endif
443 {
444 if (!RegLoadMUIStringA(hkey,"LocalizedString",szDest,len,NULL,0,NULL) ||
445 !RegQueryValueExA(hkey,"",0,NULL,(LPBYTE)szDest,&len))
446 {
447 ret = TRUE;
448 }
449 RegCloseKey(hkey);
450 }
451
452 if (!ret || !szDest[0])
453 {
454 if(IsEqualIID(riid, &CLSID_ShellDesktop))
455 {
456 if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen))
457 ret = TRUE;
458 }
459 else if (IsEqualIID(riid, &CLSID_MyComputer))
460 {
461 if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
462 ret = TRUE;
463 }
464#ifdef __REACTOS__
465 else if (IsEqualIID(riid, &CLSID_MyDocuments))
466 {
467 if(LoadStringA(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
468 ret = TRUE;
469 }
470 else if (IsEqualIID(riid, &CLSID_RecycleBin))
471 {
473 ret = TRUE;
474 }
475 else if (IsEqualIID(riid, &CLSID_ControlPanel))
476 {
478 ret = TRUE;
479 }
481 {
483 ret = TRUE;
484 }
485#endif
486 }
487
488 TRACE("-- (%s)\n", szDest);
489
490 return ret;
491}
492
493/******************************************************************************
494 * HCR_GetFolderAttributes [Internal]
495 *
496 * Query the registry for a shell folders' attributes
497 *
498 * PARAMS
499 * pidlFolder [I] A simple pidl of type PT_GUID.
500 * pdwAttributes [IO] In: Attributes to be queried, OUT: Resulting attributes.
501 *
502 * RETURNS
503 * TRUE: Found information for the attributes in the registry
504 * FALSE: No attribute information found
505 *
506 * NOTES
507 * If queried for an attribute, which is set in the CallForAttributes registry
508 * value, the function binds to the shellfolder objects and queries it.
509 */
511{
512 HKEY hSFKey;
513 LPOLESTR pwszCLSID;
514 LONG lResult;
515 DWORD dwTemp, dwLen;
516 WCHAR wszShellFolderKey[] = L"CLSID\\{00021400-0000-0000-C000-000000000046}\\ShellFolder";
517
518 TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes);
519
520 if (!_ILIsPidlSimple(pidlFolder)) {
521 static BOOL firstHit = TRUE;
522 if (firstHit) {
523 ERR("should be called for simple PIDL's only!\n");
524 firstHit = FALSE;
525 }
526 return FALSE;
527 }
528
529 if (!_ILIsDesktop(pidlFolder)) {
530 if (FAILED(StringFromCLSID(_ILGetGUIDPointer(pidlFolder), &pwszCLSID))) return FALSE;
531 memcpy(&wszShellFolderKey[6], pwszCLSID, 38 * sizeof(WCHAR));
532 CoTaskMemFree(pwszCLSID);
533 }
534
535 lResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, wszShellFolderKey, 0, KEY_READ, &hSFKey);
536#ifdef __REACTOS__
537 if (lResult != ERROR_SUCCESS)
538 {
539 ERR("Cannot open key: %ls\n", wszShellFolderKey);
540 return FALSE;
541 }
542#else
543 if (lResult != ERROR_SUCCESS) return FALSE;
544#endif
545
546 dwLen = sizeof(DWORD);
547 lResult = RegQueryValueExW(hSFKey, L"CallForAttributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
548 if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) {
549 LPSHELLFOLDER psfDesktop, psfFolder;
550 HRESULT hr;
551
552 RegCloseKey(hSFKey);
553 hr = SHGetDesktopFolder(&psfDesktop);
554 if (SUCCEEDED(hr)) {
555 hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder,
556 (LPVOID*)&psfFolder);
557 if (SUCCEEDED(hr)) {
558 hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes);
559 IShellFolder_Release(psfFolder);
560 }
561 IShellFolder_Release(psfDesktop);
562 }
563 if (FAILED(hr)) return FALSE;
564 } else {
565 lResult = RegQueryValueExW(hSFKey, L"Attributes", 0, NULL, (LPBYTE)&dwTemp, &dwLen);
566 RegCloseKey(hSFKey);
567 if (lResult == ERROR_SUCCESS) {
568 *pdwAttributes &= dwTemp;
569 } else {
570 return FALSE;
571 }
572 }
573
574 TRACE("-- *pdwAttributes == 0x%08x\n", *pdwAttributes);
575
576 return TRUE;
577}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define shell32_hInstance
#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: debug.h:110
#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:3362
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1969
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3327
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
Definition: reg.c:4241
LSTATUS WINAPI RegGetValueA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:2075
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4270
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:4038
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:5297
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4132
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2422
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
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
#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 L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2340
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:54
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:342
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:88
BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes)
Definition: classes.c:510
static BOOL HCR_RegGetIconW(HKEY hkey, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:240
BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:288
static BOOL HCR_RegGetIconA(HKEY hkey, LPSTR szDest, LPCSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:264
#define MAX_EXTENSION_LENGTH
Definition: classes.c:44
BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len)
Definition: classes.c:130
BOOL HCR_GetExecuteCommandW(HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len)
Definition: classes.c:194
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:46
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
Definition: classes.c:227
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len)
Definition: classes.c:417
BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR szName, DWORD len, int *picon_idx)
Definition: classes.c:313
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:276
#define IDS_CONTROLPANEL
Definition: shresdef.h:141
#define IDS_ADMINISTRATIVETOOLS
Definition: shresdef.h:272
#define IDS_RECYCLEBIN_FOLDER_NAME
Definition: shresdef.h:267
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:68
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
int ret
#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