ReactOS 0.4.16-dev-1946-g52006dd
shreg.c
Go to the documentation of this file.
1/* Unit test suite for SHReg* functions
2 *
3 * Copyright 2002 Juergen Schmied
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include <stdarg.h>
21#include <stdio.h>
22
23#include "wine/test.h"
24#include "windef.h"
25#include "winbase.h"
26#include "winerror.h"
27#include "winreg.h"
28#include "winuser.h"
29#include "shlwapi.h"
30
31/* Keys used for testing */
32#define REG_TEST_KEY "Software\\Wine\\Test"
33#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion\\explorer"
34
36
37static DWORD (WINAPI *pSHCopyKeyA)(HKEY,LPCSTR,HKEY,DWORD);
38static DWORD (WINAPI *pSHRegGetPathA)(HKEY,LPCSTR,LPCSTR,LPSTR,DWORD);
40static LSTATUS (WINAPI *pSHRegCreateUSKeyW)(LPCWSTR,REGSAM,HUSKEY,PHUSKEY,DWORD);
41static LSTATUS (WINAPI *pSHRegOpenUSKeyW)(LPCWSTR,REGSAM,HUSKEY,PHUSKEY,BOOL);
42static LSTATUS (WINAPI *pSHRegCloseUSKey)(HUSKEY);
43
44static const char sTestpath1[] = "%LONGSYSTEMVAR%\\subdir1";
45static const char sTestpath2[] = "%FOO%\\subdir1";
46
47static const char * sEnvvar1 = "bar";
48static const char * sEnvvar2 = "ImARatherLongButIndeedNeededString";
49
54
55static const char * sEmptyBuffer ="0123456789";
56
57/* delete key and all its subkeys */
58static DWORD delete_key( HKEY hkey, LPCSTR parent, LPCSTR keyname )
59{
60 HKEY parentKey;
61 DWORD ret;
62
63 RegCloseKey(hkey);
64
65 /* open the parent of the key to close */
67 if (ret != ERROR_SUCCESS)
68 return ret;
69
70 ret = SHDeleteKeyA( parentKey, keyname );
71 RegCloseKey(parentKey);
72
73 return ret;
74}
75
77{
78 HKEY hKey;
79 DWORD ret;
80 DWORD nExpectedLen1, nExpectedLen2;
81
82 SetEnvironmentVariableA("LONGSYSTEMVAR", sEnvvar1);
84
86 ok( ERROR_SUCCESS == ret, "RegCreateKeyA failed, ret=%lu\n", ret);
87
88 if (hKey)
89 {
90 ok(!RegSetValueExA(hKey,"Test1",0,REG_EXPAND_SZ, (LPBYTE) sTestpath1, strlen(sTestpath1)+1), "RegSetValueExA failed\n");
91 ok(!RegSetValueExA(hKey,"Test2",0,REG_SZ, (LPBYTE) sTestpath1, strlen(sTestpath1)+1), "RegSetValueExA failed\n");
92 ok(!RegSetValueExA(hKey,"Test3",0,REG_EXPAND_SZ, (LPBYTE) sTestpath2, strlen(sTestpath2)+1), "RegSetValueExA failed\n");
93 }
94
97
98 nExpectedLen1 = strlen(sTestpath1) - strlen("%LONGSYSTEMVAR%") + strlen(sEnvvar1) + 1;
99 nExpectedLen2 = strlen(sTestpath2) - strlen("%FOO%") + strlen(sEnvvar2) + 1;
100 /* ExpandEnvironmentStringsA on NT4 returns 2x the correct result */
101 trace("sExplen1 = (%ld)\n", nExpLen1);
102 if (nExpectedLen1 != nExpLen1)
103 trace( "Expanding %s failed (expected %ld) - known bug in NT4\n", sTestpath1, nExpectedLen1 );
104
105 trace("sExplen2 = (%ld)\n", nExpLen2);
106 if (nExpectedLen2 != nExpLen2)
107 trace( "Expanding %s failed (expected %ld) - known bug in NT4\n", sTestpath2, nExpectedLen2 );
108
109 /* Make sure we carry on with correct values */
110 nExpLen1 = nExpectedLen1;
111 nExpLen2 = nExpectedLen2;
112 return hKey;
113}
114
115static void test_SHGetValue(void)
116{
118 DWORD dwType;
119 DWORD dwRet;
120 char buf[MAX_PATH];
121
124 dwType = -1;
125 dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", &dwType, buf, &dwSize);
126 ok( ERROR_SUCCESS == dwRet, "SHGetValueA failed, ret=%lu\n", dwRet);
127 ok( 0 == strcmp(sExpTestpath1, buf) ||
128 broken(0 == strcmp(sTestpath1, buf)), /* IE4.x */
129 "Comparing of (%s) with (%s) failed\n", buf, sExpTestpath1);
130 ok( REG_SZ == dwType ||
131 broken(REG_EXPAND_SZ == dwType), /* IE4.x */
132 "Expected REG_SZ, got (%lu)\n", dwType);
133
136 dwType = -1;
137 dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", &dwType, buf, &dwSize);
138 ok( ERROR_SUCCESS == dwRet, "SHGetValueA failed, ret=%lu\n", dwRet);
139 ok( 0 == strcmp(sTestpath1, buf) , "Comparing of (%s) with (%s) failed\n", buf, sTestpath1);
140 ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
141}
142
143static void test_SHRegGetValue(void)
144{
145 LSTATUS ret;
146 DWORD size, type;
147 char data[MAX_PATH];
148
149 if(!pSHRegGetValueA)
150 return;
151
152 size = MAX_PATH;
153 ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_EXPAND_SZ, &type, data, &size);
154 ok(ret == ERROR_INVALID_PARAMETER, "SHRegGetValue failed, ret=%lu\n", ret);
155
156 size = MAX_PATH;
157 ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_SZ, &type, data, &size);
158 ok(ret == ERROR_SUCCESS, "SHRegGetValue failed, ret=%lu\n", ret);
159 ok(!strcmp(data, sExpTestpath1), "data = %s, expected %s\n", data, sExpTestpath1);
160 ok(type == REG_SZ, "type = %ld, expected REG_SZ\n", type);
161
162 size = MAX_PATH;
163 ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_DWORD, &type, data, &size);
164 ok(ret == ERROR_UNSUPPORTED_TYPE, "SHRegGetValue failed, ret=%lu\n", ret);
165
166 size = MAX_PATH;
167 ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_EXPAND_SZ, &type, data, &size);
168 ok(ret == ERROR_INVALID_PARAMETER, "SHRegGetValue failed, ret=%lu\n", ret);
169
170 size = MAX_PATH;
171 ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_SZ, &type, data, &size);
172 ok(ret == ERROR_SUCCESS, "SHRegGetValue failed, ret=%lu\n", ret);
173 ok(!strcmp(data, sTestpath1), "data = %s, expected %s\n", data, sTestpath1);
174 ok(type == REG_SZ, "type = %ld, expected REG_SZ\n", type);
175
176 size = MAX_PATH;
177 ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_QWORD, &type, data, &size);
178 ok(ret == ERROR_UNSUPPORTED_TYPE, "SHRegGetValue failed, ret=%lu\n", ret);
179}
180
181static void test_SHGetRegPath(void)
182{
183 char buf[MAX_PATH];
184 DWORD dwRet;
185
186 if (!pSHRegGetPathA)
187 return;
188
190 dwRet = (*pSHRegGetPathA)(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", buf, 0);
191 ok( ERROR_SUCCESS == dwRet, "SHRegGetPathA failed, ret=%lu\n", dwRet);
192 ok( 0 == strcmp(sExpTestpath1, buf) , "Comparing (%s) with (%s) failed\n", buf, sExpTestpath1);
193}
194
195static void test_SHQueryValueEx(void)
196{
197 HKEY hKey;
199 DWORD dwType;
200 char buf[MAX_PATH];
201 DWORD dwRet;
202 const char * sTestedFunction = "";
203 DWORD nUsedBuffer1,nUsedBuffer2;
204
205 sTestedFunction = "RegOpenKeyExA";
207 ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
208
209 /****** SHQueryValueExA ******/
210
211 sTestedFunction = "SHQueryValueExA";
212 nUsedBuffer1 = max(strlen(sExpTestpath1)+1, strlen(sTestpath1)+1);
213 nUsedBuffer2 = max(strlen(sExpTestpath2)+1, strlen(sTestpath2)+1);
214 /*
215 * Case 1.1 All arguments are NULL
216 */
217 dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, NULL);
218 ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
219
220 /*
221 * Case 1.2 dwType is set
222 */
223 dwType = -1;
224 dwRet = SHQueryValueExA( hKey, "Test1", NULL, &dwType, NULL, NULL);
225 ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
226 ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
227
228 /*
229 * dwSize is set
230 * dwExpanded < dwUnExpanded
231 */
232 dwSize = 6;
233 dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, &dwSize);
234 ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
235 ok( dwSize == nUsedBuffer1, "Buffer sizes (%lu) and (%lu) are not equal\n", dwSize, nUsedBuffer1);
236
237 /*
238 * dwExpanded > dwUnExpanded
239 */
240 dwSize = 6;
241 dwRet = SHQueryValueExA( hKey, "Test3", NULL, NULL, NULL, &dwSize);
242 ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
243 ok( dwSize >= nUsedBuffer2 ||
244 broken(dwSize == (strlen(sTestpath2) + 1)), /* < IE4.x */
245 "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
246
247 /*
248 * Case 1 string shrinks during expanding
249 */
251 dwSize = 6;
252 dwType = -1;
253 dwRet = SHQueryValueExA( hKey, "Test1", NULL, &dwType, buf, &dwSize);
254 ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet);
255 ok( 0 == strcmp(sEmptyBuffer, buf) , "Comparing (%s) with (%s) failed\n", buf, sEmptyBuffer);
256 ok( dwSize == nUsedBuffer1, "Buffer sizes (%lu) and (%lu) are not equal\n", dwSize, nUsedBuffer1);
257 ok( REG_SZ == dwType ||
258 broken(REG_EXPAND_SZ == dwType), /* < IE6 */
259 "Expected REG_SZ, got (%lu)\n", dwType);
260
261 /*
262 * string grows during expanding
263 * dwSize is smaller than the size of the unexpanded string
264 */
266 dwSize = 6;
267 dwType = -1;
268 dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
269 ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet);
270 ok( 0 == strcmp(sEmptyBuffer, buf) , "Comparing (%s) with (%s) failed\n", buf, sEmptyBuffer);
271 ok( dwSize >= nUsedBuffer2 ||
272 broken(dwSize == (strlen(sTestpath2) + 1)), /* < IE6 */
273 "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
274 ok( REG_SZ == dwType ||
275 broken(REG_EXPAND_SZ == dwType), /* < IE6 */
276 "Expected REG_SZ, got (%lu)\n", dwType);
277
278 /*
279 * string grows during expanding
280 * dwSize is larger than the size of the unexpanded string, but
281 * smaller than the part before the backslash. If the unexpanded
282 * string fits into the buffer, it can get cut when expanded.
283 */
285 dwSize = strlen(sEnvvar2) - 2;
286 dwType = -1;
287 dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
288 ok( ERROR_MORE_DATA == dwRet ||
289 broken(ERROR_ENVVAR_NOT_FOUND == dwRet) || /* IE5.5 */
290 broken(ERROR_SUCCESS == dwRet), /* < IE5.5*/
291 "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet);
292
293 ok( !strcmp("", buf) || !strcmp(sTestpath2, buf),
294 "Expected empty or unexpanded string (win98), got (%s)\n", buf);
295
296 ok( dwSize >= nUsedBuffer2 ||
297 broken(dwSize == (strlen("") + 1)), /* < IE 5.5 */
298 "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
299 ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
300
301 /*
302 * string grows during expanding
303 * dwSize is larger than the size of the part before the backslash,
304 * but smaller than the expanded string. If the unexpanded string fits
305 * into the buffer, it can get cut when expanded.
306 */
308 dwSize = nExpLen2 - 4;
309 dwType = -1;
310 dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
311 ok( ERROR_MORE_DATA == dwRet ||
312 broken(ERROR_ENVVAR_NOT_FOUND == dwRet) || /* IE5.5 */
313 broken(ERROR_SUCCESS == dwRet), /* < IE5.5 */
314 "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet);
315
316 ok( !strcmp("", buf) || !strcmp(sEnvvar2, buf) ||
317 broken(0 == strcmp(sTestpath2, buf)), /* IE 5.5 */
318 "Expected empty or first part of the string \"%s\", got \"%s\"\n", sEnvvar2, buf);
319
320 ok( dwSize >= nUsedBuffer2 ||
321 broken(dwSize == (strlen(sEnvvar2) + 1)) || /* IE4.01 SP1 (W98) and IE5 (W98SE) */
322 broken(dwSize == (strlen("") + 1)), /* IE4.01 (NT4) and IE5.x (W2K) */
323 "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
324 ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
325
326 /*
327 * The buffer is NULL but the size is set
328 */
330 dwSize = 6;
331 dwType = -1;
332 dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, NULL, &dwSize);
333 ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
334 ok( dwSize >= nUsedBuffer2 ||
335 broken(dwSize == (strlen(sTestpath2) + 1)), /* IE4.01 SP1 (Win98) */
336 "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
337 ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
338
340}
341
342static void test_SHCopyKey(void)
343{
344 HKEY hKeySrc, hKeyDst;
345 DWORD dwRet;
346
347 if (!pSHCopyKeyA)
348 {
349 win_skip("SHCopyKeyA is not available\n");
350 return;
351 }
352
353 /* Delete existing destination sub keys */
354 hKeyDst = NULL;
355 if (!RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst) && hKeyDst)
356 {
357 SHDeleteKeyA(hKeyDst, NULL);
358 RegCloseKey(hKeyDst);
359 }
360
361 hKeyDst = NULL;
362 dwRet = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst);
363 if (dwRet || !hKeyDst)
364 {
365 ok( 0, "Destination couldn't be created, RegCreateKeyA returned (%lu)\n", dwRet);
366 return;
367 }
368
369 hKeySrc = NULL;
371 if (dwRet || !hKeySrc)
372 {
373 ok( 0, "Source couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet);
374 RegCloseKey(hKeyDst);
375 return;
376 }
377
378 dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0);
379 ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%lu)\n", dwRet);
380
381 RegCloseKey(hKeySrc);
382 RegCloseKey(hKeyDst);
383
384 /* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */
385 hKeyDst = NULL;
386 dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Shell Folders", &hKeyDst);
387 if (dwRet || !hKeyDst)
388 {
389 ok ( 0, "Copy couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet);
390 return;
391 }
392
393 /* And the we copied the values too */
394 ok(!SHQueryValueExA(hKeyDst, "Common AppData", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n");
395
396 RegCloseKey(hKeyDst);
397}
398
399static void test_SHDeleteKey(void)
400{
401 HKEY hKeyTest, hKeyS;
402 DWORD dwRet;
403 int sysfail = 1;
404
406 {
407 if (!RegCreateKeyA(hKeyTest, "ODBC", &hKeyS))
408 {
409 HKEY hKeyO;
410
411 if (!RegCreateKeyA(hKeyS, "ODBC.INI", &hKeyO))
412 {
413 RegCloseKey (hKeyO);
414
415 if (!RegCreateKeyA(hKeyS, "ODBCINST.INI", &hKeyO))
416 {
417 RegCloseKey (hKeyO);
418 sysfail = 0;
419 }
420 }
421 RegCloseKey (hKeyS);
422 }
423 RegCloseKey (hKeyTest);
424 }
425
426 if (!sysfail)
427 {
428
430 ok ( ERROR_SUCCESS == dwRet, "SHDeleteKey failed, ret=(%lu)\n", dwRet);
431
432 dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\ODBC", &hKeyS);
433 ok ( ERROR_FILE_NOT_FOUND == dwRet, "SHDeleteKey did not delete\n");
434
435 if (dwRet == ERROR_SUCCESS)
436 RegCloseKey (hKeyS);
437 }
438 else
439 ok( 0, "Could not set up SHDeleteKey test\n");
440}
441
442static void test_SHRegCreateUSKeyW(void)
443{
444 static const WCHAR subkeyW[] = {'s','u','b','k','e','y',0};
445 LONG ret;
446
447 if (!pSHRegCreateUSKeyW)
448 {
449 win_skip("SHRegCreateUSKeyW not available\n");
450 return;
451 }
452
453 ret = pSHRegCreateUSKeyW(subkeyW, KEY_ALL_ACCESS, NULL, NULL, SHREGSET_FORCE_HKCU);
454 ok(ret == ERROR_INVALID_PARAMETER, "got %ld\n", ret);
455}
456
457static void test_SHRegCloseUSKey(void)
458{
459 static const WCHAR localW[] = {'S','o','f','t','w','a','r','e',0};
460 LONG ret;
461 HUSKEY key;
462
463 if (!pSHRegOpenUSKeyW || !pSHRegCloseUSKey)
464 {
465 win_skip("SHRegOpenUSKeyW or SHRegCloseUSKey not available\n");
466 return;
467 }
468
469 ret = pSHRegCloseUSKey(NULL);
470 ok(ret == ERROR_INVALID_PARAMETER, "got %ld\n", ret);
471
472 ret = pSHRegOpenUSKeyW(localW, KEY_ALL_ACCESS, NULL, &key, FALSE);
473 ok(ret == ERROR_SUCCESS, "got %ld\n", ret);
474
475 ret = pSHRegCloseUSKey(key);
476 ok(ret == ERROR_SUCCESS, "got %ld\n", ret);
477
478 /* Test with limited rights, specially without KEY_SET_VALUE */
479 ret = pSHRegOpenUSKeyW(localW, KEY_QUERY_VALUE, NULL, &key, FALSE);
480 ok(ret == ERROR_SUCCESS, "got %ld\n", ret);
481
482 ret = pSHRegCloseUSKey(key);
483 ok(ret == ERROR_SUCCESS, "got %ld\n", ret);
484}
485
487{
488 HKEY hkey = create_test_entries();
489
490 if (!hkey) return;
491
492 hshlwapi = GetModuleHandleA("shlwapi.dll");
493
494 /* SHCreateStreamOnFileEx was introduced in shlwapi v6.0 */
495 if(!GetProcAddress(hshlwapi, "SHCreateStreamOnFileEx")){
496 win_skip("Too old shlwapi version\n");
497 return;
498 }
499
500 pSHCopyKeyA = (void*)GetProcAddress(hshlwapi,"SHCopyKeyA");
501 pSHRegGetPathA = (void*)GetProcAddress(hshlwapi,"SHRegGetPathA");
502 pSHRegGetValueA = (void*)GetProcAddress(hshlwapi,"SHRegGetValueA");
503 pSHRegCreateUSKeyW = (void*)GetProcAddress(hshlwapi, "SHRegCreateUSKeyW");
504 pSHRegOpenUSKeyW = (void*)GetProcAddress(hshlwapi, "SHRegOpenUSKeyW");
505 pSHRegCloseUSKey = (void*)GetProcAddress(hshlwapi, "SHRegCloseUSKey");
506
515
516 delete_key( hkey, "Software\\Wine", "Test" );
517}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
void sysfail(const char *what, int errnoval)
Definition: adh-main.c:49
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1179
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4799
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define GetProcAddress(x, y)
Definition: compat.h:753
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
Definition: environ.c:399
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableA(IN LPCSTR lpName, IN LPCSTR lpValue)
Definition: environ.c:218
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
DWORD WINAPI SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1207
DWORD WINAPI SHQueryValueExA(HKEY hKey, LPCSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1402
DWORD WINAPI SHDeleteKeyA(HKEY hKey, LPCSTR lpszSubKey)
Definition: reg.c:1533
return ret
Definition: mutex.c:146
r parent
Definition: btrfs.c:3010
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define REG_SZ
Definition: layer.c:22
#define win_skip
Definition: minitest.h:67
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
long LONG
Definition: pedump.c:60
#define SRRF_RT_REG_EXPAND_SZ
Definition: shlwapi.h:699
#define SRRF_RT_REG_DWORD
Definition: shlwapi.h:701
#define SRRF_RT_REG_QWORD
Definition: shlwapi.h:703
#define SRRF_RT_REG_SZ
Definition: shlwapi.h:698
#define SHREGSET_FORCE_HKCU
Definition: shlwapi.h:720
#define delete_key(r, p, s)
Definition: reg_test.h:64
strcpy
Definition: string.h:131
static void test_SHQueryValueEx(void)
Definition: shreg.c:195
static LPSTR
Definition: shreg.c:38
static const char * sEmptyBuffer
Definition: shreg.c:55
static DWORD nExpLen1
Definition: shreg.c:52
static void test_SHDeleteKey(void)
Definition: shreg.c:399
static void test_SHGetValue(void)
Definition: shreg.c:115
static void test_SHCopyKey(void)
Definition: shreg.c:342
static BOOL
Definition: shreg.c:41
static HKEY create_test_entries(void)
Definition: shreg.c:76
static DWORD nExpLen2
Definition: shreg.c:53
static const char * sEnvvar2
Definition: shreg.c:48
static const char sTestpath2[]
Definition: shreg.c:45
static const char * sEnvvar1
Definition: shreg.c:47
static REGSAM
Definition: shreg.c:40
static void test_SHGetRegPath(void)
Definition: shreg.c:181
#define REG_CURRENT_VERSION
Definition: shreg.c:33
static DWORD
Definition: shreg.c:37
static const char sTestpath1[]
Definition: shreg.c:44
static SRRF
Definition: shreg.c:39
static char sExpTestpath1[MAX_PATH]
Definition: shreg.c:50
static HUSKEY
Definition: shreg.c:40
static void test_SHRegCloseUSKey(void)
Definition: shreg.c:457
static HMODULE hshlwapi
Definition: shreg.c:35
static void test_SHRegCreateUSKeyW(void)
Definition: shreg.c:442
static LPVOID
Definition: shreg.c:39
static LPDWORD
Definition: shreg.c:39
static char sExpTestpath2[MAX_PATH]
Definition: shreg.c:51
static LPCSTR
Definition: shreg.c:37
#define REG_TEST_KEY
Definition: shreg.c:32
static HKEY
Definition: shreg.c:37
static PHUSKEY
Definition: shreg.c:40
static LSTATUS(WINAPI *pSHRegGetValueA)(HKEY
static void test_SHRegGetValue(void)
Definition: shreg.c:143
Definition: copy.c:22
#define max(a, b)
Definition: svc.c:63
unsigned char * LPBYTE
Definition: typedefs.h:53
#define WINAPI
Definition: msvc.h:6
#define ERROR_UNSUPPORTED_TYPE
Definition: winerror.h:1336
#define ERROR_ENVVAR_NOT_FOUND
Definition: winerror.h:383
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
const char * LPCSTR
Definition: xmlstorage.h:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180