ReactOS 0.4.17-dev-357-ga8f14ff
reg.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "wine/debug.h"
#include "shlwapi.h"
#include "wine/unicode.h"
Include dependency graph for reg.c:

Go to the source code of this file.

Macros

#define NO_SHLWAPI_STREAM
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
INT WINAPI SHStringFromGUIDW (REFGUID, LPWSTR, INT)
 
HRESULT WINAPI SHRegGetCLSIDKeyW (REFGUID, LPCWSTR, BOOL, BOOL, PHKEY)
 
DWORD WINAPI SHDeleteOrphanKeyA (HKEY hKey, LPCSTR lpszSubKey)
 
DWORD WINAPI SHDeleteOrphanKeyW (HKEY hKey, LPCWSTR lpszSubKey)
 
DWORD WINAPI SHGetValueGoodBootA (HKEY hkey, LPCSTR pSubKey, LPCSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pbData)
 
DWORD WINAPI SHGetValueGoodBootW (HKEY hkey, LPCWSTR pSubKey, LPCWSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pbData)
 
BOOL WINAPI RegisterMIMETypeForExtensionA (LPCSTR lpszSubKey, LPCSTR lpszValue)
 
BOOL WINAPI RegisterMIMETypeForExtensionW (LPCWSTR lpszSubKey, LPCWSTR lpszValue)
 
BOOL WINAPI UnregisterMIMETypeForExtensionA (LPCSTR lpszSubKey)
 
BOOL WINAPI UnregisterMIMETypeForExtensionW (LPCWSTR lpszSubKey)
 
BOOL WINAPI GetMIMETypeSubKeyA (LPCSTR lpszType, LPSTR lpszBuffer, DWORD dwLen)
 
BOOL WINAPI GetMIMETypeSubKeyW (LPCWSTR lpszType, LPWSTR lpszBuffer, DWORD dwLen)
 
BOOL WINAPI MIME_GetExtensionA (LPCSTR lpszType, LPSTR lpExt, INT iLen)
 
BOOL WINAPI MIME_GetExtensionW (LPCWSTR lpszType, LPWSTR lpExt, INT iLen)
 
BOOL WINAPI RegisterExtensionForMIMETypeA (LPCSTR lpszExt, LPCSTR lpszType)
 
BOOL WINAPI RegisterExtensionForMIMETypeW (LPCWSTR lpszExt, LPCWSTR lpszType)
 
BOOL WINAPI UnregisterExtensionForMIMETypeA (LPCSTR lpszType)
 
BOOL WINAPI UnregisterExtensionForMIMETypeW (LPCWSTR lpszType)
 
HRESULT WINAPI SHRegGetCLSIDKeyA (REFGUID guid, LPCSTR lpszValue, BOOL bUseHKCU, BOOL bCreate, PHKEY phKey)
 
HRESULT WINAPI SHRegisterValidateTemplate (LPCWSTR filename, BOOL unknown)
 

Variables

static const char lpszContentTypeA [] = "Content Type"
 
static const WCHAR lpszContentTypeW [] = { 'C','o','n','t','e','n','t',' ','T','y','p','e','\0'}
 
static const char szMimeDbContentA [] = "MIME\\Database\\Content Type\\"
 
static const WCHAR szMimeDbContentW []
 
static const DWORD dwLenMimeDbContent = 27
 
static const char szExtensionA [] = "Extension"
 
static const WCHAR szExtensionW [] = { 'E', 'x', 't','e','n','s','i','o','n','\0' }
 

Macro Definition Documentation

◆ NO_SHLWAPI_STREAM

#define NO_SHLWAPI_STREAM

Definition at line 29 of file reg.c.

Function Documentation

◆ GetMIMETypeSubKeyA()

BOOL WINAPI GetMIMETypeSubKeyA ( LPCSTR  lpszType,
LPSTR  lpszBuffer,
DWORD  dwLen 
)

Definition at line 341 of file reg.c.

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}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
static const DWORD dwLenMimeDbContent
Definition: reg.c:43
static const char szMimeDbContentA[]
Definition: reg.c:39
#define debugstr_a
Definition: kernel32.h:31
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by MIME_GetExtensionA(), RegisterExtensionForMIMETypeA(), and UnregisterExtensionForMIMETypeA().

◆ GetMIMETypeSubKeyW()

BOOL WINAPI GetMIMETypeSubKeyW ( LPCWSTR  lpszType,
LPWSTR  lpszBuffer,
DWORD  dwLen 
)

Definition at line 364 of file reg.c.

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}
#define lstrlenW
Definition: compat.h:750
static const WCHAR szMimeDbContentW[]
Definition: reg.c:40
unsigned long DWORD
Definition: ntddk_ex.h:95
#define debugstr_w
Definition: kernel32.h:32
short WCHAR
Definition: pedump.c:58

Referenced by MIME_GetExtensionW(), RegisterExtensionForMIMETypeW(), and UnregisterExtensionForMIMETypeW().

◆ MIME_GetExtensionA()

BOOL WINAPI MIME_GetExtensionA ( LPCSTR  lpszType,
LPSTR  lpExt,
INT  iLen 
)

Definition at line 402 of file reg.c.

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}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI SHGetValueA(HKEY hkey, const char *subkey, const char *value, DWORD *type, void *data, DWORD *data_len)
Definition: main.c:2197
BOOL WINAPI GetMIMETypeSubKeyA(LPCSTR lpszType, LPSTR lpszBuffer, DWORD dwLen)
Definition: reg.c:341
static const char szExtensionA[]
Definition: reg.c:45
unsigned int BOOL
Definition: ntddk_ex.h:94
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

◆ MIME_GetExtensionW()

BOOL WINAPI MIME_GetExtensionW ( LPCWSTR  lpszType,
LPWSTR  lpExt,
INT  iLen 
)

Definition at line 430 of file reg.c.

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}
DWORD WINAPI SHGetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD *type, void *data, DWORD *data_len)
Definition: main.c:2222
BOOL WINAPI GetMIMETypeSubKeyW(LPCWSTR lpszType, LPWSTR lpszBuffer, DWORD dwLen)
Definition: reg.c:364
static const WCHAR szExtensionW[]
Definition: reg.c:46

◆ RegisterExtensionForMIMETypeA()

BOOL WINAPI RegisterExtensionForMIMETypeA ( LPCSTR  lpszExt,
LPCSTR  lpszType 
)

Definition at line 466 of file reg.c.

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}
DWORD WINAPI SHSetValueA(HKEY hkey, const char *subkey, const char *value, DWORD type, const void *data, DWORD data_len)
Definition: main.c:2319
#define REG_SZ
Definition: layer.c:22

◆ RegisterExtensionForMIMETypeW()

BOOL WINAPI RegisterExtensionForMIMETypeW ( LPCWSTR  lpszExt,
LPCWSTR  lpszType 
)

Definition at line 488 of file reg.c.

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}
DWORD WINAPI SHSetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD type, const void *data, DWORD data_len)
Definition: main.c:2292

◆ RegisterMIMETypeForExtensionA()

BOOL WINAPI RegisterMIMETypeForExtensionA ( LPCSTR  lpszSubKey,
LPCSTR  lpszValue 
)

Definition at line 268 of file reg.c.

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}
#define WARN(fmt,...)
Definition: precomp.h:61
static const char lpszContentTypeA[]
Definition: reg.c:36

◆ RegisterMIMETypeForExtensionW()

BOOL WINAPI RegisterMIMETypeForExtensionW ( LPCWSTR  lpszSubKey,
LPCWSTR  lpszValue 
)

Definition at line 285 of file reg.c.

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}
static const WCHAR lpszContentTypeW[]
Definition: reg.c:37

◆ SHDeleteOrphanKeyA()

DWORD WINAPI SHDeleteOrphanKeyA ( HKEY  hKey,
LPCSTR  lpszSubKey 
)

Definition at line 163 of file reg.c.

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}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define NULL
Definition: types.h:112
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 RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
FxAutoRegKey hKey
#define KEY_READ
Definition: nt_native.h:1026

Referenced by UnregisterExtensionForMIMETypeA().

◆ SHDeleteOrphanKeyW()

DWORD WINAPI SHDeleteOrphanKeyW ( HKEY  hKey,
LPCWSTR  lpszSubKey 
)

Definition at line 192 of file reg.c.

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}
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
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

Referenced by UnregisterExtensionForMIMETypeW().

◆ SHGetValueGoodBootA()

DWORD WINAPI SHGetValueGoodBootA ( HKEY  hkey,
LPCSTR  pSubKey,
LPCSTR  pValue,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pbData 
)

Definition at line 234 of file reg.c.

236{
239 return SHGetValueA(hkey, pSubKey, pValue, pwType, pvData, pbData);
240}
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
PWCHAR pValue
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
#define SM_CLEANBOOT
Definition: winuser.h:1038
int WINAPI GetSystemMetrics(_In_ int)

◆ SHGetValueGoodBootW()

DWORD WINAPI SHGetValueGoodBootW ( HKEY  hkey,
LPCWSTR  pSubKey,
LPCWSTR  pValue,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pbData 
)

Definition at line 247 of file reg.c.

249{
252 return SHGetValueW(hkey, pSubKey, pValue, pwType, pvData, pbData);
253}

◆ SHRegGetCLSIDKeyA()

HRESULT WINAPI SHRegGetCLSIDKeyA ( REFGUID  guid,
LPCSTR  lpszValue,
BOOL  bUseHKCU,
BOOL  bCreate,
PHKEY  phKey 
)

Definition at line 580 of file reg.c.

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}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GUID guid
Definition: version.c:147
HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID, LPCWSTR, BOOL, BOOL, PHKEY)
Definition: reg.c:595
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1527

◆ SHRegGetCLSIDKeyW()

HRESULT WINAPI SHRegGetCLSIDKeyW ( REFGUID  guid,
LPCWSTR  lpszValue,
BOOL  bUseHKCU,
BOOL  bCreate,
PHKEY  phKey 
)

Definition at line 595 of file reg.c.

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}
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1201
#define lstrcpyW
Definition: compat.h:749
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
INT WINAPI SHStringFromGUIDW(REFGUID, LPWSTR, INT)
Definition: ordinal.c:546
#define L(x)
Definition: resources.c:13
#define S_OK
Definition: intsafe.h:52
static PVOID ptr
Definition: dispmode.c:27
wcscat
wcscpy
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by CFileSysEnum::_AddFindResult(), SHELL32_GetFSItemAttributes(), and SHRegGetCLSIDKeyA().

◆ SHRegisterValidateTemplate()

HRESULT WINAPI SHRegisterValidateTemplate ( LPCWSTR  filename,
BOOL  unknown 
)

Definition at line 661 of file reg.c.

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 FIXME(fmt,...)
Definition: precomp.h:53
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
const char * filename
Definition: ioapi.h:137

◆ SHStringFromGUIDW()

INT WINAPI SHStringFromGUIDW ( REFGUID  guid,
LPWSTR  lpszDest,
INT  cchMax 
)

Definition at line 546 of file ordinal.c.

547{
548 WCHAR xguid[40];
549 INT iLen;
550 static const WCHAR wszFormat[] = {'{','%','0','8','l','X','-','%','0','4','X','-','%','0','4','X','-',
551 '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','%','0','2','X','%','0','2',
552 'X','%','0','2','X','%','0','2','X','}',0};
553
554 TRACE("(%s,%p,%d)\n", debugstr_guid(guid), lpszDest, cchMax);
555
556 swprintf(xguid, ARRAY_SIZE(xguid), wszFormat, guid->Data1, guid->Data2, guid->Data3,
557 guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
558 guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
559
560 iLen = lstrlenW(xguid) + 1;
561
562 if (iLen > cchMax)
563 return 0;
564 memcpy(lpszDest, xguid, iLen*sizeof(WCHAR));
565 return iLen;
566}
UINT cchMax
WCHAR lpszDest[260]
#define swprintf
Definition: precomp.h:40
#define debugstr_guid
Definition: kernel32.h:35
int32_t INT
Definition: typedefs.h:58

Referenced by SHRegGetCLSIDKeyW().

◆ UnregisterExtensionForMIMETypeA()

BOOL WINAPI UnregisterExtensionForMIMETypeA ( LPCSTR  lpszType)

Definition at line 521 of file reg.c.

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}
DWORD WINAPI SHDeleteValueA(HKEY hkey, const char *subkey, const char *value)
Definition: main.c:1926
DWORD WINAPI SHDeleteOrphanKeyA(HKEY hKey, LPCSTR lpszSubKey)
Definition: reg.c:163

◆ UnregisterExtensionForMIMETypeW()

BOOL WINAPI UnregisterExtensionForMIMETypeW ( LPCWSTR  lpszType)

Definition at line 543 of file reg.c.

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}
DWORD WINAPI SHDeleteValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value)
Definition: main.c:1906
DWORD WINAPI SHDeleteOrphanKeyW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:192

◆ UnregisterMIMETypeForExtensionA()

BOOL WINAPI UnregisterMIMETypeForExtensionA ( LPCSTR  lpszSubKey)

Definition at line 309 of file reg.c.

310{
312}

◆ UnregisterMIMETypeForExtensionW()

BOOL WINAPI UnregisterMIMETypeForExtensionW ( LPCWSTR  lpszSubKey)

Definition at line 319 of file reg.c.

320{
322}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ dwLenMimeDbContent

const DWORD dwLenMimeDbContent = 27
static

Definition at line 43 of file reg.c.

Referenced by GetMIMETypeSubKeyA(), and GetMIMETypeSubKeyW().

◆ lpszContentTypeA

const char lpszContentTypeA[] = "Content Type"
static

Definition at line 36 of file reg.c.

Referenced by RegisterMIMETypeForExtensionA(), and UnregisterMIMETypeForExtensionA().

◆ lpszContentTypeW

const WCHAR lpszContentTypeW[] = { 'C','o','n','t','e','n','t',' ','T','y','p','e','\0'}
static

Definition at line 37 of file reg.c.

Referenced by RegisterMIMETypeForExtensionW(), and UnregisterMIMETypeForExtensionW().

◆ szExtensionA

const char szExtensionA[] = "Extension"
static

◆ szExtensionW

const WCHAR szExtensionW[] = { 'E', 'x', 't','e','n','s','i','o','n','\0' }
static

◆ szMimeDbContentA

const char szMimeDbContentA[] = "MIME\\Database\\Content Type\\"
static

Definition at line 39 of file reg.c.

Referenced by GetMIMETypeSubKeyA().

◆ szMimeDbContentW

const WCHAR szMimeDbContentW[]
static
Initial value:
= { 'M', 'I', 'M','E','\\',
'D','a','t','a','b','a','s','e','\\','C','o','n','t','e','n','t',
' ','T','y','p','e','\\', 0 }

Definition at line 40 of file reg.c.

Referenced by GetMIMETypeSubKeyW().