ReactOS 0.4.17-dev-357-ga8f14ff
reg.c
Go to the documentation of this file.
1/*
2 * SHLWAPI registry functions
3 *
4 * Copyright 1998 Juergen Schmied
5 * Copyright 2001 Guy Albertelli
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 <stdarg.h>
23#include <string.h>
24#include "windef.h"
25#include "winbase.h"
26#include "winuser.h"
27#include "winreg.h"
28#include "wine/debug.h"
29#define NO_SHLWAPI_STREAM
30#include "shlwapi.h"
31#include "wine/unicode.h"
32
34
35/* Key/Value names for MIME content types */
36static const char lpszContentTypeA[] = "Content Type";
37static const WCHAR lpszContentTypeW[] = { 'C','o','n','t','e','n','t',' ','T','y','p','e','\0'};
38
39static const char szMimeDbContentA[] = "MIME\\Database\\Content Type\\";
40static const WCHAR szMimeDbContentW[] = { 'M', 'I', 'M','E','\\',
41 'D','a','t','a','b','a','s','e','\\','C','o','n','t','e','n','t',
42 ' ','T','y','p','e','\\', 0 };
43static const DWORD dwLenMimeDbContent = 27; /* strlen of szMimeDbContentA/W */
44
45static const char szExtensionA[] = "Extension";
46static const WCHAR szExtensionW[] = { 'E', 'x', 't','e','n','s','i','o','n','\0' };
47
48
51
52
53#ifdef __REACTOS__ /* Should go to shcore, but we need kernelbase for that */
54/*************************************************************************
55 * SHRegSetPathA [SHLWAPI.@]
56 *
57 * Write a path to the registry.
58 *
59 * PARAMS
60 * hKey [I] Handle to registry key
61 * lpszSubKey [I] Name of sub key containing path to set
62 * lpszValue [I] Name of value containing path to set
63 * lpszPath [O] Path to write
64 * dwFlags [I] Reserved, must be 0.
65 *
66 * RETURNS
67 * Success: ERROR_SUCCESS.
68 * Failure: An error code from SHSetValueA().
69 */
70DWORD WINAPI SHRegSetPathA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue,
71 LPCSTR lpszPath, DWORD dwFlags)
72{
73 char szBuff[MAX_PATH];
74#ifdef __REACTOS__
75 DWORD dwType;
76 LPCSTR pszData;
77 INT cch;
78
80
81 if (PathUnExpandEnvStringsA(lpszPath, szBuff, _countof(szBuff)))
82 {
83 dwType = REG_EXPAND_SZ;
84 pszData = szBuff;
85 }
86 else
87 {
88 dwType = REG_SZ;
89 pszData = lpszPath;
90 }
91
92 cch = lstrlenA(pszData);
93 return SHSetValueA(hKey, lpszSubKey, lpszValue, dwType, pszData, (cch + 1) * sizeof(CHAR));
94#else
95 FIXME("(hkey=%p,%s,%s,%p,%d) - semi-stub\n",hKey, debugstr_a(lpszSubKey),
96 debugstr_a(lpszValue), lpszPath, dwFlags);
97
98 lstrcpyA(szBuff, lpszPath);
99
100 /* FIXME: PathUnExpandEnvStringsA(szBuff); */
101
102 return SHSetValueA(hKey,lpszSubKey, lpszValue, REG_SZ, szBuff,
103 lstrlenA(szBuff));
104#endif
105}
106
107/*************************************************************************
108 * SHRegSetPathW [SHLWAPI.@]
109 *
110 * See SHRegSetPathA.
111 */
112DWORD WINAPI SHRegSetPathW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue,
113 LPCWSTR lpszPath, DWORD dwFlags)
114{
115 WCHAR szBuff[MAX_PATH];
116#ifdef __REACTOS__
117 DWORD dwType;
118 LPCWSTR pszData;
119 INT cch;
120
122
123 if (PathUnExpandEnvStringsW(lpszPath, szBuff, _countof(szBuff)))
124 {
125 dwType = REG_EXPAND_SZ;
126 pszData = szBuff;
127 }
128 else
129 {
130 dwType = REG_SZ;
131 pszData = lpszPath;
132 }
133
134 cch = lstrlenW(pszData);
135 return SHSetValueW(hKey, lpszSubKey, lpszValue, dwType, pszData, (cch + 1) * sizeof(WCHAR));
136#else
137 FIXME("(hkey=%p,%s,%s,%p,%d) - semi-stub\n",hKey, debugstr_w(lpszSubKey),
138 debugstr_w(lpszValue), lpszPath, dwFlags);
139
140 lstrcpyW(szBuff, lpszPath);
141
142 /* FIXME: PathUnExpandEnvStringsW(szBuff); */
143
144 return SHSetValueW(hKey,lpszSubKey, lpszValue, REG_SZ, szBuff,
145 lstrlenW(szBuff));
146#endif
147}
148#endif /* __REACTOS__ */
149
150/*************************************************************************
151 * SHDeleteOrphanKeyA [SHLWAPI.@]
152 *
153 * Delete a registry key with no sub keys or values.
154 *
155 * PARAMS
156 * hKey [I] Handle to registry key
157 * lpszSubKey [I] Name of sub key to possibly delete
158 *
159 * RETURNS
160 * Success: ERROR_SUCCESS. The key has been deleted if it was an orphan.
161 * Failure: An error from RegOpenKeyExA(), RegQueryValueExA(), or RegDeleteKeyA().
162 */
164{
165 HKEY hSubKey;
166 DWORD dwKeyCount = 0, dwValueCount = 0, dwRet;
167
168 TRACE("(hkey=%p,%s)\n", hKey, debugstr_a(lpszSubKey));
169
170 dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
171
172 if(!dwRet)
173 {
174 /* Get subkey and value count */
175 dwRet = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, &dwKeyCount,
176 NULL, NULL, &dwValueCount, NULL, NULL, NULL, NULL);
177
178 if(!dwRet && !dwKeyCount && !dwValueCount)
179 {
180 dwRet = RegDeleteKeyA(hKey, lpszSubKey);
181 }
182 RegCloseKey(hSubKey);
183 }
184 return dwRet;
185}
186
187/*************************************************************************
188 * SHDeleteOrphanKeyW [SHLWAPI.@]
189 *
190 * See SHDeleteOrphanKeyA.
191 */
193{
194 HKEY hSubKey;
195 DWORD dwKeyCount = 0, dwValueCount = 0, dwRet;
196
197 TRACE("(hkey=%p,%s)\n", hKey, debugstr_w(lpszSubKey));
198
199 dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
200
201 if(!dwRet)
202 {
203 /* Get subkey and value count */
204 dwRet = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &dwKeyCount,
205 NULL, NULL, &dwValueCount, NULL, NULL, NULL, NULL);
206
207 if(!dwRet && !dwKeyCount && !dwValueCount)
208 {
209 dwRet = RegDeleteKeyW(hKey, lpszSubKey);
210 }
211 RegCloseKey(hSubKey);
212 }
213 return dwRet;
214}
215
216/*************************************************************************
217 * @ [SHLWAPI.205]
218 *
219 * Get a value from the registry.
220 *
221 * PARAMS
222 * hKey [I] Handle to registry key
223 * pSubKey [I] Name of sub key containing value to get
224 * pValue [I] Name of value to get
225 * pwType [O] Destination for the values type
226 * pvData [O] Destination for the values data
227 * pbData [O] Destination for the values size
228 *
229 * RETURNS
230 * Success: ERROR_SUCCESS. Output parameters contain the details read.
231 * Failure: An error code from RegOpenKeyExA() or SHQueryValueExA(),
232 * or ERROR_INVALID_FUNCTION in the machine is in safe mode.
233 */
235 LPDWORD pwType, LPVOID pvData, LPDWORD pbData)
236{
239 return SHGetValueA(hkey, pSubKey, pValue, pwType, pvData, pbData);
240}
241
242/*************************************************************************
243 * @ [SHLWAPI.206]
244 *
245 * Unicode version of SHGetValueGoodBootW.
246 */
248 LPDWORD pwType, LPVOID pvData, LPDWORD pbData)
249{
252 return SHGetValueW(hkey, pSubKey, pValue, pwType, pvData, pbData);
253}
254
255/*************************************************************************
256 * @ [SHLWAPI.320]
257 *
258 * Set a MIME content type in the registry.
259 *
260 * PARAMS
261 * lpszSubKey [I] Name of key under HKEY_CLASSES_ROOT.
262 * lpszValue [I] Value to set
263 *
264 * RETURNS
265 * Success: TRUE
266 * Failure: FALSE
267 */
269{
270 if (!lpszValue)
271 {
272 WARN("Invalid lpszValue would crash under Win32!\n");
273 return FALSE;
274 }
275
277 REG_SZ, lpszValue, strlen(lpszValue));
278}
279
280/*************************************************************************
281 * @ [SHLWAPI.321]
282 *
283 * Unicode version of RegisterMIMETypeForExtensionA.
284 */
286{
287 if (!lpszValue)
288 {
289 WARN("Invalid lpszValue would crash under Win32!\n");
290 return FALSE;
291 }
292
294 REG_SZ, lpszValue, lstrlenW(lpszValue));
295}
296
297/*************************************************************************
298 * @ [SHLWAPI.322]
299 *
300 * Delete a MIME content type from the registry.
301 *
302 * PARAMS
303 * lpszSubKey [I] Name of sub key
304 *
305 * RETURNS
306 * Success: TRUE
307 * Failure: FALSE
308 */
310{
312}
313
314/*************************************************************************
315 * @ [SHLWAPI.323]
316 *
317 * Unicode version of UnregisterMIMETypeForExtensionA.
318 */
320{
322}
323
324/*************************************************************************
325 * @ [SHLWAPI.328]
326 *
327 * Get the registry path to a MIME content key.
328 *
329 * PARAMS
330 * lpszType [I] Content type to get the path for
331 * lpszBuffer [O] Destination for path
332 * dwLen [I] Length of lpszBuffer
333 *
334 * RETURNS
335 * Success: TRUE. lpszBuffer contains the full path.
336 * Failure: FALSE.
337 *
338 * NOTES
339 * The base path for the key is "MIME\Database\Content Type\"
340 */
341BOOL WINAPI GetMIMETypeSubKeyA(LPCSTR lpszType, LPSTR lpszBuffer, DWORD dwLen)
342{
343 TRACE("(%s,%p,%ld)\n", debugstr_a(lpszType), lpszBuffer, dwLen);
344
345 if (dwLen > dwLenMimeDbContent && lpszType && lpszBuffer)
346 {
347 size_t dwStrLen = strlen(lpszType);
348
349 if (dwStrLen < dwLen - dwLenMimeDbContent)
350 {
352 memcpy(lpszBuffer + dwLenMimeDbContent, lpszType, dwStrLen + 1);
353 return TRUE;
354 }
355 }
356 return FALSE;
357}
358
359/*************************************************************************
360 * @ [SHLWAPI.329]
361 *
362 * Unicode version of GetMIMETypeSubKeyA.
363 */
364BOOL WINAPI GetMIMETypeSubKeyW(LPCWSTR lpszType, LPWSTR lpszBuffer, DWORD dwLen)
365{
366 TRACE("(%s,%p,%ld)\n", debugstr_w(lpszType), lpszBuffer, dwLen);
367
368 if (dwLen > dwLenMimeDbContent && lpszType && lpszBuffer)
369 {
370 DWORD dwStrLen = lstrlenW(lpszType);
371
372 if (dwStrLen < dwLen - dwLenMimeDbContent)
373 {
374 memcpy(lpszBuffer, szMimeDbContentW, dwLenMimeDbContent * sizeof(WCHAR));
375 memcpy(lpszBuffer + dwLenMimeDbContent, lpszType, (dwStrLen + 1) * sizeof(WCHAR));
376 return TRUE;
377 }
378 }
379 return FALSE;
380}
381
382/*************************************************************************
383 * @ [SHLWAPI.330]
384 *
385 * Get the file extension for a given Mime type.
386 *
387 * PARAMS
388 * lpszType [I] Mime type to get the file extension for
389 * lpExt [O] Destination for the resulting extension
390 * iLen [I] Length of lpExt in characters
391 *
392 * RETURNS
393 * Success: TRUE. lpExt contains the file extension.
394 * Failure: FALSE, if any parameter is invalid or the extension cannot be
395 * retrieved. If iLen > 0, lpExt is set to an empty string.
396 *
397 * NOTES
398 * - The extension returned in lpExt always has a leading '.' character, even
399 * if the registry Mime database entry does not.
400 * - iLen must be long enough for the file extension for this function to succeed.
401 */
403{
404 char szSubKey[MAX_PATH];
405 DWORD dwlen = iLen - 1, dwType;
406 BOOL bRet = FALSE;
407
408 if (iLen > 0 && lpExt)
409 *lpExt = '\0';
410
411 if (lpszType && lpExt && iLen > 2 &&
412 GetMIMETypeSubKeyA(lpszType, szSubKey, MAX_PATH) &&
413 !SHGetValueA(HKEY_CLASSES_ROOT, szSubKey, szExtensionA, &dwType, lpExt + 1, &dwlen) &&
414 lpExt[1])
415 {
416 if (lpExt[1] == '.')
417 memmove(lpExt, lpExt + 1, strlen(lpExt + 1) + 1);
418 else
419 *lpExt = '.'; /* Supply a '.' */
420 bRet = TRUE;
421 }
422 return bRet;
423}
424
425/*************************************************************************
426 * @ [SHLWAPI.331]
427 *
428 * Unicode version of MIME_GetExtensionA.
429 */
431{
432 WCHAR szSubKey[MAX_PATH];
433 DWORD dwlen = iLen - 1, dwType;
434 BOOL bRet = FALSE;
435
436 if (iLen > 0 && lpExt)
437 *lpExt = '\0';
438
439 if (lpszType && lpExt && iLen > 2 &&
440 GetMIMETypeSubKeyW(lpszType, szSubKey, MAX_PATH) &&
441 !SHGetValueW(HKEY_CLASSES_ROOT, szSubKey, szExtensionW, &dwType, lpExt + 1, &dwlen) &&
442 lpExt[1])
443 {
444 if (lpExt[1] == '.')
445 memmove(lpExt, lpExt + 1, (lstrlenW(lpExt + 1) + 1) * sizeof(WCHAR));
446 else
447 *lpExt = '.'; /* Supply a '.' */
448 bRet = TRUE;
449 }
450 return bRet;
451}
452
453/*************************************************************************
454 * @ [SHLWAPI.324]
455 *
456 * Set the file extension for a MIME content key.
457 *
458 * PARAMS
459 * lpszExt [I] File extension to set
460 * lpszType [I] Content type to set the extension for
461 *
462 * RETURNS
463 * Success: TRUE. The file extension is set in the registry.
464 * Failure: FALSE.
465 */
467{
468 DWORD dwLen;
469 char szKey[MAX_PATH];
470
471 TRACE("(%s,%s)\n", debugstr_a(lpszExt), debugstr_a(lpszType));
472
473 if (!GetMIMETypeSubKeyA(lpszType, szKey, MAX_PATH)) /* Get full path to the key */
474 return FALSE;
475
476 dwLen = strlen(lpszExt) + 1;
477
478 if (SHSetValueA(HKEY_CLASSES_ROOT, szKey, szExtensionA, REG_SZ, lpszExt, dwLen))
479 return FALSE;
480 return TRUE;
481}
482
483/*************************************************************************
484 * @ [SHLWAPI.325]
485 *
486 * Unicode version of RegisterExtensionForMIMETypeA.
487 */
489{
490 DWORD dwLen;
491 WCHAR szKey[MAX_PATH];
492
493 TRACE("(%s,%s)\n", debugstr_w(lpszExt), debugstr_w(lpszType));
494
495 /* Get the full path to the key */
496 if (!GetMIMETypeSubKeyW(lpszType, szKey, MAX_PATH)) /* Get full path to the key */
497 return FALSE;
498
499 dwLen = (lstrlenW(lpszExt) + 1) * sizeof(WCHAR);
500
501 if (SHSetValueW(HKEY_CLASSES_ROOT, szKey, szExtensionW, REG_SZ, lpszExt, dwLen))
502 return FALSE;
503 return TRUE;
504}
505
506/*************************************************************************
507 * @ [SHLWAPI.326]
508 *
509 * Delete a file extension from a MIME content type.
510 *
511 * PARAMS
512 * lpszType [I] Content type to delete the extension for
513 *
514 * RETURNS
515 * Success: TRUE. The file extension is deleted from the registry.
516 * Failure: FALSE. The extension may have been removed but the key remains.
517 *
518 * NOTES
519 * If deleting the extension leaves an orphan key, the key is removed also.
520 */
522{
523 char szKey[MAX_PATH];
524
525 TRACE("(%s)\n", debugstr_a(lpszType));
526
527 if (!GetMIMETypeSubKeyA(lpszType, szKey, MAX_PATH)) /* Get full path to the key */
528 return FALSE;
529
531 return FALSE;
532
534 return FALSE;
535 return TRUE;
536}
537
538/*************************************************************************
539 * @ [SHLWAPI.327]
540 *
541 * Unicode version of UnregisterExtensionForMIMETypeA.
542 */
544{
545 WCHAR szKey[MAX_PATH];
546
547 TRACE("(%s)\n", debugstr_w(lpszType));
548
549 if (!GetMIMETypeSubKeyW(lpszType, szKey, MAX_PATH)) /* Get full path to the key */
550 return FALSE;
551
553 return FALSE;
554
556 return FALSE;
557 return TRUE;
558}
559
560/*
561 * The following functions are ORDINAL ONLY:
562 */
563
564/*************************************************************************
565 * @ [SHLWAPI.343]
566 *
567 * Create or open an explorer ClassId Key.
568 *
569 * PARAMS
570 * guid [I] Explorer ClassId key to open
571 * lpszValue [I] Value name under the ClassId Key
572 * bUseHKCU [I] TRUE=Use HKEY_CURRENT_USER, FALSE=Use HKEY_CLASSES_ROOT
573 * bCreate [I] TRUE=Create the key if it doesn't exist, FALSE=Don't
574 * phKey [O] Destination for the resulting key handle
575 *
576 * RETURNS
577 * Success: S_OK. phKey contains the resulting registry handle.
578 * Failure: An HRESULT error code indicating the problem.
579 */
581{
582 WCHAR szValue[MAX_PATH];
583
584 if (lpszValue)
585 MultiByteToWideChar(CP_ACP, 0, lpszValue, -1, szValue, ARRAY_SIZE(szValue));
586
587 return SHRegGetCLSIDKeyW(guid, lpszValue ? szValue : NULL, bUseHKCU, bCreate, phKey);
588}
589
590/*************************************************************************
591 * @ [SHLWAPI.344]
592 *
593 * Unicode version of SHRegGetCLSIDKeyA.
594 */
596 BOOL bCreate, PHKEY phKey)
597{
598#ifndef __REACTOS__
599 static const WCHAR szClassIdKey[] = { 'S','o','f','t','w','a','r','e','\\',
600 'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
601 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
602 'E','x','p','l','o','r','e','r','\\','C','L','S','I','D','\\' };
603#endif
604 WCHAR szKey[MAX_PATH];
605 DWORD dwRet;
606 HKEY hkey;
607
608 /* Create the key string */
609#ifdef __REACTOS__
610 // https://www.geoffchappell.com/studies/windows/shell/shlwapi/api/reg/reggetclsidkey.htm
611 WCHAR* ptr;
612
613 wcscpy(szKey, bUseHKCU ? L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\" : L"CLSID\\");
614 ptr = szKey + wcslen(szKey);
615 SHStringFromGUIDW(guid, ptr, 39); /* Append guid */
616 if (lpszValue)
617 {
618 ptr = szKey + wcslen(szKey);
619 wcscat(ptr, L"\\");
620 wcscat(++ptr, lpszValue);
621 }
622#else
623 memcpy(szKey, szClassIdKey, sizeof(szClassIdKey));
624 SHStringFromGUIDW(guid, szKey + ARRAY_SIZE(szClassIdKey), 39); /* Append guid */
625
626 if(lpszValue)
627 {
628 szKey[ARRAY_SIZE(szClassIdKey) + 39] = '\\';
629 lstrcpyW(szKey + ARRAY_SIZE(szClassIdKey) + 40, lpszValue); /* Append value name */
630 }
631#endif
632
633 hkey = bUseHKCU ? HKEY_CURRENT_USER : HKEY_CLASSES_ROOT;
634
635 if(bCreate)
636 dwRet = RegCreateKeyW(hkey, szKey, phKey);
637 else
638 dwRet = RegOpenKeyExW(hkey, szKey, 0, KEY_READ, phKey);
639
640 return dwRet ? HRESULT_FROM_WIN32(dwRet) : S_OK;
641}
642
643/*************************************************************************
644 * SHRegisterValidateTemplate [SHLWAPI.@]
645 *
646 * observed from the ie 5.5 installer:
647 * - allocates a buffer with the size of the given file
648 * - read the file content into the buffer
649 * - creates the key szTemplateKey
650 * - sets "205523652929647911071668590831910975402"=dword:00002e37 at
651 * the key
652 *
653 * PARAMS
654 * filename [I] An existing file its content is read into an allocated
655 * buffer
656 * unknown [I]
657 *
658 * RETURNS
659 * Success: ERROR_SUCCESS.
660 */
662{
663/* static const WCHAR szTemplateKey[] = { 'S','o','f','t','w','a','r','e','\\',
664 * 'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
665 * 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
666 * 'E','x','p','l','o','r','e','r','\\',
667 * 'T','e','m','p','l','a','t','e','R','e','g','i','s','t','r','y',0 };
668 */
669 FIXME("stub: %s, %08x\n", debugstr_w(filename), unknown);
670
671 return S_OK;
672}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3583
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3662
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1201
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define CP_ACP
Definition: compat.h:109
#define MAX_PATH
Definition: compat.h:34
#define lstrcpyW
Definition: compat.h:749
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI PathUnExpandEnvStringsW(const WCHAR *path, WCHAR *buffer, UINT buf_len)
Definition: path.c:2681
BOOL WINAPI PathUnExpandEnvStringsA(const char *path, char *buffer, UINT buf_len)
Definition: path.c:2641
GUID guid
Definition: version.c:147
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
DWORD WINAPI SHGetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD *type, void *data, DWORD *data_len)
Definition: main.c:2222
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 SHDeleteValueA(HKEY hkey, const char *subkey, const char *value)
Definition: main.c:1926
DWORD WINAPI SHDeleteValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value)
Definition: main.c:1906
DWORD WINAPI SHRegSetPathW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, const WCHAR *path, DWORD flags)
Definition: main.c:2359
DWORD WINAPI SHGetValueA(HKEY hkey, const char *subkey, const char *value, DWORD *type, void *data, DWORD *data_len)
Definition: main.c:2197
DWORD WINAPI SHSetValueA(HKEY hkey, const char *subkey, const char *value, DWORD type, const void *data, DWORD data_len)
Definition: main.c:2319
DWORD WINAPI SHRegSetPathA(HKEY hkey, const char *subkey, const char *value, const char *path, DWORD flags)
Definition: main.c:2346
HRESULT WINAPI SHRegisterValidateTemplate(LPCWSTR filename, BOOL unknown)
Definition: reg.c:661
BOOL WINAPI UnregisterMIMETypeForExtensionW(LPCWSTR lpszSubKey)
Definition: reg.c:319
static const char lpszContentTypeA[]
Definition: reg.c:36
DWORD WINAPI SHGetValueGoodBootA(HKEY hkey, LPCSTR pSubKey, LPCSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pbData)
Definition: reg.c:234
BOOL WINAPI UnregisterMIMETypeForExtensionA(LPCSTR lpszSubKey)
Definition: reg.c:309
BOOL WINAPI RegisterMIMETypeForExtensionA(LPCSTR lpszSubKey, LPCSTR lpszValue)
Definition: reg.c:268
DWORD WINAPI SHDeleteOrphanKeyW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:192
BOOL WINAPI GetMIMETypeSubKeyW(LPCWSTR lpszType, LPWSTR lpszBuffer, DWORD dwLen)
Definition: reg.c:364
static const DWORD dwLenMimeDbContent
Definition: reg.c:43
HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID, LPCWSTR, BOOL, BOOL, PHKEY)
Definition: reg.c:595
BOOL WINAPI RegisterExtensionForMIMETypeW(LPCWSTR lpszExt, LPCWSTR lpszType)
Definition: reg.c:488
HRESULT WINAPI SHRegGetCLSIDKeyA(REFGUID guid, LPCSTR lpszValue, BOOL bUseHKCU, BOOL bCreate, PHKEY phKey)
Definition: reg.c:580
BOOL WINAPI RegisterExtensionForMIMETypeA(LPCSTR lpszExt, LPCSTR lpszType)
Definition: reg.c:466
BOOL WINAPI UnregisterExtensionForMIMETypeA(LPCSTR lpszType)
Definition: reg.c:521
static const char szMimeDbContentA[]
Definition: reg.c:39
BOOL WINAPI GetMIMETypeSubKeyA(LPCSTR lpszType, LPSTR lpszBuffer, DWORD dwLen)
Definition: reg.c:341
static const WCHAR szMimeDbContentW[]
Definition: reg.c:40
BOOL WINAPI MIME_GetExtensionW(LPCWSTR lpszType, LPWSTR lpExt, INT iLen)
Definition: reg.c:430
DWORD WINAPI SHDeleteOrphanKeyA(HKEY hKey, LPCSTR lpszSubKey)
Definition: reg.c:163
BOOL WINAPI MIME_GetExtensionA(LPCSTR lpszType, LPSTR lpExt, INT iLen)
Definition: reg.c:402
static const char szExtensionA[]
Definition: reg.c:45
DWORD WINAPI SHGetValueGoodBootW(HKEY hkey, LPCWSTR pSubKey, LPCWSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pbData)
Definition: reg.c:247
INT WINAPI SHStringFromGUIDW(REFGUID, LPWSTR, INT)
Definition: ordinal.c:546
static const WCHAR szExtensionW[]
Definition: reg.c:46
BOOL WINAPI UnregisterExtensionForMIMETypeW(LPCWSTR lpszType)
Definition: reg.c:543
static const WCHAR lpszContentTypeW[]
Definition: reg.c:37
BOOL WINAPI RegisterMIMETypeForExtensionW(LPCWSTR lpszSubKey, LPCWSTR lpszValue)
Definition: reg.c:285
#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
PWCHAR pValue
#define S_OK
Definition: intsafe.h:52
const char * filename
Definition: ioapi.h:137
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static PVOID ptr
Definition: dispmode.c:27
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
#define KEY_READ
Definition: nt_native.h:1026
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
short WCHAR
Definition: pedump.c:58
char CHAR
Definition: pedump.c:57
wcscat
wcscpy
_In_ UINT _In_ UINT cch
Definition: shellapi.h:432
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1527
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
Definition: scsiwmi.h:51
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
uint32_t * LPDWORD
Definition: typedefs.h:59
char * LPSTR
Definition: typedefs.h:51
int32_t INT
Definition: typedefs.h:58
#define WINAPI
Definition: msvc.h:6
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define SM_CLEANBOOT
Definition: winuser.h:1038
int WINAPI GetSystemMetrics(_In_ int)