ReactOS 0.4.17-dev-116-ga4b6fe9
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.

Classes

struct  SHUSKEY
 

Macros

#define NO_SHLWAPI_STREAM
 
#define REG_HKCU   TRUE
 
#define REG_HKLM   FALSE
 
#define szClassIdKeyLen   (sizeof(szClassIdKey)/sizeof(WCHAR))
 

Typedefs

typedef struct SHUSKEYLPSHUSKEY
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
INT WINAPI SHStringFromGUIDW (REFGUID, LPWSTR, INT)
 
HRESULT WINAPI SHRegGetCLSIDKeyW (REFGUID, LPCWSTR, BOOL, BOOL, PHKEY)
 
static HKEY REG_GetHKEYFromHUSKEY (HUSKEY hUSKey, BOOL which)
 
LONG WINAPI SHRegOpenUSKeyA (LPCSTR Path, REGSAM AccessType, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU)
 
LONG WINAPI SHRegOpenUSKeyW (LPCWSTR Path, REGSAM AccessType, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU)
 
LONG WINAPI SHRegCloseUSKey (HUSKEY hUSKey)
 
LONG WINAPI SHRegCreateUSKeyA (LPCSTR path, REGSAM samDesired, HUSKEY relative_key, PHUSKEY new_uskey, DWORD flags)
 
LONG WINAPI SHRegCreateUSKeyW (LPCWSTR path, REGSAM samDesired, HUSKEY relative_key, PHUSKEY new_uskey, DWORD flags)
 
LONG WINAPI SHRegDeleteEmptyUSKeyA (HUSKEY hUSKey, LPCSTR pszValue, SHREGDEL_FLAGS delRegFlags)
 
LONG WINAPI SHRegDeleteEmptyUSKeyW (HUSKEY hUSKey, LPCWSTR pszValue, SHREGDEL_FLAGS delRegFlags)
 
LONG WINAPI SHRegDeleteUSValueA (HUSKEY hUSKey, LPCSTR pszValue, SHREGDEL_FLAGS delRegFlags)
 
LONG WINAPI SHRegDeleteUSValueW (HUSKEY hUSKey, LPCWSTR pszValue, SHREGDEL_FLAGS delRegFlags)
 
LONG WINAPI SHRegEnumUSValueA (HUSKEY hUSKey, DWORD dwIndex, LPSTR pszValueName, LPDWORD pcchValueNameLen, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags)
 
LONG WINAPI SHRegEnumUSValueW (HUSKEY hUSKey, DWORD dwIndex, LPWSTR pszValueName, LPDWORD pcchValueNameLen, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags)
 
LONG WINAPI SHRegQueryUSValueA (HUSKEY hUSKey, LPCSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, LPVOID pvDefaultData, DWORD dwDefaultDataSize)
 
LONG WINAPI SHRegQueryUSValueW (HUSKEY hUSKey, LPCWSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, LPVOID pvDefaultData, DWORD dwDefaultDataSize)
 
LONG WINAPI SHRegGetUSValueA (LPCSTR pSubKey, LPCSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData, BOOL flagIgnoreHKCU, LPVOID pDefaultData, DWORD wDefaultDataSize)
 
LONG WINAPI SHRegGetUSValueW (LPCWSTR pSubKey, LPCWSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData, BOOL flagIgnoreHKCU, LPVOID pDefaultData, DWORD wDefaultDataSize)
 
LONG WINAPI SHRegSetUSValueA (LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwType, LPVOID pvData, DWORD cbData, DWORD dwFlags)
 
LONG WINAPI SHRegSetUSValueW (LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwType, LPVOID pvData, DWORD cbData, DWORD dwFlags)
 
BOOL WINAPI SHRegGetBoolUSValueA (LPCSTR pszSubKey, LPCSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault)
 
BOOL WINAPI SHRegGetBoolUSValueW (LPCWSTR pszSubKey, LPCWSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault)
 
LONG WINAPI SHRegQueryInfoUSKeyA (HUSKEY hUSKey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen, SHREGENUM_FLAGS enumRegFlags)
 
LONG WINAPI SHRegQueryInfoUSKeyW (HUSKEY hUSKey, LPDWORD pcSubKeys, LPDWORD pcchMaxSubKeyLen, LPDWORD pcValues, LPDWORD pcchMaxValueNameLen, SHREGENUM_FLAGS enumRegFlags)
 
LONG WINAPI SHRegEnumUSKeyA (HUSKEY hUSKey, DWORD dwIndex, LPSTR pszName, LPDWORD pcchValueNameLen, SHREGENUM_FLAGS enumRegFlags)
 
LONG WINAPI SHRegEnumUSKeyW (HUSKEY hUSKey, DWORD dwIndex, LPWSTR pszName, LPDWORD pcchValueNameLen, SHREGENUM_FLAGS enumRegFlags)
 
LONG WINAPI SHRegWriteUSValueA (HUSKEY hUSKey, LPCSTR pszValue, DWORD dwType, LPVOID pvData, DWORD cbData, DWORD dwFlags)
 
LONG WINAPI SHRegWriteUSValueW (HUSKEY hUSKey, LPCWSTR pszValue, DWORD dwType, LPVOID pvData, DWORD cbData, DWORD dwFlags)
 
DWORD WINAPI SHRegGetPathA (HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPSTR lpszPath, DWORD dwFlags)
 
DWORD WINAPI SHRegGetPathW (HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPWSTR lpszPath, DWORD dwFlags)
 
DWORD WINAPI SHRegSetPathA (HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPCSTR lpszPath, DWORD dwFlags)
 
DWORD WINAPI SHRegSetPathW (HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPCWSTR lpszPath, DWORD dwFlags)
 
DWORD WINAPI SHGetValueA (HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
 
DWORD WINAPI SHGetValueW (HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
 
DWORD WINAPI SHSetValueA (HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
 
DWORD WINAPI SHSetValueW (HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
 
LONG WINAPI SHQueryInfoKeyA (HKEY hKey, LPDWORD pwSubKeys, LPDWORD pwSubKeyMax, LPDWORD pwValues, LPDWORD pwValueMax)
 
LONG WINAPI SHQueryInfoKeyW (HKEY hKey, LPDWORD pwSubKeys, LPDWORD pwSubKeyMax, LPDWORD pwValues, LPDWORD pwValueMax)
 
DWORD WINAPI SHQueryValueExA (HKEY hKey, LPCSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
 
DWORD WINAPI SHQueryValueExW (HKEY hKey, LPCWSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
 
DWORD WINAPI SHDeleteKeyA (HKEY hKey, LPCSTR lpszSubKey)
 
DWORD WINAPI SHDeleteKeyW (HKEY hKey, LPCWSTR lpszSubKey)
 
DWORD WINAPI SHDeleteEmptyKeyA (HKEY hKey, LPCSTR lpszSubKey)
 
DWORD WINAPI SHDeleteEmptyKeyW (HKEY hKey, LPCWSTR lpszSubKey)
 
DWORD WINAPI SHDeleteOrphanKeyA (HKEY hKey, LPCSTR lpszSubKey)
 
DWORD WINAPI SHDeleteOrphanKeyW (HKEY hKey, LPCWSTR lpszSubKey)
 
DWORD WINAPI SHDeleteValueA (HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue)
 
DWORD WINAPI SHDeleteValueW (HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue)
 
LONG WINAPI SHEnumKeyExA (HKEY hKey, DWORD dwIndex, LPSTR lpszSubKey, LPDWORD pwLen)
 
LONG WINAPI SHEnumKeyExW (HKEY hKey, DWORD dwIndex, LPWSTR lpszSubKey, LPDWORD pwLen)
 
LONG WINAPI SHEnumValueA (HKEY hKey, DWORD dwIndex, LPSTR lpszValue, LPDWORD pwLen, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
 
LONG WINAPI SHEnumValueW (HKEY hKey, DWORD dwIndex, LPWSTR lpszValue, LPDWORD pwLen, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
 
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)
 
HKEY WINAPI SHRegDuplicateHKey (HKEY hKey)
 
DWORD WINAPI SHCopyKeyA (HKEY hKeySrc, LPCSTR lpszSrcSubKey, HKEY hKeyDst, DWORD dwReserved)
 
DWORD WINAPI SHCopyKeyW (HKEY hKeySrc, LPCWSTR lpszSrcSubKey, HKEY hKeyDst, DWORD dwReserved)
 
int WINAPI SHRegGetIntW (HKEY hKey, LPCWSTR lpszValue, int iDefault)
 
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.

◆ REG_HKCU

#define REG_HKCU   TRUE

Definition at line 61 of file reg.c.

◆ REG_HKLM

#define REG_HKLM   FALSE

Definition at line 62 of file reg.c.

◆ szClassIdKeyLen

#define szClassIdKeyLen   (sizeof(szClassIdKey)/sizeof(WCHAR))

Typedef Documentation

◆ LPSHUSKEY

Function Documentation

◆ GetMIMETypeSubKeyA()

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

Definition at line 2026 of file reg.c.

2027{
2028 TRACE("(%s,%p,%d)\n", debugstr_a(lpszType), lpszBuffer, dwLen);
2029
2030 if (dwLen > dwLenMimeDbContent && lpszType && lpszBuffer)
2031 {
2032 size_t dwStrLen = strlen(lpszType);
2033
2034 if (dwStrLen < dwLen - dwLenMimeDbContent)
2035 {
2037 memcpy(lpszBuffer + dwLenMimeDbContent, lpszType, dwStrLen + 1);
2038 return TRUE;
2039 }
2040 }
2041 return FALSE;
2042}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
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 2049 of file reg.c.

2050{
2051 TRACE("(%s,%p,%d)\n", debugstr_w(lpszType), lpszBuffer, dwLen);
2052
2053 if (dwLen > dwLenMimeDbContent && lpszType && lpszBuffer)
2054 {
2055 DWORD dwStrLen = strlenW(lpszType);
2056
2057 if (dwStrLen < dwLen - dwLenMimeDbContent)
2058 {
2059 memcpy(lpszBuffer, szMimeDbContentW, dwLenMimeDbContent * sizeof(WCHAR));
2060 memcpy(lpszBuffer + dwLenMimeDbContent, lpszType, (dwStrLen + 1) * sizeof(WCHAR));
2061 return TRUE;
2062 }
2063 }
2064 return FALSE;
2065}
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
#define strlenW(s)
Definition: unicode.h:28

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

◆ MIME_GetExtensionA()

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

Definition at line 2087 of file reg.c.

2088{
2089 char szSubKey[MAX_PATH];
2090 DWORD dwlen = iLen - 1, dwType;
2091 BOOL bRet = FALSE;
2092
2093 if (iLen > 0 && lpExt)
2094 *lpExt = '\0';
2095
2096 if (lpszType && lpExt && iLen > 2 &&
2097 GetMIMETypeSubKeyA(lpszType, szSubKey, MAX_PATH) &&
2098 !SHGetValueA(HKEY_CLASSES_ROOT, szSubKey, szExtensionA, &dwType, lpExt + 1, &dwlen) &&
2099 lpExt[1])
2100 {
2101 if (lpExt[1] == '.')
2102 memmove(lpExt, lpExt + 1, strlen(lpExt + 1) + 1);
2103 else
2104 *lpExt = '.'; /* Supply a '.' */
2105 bRet = TRUE;
2106 }
2107 return bRet;
2108}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1249
BOOL WINAPI GetMIMETypeSubKeyA(LPCSTR lpszType, LPSTR lpszBuffer, DWORD dwLen)
Definition: reg.c:2026
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 2115 of file reg.c.

2116{
2117 WCHAR szSubKey[MAX_PATH];
2118 DWORD dwlen = iLen - 1, dwType;
2119 BOOL bRet = FALSE;
2120
2121 if (iLen > 0 && lpExt)
2122 *lpExt = '\0';
2123
2124 if (lpszType && lpExt && iLen > 2 &&
2125 GetMIMETypeSubKeyW(lpszType, szSubKey, MAX_PATH) &&
2126 !SHGetValueW(HKEY_CLASSES_ROOT, szSubKey, szExtensionW, &dwType, lpExt + 1, &dwlen) &&
2127 lpExt[1])
2128 {
2129 if (lpExt[1] == '.')
2130 memmove(lpExt, lpExt + 1, (strlenW(lpExt + 1) + 1) * sizeof(WCHAR));
2131 else
2132 *lpExt = '.'; /* Supply a '.' */
2133 bRet = TRUE;
2134 }
2135 return bRet;
2136}
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1278
BOOL WINAPI GetMIMETypeSubKeyW(LPCWSTR lpszType, LPWSTR lpszBuffer, DWORD dwLen)
Definition: reg.c:2049
static const WCHAR szExtensionW[]
Definition: reg.c:46

◆ REG_GetHKEYFromHUSKEY()

static HKEY REG_GetHKEYFromHUSKEY ( HUSKEY  hUSKey,
BOOL  which 
)
static

Definition at line 69 of file reg.c.

70{
71 HKEY test = hUSKey;
72 LPSHUSKEY mihk = hUSKey;
73
74 if ((test == HKEY_CLASSES_ROOT) ||
77 (test == HKEY_DYN_DATA) ||
80/* FIXME: need to define for Win2k, ME, XP
81 * (test == HKEY_PERFORMANCE_TEXT) ||
82 * (test == HKEY_PERFORMANCE_NLSTEXT) ||
83 */
84 (test == HKEY_USERS)) return test;
85 if (which == REG_HKCU) return mihk->HKCUkey;
86 return mihk->HKLMkey;
87}
#define REG_HKCU
Definition: reg.c:61
#define test
Definition: rosglue.h:37
Definition: reg.c:49
HKEY HKCUkey
Definition: reg.c:51
HKEY HKLMkey
Definition: reg.c:53
static GLenum which
Definition: wgl_font.c:159
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
#define HKEY_DYN_DATA
Definition: winreg.h:16
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_PERFORMANCE_DATA
Definition: winreg.h:14
#define HKEY_USERS
Definition: winreg.h:13

Referenced by SHRegCreateUSKeyW(), SHRegEnumUSKeyA(), SHRegEnumUSKeyW(), SHRegEnumUSValueA(), SHRegEnumUSValueW(), SHRegOpenUSKeyW(), SHRegQueryInfoUSKeyA(), SHRegQueryInfoUSKeyW(), SHRegQueryUSValueA(), and SHRegQueryUSValueW().

◆ RegisterExtensionForMIMETypeA()

BOOL WINAPI RegisterExtensionForMIMETypeA ( LPCSTR  lpszExt,
LPCSTR  lpszType 
)

Definition at line 2151 of file reg.c.

2152{
2153 DWORD dwLen;
2154 char szKey[MAX_PATH];
2155
2156 TRACE("(%s,%s)\n", debugstr_a(lpszExt), debugstr_a(lpszType));
2157
2158 if (!GetMIMETypeSubKeyA(lpszType, szKey, MAX_PATH)) /* Get full path to the key */
2159 return FALSE;
2160
2161 dwLen = strlen(lpszExt) + 1;
2162
2163 if (SHSetValueA(HKEY_CLASSES_ROOT, szKey, szExtensionA, REG_SZ, lpszExt, dwLen))
2164 return FALSE;
2165 return TRUE;
2166}
DWORD WINAPI SHSetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
Definition: reg.c:1320
#define REG_SZ
Definition: layer.c:22

◆ RegisterExtensionForMIMETypeW()

BOOL WINAPI RegisterExtensionForMIMETypeW ( LPCWSTR  lpszExt,
LPCWSTR  lpszType 
)

Definition at line 2173 of file reg.c.

2174{
2175 DWORD dwLen;
2176 WCHAR szKey[MAX_PATH];
2177
2178 TRACE("(%s,%s)\n", debugstr_w(lpszExt), debugstr_w(lpszType));
2179
2180 /* Get the full path to the key */
2181 if (!GetMIMETypeSubKeyW(lpszType, szKey, MAX_PATH)) /* Get full path to the key */
2182 return FALSE;
2183
2184 dwLen = (lstrlenW(lpszExt) + 1) * sizeof(WCHAR);
2185
2186 if (SHSetValueW(HKEY_CLASSES_ROOT, szKey, szExtensionW, REG_SZ, lpszExt, dwLen))
2187 return FALSE;
2188 return TRUE;
2189}
#define lstrlenW
Definition: compat.h:750
DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
Definition: reg.c:1348

◆ RegisterMIMETypeForExtensionA()

BOOL WINAPI RegisterMIMETypeForExtensionA ( LPCSTR  lpszSubKey,
LPCSTR  lpszValue 
)

Definition at line 1953 of file reg.c.

1954{
1955 if (!lpszValue)
1956 {
1957 WARN("Invalid lpszValue would crash under Win32!\n");
1958 return FALSE;
1959 }
1960
1961 return !SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA,
1962 REG_SZ, lpszValue, strlen(lpszValue));
1963}
#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 1970 of file reg.c.

1971{
1972 if (!lpszValue)
1973 {
1974 WARN("Invalid lpszValue would crash under Win32!\n");
1975 return FALSE;
1976 }
1977
1978 return !SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW,
1979 REG_SZ, lpszValue, strlenW(lpszValue));
1980}
static const WCHAR lpszContentTypeW[]
Definition: reg.c:37

◆ SHCopyKeyA()

DWORD WINAPI SHCopyKeyA ( HKEY  hKeySrc,
LPCSTR  lpszSrcSubKey,
HKEY  hKeyDst,
DWORD  dwReserved 
)

Definition at line 2286 of file reg.c.

2287{
2288 WCHAR szSubKeyW[MAX_PATH];
2289
2290 TRACE("(hkey=%p,%s,%p08x,%d)\n", hKeySrc, debugstr_a(lpszSrcSubKey), hKeyDst, dwReserved);
2291
2292 if (lpszSrcSubKey)
2293 MultiByteToWideChar(CP_ACP, 0, lpszSrcSubKey, -1, szSubKeyW, MAX_PATH);
2294
2295 return SHCopyKeyW(hKeySrc, lpszSrcSubKey ? szSubKeyW : NULL, hKeyDst, dwReserved);
2296}
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
DWORD WINAPI SHCopyKeyW(HKEY hKeySrc, LPCWSTR lpszSrcSubKey, HKEY hKeyDst, DWORD dwReserved)
Definition: reg.c:2303
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ SHCopyKeyW()

DWORD WINAPI SHCopyKeyW ( HKEY  hKeySrc,
LPCWSTR  lpszSrcSubKey,
HKEY  hKeyDst,
DWORD  dwReserved 
)

Definition at line 2303 of file reg.c.

2304{
2305 DWORD dwKeyCount = 0, dwValueCount = 0, dwMaxKeyLen = 0;
2306 DWORD dwMaxValueLen = 0, dwMaxDataLen = 0, i;
2307 BYTE buff[1024];
2308 LPVOID lpBuff = buff;
2309 WCHAR szName[MAX_PATH], *lpszName = szName;
2310 DWORD dwRet = S_OK;
2311
2312 TRACE("hkey=%p,%s,%p08x,%d)\n", hKeySrc, debugstr_w(lpszSrcSubKey), hKeyDst, dwReserved);
2313
2314 if(!hKeyDst || !hKeySrc)
2316 else
2317 {
2318 /* Open source key */
2319 if(lpszSrcSubKey)
2320 dwRet = RegOpenKeyExW(hKeySrc, lpszSrcSubKey, 0, KEY_ALL_ACCESS, &hKeySrc);
2321
2322 if(dwRet)
2323 hKeyDst = NULL; /* Don't close this key since we didn't open it */
2324 else
2325 {
2326 /* Get details about sub keys and values */
2327 dwRet = RegQueryInfoKeyW(hKeySrc, NULL, NULL, NULL, &dwKeyCount, &dwMaxKeyLen,
2328 NULL, &dwValueCount, &dwMaxValueLen, &dwMaxDataLen,
2329 NULL, NULL);
2330 if(!dwRet)
2331 {
2332 if (dwMaxValueLen > dwMaxKeyLen)
2333 dwMaxKeyLen = dwMaxValueLen; /* Get max size for key/value names */
2334
2335 if (dwMaxKeyLen++ > MAX_PATH - 1)
2336 lpszName = HeapAlloc(GetProcessHeap(), 0, dwMaxKeyLen * sizeof(WCHAR));
2337
2338 if (dwMaxDataLen > sizeof(buff))
2339 lpBuff = HeapAlloc(GetProcessHeap(), 0, dwMaxDataLen);
2340
2341 if (!lpszName || !lpBuff)
2343 }
2344 }
2345 }
2346
2347 /* Copy all the sub keys */
2348 for(i = 0; i < dwKeyCount && !dwRet; i++)
2349 {
2350 HKEY hSubKeySrc, hSubKeyDst;
2351 DWORD dwSize = dwMaxKeyLen;
2352
2353 dwRet = RegEnumKeyExW(hKeySrc, i, lpszName, &dwSize, NULL, NULL, NULL, NULL);
2354
2355 if(!dwRet)
2356 {
2357 /* Open source sub key */
2358 dwRet = RegOpenKeyExW(hKeySrc, lpszName, 0, KEY_READ, &hSubKeySrc);
2359
2360 if(!dwRet)
2361 {
2362 /* Create destination sub key */
2363 dwRet = RegCreateKeyW(hKeyDst, lpszName, &hSubKeyDst);
2364
2365 if(!dwRet)
2366 {
2367 /* Recursively copy keys and values from the sub key */
2368 dwRet = SHCopyKeyW(hSubKeySrc, NULL, hSubKeyDst, 0);
2369 RegCloseKey(hSubKeyDst);
2370 }
2371 }
2372 RegCloseKey(hSubKeySrc);
2373 }
2374 }
2375
2376 /* Copy all the values in this key */
2377 for (i = 0; i < dwValueCount && !dwRet; i++)
2378 {
2379 DWORD dwNameSize = dwMaxKeyLen, dwType, dwLen = dwMaxDataLen;
2380
2381 dwRet = RegEnumValueW(hKeySrc, i, lpszName, &dwNameSize, NULL, &dwType, lpBuff, &dwLen);
2382
2383 if (!dwRet)
2384 dwRet = SHSetValueW(hKeyDst, NULL, lpszName, dwType, lpBuff, dwLen);
2385 }
2386
2387 /* Free buffers if allocated */
2388 if (lpszName != szName)
2389 HeapFree(GetProcessHeap(), 0, lpszName);
2390 if (lpBuff != buff)
2391 HeapFree(GetProcessHeap(), 0, lpBuff);
2392
2393 if (lpszSrcSubKey && hKeyDst)
2394 RegCloseKey(hKeyDst);
2395 return dwRet;
2396}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
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
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static unsigned char buff[32768]
Definition: fatten.c:17
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
#define S_OK
Definition: intsafe.h:52
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define KEY_READ
Definition: nt_native.h:1026
static const WCHAR szName[]
Definition: powrprof.c:45
unsigned char BYTE
Definition: xxhash.c:193

Referenced by COpenWithList::SetDefaultHandler(), SHCopyKeyA(), and SHCopyKeyW().

◆ SHDeleteEmptyKeyA()

DWORD WINAPI SHDeleteEmptyKeyA ( HKEY  hKey,
LPCSTR  lpszSubKey 
)

Definition at line 1650 of file reg.c.

1651{
1652 DWORD dwRet, dwKeyCount = 0;
1653 HKEY hSubKey = 0;
1654
1655 TRACE("(hkey=%p,%s)\n", hKey, debugstr_a(lpszSubKey));
1656
1657 dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
1658 if(!dwRet)
1659 {
1660 dwRet = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, &dwKeyCount,
1661 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
1662 RegCloseKey(hSubKey);
1663 if(!dwRet)
1664 {
1665 if (!dwKeyCount)
1666 dwRet = RegDeleteKeyA(hKey, lpszSubKey);
1667 else
1668 dwRet = ERROR_KEY_HAS_CHILDREN;
1669 }
1670 }
1671 return dwRet;
1672}
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 ERROR_KEY_HAS_CHILDREN
Definition: winerror.h:923

◆ SHDeleteEmptyKeyW()

DWORD WINAPI SHDeleteEmptyKeyW ( HKEY  hKey,
LPCWSTR  lpszSubKey 
)

Definition at line 1679 of file reg.c.

1680{
1681 DWORD dwRet, dwKeyCount = 0;
1682 HKEY hSubKey = 0;
1683
1684 TRACE("(hkey=%p, %s)\n", hKey, debugstr_w(lpszSubKey));
1685
1686 dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
1687 if(!dwRet)
1688 {
1689 dwRet = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &dwKeyCount,
1690 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
1691 RegCloseKey(hSubKey);
1692 if(!dwRet)
1693 {
1694 if (!dwKeyCount)
1695 dwRet = RegDeleteKeyW(hKey, lpszSubKey);
1696 else
1697 dwRet = ERROR_KEY_HAS_CHILDREN;
1698 }
1699 }
1700 return dwRet;
1701}
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239

◆ SHDeleteKeyA()

DWORD WINAPI SHDeleteKeyA ( HKEY  hKey,
LPCSTR  lpszSubKey 
)

Definition at line 1575 of file reg.c.

1576{
1577 WCHAR subkeyW[MAX_PATH];
1578
1579 MultiByteToWideChar (CP_ACP, 0, lpszSubKey, -1, subkeyW, sizeof(subkeyW)/sizeof(WCHAR));
1580 return SHDeleteKeyW(hKey, subkeyW);
1581}
DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1588

Referenced by delete_key(), test_getstring_no_extra(), test_SHCopyKey(), test_SHDeleteKey(), and testRegStore().

◆ SHDeleteKeyW()

DWORD WINAPI SHDeleteKeyW ( HKEY  hKey,
LPCWSTR  lpszSubKey 
)

Definition at line 1588 of file reg.c.

1589{
1590 DWORD dwRet, dwMaxSubkeyLen = 0, dwSize;
1591 WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
1592 HKEY hSubKey = 0;
1593
1594 TRACE("(hkey=%p,%s)\n", hKey, debugstr_w(lpszSubKey));
1595
1596 dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
1597 if(!dwRet)
1598 {
1599 /* Find the maximum subkey length so that we can allocate a buffer */
1600 dwRet = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL,
1601 &dwMaxSubkeyLen, NULL, NULL, NULL, NULL, NULL, NULL);
1602 if(!dwRet)
1603 {
1604 dwMaxSubkeyLen++;
1605 if (dwMaxSubkeyLen > sizeof(szNameBuf)/sizeof(WCHAR))
1606 /* Name too big: alloc a buffer for it */
1607 lpszName = HeapAlloc(GetProcessHeap(), 0, dwMaxSubkeyLen*sizeof(WCHAR));
1608
1609 if(!lpszName)
1611 else
1612 {
1613 while (dwRet == ERROR_SUCCESS)
1614 {
1615 dwSize = dwMaxSubkeyLen;
1616 dwRet = RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL, NULL, NULL, NULL);
1617 if (dwRet == ERROR_SUCCESS || dwRet == ERROR_MORE_DATA)
1618 dwRet = SHDeleteKeyW(hSubKey, lpszName);
1619 }
1620 if (dwRet == ERROR_NO_MORE_ITEMS)
1621 dwRet = ERROR_SUCCESS;
1622
1623 if (lpszName != szNameBuf)
1624 HeapFree(GetProcessHeap(), 0, lpszName); /* Free buffer if allocated */
1625 }
1626 }
1627
1628 RegCloseKey(hSubKey);
1629 if(!dwRet)
1630 dwRet = RegDeleteKeyW(hKey, lpszSubKey);
1631 }
1632 return dwRet;
1633}
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105

Referenced by CMruNode::_DeleteValue(), DeleteExt(), EditTypeDlg_WriteClass(), HandleMruData(), MRUList_DataList(), MRUList_PidlList(), PNP_DeleteClassKey(), SHAddToRecentDocs(), SHDeleteKeyA(), and SHDeleteKeyW().

◆ SHDeleteOrphanKeyA()

DWORD WINAPI SHDeleteOrphanKeyA ( HKEY  hKey,
LPCSTR  lpszSubKey 
)

Definition at line 1716 of file reg.c.

1717{
1718 HKEY hSubKey;
1719 DWORD dwKeyCount = 0, dwValueCount = 0, dwRet;
1720
1721 TRACE("(hkey=%p,%s)\n", hKey, debugstr_a(lpszSubKey));
1722
1723 dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
1724
1725 if(!dwRet)
1726 {
1727 /* Get subkey and value count */
1728 dwRet = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, &dwKeyCount,
1729 NULL, NULL, &dwValueCount, NULL, NULL, NULL, NULL);
1730
1731 if(!dwRet && !dwKeyCount && !dwValueCount)
1732 {
1733 dwRet = RegDeleteKeyA(hKey, lpszSubKey);
1734 }
1735 RegCloseKey(hSubKey);
1736 }
1737 return dwRet;
1738}

Referenced by UnregisterExtensionForMIMETypeA().

◆ SHDeleteOrphanKeyW()

DWORD WINAPI SHDeleteOrphanKeyW ( HKEY  hKey,
LPCWSTR  lpszSubKey 
)

Definition at line 1745 of file reg.c.

1746{
1747 HKEY hSubKey;
1748 DWORD dwKeyCount = 0, dwValueCount = 0, dwRet;
1749
1750 TRACE("(hkey=%p,%s)\n", hKey, debugstr_w(lpszSubKey));
1751
1752 dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
1753
1754 if(!dwRet)
1755 {
1756 /* Get subkey and value count */
1757 dwRet = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &dwKeyCount,
1758 NULL, NULL, &dwValueCount, NULL, NULL, NULL, NULL);
1759
1760 if(!dwRet && !dwKeyCount && !dwValueCount)
1761 {
1762 dwRet = RegDeleteKeyW(hKey, lpszSubKey);
1763 }
1764 RegCloseKey(hSubKey);
1765 }
1766 return dwRet;
1767}

Referenced by UnregisterExtensionForMIMETypeW().

◆ SHDeleteValueA()

DWORD WINAPI SHDeleteValueA ( HKEY  hKey,
LPCSTR  lpszSubKey,
LPCSTR  lpszValue 
)

Definition at line 1783 of file reg.c.

1784{
1785 DWORD dwRet;
1786 HKEY hSubKey;
1787
1788 TRACE("(hkey=%p,%s,%s)\n", hKey, debugstr_a(lpszSubKey), debugstr_a(lpszValue));
1789
1790 dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_SET_VALUE, &hSubKey);
1791 if (!dwRet)
1792 {
1793 dwRet = RegDeleteValueA(hSubKey, lpszValue);
1794 RegCloseKey(hSubKey);
1795 }
1796 return dwRet;
1797}
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2287
#define KEY_SET_VALUE
Definition: nt_native.h:1020

Referenced by test_objecttag(), UnregisterExtensionForMIMETypeA(), and UnregisterMIMETypeForExtensionA().

◆ SHDeleteValueW()

DWORD WINAPI SHDeleteValueW ( HKEY  hKey,
LPCWSTR  lpszSubKey,
LPCWSTR  lpszValue 
)

Definition at line 1804 of file reg.c.

1805{
1806 DWORD dwRet;
1807 HKEY hSubKey;
1808
1809 TRACE("(hkey=%p,%s,%s)\n", hKey, debugstr_w(lpszSubKey), debugstr_w(lpszValue));
1810
1811 dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_SET_VALUE, &hSubKey);
1812 if (!dwRet)
1813 {
1814 dwRet = RegDeleteValueW(hSubKey, lpszValue);
1815 RegCloseKey(hSubKey);
1816 }
1817 return dwRet;
1818}
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330

Referenced by CMruBase::_DeleteValue(), CMruLongList::_ImportShortList(), MRUList_DataList(), CGlobalFolderSettings::Save(), CRegFolder::SetNameOf(), UnregisterExtensionForMIMETypeW(), UnregisterMIMETypeForExtensionW(), and CRegPropertyBag::Write().

◆ SHEnumKeyExA()

LONG WINAPI SHEnumKeyExA ( HKEY  hKey,
DWORD  dwIndex,
LPSTR  lpszSubKey,
LPDWORD  pwLen 
)

Definition at line 1835 of file reg.c.

1837{
1838 TRACE("(hkey=%p,%d,%s,%p)\n", hKey, dwIndex, debugstr_a(lpszSubKey), pwLen);
1839
1840 return RegEnumKeyExA(hKey, dwIndex, lpszSubKey, pwLen, NULL, NULL, NULL, NULL);
1841}
LONG WINAPI RegEnumKeyExA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2419

◆ SHEnumKeyExW()

LONG WINAPI SHEnumKeyExW ( HKEY  hKey,
DWORD  dwIndex,
LPWSTR  lpszSubKey,
LPDWORD  pwLen 
)

Definition at line 1848 of file reg.c.

1850{
1851 TRACE("(hkey=%p,%d,%s,%p)\n", hKey, dwIndex, debugstr_w(lpszSubKey), pwLen);
1852
1853 return RegEnumKeyExW(hKey, dwIndex, lpszSubKey, pwLen, NULL, NULL, NULL, NULL);
1854}

◆ SHEnumValueA()

LONG WINAPI SHEnumValueA ( HKEY  hKey,
DWORD  dwIndex,
LPSTR  lpszValue,
LPDWORD  pwLen,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pcbData 
)

Definition at line 1874 of file reg.c.

1877{
1878 TRACE("(hkey=%p,%d,%s,%p,%p,%p,%p)\n", hKey, dwIndex,
1879 debugstr_a(lpszValue), pwLen, pwType, pvData, pcbData);
1880
1881 return RegEnumValueA(hKey, dwIndex, lpszValue, pwLen, NULL,
1882 pwType, pvData, pcbData);
1883}
LONG WINAPI RegEnumValueA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpdwReserved, _Out_opt_ LPDWORD lpdwType, _Out_opt_ LPBYTE lpData, _Inout_opt_ LPDWORD lpcbData)
Definition: reg.c:2668
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
_In_ _Out_writes_opt_ pcchValueName _Inout_opt_ LPDWORD _Out_opt_ _Out_writes_bytes_to_opt_ pcbData _Inout_opt_ LPDWORD pcbData
Definition: shlwapi.h:757

◆ SHEnumValueW()

LONG WINAPI SHEnumValueW ( HKEY  hKey,
DWORD  dwIndex,
LPWSTR  lpszValue,
LPDWORD  pwLen,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pcbData 
)

Definition at line 1890 of file reg.c.

1893{
1894 TRACE("(hkey=%p,%d,%s,%p,%p,%p,%p)\n", hKey, dwIndex,
1895 debugstr_w(lpszValue), pwLen, pwType, pvData, pcbData);
1896
1897 return RegEnumValueW(hKey, dwIndex, lpszValue, pwLen, NULL,
1898 pwType, pvData, pcbData);
1899}

◆ SHGetValueA()

DWORD WINAPI SHGetValueA ( HKEY  hKey,
LPCSTR  lpszSubKey,
LPCSTR  lpszValue,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pcbData 
)

Definition at line 1249 of file reg.c.

1251{
1252 DWORD dwRet = 0;
1253 HKEY hSubKey = 0;
1254
1255 TRACE("(hkey=%p,%s,%s,%p,%p,%p)\n", hKey, debugstr_a(lpszSubKey),
1256 debugstr_a(lpszValue), pwType, pvData, pcbData);
1257
1258 /* lpszSubKey can be 0. In this case the value is taken from the
1259 * current key.
1260 */
1261 if(lpszSubKey)
1262 dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey);
1263
1264 if (! dwRet)
1265 {
1266 /* SHQueryValueEx expands Environment strings */
1267 dwRet = SHQueryValueExA(hSubKey ? hSubKey : hKey, lpszValue, 0, pwType, pvData, pcbData);
1268 if (hSubKey) RegCloseKey(hSubKey);
1269 }
1270 return dwRet;
1271}
DWORD WINAPI SHQueryValueExA(HKEY hKey, LPCSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1444
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019

Referenced by getregdw(), MIME_GetExtensionA(), PathIsContentTypeA(), SHGetValueGoodBootA(), SHLWAPI_GetMappedFlags(), SHLWAPI_GetRegistryCompatFlags(), SHLWAPI_UseSystemForSystemFolders(), SHRegGetPathA(), and test_SHGetValue().

◆ SHGetValueGoodBootA()

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

Definition at line 1919 of file reg.c.

1921{
1924 return SHGetValueA(hkey, pSubKey, pValue, pwType, pvData, pbData);
1925}
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
PWCHAR pValue
#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 1932 of file reg.c.

1934{
1937 return SHGetValueW(hkey, pSubKey, pValue, pwType, pvData, pbData);
1938}

◆ SHGetValueW()

DWORD WINAPI SHGetValueW ( HKEY  hKey,
LPCWSTR  lpszSubKey,
LPCWSTR  lpszValue,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pcbData 
)

Definition at line 1278 of file reg.c.

1280{
1281 DWORD dwRet = 0;
1282 HKEY hSubKey = 0;
1283
1284 TRACE("(hkey=%p,%s,%s,%p,%p,%p)\n", hKey, debugstr_w(lpszSubKey),
1285 debugstr_w(lpszValue), pwType, pvData, pcbData);
1286
1287 if(lpszSubKey)
1288 dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey);
1289
1290 if (! dwRet)
1291 {
1292 dwRet = SHQueryValueExW(hSubKey ? hSubKey : hKey, lpszValue, 0, pwType, pvData, pcbData);
1293 if (hSubKey) RegCloseKey(hSubKey);
1294 }
1295 return dwRet;
1296}
DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1503

Referenced by CDesktopUpgradePropertyBag::_AlreadyUpgraded(), CBandSiteMenu::_CreateMenuPart(), CViewStatePropertyBag::_GetMRUSize(), CMruShortList::_InitSlots(), CMruLongList::_InitSlots(), CMruBase::_LoadItem(), CMruPidlList::_LoadNodeSlots(), CRegPropertyBag::_ReadBinary(), CRegPropertyBag::_ReadDword(), CDesktopUpgradePropertyBag::_ReadFlags(), CRegPropertyBag::_ReadString(), Candidate_SHGetRestriction(), GetAssocClass(), CRegFolder::GetDisplayNameOf(), CMruNode::GetNodeSlot(), GetZipCodePage(), HCR_GetExecuteCommandW(), InitializeServerAdminUI(), TaskbarSettings::Load(), MIME_GetExtensionW(), MRUList_Check(), MRUList_DataList(), MRUList_PidlList_0(), PathIsContentTypeW(), CRegPropertyBag::Read(), SHAboutInfoW(), SHCreatePropSheetExtArrayEx(), SHELL32_ReadRegShellState(), SHELL_GetCachedComputerDescription(), SHGetRestriction(), SHGetValueGoodBootW(), SHRegGetPathW(), SIC_GetMetricsValue(), and CDefView::UpdateListColors().

◆ SHQueryInfoKeyA()

LONG WINAPI SHQueryInfoKeyA ( HKEY  hKey,
LPDWORD  pwSubKeys,
LPDWORD  pwSubKeyMax,
LPDWORD  pwValues,
LPDWORD  pwValueMax 
)

Definition at line 1379 of file reg.c.

1381{
1382 TRACE("(hkey=%p,%p,%p,%p,%p)\n", hKey, pwSubKeys, pwSubKeyMax,
1383 pwValues, pwValueMax);
1384 return RegQueryInfoKeyA(hKey, NULL, NULL, NULL, pwSubKeys, pwSubKeyMax,
1385 NULL, pwValues, pwValueMax, NULL, NULL, NULL);
1386}

◆ SHQueryInfoKeyW()

LONG WINAPI SHQueryInfoKeyW ( HKEY  hKey,
LPDWORD  pwSubKeys,
LPDWORD  pwSubKeyMax,
LPDWORD  pwValues,
LPDWORD  pwValueMax 
)

Definition at line 1393 of file reg.c.

1395{
1396 TRACE("(hkey=%p,%p,%p,%p,%p)\n", hKey, pwSubKeys, pwSubKeyMax,
1397 pwValues, pwValueMax);
1398 return RegQueryInfoKeyW(hKey, NULL, NULL, NULL, pwSubKeys, pwSubKeyMax,
1399 NULL, pwValues, pwValueMax, NULL, NULL, NULL);
1400}

◆ SHQueryValueExA()

DWORD WINAPI SHQueryValueExA ( HKEY  hKey,
LPCSTR  lpszValue,
LPDWORD  lpReserved,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pcbData 
)

Definition at line 1444 of file reg.c.

1447{
1448 DWORD dwRet, dwType, dwUnExpDataLen = 0, dwExpDataLen;
1449
1450 TRACE("(hkey=%p,%s,%p,%p,%p,%p=%d)\n", hKey, debugstr_a(lpszValue),
1451 lpReserved, pwType, pvData, pcbData, pcbData ? *pcbData : 0);
1452
1453 if (pcbData) dwUnExpDataLen = *pcbData;
1454
1455 dwRet = RegQueryValueExA(hKey, lpszValue, lpReserved, &dwType, pvData, &dwUnExpDataLen);
1456
1457 if (pcbData && (dwType == REG_EXPAND_SZ))
1458 {
1459 DWORD nBytesToAlloc;
1460
1461 /* Expand type REG_EXPAND_SZ into REG_SZ */
1462 LPSTR szData;
1463
1464 /* If the caller didn't supply a buffer or the buffer is too small we have
1465 * to allocate our own
1466 */
1467 if ((!pvData) || (dwRet == ERROR_MORE_DATA) )
1468 {
1469 char cNull = '\0';
1470 nBytesToAlloc = dwUnExpDataLen;
1471
1472 szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc);
1473 RegQueryValueExA (hKey, lpszValue, lpReserved, NULL, (LPBYTE)szData, &nBytesToAlloc);
1474 dwExpDataLen = ExpandEnvironmentStringsA(szData, &cNull, 1);
1475 dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen);
1476 LocalFree(szData);
1477 }
1478 else
1479 {
1480 nBytesToAlloc = (lstrlenA(pvData)+1) * sizeof (CHAR);
1481 szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc);
1482 lstrcpyA(szData, pvData);
1483 dwExpDataLen = ExpandEnvironmentStringsA(szData, pvData, *pcbData / sizeof(CHAR));
1484 if (dwExpDataLen > *pcbData) dwRet = ERROR_MORE_DATA;
1485 dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen);
1486 LocalFree(szData);
1487 }
1488 }
1489
1490 /* Update the type and data size if the caller wanted them */
1491 if ( dwType == REG_EXPAND_SZ ) dwType = REG_SZ;
1492 if ( pwType ) *pwType = dwType;
1493 if ( pcbData ) *pcbData = dwUnExpDataLen;
1494 return dwRet;
1495}
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
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
Definition: environ.c:400
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define LMEM_ZEROINIT
Definition: minwinbase.h:85
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
char CHAR
Definition: pedump.c:57
#define max(a, b)
Definition: svc.c:63
unsigned char * LPBYTE
Definition: typedefs.h:53
char * LPSTR
Definition: typedefs.h:51
_In_ DWORD _In_ int _In_ int _In_opt_ LPNLSVERSIONINFO _In_opt_ LPVOID lpReserved
Definition: winnls.h:1268

Referenced by SHADD_get_policy(), SHGetValueA(), SHRegQueryValueExA(), test_SHCopyKey(), and test_SHQueryValueEx().

◆ SHQueryValueExW()

DWORD WINAPI SHQueryValueExW ( HKEY  hKey,
LPCWSTR  lpszValue,
LPDWORD  lpReserved,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pcbData 
)

Definition at line 1503 of file reg.c.

1506{
1507 DWORD dwRet, dwType, dwUnExpDataLen = 0, dwExpDataLen;
1508
1509 TRACE("(hkey=%p,%s,%p,%p,%p,%p=%d)\n", hKey, debugstr_w(lpszValue),
1510 lpReserved, pwType, pvData, pcbData, pcbData ? *pcbData : 0);
1511
1512 if (pcbData) dwUnExpDataLen = *pcbData;
1513
1514 dwRet = RegQueryValueExW(hKey, lpszValue, lpReserved, &dwType, pvData, &dwUnExpDataLen);
1515 if (dwRet!=ERROR_SUCCESS && dwRet!=ERROR_MORE_DATA)
1516 return dwRet;
1517
1518 if (pcbData && (dwType == REG_EXPAND_SZ))
1519 {
1520 DWORD nBytesToAlloc;
1521
1522 /* Expand type REG_EXPAND_SZ into REG_SZ */
1523 LPWSTR szData;
1524
1525 /* If the caller didn't supply a buffer or the buffer is too small we have
1526 * to allocate our own
1527 */
1528 if ((!pvData) || (dwRet == ERROR_MORE_DATA) )
1529 {
1530 WCHAR cNull = '\0';
1531 nBytesToAlloc = dwUnExpDataLen;
1532
1533 szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc);
1534 RegQueryValueExW (hKey, lpszValue, lpReserved, NULL, (LPBYTE)szData, &nBytesToAlloc);
1535 dwExpDataLen = ExpandEnvironmentStringsW(szData, &cNull, 1);
1536 dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen);
1537 LocalFree(szData);
1538 }
1539 else
1540 {
1541 nBytesToAlloc = (lstrlenW(pvData) + 1) * sizeof(WCHAR);
1542 szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc);
1543 lstrcpyW(szData, pvData);
1544 dwExpDataLen = ExpandEnvironmentStringsW(szData, pvData, *pcbData/sizeof(WCHAR) );
1545 if (dwExpDataLen > *pcbData) dwRet = ERROR_MORE_DATA;
1546 dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen);
1547 LocalFree(szData);
1548 }
1549 }
1550
1551 /* Update the type and data size if the caller wanted them */
1552 if ( dwType == REG_EXPAND_SZ ) dwType = REG_SZ;
1553 if ( pwType ) *pwType = dwType;
1554 if ( pcbData ) *pcbData = dwUnExpDataLen;
1555 return dwRet;
1556}
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
#define lstrcpyW
Definition: compat.h:749
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:520
uint16_t * LPWSTR
Definition: typedefs.h:56

Referenced by CFSExtractIcon_CreateInstance(), CQueryAssociations::GetValue(), IsOS(), read_advanced_key(), SH32_CoCreateInstance(), SHELL_ReadSingleUnreadMailCount(), SHGetValueW(), SHRegGetIntW(), SHRegQueryValueExW(), SKAllocValueW(), and SKGetValueW().

◆ SHRegCloseUSKey()

LONG WINAPI SHRegCloseUSKey ( HUSKEY  hUSKey)

Definition at line 190 of file reg.c.

192{
193 LPSHUSKEY hKey = hUSKey;
195
196 if (!hKey)
198
199 if (hKey->HKCUkey)
200 ret = RegCloseKey(hKey->HKCUkey);
201 if (hKey->HKCUstart && hKey->HKCUstart != HKEY_CURRENT_USER)
202 ret = RegCloseKey(hKey->HKCUstart);
203 if (hKey->HKLMkey)
204 ret = RegCloseKey(hKey->HKLMkey);
205 if (hKey->HKLMstart && hKey->HKLMstart != HKEY_LOCAL_MACHINE)
206 ret = RegCloseKey(hKey->HKLMstart);
207
209 return ret;
210}
return ret
Definition: mutex.c:146
long LONG
Definition: pedump.c:60

Referenced by SHRegGetUSValueA(), SHRegGetUSValueW(), SHRegOpenUSKeyW(), SHRegSetUSValueA(), and SHRegSetUSValueW().

◆ SHRegCreateUSKeyA()

LONG WINAPI SHRegCreateUSKeyA ( LPCSTR  path,
REGSAM  samDesired,
HUSKEY  relative_key,
PHUSKEY  new_uskey,
DWORD  flags 
)

Definition at line 217 of file reg.c.

219{
220 WCHAR *pathW;
221 LONG ret;
222
223 TRACE("(%s, 0x%08x, %p, %p, 0x%08x)\n", debugstr_a(path), samDesired, relative_key,
224 new_uskey, flags);
225
226 if (path)
227 {
228 INT len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0);
229 pathW = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
230 if (!pathW)
233 }
234 else
235 pathW = NULL;
236
237 ret = SHRegCreateUSKeyW(pathW, samDesired, relative_key, new_uskey, flags);
239 return ret;
240}
LONG WINAPI SHRegCreateUSKeyW(LPCWSTR path, REGSAM samDesired, HUSKEY relative_key, PHUSKEY new_uskey, DWORD flags)
Definition: reg.c:258
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR pathW[]
Definition: path.c:2368
int32_t INT
Definition: typedefs.h:58

◆ SHRegCreateUSKeyW()

LONG WINAPI SHRegCreateUSKeyW ( LPCWSTR  path,
REGSAM  samDesired,
HUSKEY  relative_key,
PHUSKEY  new_uskey,
DWORD  flags 
)

Definition at line 258 of file reg.c.

260{
262 SHUSKEY *ret_key;
263
264 TRACE("(%s, 0x%08x, %p, %p, 0x%08x)\n", debugstr_w(path), samDesired,
265 relative_key, new_uskey, flags);
266
267 if (!new_uskey) return ERROR_INVALID_PARAMETER;
268
269 *new_uskey = NULL;
270
272 {
273 FIXME("unsupported flags 0x%08x\n", flags);
274 return ERROR_SUCCESS;
275 }
276
277 ret_key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret_key));
278 lstrcpynW(ret_key->lpszPath, path, sizeof(ret_key->lpszPath)/sizeof(WCHAR));
279
280 if (relative_key)
281 {
284 }
285 else
286 {
287 ret_key->HKCUstart = HKEY_CURRENT_USER;
288 ret_key->HKLMstart = HKEY_LOCAL_MACHINE;
289 }
290
292 {
293 ret = RegCreateKeyExW(ret_key->HKCUstart, path, 0, NULL, 0, samDesired, NULL, &ret_key->HKCUkey, NULL);
294 if (ret == ERROR_SUCCESS)
295 *new_uskey = ret_key;
296 else
297 HeapFree(GetProcessHeap(), 0, ret_key);
298 }
299
300 return ret;
301}
#define FIXME(fmt,...)
Definition: precomp.h:53
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define lstrcpynW
Definition: compat.h:738
static HKEY REG_GetHKEYFromHUSKEY(HUSKEY hUSKey, BOOL which)
Definition: reg.c:69
#define REG_HKLM
Definition: reg.c:62
HKEY WINAPI SHRegDuplicateHKey(HKEY hKey)
Definition: reg.c:2256
#define SHREGSET_FORCE_HKCU
Definition: shlwapi.h:720
WCHAR lpszPath[MAX_PATH]
Definition: reg.c:54
HKEY HKLMstart
Definition: reg.c:52
HKEY HKCUstart
Definition: reg.c:50

Referenced by SHRegCreateUSKeyA().

◆ SHRegDeleteEmptyUSKeyA()

LONG WINAPI SHRegDeleteEmptyUSKeyA ( HUSKEY  hUSKey,
LPCSTR  pszValue,
SHREGDEL_FLAGS  delRegFlags 
)

Definition at line 318 of file reg.c.

319{
320 FIXME("(%p, %s, 0x%08x) stub\n", hUSKey, debugstr_a(pszValue), delRegFlags);
321 return ERROR_SUCCESS;
322}
_In_opt_ LPCSTR _In_opt_ LPCSTR pszValue
Definition: shlwapi.h:783

◆ SHRegDeleteEmptyUSKeyW()

LONG WINAPI SHRegDeleteEmptyUSKeyW ( HUSKEY  hUSKey,
LPCWSTR  pszValue,
SHREGDEL_FLAGS  delRegFlags 
)

Definition at line 329 of file reg.c.

330{
331 FIXME("(%p, %s, 0x%08x) stub\n", hUSKey, debugstr_w(pszValue), delRegFlags);
332 return ERROR_SUCCESS;
333}

◆ SHRegDeleteUSValueA()

LONG WINAPI SHRegDeleteUSValueA ( HUSKEY  hUSKey,
LPCSTR  pszValue,
SHREGDEL_FLAGS  delRegFlags 
)

Definition at line 350 of file reg.c.

351{
352 FIXME("(%p, %s, 0x%08x) stub\n", hUSKey, debugstr_a(pszValue), delRegFlags);
353 return ERROR_SUCCESS;
354}

◆ SHRegDeleteUSValueW()

LONG WINAPI SHRegDeleteUSValueW ( HUSKEY  hUSKey,
LPCWSTR  pszValue,
SHREGDEL_FLAGS  delRegFlags 
)

Definition at line 361 of file reg.c.

362{
363 FIXME("(%p, %s, 0x%08x) stub\n", hUSKey, debugstr_w(pszValue), delRegFlags);
364 return ERROR_SUCCESS;
365}

◆ SHRegDuplicateHKey()

HKEY WINAPI SHRegDuplicateHKey ( HKEY  hKey)

Definition at line 2256 of file reg.c.

2257{
2258 HKEY newKey = 0;
2259
2260 RegOpenKeyExA(hKey, 0, 0, MAXIMUM_ALLOWED, &newKey);
2261 TRACE("new key is %p\n", newKey);
2262 return newKey;
2263}
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83

Referenced by CMruBase::InitData(), CDefaultContextMenu::Initialize(), SHRegCreateUSKeyW(), and SHRegOpenUSKeyW().

◆ SHRegEnumUSKeyA()

LONG WINAPI SHRegEnumUSKeyA ( HUSKEY  hUSKey,
DWORD  dwIndex,
LPSTR  pszName,
LPDWORD  pcchValueNameLen,
SHREGENUM_FLAGS  enumRegFlags 
)

Definition at line 920 of file reg.c.

926{
927 HKEY dokey;
928
929 TRACE("(%p,%d,%p,%p(%d),%d)\n",
930 hUSKey, dwIndex, pszName, pcchValueNameLen,
931 *pcchValueNameLen, enumRegFlags);
932
933 if (((enumRegFlags == SHREGENUM_HKCU) ||
934 (enumRegFlags == SHREGENUM_DEFAULT)) &&
935 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) {
936 return RegEnumKeyExA(dokey, dwIndex, pszName, pcchValueNameLen,
937 0, 0, 0, 0);
938 }
939
940 if (((enumRegFlags == SHREGENUM_HKLM) ||
941 (enumRegFlags == SHREGENUM_DEFAULT)) &&
942 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) {
943 return RegEnumKeyExA(dokey, dwIndex, pszName, pcchValueNameLen,
944 0, 0, 0, 0);
945 }
946 FIXME("no support for SHREGENUM_BOTH\n");
948}
@ SHREGENUM_HKCU
Definition: shlwapi.h:734
@ SHREGENUM_DEFAULT
Definition: shlwapi.h:733
@ SHREGENUM_HKLM
Definition: shlwapi.h:735

◆ SHRegEnumUSKeyW()

LONG WINAPI SHRegEnumUSKeyW ( HUSKEY  hUSKey,
DWORD  dwIndex,
LPWSTR  pszName,
LPDWORD  pcchValueNameLen,
SHREGENUM_FLAGS  enumRegFlags 
)

Definition at line 955 of file reg.c.

961{
962 HKEY dokey;
963
964 TRACE("(%p,%d,%p,%p(%d),%d)\n",
965 hUSKey, dwIndex, pszName, pcchValueNameLen,
966 *pcchValueNameLen, enumRegFlags);
967
968 if (((enumRegFlags == SHREGENUM_HKCU) ||
969 (enumRegFlags == SHREGENUM_DEFAULT)) &&
970 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) {
971 return RegEnumKeyExW(dokey, dwIndex, pszName, pcchValueNameLen,
972 0, 0, 0, 0);
973 }
974
975 if (((enumRegFlags == SHREGENUM_HKLM) ||
976 (enumRegFlags == SHREGENUM_DEFAULT)) &&
977 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) {
978 return RegEnumKeyExW(dokey, dwIndex, pszName, pcchValueNameLen,
979 0, 0, 0, 0);
980 }
981 FIXME("no support for SHREGENUM_BOTH\n");
983}

◆ SHRegEnumUSValueA()

LONG WINAPI SHRegEnumUSValueA ( HUSKEY  hUSKey,
DWORD  dwIndex,
LPSTR  pszValueName,
LPDWORD  pcchValueNameLen,
LPDWORD  pdwType,
LPVOID  pvData,
LPDWORD  pcbData,
SHREGENUM_FLAGS  enumRegFlags 
)

Definition at line 387 of file reg.c.

390{
391 HKEY dokey;
392
393 TRACE("(%p, 0x%08x, %p, %p, %p, %p, %p, 0x%08x)\n", hUSKey, dwIndex,
394 pszValueName, pcchValueNameLen, pdwType, pvData, pcbData, enumRegFlags);
395
396 if (((enumRegFlags == SHREGENUM_HKCU) ||
397 (enumRegFlags == SHREGENUM_DEFAULT)) &&
398 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) {
399 return RegEnumValueA(dokey, dwIndex, pszValueName, pcchValueNameLen,
401 }
402
403 if (((enumRegFlags == SHREGENUM_HKLM) ||
404 (enumRegFlags == SHREGENUM_DEFAULT)) &&
405 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) {
406 return RegEnumValueA(dokey, dwIndex, pszValueName, pcchValueNameLen,
408 }
409 FIXME("no support for SHREGENUM_BOTH\n");
411}
_In_opt_ LPCSTR _In_opt_ LPCSTR _In_ SRRF _Out_opt_ LPDWORD pdwType
Definition: shlwapi.h:783

◆ SHRegEnumUSValueW()

LONG WINAPI SHRegEnumUSValueW ( HUSKEY  hUSKey,
DWORD  dwIndex,
LPWSTR  pszValueName,
LPDWORD  pcchValueNameLen,
LPDWORD  pdwType,
LPVOID  pvData,
LPDWORD  pcbData,
SHREGENUM_FLAGS  enumRegFlags 
)

Definition at line 418 of file reg.c.

421{
422 HKEY dokey;
423
424 TRACE("(%p, 0x%08x, %p, %p, %p, %p, %p, 0x%08x)\n", hUSKey, dwIndex,
425 pszValueName, pcchValueNameLen, pdwType, pvData, pcbData, enumRegFlags);
426
427 if (((enumRegFlags == SHREGENUM_HKCU) ||
428 (enumRegFlags == SHREGENUM_DEFAULT)) &&
429 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) {
430 return RegEnumValueW(dokey, dwIndex, pszValueName, pcchValueNameLen,
432 }
433
434 if (((enumRegFlags == SHREGENUM_HKLM) ||
435 (enumRegFlags == SHREGENUM_DEFAULT)) &&
436 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) {
437 return RegEnumValueW(dokey, dwIndex, pszValueName, pcchValueNameLen,
439 }
440 FIXME("no support for SHREGENUM_BOTH\n");
442}

◆ SHRegGetBoolUSValueA()

BOOL WINAPI SHRegGetBoolUSValueA ( LPCSTR  pszSubKey,
LPCSTR  pszValue,
BOOL  fIgnoreHKCU,
BOOL  fDefault 
)

Definition at line 714 of file reg.c.

719{
720 DWORD type, datalen, work;
721 BOOL ret = fDefault;
722 CHAR data[10];
723
724 TRACE("key '%s', value '%s', %s\n",
726 (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM");
727
728 datalen = sizeof(data)-1;
730 data, &datalen,
731 fIgnoreHKCU, 0, 0)) {
732 /* process returned data via type into bool */
733 switch (type) {
734 case REG_SZ:
735 data[9] = '\0'; /* set end of string */
736 if (lstrcmpiA(data, "YES") == 0) ret = TRUE;
737 if (lstrcmpiA(data, "TRUE") == 0) ret = TRUE;
738 if (lstrcmpiA(data, "NO") == 0) ret = FALSE;
739 if (lstrcmpiA(data, "FALSE") == 0) ret = FALSE;
740 break;
741 case REG_DWORD:
742 work = *(LPDWORD)data;
743 ret = (work != 0);
744 break;
745 case REG_BINARY:
746 if (datalen == 1) {
747 ret = (data[0] != '\0');
748 break;
749 }
750 default:
751 FIXME("Unsupported registry data type %d\n", type);
752 ret = FALSE;
753 }
754 TRACE("got value (type=%d), returning <%s>\n", type,
755 (ret) ? "TRUE" : "FALSE");
756 }
757 else {
758 ret = fDefault;
759 TRACE("returning default data <%s>\n",
760 (ret) ? "TRUE" : "FALSE");
761 }
762 return ret;
763}
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4133
LONG WINAPI SHRegGetUSValueA(LPCSTR pSubKey, LPCSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData, BOOL flagIgnoreHKCU, LPVOID pDefaultData, DWORD wDefaultDataSize)
Definition: reg.c:561
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int const JOCTET unsigned int datalen
Definition: jpeglib.h:1033
#define REG_BINARY
Definition: nt_native.h:1499
#define LPDWORD
Definition: nt_native.h:46
_In_opt_ LPCSTR pszSubKey
Definition: shlwapi.h:783
#define REG_DWORD
Definition: sdbapi.c:615

◆ SHRegGetBoolUSValueW()

BOOL WINAPI SHRegGetBoolUSValueW ( LPCWSTR  pszSubKey,
LPCWSTR  pszValue,
BOOL  fIgnoreHKCU,
BOOL  fDefault 
)

Definition at line 770 of file reg.c.

775{
776 static const WCHAR wYES[]= {'Y','E','S','\0'};
777 static const WCHAR wTRUE[]= {'T','R','U','E','\0'};
778 static const WCHAR wNO[]= {'N','O','\0'};
779 static const WCHAR wFALSE[]={'F','A','L','S','E','\0'};
780 DWORD type, datalen, work;
781 BOOL ret = fDefault;
782 WCHAR data[10];
783
784 TRACE("key '%s', value '%s', %s\n",
786 (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM");
787
788 datalen = (sizeof(data)-1) * sizeof(WCHAR);
790 data, &datalen,
791 fIgnoreHKCU, 0, 0)) {
792 /* process returned data via type into bool */
793 switch (type) {
794 case REG_SZ:
795 data[9] = '\0'; /* set end of string */
796 if (lstrcmpiW(data, wYES)==0 || lstrcmpiW(data, wTRUE)==0)
797 ret = TRUE;
798 else if (lstrcmpiW(data, wNO)==0 || lstrcmpiW(data, wFALSE)==0)
799 ret = FALSE;
800 break;
801 case REG_DWORD:
802 work = *(LPDWORD)data;
803 ret = (work != 0);
804 break;
805 case REG_BINARY:
806 if (datalen == 1) {
807 ret = (data[0] != '\0');
808 break;
809 }
810 default:
811 FIXME("Unsupported registry data type %d\n", type);
812 ret = FALSE;
813 }
814 TRACE("got value (type=%d), returning <%s>\n", type,
815 (ret) ? "TRUE" : "FALSE");
816 }
817 else {
818 ret = fDefault;
819 TRACE("returning default data <%s>\n",
820 (ret) ? "TRUE" : "FALSE");
821 }
822 return ret;
823}
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
LONG WINAPI SHRegGetUSValueW(LPCWSTR pSubKey, LPCWSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData, BOOL flagIgnoreHKCU, LPVOID pDefaultData, DWORD wDefaultDataSize)
Definition: reg.c:594

◆ SHRegGetCLSIDKeyA()

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

Definition at line 2449 of file reg.c.

2450{
2451 WCHAR szValue[MAX_PATH];
2452
2453 if (lpszValue)
2454 MultiByteToWideChar(CP_ACP, 0, lpszValue, -1, szValue, sizeof(szValue)/sizeof(WCHAR));
2455
2456 return SHRegGetCLSIDKeyW(guid, lpszValue ? szValue : NULL, bUseHKCU, bCreate, phKey);
2457}
GUID guid
Definition: version.c:147
HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID, LPCWSTR, BOOL, BOOL, PHKEY)
Definition: reg.c:2464
_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 2464 of file reg.c.

2466{
2467#ifndef __REACTOS__
2468 static const WCHAR szClassIdKey[] = { 'S','o','f','t','w','a','r','e','\\',
2469 'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
2470 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
2471 'E','x','p','l','o','r','e','r','\\','C','L','S','I','D','\\' };
2472#endif
2473#define szClassIdKeyLen (sizeof(szClassIdKey)/sizeof(WCHAR))
2474 WCHAR szKey[MAX_PATH];
2475 DWORD dwRet;
2476 HKEY hkey;
2477
2478 /* Create the key string */
2479#ifdef __REACTOS__
2480 // https://www.geoffchappell.com/studies/windows/shell/shlwapi/api/reg/reggetclsidkey.htm
2481 WCHAR* ptr;
2482
2483 wcscpy(szKey, bUseHKCU ? L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\" : L"CLSID\\");
2484 ptr = szKey + wcslen(szKey);
2485 SHStringFromGUIDW(guid, ptr, 39); /* Append guid */
2486 if (lpszValue)
2487 {
2488 ptr = szKey + wcslen(szKey);
2489 wcscat(ptr, L"\\");
2490 wcscat(++ptr, lpszValue);
2491 }
2492#else
2493 memcpy(szKey, szClassIdKey, sizeof(szClassIdKey));
2494 SHStringFromGUIDW(guid, szKey + szClassIdKeyLen, 39); /* Append guid */
2495
2496 if(lpszValue)
2497 {
2498 szKey[szClassIdKeyLen + 39] = '\\';
2499 strcpyW(szKey + szClassIdKeyLen + 40, lpszValue); /* Append value name */
2500 }
2501#endif
2502
2503 hkey = bUseHKCU ? HKEY_CURRENT_USER : HKEY_CLASSES_ROOT;
2504
2505 if(bCreate)
2506 dwRet = RegCreateKeyW(hkey, szKey, phKey);
2507 else
2508 dwRet = RegOpenKeyExW(hkey, szKey, 0, KEY_READ, phKey);
2509
2510 return dwRet ? HRESULT_FROM_WIN32(dwRet) : S_OK;
2511}
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
INT WINAPI SHStringFromGUIDW(REFGUID, LPWSTR, INT)
Definition: ordinal.c:661
#define szClassIdKeyLen
#define L(x)
Definition: resources.c:13
static PVOID ptr
Definition: dispmode.c:27
wcscat
wcscpy
#define strcpyW(d, s)
Definition: unicode.h:29
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210

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

◆ SHRegGetIntW()

int WINAPI SHRegGetIntW ( HKEY  hKey,
LPCWSTR  lpszValue,
int  iDefault 
)

Definition at line 2416 of file reg.c.

2417{
2418 TRACE("(%p,%s,%d)\n", hKey, debugstr_w(lpszValue), iDefault);
2419
2420 if (hKey)
2421 {
2422 WCHAR szBuff[32];
2423 DWORD dwSize = sizeof(szBuff);
2424 szBuff[0] = '\0';
2425 SHQueryValueExW(hKey, lpszValue, 0, 0, szBuff, &dwSize);
2426
2427 if(*szBuff >= '0' && *szBuff <= '9')
2428 return StrToIntW(szBuff);
2429 }
2430 return iDefault;
2431}
INT WINAPI StrToIntW(LPCWSTR lpString)
Definition: string.c:407

Referenced by LoadCurrentScheme(), and LoadSchemeFromReg().

◆ SHRegGetPathA()

DWORD WINAPI SHRegGetPathA ( HKEY  hKey,
LPCSTR  lpszSubKey,
LPCSTR  lpszValue,
LPSTR  lpszPath,
DWORD  dwFlags 
)

Definition at line 1109 of file reg.c.

1111{
1113
1114 TRACE("(hkey=%p,%s,%s,%p,%d)\n", hKey, debugstr_a(lpszSubKey),
1115 debugstr_a(lpszValue), lpszPath, dwFlags);
1116
1117 return SHGetValueA(hKey, lpszSubKey, lpszValue, 0, lpszPath, &dwSize);
1118}
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141

◆ SHRegGetPathW()

DWORD WINAPI SHRegGetPathW ( HKEY  hKey,
LPCWSTR  lpszSubKey,
LPCWSTR  lpszValue,
LPWSTR  lpszPath,
DWORD  dwFlags 
)

Definition at line 1125 of file reg.c.

1127{
1129
1130 TRACE("(hkey=%p,%s,%s,%p,%d)\n", hKey, debugstr_w(lpszSubKey),
1131 debugstr_w(lpszValue), lpszPath, dwFlags);
1132
1133 return SHGetValueW(hKey, lpszSubKey, lpszValue, 0, lpszPath, &dwSize);
1134}

◆ SHRegGetUSValueA()

LONG WINAPI SHRegGetUSValueA ( LPCSTR  pSubKey,
LPCSTR  pValue,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pcbData,
BOOL  flagIgnoreHKCU,
LPVOID  pDefaultData,
DWORD  wDefaultDataSize 
)

Definition at line 561 of file reg.c.

570{
571 HUSKEY myhuskey;
572 LONG ret;
573
574 if (!pvData || !pcbData) return ERROR_INVALID_FUNCTION; /* FIXME:wrong*/
575 TRACE("key '%s', value '%s', datalen %d, %s\n",
576 debugstr_a(pSubKey), debugstr_a(pValue), *pcbData,
577 (flagIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM");
578
579 ret = SHRegOpenUSKeyA(pSubKey, 0x1, 0, &myhuskey, flagIgnoreHKCU);
580 if (ret == ERROR_SUCCESS) {
581 ret = SHRegQueryUSValueA(myhuskey, pValue, pwType, pvData,
582 pcbData, flagIgnoreHKCU, pDefaultData,
583 wDefaultDataSize);
584 SHRegCloseUSKey(myhuskey);
585 }
586 return ret;
587}
LONG WINAPI SHRegQueryUSValueA(HUSKEY hUSKey, LPCSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, LPVOID pvDefaultData, DWORD dwDefaultDataSize)
Definition: reg.c:453
LONG WINAPI SHRegOpenUSKeyA(LPCSTR Path, REGSAM AccessType, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU)
Definition: reg.c:106
LONG WINAPI SHRegCloseUSKey(HUSKEY hUSKey)
Definition: reg.c:190

Referenced by SHRegGetBoolUSValueA().

◆ SHRegGetUSValueW()

LONG WINAPI SHRegGetUSValueW ( LPCWSTR  pSubKey,
LPCWSTR  pValue,
LPDWORD  pwType,
LPVOID  pvData,
LPDWORD  pcbData,
BOOL  flagIgnoreHKCU,
LPVOID  pDefaultData,
DWORD  wDefaultDataSize 
)

Definition at line 594 of file reg.c.

603{
604 HUSKEY myhuskey;
605 LONG ret;
606
607 if (!pvData || !pcbData) return ERROR_INVALID_FUNCTION; /* FIXME:wrong*/
608 TRACE("key '%s', value '%s', datalen %d, %s\n",
609 debugstr_w(pSubKey), debugstr_w(pValue), *pcbData,
610 (flagIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM");
611
612 ret = SHRegOpenUSKeyW(pSubKey, 0x1, 0, &myhuskey, flagIgnoreHKCU);
613 if (ret == ERROR_SUCCESS) {
614 ret = SHRegQueryUSValueW(myhuskey, pValue, pwType, pvData,
615 pcbData, flagIgnoreHKCU, pDefaultData,
616 wDefaultDataSize);
617 SHRegCloseUSKey(myhuskey);
618 }
619 return ret;
620}
LONG WINAPI SHRegOpenUSKeyW(LPCWSTR Path, REGSAM AccessType, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU)
Definition: reg.c:123
LONG WINAPI SHRegQueryUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, LPVOID pvDefaultData, DWORD dwDefaultDataSize)
Definition: reg.c:504

Referenced by SHRegGetBoolUSValueW().

◆ SHRegisterValidateTemplate()

HRESULT WINAPI SHRegisterValidateTemplate ( LPCWSTR  filename,
BOOL  unknown 
)

Definition at line 2531 of file reg.c.

2532{
2533/* static const WCHAR szTemplateKey[] = { 'S','o','f','t','w','a','r','e','\\',
2534 * 'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
2535 * 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
2536 * 'E','x','p','l','o','r','e','r','\\',
2537 * 'T','e','m','p','l','a','t','e','R','e','g','i','s','t','r','y',0 };
2538 */
2539 FIXME("stub: %s, %08x\n", debugstr_w(filename), unknown);
2540
2541 return S_OK;
2542}
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
const char * filename
Definition: ioapi.h:137

◆ SHRegOpenUSKeyA()

LONG WINAPI SHRegOpenUSKeyA ( LPCSTR  Path,
REGSAM  AccessType,
HUSKEY  hRelativeUSKey,
PHUSKEY  phNewUSKey,
BOOL  fIgnoreHKCU 
)

Definition at line 106 of file reg.c.

108{
110
111 if (Path)
113
114 return SHRegOpenUSKeyW(Path ? szPath : NULL, AccessType, hRelativeUSKey,
115 phNewUSKey, fIgnoreHKCU);
116}
PRTL_UNICODE_STRING_BUFFER Path
LPCWSTR szPath
Definition: env.c:37

Referenced by SHRegGetUSValueA(), and SHRegSetUSValueA().

◆ SHRegOpenUSKeyW()

LONG WINAPI SHRegOpenUSKeyW ( LPCWSTR  Path,
REGSAM  AccessType,
HUSKEY  hRelativeUSKey,
PHUSKEY  phNewUSKey,
BOOL  fIgnoreHKCU 
)

Definition at line 123 of file reg.c.

125{
126 LONG ret2, ret1 = ~ERROR_SUCCESS;
128
129 TRACE("(%s,0x%x,%p,%p,%d)\n", debugstr_w(Path),(LONG)AccessType,
130 hRelativeUSKey, phNewUSKey, fIgnoreHKCU);
131
132 if (phNewUSKey)
133 *phNewUSKey = NULL;
134
135 /* Create internal HUSKEY */
137 lstrcpynW(hKey->lpszPath, Path, sizeof(hKey->lpszPath)/sizeof(WCHAR));
138
139 if (hRelativeUSKey)
140 {
141 hKey->HKCUstart = SHRegDuplicateHKey(REG_GetHKEYFromHUSKEY(hRelativeUSKey, REG_HKCU));
142 hKey->HKLMstart = SHRegDuplicateHKey(REG_GetHKEYFromHUSKEY(hRelativeUSKey, REG_HKLM));
143
144 /* FIXME: if either of these keys is NULL, create the start key from
145 * the relative keys start+path
146 */
147 }
148 else
149 {
150 hKey->HKCUstart = HKEY_CURRENT_USER;
151 hKey->HKLMstart = HKEY_LOCAL_MACHINE;
152 }
153
154 if (!fIgnoreHKCU)
155 {
156 ret1 = RegOpenKeyExW(hKey->HKCUstart, hKey->lpszPath, 0, AccessType, &hKey->HKCUkey);
157 if (ret1)
158 hKey->HKCUkey = 0;
159 }
160
161 ret2 = RegOpenKeyExW(hKey->HKLMstart, hKey->lpszPath, 0, AccessType, &hKey->HKLMkey);
162 if (ret2)
163 hKey->HKLMkey = 0;
164
165 if (ret1 || ret2)
166 TRACE("one or more opens failed: HKCU=%d HKLM=%d\n", ret1, ret2);
167
168 if (ret1 && ret2)
169 {
170 /* Neither open succeeded: fail */
172 return ret2;
173 }
174
175 TRACE("HUSKEY=%p\n", hKey);
176 if (phNewUSKey)
177 *phNewUSKey = hKey;
178 return ERROR_SUCCESS;
179}

Referenced by SHRegGetUSValueW(), SHRegOpenUSKeyA(), and SHRegSetUSValueW().

◆ SHRegQueryInfoUSKeyA()

LONG WINAPI SHRegQueryInfoUSKeyA ( HUSKEY  hUSKey,
LPDWORD  pcSubKeys,
LPDWORD  pcchMaxSubKeyLen,
LPDWORD  pcValues,
LPDWORD  pcchMaxValueNameLen,
SHREGENUM_FLAGS  enumRegFlags 
)

Definition at line 834 of file reg.c.

841{
842 HKEY dokey;
843 LONG ret;
844
845 TRACE("(%p,%p,%p,%p,%p,%d)\n",
846 hUSKey,pcSubKeys,pcchMaxSubKeyLen,pcValues,
847 pcchMaxValueNameLen,enumRegFlags);
848
849 /* if user wants HKCU, and it exists, then try it */
850 if (((enumRegFlags == SHREGENUM_HKCU) ||
851 (enumRegFlags == SHREGENUM_DEFAULT)) &&
852 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) {
853 ret = RegQueryInfoKeyA(dokey, 0, 0, 0,
854 pcSubKeys, pcchMaxSubKeyLen, 0,
855 pcValues, pcchMaxValueNameLen, 0, 0, 0);
856 if ((ret == ERROR_SUCCESS) ||
857 (enumRegFlags == SHREGENUM_HKCU))
858 return ret;
859 }
860 if (((enumRegFlags == SHREGENUM_HKLM) ||
861 (enumRegFlags == SHREGENUM_DEFAULT)) &&
862 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) {
863 return RegQueryInfoKeyA(dokey, 0, 0, 0,
864 pcSubKeys, pcchMaxSubKeyLen, 0,
865 pcValues, pcchMaxValueNameLen, 0, 0, 0);
866 }
868}

◆ SHRegQueryInfoUSKeyW()

LONG WINAPI SHRegQueryInfoUSKeyW ( HUSKEY  hUSKey,
LPDWORD  pcSubKeys,
LPDWORD  pcchMaxSubKeyLen,
LPDWORD  pcValues,
LPDWORD  pcchMaxValueNameLen,
SHREGENUM_FLAGS  enumRegFlags 
)

Definition at line 875 of file reg.c.

882{
883 HKEY dokey;
884 LONG ret;
885
886 TRACE("(%p,%p,%p,%p,%p,%d)\n",
887 hUSKey,pcSubKeys,pcchMaxSubKeyLen,pcValues,
888 pcchMaxValueNameLen,enumRegFlags);
889
890 /* if user wants HKCU, and it exists, then try it */
891 if (((enumRegFlags == SHREGENUM_HKCU) ||
892 (enumRegFlags == SHREGENUM_DEFAULT)) &&
893 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) {
894 ret = RegQueryInfoKeyW(dokey, 0, 0, 0,
895 pcSubKeys, pcchMaxSubKeyLen, 0,
896 pcValues, pcchMaxValueNameLen, 0, 0, 0);
897 if ((ret == ERROR_SUCCESS) ||
898 (enumRegFlags == SHREGENUM_HKCU))
899 return ret;
900 }
901 if (((enumRegFlags == SHREGENUM_HKLM) ||
902 (enumRegFlags == SHREGENUM_DEFAULT)) &&
903 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) {
904 return RegQueryInfoKeyW(dokey, 0, 0, 0,
905 pcSubKeys, pcchMaxSubKeyLen, 0,
906 pcValues, pcchMaxValueNameLen, 0, 0, 0);
907 }
909}

◆ SHRegQueryUSValueA()

LONG WINAPI SHRegQueryUSValueA ( HUSKEY  hUSKey,
LPCSTR  pszValue,
LPDWORD  pdwType,
LPVOID  pvData,
LPDWORD  pcbData,
BOOL  fIgnoreHKCU,
LPVOID  pvDefaultData,
DWORD  dwDefaultDataSize 
)

Definition at line 453 of file reg.c.

462{
463 LONG ret = ~ERROR_SUCCESS;
464 LONG i, maxmove;
465 HKEY dokey;
466 CHAR *src, *dst;
467
468 /* if user wants HKCU, and it exists, then try it */
469 if (!fIgnoreHKCU && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) {
470 ret = RegQueryValueExA(dokey,
472 TRACE("HKCU RegQueryValue returned %08x\n", ret);
473 }
474
475 /* if HKCU did not work and HKLM exists, then try it */
476 if ((ret != ERROR_SUCCESS) &&
477 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) {
478 ret = RegQueryValueExA(dokey,
480 TRACE("HKLM RegQueryValue returned %08x\n", ret);
481 }
482
483 /* if neither worked, and default data exists, then use it */
484 if (ret != ERROR_SUCCESS) {
485 if (pvDefaultData && (dwDefaultDataSize != 0)) {
487 src = pvDefaultData;
488 dst = pvData;
489 for(i=0; i<maxmove; i++) *dst++ = *src++;
490 *pcbData = maxmove;
491 TRACE("setting default data\n");
493 }
494 }
495 return ret;
496}
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
_In_opt_ _Inout_opt_ _Out_writes_bytes_to_opt_ pcbData _Inout_opt_ LPDWORD _In_ _In_ DWORD dwDefaultDataSize
Definition: shlwapi.h:781

Referenced by SHRegGetUSValueA().

◆ SHRegQueryUSValueW()

LONG WINAPI SHRegQueryUSValueW ( HUSKEY  hUSKey,
LPCWSTR  pszValue,
LPDWORD  pdwType,
LPVOID  pvData,
LPDWORD  pcbData,
BOOL  fIgnoreHKCU,
LPVOID  pvDefaultData,
DWORD  dwDefaultDataSize 
)

Definition at line 504 of file reg.c.

513{
514 LONG ret = ~ERROR_SUCCESS;
515 LONG i, maxmove;
516 HKEY dokey;
517 CHAR *src, *dst;
518
519 /* if user wants HKCU, and it exists, then try it */
520 if (!fIgnoreHKCU && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) {
521 ret = RegQueryValueExW(dokey,
523 TRACE("HKCU RegQueryValue returned %08x\n", ret);
524 }
525
526 /* if HKCU did not work and HKLM exists, then try it */
527 if ((ret != ERROR_SUCCESS) &&
528 (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) {
529 ret = RegQueryValueExW(dokey,
531 TRACE("HKLM RegQueryValue returned %08x\n", ret);
532 }
533
534 /* if neither worked, and default data exists, then use it */
535 if (ret != ERROR_SUCCESS) {
536 if (pvDefaultData && (dwDefaultDataSize != 0)) {
538 src = pvDefaultData;
539 dst = pvData;
540 for(i=0; i<maxmove; i++) *dst++ = *src++;
541 *pcbData = maxmove;
542 TRACE("setting default data\n");
544 }
545 }
546 return ret;
547}

Referenced by SHRegGetUSValueW().

◆ SHRegSetPathA()

DWORD WINAPI SHRegSetPathA ( HKEY  hKey,
LPCSTR  lpszSubKey,
LPCSTR  lpszValue,
LPCSTR  lpszPath,
DWORD  dwFlags 
)

Definition at line 1153 of file reg.c.

1155{
1156 char szBuff[MAX_PATH];
1157#ifdef __REACTOS__
1158 DWORD dwType;
1159 LPCSTR pszData;
1160 INT cch;
1161
1163
1164 if (PathUnExpandEnvStringsA(lpszPath, szBuff, _countof(szBuff)))
1165 {
1166 dwType = REG_EXPAND_SZ;
1167 pszData = szBuff;
1168 }
1169 else
1170 {
1171 dwType = REG_SZ;
1172 pszData = lpszPath;
1173 }
1174
1175 cch = lstrlenA(pszData);
1176 return SHSetValueA(hKey, lpszSubKey, lpszValue, dwType, pszData, (cch + 1) * sizeof(CHAR));
1177#else
1178 FIXME("(hkey=%p,%s,%s,%p,%d) - semi-stub\n",hKey, debugstr_a(lpszSubKey),
1179 debugstr_a(lpszValue), lpszPath, dwFlags);
1180
1181 lstrcpyA(szBuff, lpszPath);
1182
1183 /* FIXME: PathUnExpandEnvStringsA(szBuff); */
1184
1185 return SHSetValueA(hKey,lpszSubKey, lpszValue, REG_SZ, szBuff,
1186 lstrlenA(szBuff));
1187#endif
1188}
BOOL WINAPI PathUnExpandEnvStringsA(const char *path, char *buffer, UINT buf_len)
Definition: path.c:2665
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
_In_ UINT _In_ UINT cch
Definition: shellapi.h:432
#define _countof(array)
Definition: sndvol32.h:70
const char * LPCSTR
Definition: typedefs.h:52

◆ SHRegSetPathW()

DWORD WINAPI SHRegSetPathW ( HKEY  hKey,
LPCWSTR  lpszSubKey,
LPCWSTR  lpszValue,
LPCWSTR  lpszPath,
DWORD  dwFlags 
)

Definition at line 1195 of file reg.c.

1197{
1198 WCHAR szBuff[MAX_PATH];
1199#ifdef __REACTOS__
1200 DWORD dwType;
1201 LPCWSTR pszData;
1202 INT cch;
1203
1205
1206 if (PathUnExpandEnvStringsW(lpszPath, szBuff, _countof(szBuff)))
1207 {
1208 dwType = REG_EXPAND_SZ;
1209 pszData = szBuff;
1210 }
1211 else
1212 {
1213 dwType = REG_SZ;
1214 pszData = lpszPath;
1215 }
1216
1217 cch = lstrlenW(pszData);
1218 return SHSetValueW(hKey, lpszSubKey, lpszValue, dwType, pszData, (cch + 1) * sizeof(WCHAR));
1219#else
1220 FIXME("(hkey=%p,%s,%s,%p,%d) - semi-stub\n",hKey, debugstr_w(lpszSubKey),
1221 debugstr_w(lpszValue), lpszPath, dwFlags);
1222
1223 lstrcpyW(szBuff, lpszPath);
1224
1225 /* FIXME: PathUnExpandEnvStringsW(szBuff); */
1226
1227 return SHSetValueW(hKey,lpszSubKey, lpszValue, REG_SZ, szBuff,
1228 lstrlenW(szBuff));
1229#endif
1230}
BOOL WINAPI PathUnExpandEnvStringsW(const WCHAR *path, WCHAR *buffer, UINT buf_len)
Definition: path.c:2705
const uint16_t * LPCWSTR
Definition: typedefs.h:57

◆ SHRegSetUSValueA()

LONG WINAPI SHRegSetUSValueA ( LPCSTR  pszSubKey,
LPCSTR  pszValue,
DWORD  dwType,
LPVOID  pvData,
DWORD  cbData,
DWORD  dwFlags 
)

Definition at line 643 of file reg.c.

645{
646 BOOL ignoreHKCU = TRUE;
647 HUSKEY hkey;
648 LONG ret;
649
650 TRACE("(%s,%s,%d,%p,%d,0x%08x\n", debugstr_a(pszSubKey), debugstr_a(pszValue),
651 dwType, pvData, cbData, dwFlags);
652
653 if (!pvData)
655
657 ignoreHKCU = FALSE;
658
659 ret = SHRegOpenUSKeyA(pszSubKey, KEY_ALL_ACCESS, 0, &hkey, ignoreHKCU);
660 if (ret == ERROR_SUCCESS)
661 {
663 SHRegCloseUSKey(hkey);
664 }
665 return ret;
666}
LONG WINAPI SHRegWriteUSValueA(HUSKEY hUSKey, LPCSTR pszValue, DWORD dwType, LPVOID pvData, DWORD cbData, DWORD dwFlags)
Definition: reg.c:1007
#define SHREGSET_HKCU
Definition: shlwapi.h:719
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761

◆ SHRegSetUSValueW()

LONG WINAPI SHRegSetUSValueW ( LPCWSTR  pszSubKey,
LPCWSTR  pszValue,
DWORD  dwType,
LPVOID  pvData,
DWORD  cbData,
DWORD  dwFlags 
)

Definition at line 673 of file reg.c.

675{
676 BOOL ignoreHKCU = TRUE;
677 HUSKEY hkey;
678 LONG ret;
679
680 TRACE("(%s,%s,%d,%p,%d,0x%08x\n", debugstr_w(pszSubKey), debugstr_w(pszValue),
681 dwType, pvData, cbData, dwFlags);
682
683 if (!pvData)
685
687 ignoreHKCU = FALSE;
688
689 ret = SHRegOpenUSKeyW(pszSubKey, KEY_ALL_ACCESS, 0, &hkey, ignoreHKCU);
690 if (ret == ERROR_SUCCESS)
691 {
693 SHRegCloseUSKey(hkey);
694 }
695 return ret;
696}
LONG WINAPI SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, DWORD dwType, LPVOID pvData, DWORD cbData, DWORD dwFlags)
Definition: reg.c:1024

◆ SHRegWriteUSValueA()

LONG WINAPI SHRegWriteUSValueA ( HUSKEY  hUSKey,
LPCSTR  pszValue,
DWORD  dwType,
LPVOID  pvData,
DWORD  cbData,
DWORD  dwFlags 
)

Definition at line 1007 of file reg.c.

1009{
1010 WCHAR szValue[MAX_PATH];
1011
1012 if (pszValue)
1013 MultiByteToWideChar(CP_ACP, 0, pszValue, -1, szValue, MAX_PATH);
1014
1015 return SHRegWriteUSValueW(hUSKey, pszValue ? szValue : NULL, dwType,
1017}

Referenced by SHRegSetUSValueA().

◆ SHRegWriteUSValueW()

LONG WINAPI SHRegWriteUSValueW ( HUSKEY  hUSKey,
LPCWSTR  pszValue,
DWORD  dwType,
LPVOID  pvData,
DWORD  cbData,
DWORD  dwFlags 
)

Definition at line 1024 of file reg.c.

1026{
1027 DWORD dummy;
1028 LPSHUSKEY hKey = hUSKey;
1030
1031 TRACE("(%p,%s,%d,%p,%d,%d)\n", hUSKey, debugstr_w(pszValue),
1032 dwType, pvData, cbData, dwFlags);
1033
1034 if (!hUSKey || IsBadWritePtr(hUSKey, sizeof(SHUSKEY)) ||
1037
1039 {
1040 if (!hKey->HKCUkey)
1041 {
1042 /* Create the key */
1043 ret = RegCreateKeyW(hKey->HKCUstart, hKey->lpszPath, &hKey->HKCUkey);
1044 TRACE("Creating HKCU key, ret = %d\n", ret);
1045 if (ret && (dwFlags & (SHREGSET_FORCE_HKCU)))
1046 {
1047 hKey->HKCUkey = 0;
1048 return ret;
1049 }
1050 }
1051
1052 if (!ret)
1053 {
1054 if ((dwFlags & SHREGSET_FORCE_HKCU) ||
1056 {
1057 /* Doesn't exist or we are forcing: Write value */
1058 ret = RegSetValueExW(hKey->HKCUkey, pszValue, 0, dwType, pvData, cbData);
1059 TRACE("Writing HKCU value, ret = %d\n", ret);
1060 }
1061 }
1062 }
1063
1065 {
1066 if (!hKey->HKLMkey)
1067 {
1068 /* Create the key */
1069 ret = RegCreateKeyW(hKey->HKLMstart, hKey->lpszPath, &hKey->HKLMkey);
1070 TRACE("Creating HKLM key, ret = %d\n", ret);
1071 if (ret && (dwFlags & (SHREGSET_FORCE_HKLM)))
1072 {
1073 hKey->HKLMkey = 0;
1074 return ret;
1075 }
1076 }
1077
1078 if (!ret)
1079 {
1080 if ((dwFlags & SHREGSET_FORCE_HKLM) ||
1082 {
1083 /* Doesn't exist or we are forcing: Write value */
1084 ret = RegSetValueExW(hKey->HKLMkey, pszValue, 0, dwType, pvData, cbData);
1085 TRACE("Writing HKLM value, ret = %d\n", ret);
1086 }
1087 }
1088 }
1089
1090 return ret;
1091}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
Definition: except.c:883
#define SHREGSET_HKLM
Definition: shlwapi.h:721
#define SHREGSET_FORCE_HKLM
Definition: shlwapi.h:722

Referenced by SHRegSetUSValueW(), and SHRegWriteUSValueA().

◆ SHSetValueA()

DWORD WINAPI SHSetValueA ( HKEY  hKey,
LPCSTR  lpszSubKey,
LPCSTR  lpszValue,
DWORD  dwType,
LPCVOID  pvData,
DWORD  cbData 
)

Definition at line 1320 of file reg.c.

1322{
1323 DWORD dwRet = ERROR_SUCCESS, dwDummy;
1324 HKEY hSubKey;
1325
1326 TRACE("(hkey=%p,%s,%s,%d,%p,%d)\n", hKey, debugstr_a(lpszSubKey),
1327 debugstr_a(lpszValue), dwType, pvData, cbData);
1328
1329 if (lpszSubKey && *lpszSubKey)
1330 dwRet = RegCreateKeyExA(hKey, lpszSubKey, 0, NULL,
1331 0, KEY_SET_VALUE, NULL, &hSubKey, &dwDummy);
1332 else
1333 hSubKey = hKey;
1334 if (!dwRet)
1335 {
1336 dwRet = RegSetValueExA(hSubKey, lpszValue, 0, dwType, pvData, cbData);
1337 if (hSubKey != hKey)
1338 RegCloseKey(hSubKey);
1339 }
1340 return dwRet;
1341}
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4799
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
Definition: reg.c:1034

Referenced by RegisterExtensionForMIMETypeA(), RegisterMIMETypeForExtensionA(), and SHRegSetPathA().

◆ SHSetValueW()

DWORD WINAPI SHSetValueW ( HKEY  hKey,
LPCWSTR  lpszSubKey,
LPCWSTR  lpszValue,
DWORD  dwType,
LPCVOID  pvData,
DWORD  cbData 
)

Definition at line 1348 of file reg.c.

1350{
1351 DWORD dwRet = ERROR_SUCCESS, dwDummy;
1352 HKEY hSubKey;
1353
1354 TRACE("(hkey=%p,%s,%s,%d,%p,%d)\n", hKey, debugstr_w(lpszSubKey),
1355 debugstr_w(lpszValue), dwType, pvData, cbData);
1356
1357 if (lpszSubKey && *lpszSubKey)
1358 dwRet = RegCreateKeyExW(hKey, lpszSubKey, 0, NULL,
1359 0, KEY_SET_VALUE, NULL, &hSubKey, &dwDummy);
1360 else
1361 hSubKey = hKey;
1362 if (!dwRet)
1363 {
1364 dwRet = RegSetValueExW(hSubKey, lpszValue, 0, dwType, pvData, cbData);
1365 if (hSubKey != hKey)
1366 RegCloseKey(hSubKey);
1367 }
1368 return dwRet;
1369}

Referenced by CMruBase::_AddItem(), CDesktopUpgradePropertyBag::_MarkAsUpgraded(), CMruPidlList::_SaveNodeSlots(), CMruShortList::_SaveSlots(), CMruLongList::_SaveSlots(), CRegPropertyBag::_WriteStream(), ApplyScheme(), CRegTreeOptions::GetSetState(), InitializeServerAdminUI(), MRUList_DataList(), RegisterExtensionForMIMETypeW(), RegisterMIMETypeForExtensionW(), TaskbarSettings::Save(), CGlobalFolderSettings::Save(), CRegFolder::SetNameOf(), CMruNode::SetNodeSlot(), SetUnreadMailInfo(), SHCopyKeyW(), SHELL32_WriteRegShellState(), SHELL_CacheComputerDescription(), SHGetSetSettings(), SHRegSetPathW(), and CRegPropertyBag::Write().

◆ SHStringFromGUIDW()

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

Definition at line 661 of file ordinal.c.

662{
663 WCHAR xguid[40];
664 INT iLen;
665 static const WCHAR wszFormat[] = {'{','%','0','8','l','X','-','%','0','4','X','-','%','0','4','X','-',
666 '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','%','0','2','X','%','0','2',
667 'X','%','0','2','X','%','0','2','X','}',0};
668
669 TRACE("(%s,%p,%d)\n", debugstr_guid(guid), lpszDest, cchMax);
670
671 sprintfW(xguid, wszFormat, guid->Data1, guid->Data2, guid->Data3,
672 guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
673 guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
674
675 iLen = strlenW(xguid) + 1;
676
677 if (iLen > cchMax)
678 return 0;
679 memcpy(lpszDest, xguid, iLen*sizeof(WCHAR));
680 return iLen;
681}
UINT cchMax
WCHAR lpszDest[260]
#define debugstr_guid
Definition: kernel32.h:35
#define sprintfW
Definition: unicode.h:58

Referenced by SHRegGetCLSIDKeyW().

◆ UnregisterExtensionForMIMETypeA()

BOOL WINAPI UnregisterExtensionForMIMETypeA ( LPCSTR  lpszType)

Definition at line 2206 of file reg.c.

2207{
2208 char szKey[MAX_PATH];
2209
2210 TRACE("(%s)\n", debugstr_a(lpszType));
2211
2212 if (!GetMIMETypeSubKeyA(lpszType, szKey, MAX_PATH)) /* Get full path to the key */
2213 return FALSE;
2214
2216 return FALSE;
2217
2219 return FALSE;
2220 return TRUE;
2221}
DWORD WINAPI SHDeleteOrphanKeyA(HKEY hKey, LPCSTR lpszSubKey)
Definition: reg.c:1716
DWORD WINAPI SHDeleteValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue)
Definition: reg.c:1783

◆ UnregisterExtensionForMIMETypeW()

BOOL WINAPI UnregisterExtensionForMIMETypeW ( LPCWSTR  lpszType)

Definition at line 2228 of file reg.c.

2229{
2230 WCHAR szKey[MAX_PATH];
2231
2232 TRACE("(%s)\n", debugstr_w(lpszType));
2233
2234 if (!GetMIMETypeSubKeyW(lpszType, szKey, MAX_PATH)) /* Get full path to the key */
2235 return FALSE;
2236
2238 return FALSE;
2239
2241 return FALSE;
2242 return TRUE;
2243}
DWORD WINAPI SHDeleteValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue)
Definition: reg.c:1804
DWORD WINAPI SHDeleteOrphanKeyW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1745

◆ UnregisterMIMETypeForExtensionA()

BOOL WINAPI UnregisterMIMETypeForExtensionA ( LPCSTR  lpszSubKey)

Definition at line 1994 of file reg.c.

1995{
1997}

◆ UnregisterMIMETypeForExtensionW()

BOOL WINAPI UnregisterMIMETypeForExtensionW ( LPCWSTR  lpszSubKey)

Definition at line 2004 of file reg.c.

2005{
2007}

◆ 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().