Use the Unicode string functions from wine/unicode.h instead of the
[wine.git] / dlls / shell32 / shellreg.c
blob450f0386dd64e9ebaa1dd21490bd50496907a994
1 /*
2 Shell Registry Access
3 */
4 #include <string.h>
5 #include <stdio.h>
6 #include "winerror.h"
7 #include "winreg.h"
8 #include "debugtools.h"
9 #include "winnls.h"
10 #include "winversion.h"
11 #include "heap.h"
13 #include "shellapi.h"
14 #include "shlobj.h"
15 #include "shell32_main.h"
16 #include "wine/undocshell.h"
18 DEFAULT_DEBUG_CHANNEL(shell);
20 /*************************************************************************
21 * SHRegOpenKeyA [SHELL32.506]
24 HRESULT WINAPI SHRegOpenKeyA(
25 HKEY hKey,
26 LPSTR lpSubKey,
27 LPHKEY phkResult)
29 TRACE("(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
30 return RegOpenKeyA(hKey, lpSubKey, phkResult);
33 /*************************************************************************
34 * SHRegOpenKeyW [NT4.0:SHELL32.507]
37 HRESULT WINAPI SHRegOpenKeyW (
38 HKEY hkey,
39 LPCWSTR lpszSubKey,
40 LPHKEY retkey)
42 WARN("0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
43 return RegOpenKeyW( hkey, lpszSubKey, retkey );
46 /*************************************************************************
47 * SHRegQueryValueExA SHQueryValueExA [SHELL32.509][SHLWAPI.@]
50 HRESULT WINAPI SHRegQueryValueExA(
51 HKEY hkey,
52 LPSTR lpValueName,
53 LPDWORD lpReserved,
54 LPDWORD lpType,
55 LPBYTE lpData,
56 LPDWORD lpcbData)
58 TRACE("0x%04x %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
59 return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
62 /*************************************************************************
63 * SHRegQueryValueW [NT4.0:SHELL32.510]
66 HRESULT WINAPI SHRegQueryValueW(
67 HKEY hkey,
68 LPWSTR lpszSubKey,
69 LPWSTR lpszData,
70 LPDWORD lpcbData )
72 WARN("0x%04x %s %p %p semi-stub\n",
73 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
74 return RegQueryValueW( hkey, lpszSubKey, lpszData, lpcbData );
77 /*************************************************************************
78 * SHRegQueryValueExW, SHQueryValueExW [NT4.0:SHELL32.511][SHLWAPI.@]
80 * FIXME
81 * if the datatype REG_EXPAND_SZ then expand the string and change
82 * *pdwType to REG_SZ.
84 HRESULT WINAPI SHRegQueryValueExW (
85 HKEY hkey,
86 LPWSTR pszValue,
87 LPDWORD pdwReserved,
88 LPDWORD pdwType,
89 LPVOID pvData,
90 LPDWORD pcbData)
92 DWORD ret;
93 WARN("0x%04x %s %p %p %p %p semi-stub\n",
94 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
95 ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
96 return ret;
99 /* SHGetValue: Gets a value from the registry */
101 /*************************************************************************
102 * SHGetValueA
104 * Gets a value from the registry
106 DWORD WINAPI SHGetValueA(
107 HKEY hkey,
108 LPCSTR pSubKey,
109 LPCSTR pValue,
110 LPDWORD pwType,
111 LPVOID pvData,
112 LPDWORD pbData)
114 HKEY hSubKey;
115 DWORD res;
117 TRACE("(%s %s)\n", pSubKey, pValue);
119 if((res = RegOpenKeyA(hkey, pSubKey, &hSubKey))) return res;
120 res = RegQueryValueExA(hSubKey, pValue, 0, pwType, pvData, pbData);
121 RegCloseKey( hSubKey );
123 return res;
126 /*************************************************************************
127 * SHGetValueW
129 * Gets a value from the registry
131 DWORD WINAPI SHGetValueW(
132 HKEY hkey,
133 LPCWSTR pSubKey,
134 LPCWSTR pValue,
135 LPDWORD pwType,
136 LPVOID pvData,
137 LPDWORD pbData)
139 HKEY hSubKey;
140 DWORD res;
142 TRACE("(%s %s)\n", debugstr_w(pSubKey), debugstr_w(pValue));
144 if((res = RegOpenKeyW(hkey, pSubKey, &hSubKey))) return res;
145 res = RegQueryValueExW(hSubKey, pValue, 0, pwType, pvData, pbData);
146 RegCloseKey( hSubKey );
148 return res;
151 /* gets a user-specific registry value. */
153 /*************************************************************************
154 * SHRegGetUSValueA
156 * Gets a user-specific registry value
158 LONG WINAPI SHRegGetUSValueA(
159 LPCSTR pSubKey,
160 LPCSTR pValue,
161 LPDWORD pwType,
162 LPVOID pvData,
163 LPDWORD pbData,
164 BOOL fIgnoreHKCU,
165 LPVOID pDefaultData,
166 DWORD wDefaultDataSize)
168 FIXME("(%p),stub!\n", pSubKey);
169 return ERROR_SUCCESS; /* return success */
172 /*************************************************************************
173 * SHRegGetUSValueW
175 * Gets a user-specific registry value
177 LONG WINAPI SHRegGetUSValueW(
178 LPCWSTR pSubKey,
179 LPCWSTR pValue,
180 LPDWORD pwType,
181 LPVOID pvData,
182 LPDWORD pbData,
183 BOOL flagIgnoreHKCU,
184 LPVOID pDefaultData,
185 DWORD wDefaultDataSize)
187 FIXME("(%p),stub!\n", pSubKey);
188 return ERROR_SUCCESS; /* return success */
191 /*************************************************************************
192 * SHRegGetBoolUSValueA
194 BOOL WINAPI SHRegGetBoolUSValueA(
195 LPCSTR pszSubKey,
196 LPCSTR pszValue,
197 BOOL fIgnoreHKCU,
198 BOOL fDefault)
200 FIXME("%s %s\n", pszSubKey,pszValue);
201 return fDefault;
204 /*************************************************************************
205 * SHRegGetBoolUSValueW
207 BOOL WINAPI SHRegGetBoolUSValueW(
208 LPCWSTR pszSubKey,
209 LPCWSTR pszValue,
210 BOOL fIgnoreHKCU,
211 BOOL fDefault)
213 FIXME("%s %s\n", debugstr_w(pszSubKey),debugstr_w(pszValue));
214 return fDefault;
217 /*************************************************************************
218 * SHRegQueryUSValueA [SHLWAPI]
220 LONG WINAPI SHRegQueryUSValueA(
221 HKEY/*HUSKEY*/ hUSKey,
222 LPCSTR pszValue,
223 LPDWORD pdwType,
224 void *pvData,
225 LPDWORD pcbData,
226 BOOL fIgnoreHKCU,
227 void *pvDefaultData,
228 DWORD dwDefaultDataSize)
230 FIXME("%s stub\n",pszValue);
231 return 1;
234 /*************************************************************************
235 * SHRegGetPathA
237 DWORD WINAPI SHRegGetPathA(
238 HKEY hKey,
239 LPCSTR pcszSubKey,
240 LPCSTR pcszValue,
241 LPSTR pszPath,
242 DWORD dwFlags)
244 FIXME("%s %s\n", pcszSubKey, pcszValue);
245 return 0;
248 /*************************************************************************
249 * SHRegGetPathW
251 DWORD WINAPI SHRegGetPathW(
252 HKEY hKey,
253 LPCWSTR pcszSubKey,
254 LPCWSTR pcszValue,
255 LPWSTR pszPath,
256 DWORD dwFlags)
258 FIXME("%s %s\n", debugstr_w(pcszSubKey), debugstr_w(pcszValue));
259 return 0;
261 /*************************************************************************
262 * SHRegDeleteKeyA and SHDeleteKeyA
264 HRESULT WINAPI SHRegDeleteKeyA(
265 HKEY hkey,
266 LPCSTR pszSubKey)
268 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
269 return 0;
272 /*************************************************************************
273 * SHRegDeleteKeyW and SHDeleteKeyA
275 HRESULT WINAPI SHRegDeleteKeyW(
276 HKEY hkey,
277 LPCWSTR pszSubKey)
279 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
280 return 0;
283 /*************************************************************************
284 * SHSetValueA [SHLWAPI]
286 DWORD WINAPI SHSetValueA(
287 HKEY hkey,
288 LPCSTR pszSubKey,
289 LPCSTR pszValue,
290 DWORD dwType,
291 LPCVOID pvData,
292 DWORD cbData)
294 FIXME("(%s %s)stub\n",pszSubKey, pszValue);
295 return 1;
298 /*************************************************************************
299 * SHRegCloseKey [NT4.0:SHELL32.505]
302 HRESULT WINAPI SHRegCloseKey (HKEY hkey)
304 TRACE("0x%04x\n",hkey);
305 return RegCloseKey( hkey );