source: trunk/src/shlwapi/reg.c@ 5280

Last change on this file since 5280 was 4081, checked in by sandervl, 25 years ago

resync with Wine 20000801

File size: 5.4 KB
Line 
1/*
2 * SHLWAPI registry functions
3 * Note: Odin changes marked by __WIN32OS2__
4 */
5
6#include "windef.h"
7#include "winerror.h"
8#include "winreg.h"
9#include "wine/undocshell.h"
10#include "debugtools.h"
11
12DEFAULT_DEBUG_CHANNEL(shell);
13
14/*************************************************************************
15 * SHRegGetUSValueA [SHLWAPI.@]
16 *
17 * Gets a user-specific registry value
18 */
19LONG WINAPI SHRegGetUSValueA(
20 LPCSTR pSubKey,
21 LPCSTR pValue,
22 LPDWORD pwType,
23 LPVOID pvData,
24 LPDWORD pbData,
25 BOOL fIgnoreHKCU,
26 LPVOID pDefaultData,
27 DWORD wDefaultDataSize)
28{
29 FIXME("(%p),stub!\n", pSubKey);
30 return ERROR_SUCCESS; /* return success */
31}
32
33/*************************************************************************
34 * SHRegGetUSValueW [SHLWAPI.@]
35 *
36 * Gets a user-specific registry value
37 */
38LONG WINAPI SHRegGetUSValueW(
39 LPCWSTR pSubKey,
40 LPCWSTR pValue,
41 LPDWORD pwType,
42 LPVOID pvData,
43 LPDWORD pbData,
44 BOOL flagIgnoreHKCU,
45 LPVOID pDefaultData,
46 DWORD wDefaultDataSize)
47{
48 FIXME("(%p),stub!\n", pSubKey);
49 return ERROR_SUCCESS; /* return success */
50}
51
52#ifndef __WIN32OS2__
53/*************************************************************************
54 * SHRegGetBoolUSValueA [SHLWAPI.@]
55 */
56BOOL WINAPI SHRegGetBoolUSValueA(
57 LPCSTR pszSubKey,
58 LPCSTR pszValue,
59 BOOL fIgnoreHKCU,
60 BOOL fDefault)
61{
62 FIXME("%s %s\n", pszSubKey,pszValue);
63 return fDefault;
64}
65
66/*************************************************************************
67 * SHRegGetBoolUSValueW [SHLWAPI.@]
68 */
69BOOL WINAPI SHRegGetBoolUSValueW(
70 LPCWSTR pszSubKey,
71 LPCWSTR pszValue,
72 BOOL fIgnoreHKCU,
73 BOOL fDefault)
74{
75 FIXME("%s %s\n", debugstr_w(pszSubKey),debugstr_w(pszValue));
76 return fDefault;
77}
78#endif
79
80/*************************************************************************
81 * SHRegQueryUSValueA [SHLWAPI]
82 */
83LONG WINAPI SHRegQueryUSValueA(
84 HKEY/*HUSKEY*/ hUSKey,
85 LPCSTR pszValue,
86 LPDWORD pdwType,
87 void *pvData,
88 LPDWORD pcbData,
89 BOOL fIgnoreHKCU,
90 void *pvDefaultData,
91 DWORD dwDefaultDataSize)
92{
93 FIXME("%s stub\n",pszValue);
94 return 1;
95}
96
97/*************************************************************************
98 * SHRegGetPathA [SHLWAPI.@]
99 */
100DWORD WINAPI SHRegGetPathA(
101 HKEY hKey,
102 LPCSTR pcszSubKey,
103 LPCSTR pcszValue,
104 LPSTR pszPath,
105 DWORD dwFlags)
106{
107 FIXME("%s %s\n", pcszSubKey, pcszValue);
108 return 0;
109}
110
111/*************************************************************************
112 * SHRegGetPathW [SHLWAPI.@]
113 */
114DWORD WINAPI SHRegGetPathW(
115 HKEY hKey,
116 LPCWSTR pcszSubKey,
117 LPCWSTR pcszValue,
118 LPWSTR pszPath,
119 DWORD dwFlags)
120{
121 FIXME("%s %s\n", debugstr_w(pcszSubKey), debugstr_w(pcszValue));
122 return 0;
123}
124
125/*************************************************************************
126 * SHGetValueA [SHLWAPI.@]
127 *
128 * Gets a value from the registry
129 */
130DWORD WINAPI SHGetValueA(
131 HKEY hkey,
132 LPCSTR pSubKey,
133 LPCSTR pValue,
134 LPDWORD pwType,
135 LPVOID pvData,
136 LPDWORD pbData)
137{
138 HKEY hSubKey;
139 DWORD res;
140
141 TRACE("(%s %s)\n", pSubKey, pValue);
142
143 if((res = RegOpenKeyA(hkey, pSubKey, &hSubKey))) return res;
144 res = RegQueryValueExA(hSubKey, pValue, 0, pwType, pvData, pbData);
145 RegCloseKey( hSubKey );
146
147 return res;
148}
149
150/*************************************************************************
151 * SHGetValueW [SHLWAPI.@]
152 *
153 * Gets a value from the registry
154 */
155DWORD WINAPI SHGetValueW(
156 HKEY hkey,
157 LPCWSTR pSubKey,
158 LPCWSTR pValue,
159 LPDWORD pwType,
160 LPVOID pvData,
161 LPDWORD pbData)
162{
163 HKEY hSubKey;
164 DWORD res;
165
166 TRACE("(%s %s)\n", debugstr_w(pSubKey), debugstr_w(pValue));
167
168 if((res = RegOpenKeyW(hkey, pSubKey, &hSubKey))) return res;
169 res = RegQueryValueExW(hSubKey, pValue, 0, pwType, pvData, pbData);
170 RegCloseKey( hSubKey );
171
172 return res;
173}
174
175/*************************************************************************
176 * SHSetValueA [SHLWAPI.@]
177 */
178DWORD WINAPI SHSetValueA(
179 HKEY hkey,
180 LPCSTR pszSubKey,
181 LPCSTR pszValue,
182 DWORD dwType,
183 LPCVOID pvData,
184 DWORD cbData)
185{
186 FIXME("(%s %s)stub\n",pszSubKey, pszValue);
187 return 1;
188}
189
190/*************************************************************************
191 * SHQueryValueExA [SHLWAPI.@]
192 *
193 */
194HRESULT WINAPI SHQueryValueExA(
195 HKEY hkey,
196 LPSTR lpValueName,
197 LPDWORD lpReserved,
198 LPDWORD lpType,
199 LPBYTE lpData,
200 LPDWORD lpcbData)
201{
202 TRACE("0x%04x %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
203 return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
204}
205
206
207/*************************************************************************
208 * SHQueryValueExW [SHLWAPI.@]
209 *
210 * FIXME
211 * if the datatype REG_EXPAND_SZ then expand the string and change
212 * *pdwType to REG_SZ.
213 */
214HRESULT WINAPI SHQueryValueExW (
215 HKEY hkey,
216 LPWSTR pszValue,
217 LPDWORD pdwReserved,
218 LPDWORD pdwType,
219 LPVOID pvData,
220 LPDWORD pcbData)
221{
222 WARN("0x%04x %s %p %p %p %p semi-stub\n",
223 hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
224 return RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
225}
226
227/*************************************************************************
228 * SHDeleteKeyA [SHLWAPI.@]
229 */
230HRESULT WINAPI SHDeleteKeyA(
231 HKEY hkey,
232 LPCSTR pszSubKey)
233{
234 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
235 return 0;
236}
237
238/*************************************************************************
239 * SHDeleteKeyW [SHLWAPI.@]
240 */
241HRESULT WINAPI SHDeleteKeyW(
242 HKEY hkey,
243 LPCWSTR pszSubKey)
244{
245 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
246 return 0;
247}
Note: See TracBrowser for help on using the repository browser.