Pass the main exe name in the CREATE_PROCESS debug event.
[wine.git] / dlls / shell32 / shellreg.c
blob9ca6f8d025979a8f95bd8f29c76a33f547c1ae2f
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"
12 #include "crtdll.h"
14 #include "shellapi.h"
15 #include "shlobj.h"
16 #include "shell32_main.h"
17 #include "wine/undocshell.h"
19 DEFAULT_DEBUG_CHANNEL(shell);
21 /*************************************************************************
22 * SHRegOpenKeyA [SHELL32.506]
25 HRESULT WINAPI SHRegOpenKeyA(
26 HKEY hKey,
27 LPSTR lpSubKey,
28 LPHKEY phkResult)
30 TRACE("(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
31 return RegOpenKeyA(hKey, lpSubKey, phkResult);
34 /*************************************************************************
35 * SHRegOpenKeyW [NT4.0:SHELL32.507]
38 HRESULT WINAPI SHRegOpenKeyW (
39 HKEY hkey,
40 LPCWSTR lpszSubKey,
41 LPHKEY retkey)
43 WARN("0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
44 return RegOpenKeyW( hkey, lpszSubKey, retkey );
47 /*************************************************************************
48 * SHRegQueryValueExA SHQueryValueExA [SHELL32.509][SHLWAPI.@]
51 HRESULT WINAPI SHRegQueryValueExA(
52 HKEY hkey,
53 LPSTR lpValueName,
54 LPDWORD lpReserved,
55 LPDWORD lpType,
56 LPBYTE lpData,
57 LPDWORD lpcbData)
59 TRACE("0x%04x %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
60 return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
63 /*************************************************************************
64 * SHRegQueryValueW [NT4.0:SHELL32.510]
67 HRESULT WINAPI SHRegQueryValueW(
68 HKEY hkey,
69 LPWSTR lpszSubKey,
70 LPWSTR lpszData,
71 LPDWORD lpcbData )
73 WARN("0x%04x %s %p %p semi-stub\n",
74 hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
75 return RegQueryValueW( hkey, lpszSubKey, lpszData, lpcbData );
78 /*************************************************************************
79 * SHRegQueryValueExW, SHQueryValueExW [NT4.0:SHELL32.511][SHLWAPI.@]
81 * FIXME
82 * if the datatype REG_EXPAND_SZ then expand the string and change
83 * *pdwType to REG_SZ.
85 HRESULT WINAPI SHRegQueryValueExW (
86 HKEY hkey,
87 LPWSTR pszValue,
88 LPDWORD pdwReserved,
89 LPDWORD pdwType,
90 LPVOID pvData,
91 LPDWORD pcbData)
93 DWORD ret;
94 WARN("0x%04x %s %p %p %p %p semi-stub\n",
95 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
96 ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
97 return ret;
100 /* SHGetValue: Gets a value from the registry */
102 /*************************************************************************
103 * SHGetValueA
105 * Gets a value from the registry
107 DWORD WINAPI SHGetValueA(
108 HKEY hkey,
109 LPCSTR pSubKey,
110 LPCSTR pValue,
111 LPDWORD pwType,
112 LPVOID pvData,
113 LPDWORD pbData)
115 HKEY hSubKey;
116 DWORD res;
118 TRACE("(%s %s)\n", pSubKey, pValue);
120 if((res = RegOpenKeyA(hkey, pSubKey, &hSubKey))) return res;
121 res = RegQueryValueExA(hSubKey, pValue, 0, pwType, pvData, pbData);
122 RegCloseKey( hSubKey );
124 return res;
127 /*************************************************************************
128 * SHGetValueW
130 * Gets a value from the registry
132 DWORD WINAPI SHGetValueW(
133 HKEY hkey,
134 LPCWSTR pSubKey,
135 LPCWSTR pValue,
136 LPDWORD pwType,
137 LPVOID pvData,
138 LPDWORD pbData)
140 HKEY hSubKey;
141 DWORD res;
143 TRACE("(%s %s)\n", debugstr_w(pSubKey), debugstr_w(pValue));
145 if((res = RegOpenKeyW(hkey, pSubKey, &hSubKey))) return res;
146 res = RegQueryValueExW(hSubKey, pValue, 0, pwType, pvData, pbData);
147 RegCloseKey( hSubKey );
149 return res;
152 /* gets a user-specific registry value. */
154 /*************************************************************************
155 * SHRegGetUSValueA
157 * Gets a user-specific registry value
159 LONG WINAPI SHRegGetUSValueA(
160 LPCSTR pSubKey,
161 LPCSTR pValue,
162 LPDWORD pwType,
163 LPVOID pvData,
164 LPDWORD pbData,
165 BOOL fIgnoreHKCU,
166 LPVOID pDefaultData,
167 DWORD wDefaultDataSize)
169 FIXME("(%p),stub!\n", pSubKey);
170 return ERROR_SUCCESS; /* return success */
173 /*************************************************************************
174 * SHRegGetUSValueW
176 * Gets a user-specific registry value
178 LONG WINAPI SHRegGetUSValueW(
179 LPCWSTR pSubKey,
180 LPCWSTR pValue,
181 LPDWORD pwType,
182 LPVOID pvData,
183 LPDWORD pbData,
184 BOOL flagIgnoreHKCU,
185 LPVOID pDefaultData,
186 DWORD wDefaultDataSize)
188 FIXME("(%p),stub!\n", pSubKey);
189 return ERROR_SUCCESS; /* return success */
192 /*************************************************************************
193 * SHRegGetBoolUSValueA
195 BOOL WINAPI SHRegGetBoolUSValueA(
196 LPCSTR pszSubKey,
197 LPCSTR pszValue,
198 BOOL fIgnoreHKCU,
199 BOOL fDefault)
201 FIXME("%s %s\n", pszSubKey,pszValue);
202 return fDefault;
205 /*************************************************************************
206 * SHRegGetBoolUSValueW
208 BOOL WINAPI SHRegGetBoolUSValueW(
209 LPCWSTR pszSubKey,
210 LPCWSTR pszValue,
211 BOOL fIgnoreHKCU,
212 BOOL fDefault)
214 FIXME("%s %s\n", debugstr_w(pszSubKey),debugstr_w(pszValue));
215 return fDefault;
218 /*************************************************************************
219 * SHRegQueryUSValueA [SHLWAPI]
221 LONG WINAPI SHRegQueryUSValueA(
222 HKEY/*HUSKEY*/ hUSKey,
223 LPCSTR pszValue,
224 LPDWORD pdwType,
225 void *pvData,
226 LPDWORD pcbData,
227 BOOL fIgnoreHKCU,
228 void *pvDefaultData,
229 DWORD dwDefaultDataSize)
231 FIXME("%s stub\n",pszValue);
232 return 1;
235 /*************************************************************************
236 * SHRegGetPathA
238 DWORD WINAPI SHRegGetPathA(
239 HKEY hKey,
240 LPCSTR pcszSubKey,
241 LPCSTR pcszValue,
242 LPSTR pszPath,
243 DWORD dwFlags)
245 FIXME("%s %s\n", pcszSubKey, pcszValue);
246 return 0;
249 /*************************************************************************
250 * SHRegGetPathW
252 DWORD WINAPI SHRegGetPathW(
253 HKEY hKey,
254 LPCWSTR pcszSubKey,
255 LPCWSTR pcszValue,
256 LPWSTR pszPath,
257 DWORD dwFlags)
259 FIXME("%s %s\n", debugstr_w(pcszSubKey), debugstr_w(pcszValue));
260 return 0;
262 /*************************************************************************
263 * SHRegDeleteKeyA and SHDeleteKeyA
265 HRESULT WINAPI SHRegDeleteKeyA(
266 HKEY hkey,
267 LPCSTR pszSubKey)
269 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
270 return 0;
273 /*************************************************************************
274 * SHRegDeleteKeyW and SHDeleteKeyA
276 HRESULT WINAPI SHRegDeleteKeyW(
277 HKEY hkey,
278 LPCWSTR pszSubKey)
280 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
281 return 0;
284 /*************************************************************************
285 * SHSetValueA [SHLWAPI]
287 DWORD WINAPI SHSetValueA(
288 HKEY hkey,
289 LPCSTR pszSubKey,
290 LPCSTR pszValue,
291 DWORD dwType,
292 LPCVOID pvData,
293 DWORD cbData)
295 FIXME("(%s %s)stub\n",pszSubKey, pszValue);
296 return 1;
299 /*************************************************************************
300 * SHRegCloseKey [NT4.0:SHELL32.505]
303 HRESULT WINAPI SHRegCloseKey (HKEY hkey)
305 TRACE("0x%04x\n",hkey);
306 return RegCloseKey( hkey );