35#define IS_HKCR(hk) ((UINT_PTR)hk > 0 && ((UINT_PTR)hk & 3) == 2)
40static const char *
sTestpath1 =
"%LONGSYSTEMVAR%\\subdir1";
64 static char *
list[32];
80 static const char hex[16] =
"0123456789abcdef";
86 if (!
str)
return "(null)";
98 unsigned char c = *
str++;
101 case '\n': *
dst++ =
'\\'; *
dst++ =
'n';
break;
102 case '\r': *
dst++ =
'\\'; *
dst++ =
'r';
break;
103 case '\t': *
dst++ =
'\\'; *
dst++ =
't';
break;
104 case '"': *
dst++ =
'\\'; *
dst++ =
'"';
break;
105 case '\\': *
dst++ =
'\\'; *
dst++ =
'\\';
break;
107 if (
c >=
' ' &&
c <= 126)
129#define ADVAPI32_GET_PROC(func) \
130 p ## func = (void*)GetProcAddress(hadvapi32, #func)
191 ok(hkey !=
NULL,
"RegOpenKeyExA succeeded but returned NULL hkey\n");
196 ok(hkey ==
NULL,
"RegOpenKeyExA failed but returned hkey %p\n", hkey);
198 trace(
"running as limited user\n");
202#define lok ok_(__FILE__, line)
203#define test_hkey_main_Value_A(name, string, full_byte_len) _test_hkey_main_Value_A(__LINE__, name, string, full_byte_len)
221 ok(
GLE == 0xdeadbeef,
"RegQueryValueExA set GLE = %u\n",
GLE);
224 str_byte_len = (
string ?
lstrlenA(
string) : 0) + 1;
226 lok(cbData == full_byte_len,
"cbData=%d instead of %d or %d\n", cbData, full_byte_len, str_byte_len);
237 lok(*
value == 0xbd,
"RegQueryValueExA overflowed: cbData=%u *value=%02x\n", cbData, *
value);
241 lok(
memcmp(
value,
string, cbData) == 0,
"RegQueryValueExA/2 failed: %s/%d != %s/%d\n",
244 lok(*(
value+cbData) == 0xbd,
"RegQueryValueExA/2 overflowed at offset %u: %02x != bd\n", cbData, *(
value+cbData));
249#define test_hkey_main_Value_W(name, string, full_byte_len) _test_hkey_main_Value_W(__LINE__, name, string, full_byte_len)
267 win_skip(
"RegQueryValueExW() is not implemented\n");
272 lok(cbData == full_byte_len,
273 "cbData=%d instead of %d\n", cbData, full_byte_len);
284 lok(
memcmp(
value,
string, cbData) == 0,
"RegQueryValueExW failed: %s/%d != %s/%d\n",
289 lok(*(
value+cbData) == 0xbd,
"RegQueryValueExW/2 overflowed at %u: %02x != bd\n", cbData, *(
value+cbData));
290 lok(*(
value+cbData+1) == 0xbd,
"RegQueryValueExW/2 overflowed at %u+1: %02x != bd\n", cbData, *(
value+cbData+1));
298 static const WCHAR name1W[] = {
'C',
'l',
'e',
'a',
'n',
'S',
'i',
'n',
'g',
'l',
'e',
'S',
't',
'r',
'i',
'n',
'g', 0};
299 static const WCHAR name2W[] = {
'S',
'o',
'm',
'e',
'I',
'n',
't',
'r',
'a',
'Z',
'e',
'r',
'o',
'e',
'd',
'S',
't',
'r',
'i',
'n',
'g', 0};
301 static const WCHAR string1W[] = {
'T',
'h',
'i',
's',
'N',
'e',
'v',
'e',
'r',
'B',
'r',
'e',
'a',
'k',
's', 0};
302 static const WCHAR string2W[] = {
'T',
'h',
'i',
's', 0 ,
'B',
'r',
'e',
'a',
'k',
's', 0 , 0 ,
'A', 0 , 0 , 0 ,
'L',
'o',
't', 0 , 0 , 0 , 0, 0};
303 static const WCHAR substring2W[] = {
'T',
'h',
'i',
's',0};
305 static const char name1A[] =
"CleanSingleString";
306 static const char name2A[] =
"SomeIntraZeroedString";
307 static const char emptyA[] =
"";
308 static const char string1A[] =
"ThisNeverBreaks";
309 static const char string2A[] =
"This\0Breaks\0\0A\0\0\0Lot\0\0\0\0";
310 static const char substring2A[] =
"This";
458 if (!pRegSetKeyValueW)
459 win_skip(
"RegSetKeyValue() is not supported.\n");
462 static const WCHAR subkeyW[] = {
's',
'u',
'b',
'k',
'e',
'y',0};
471 ret = pRegSetKeyValueW(
hkey_main, subkeyW, name1W,
REG_SZ, string1W,
sizeof(string1W));
479 ok(
len ==
sizeof(string1W),
"got %d\n",
len);
497 static const DWORD qw[2] = { 0x12345678, 0x87654321 };
503 "RegSetValueExA failed\n");
505 "RegSetValueExA failed\n");
507 "RegSetValueExA failed\n");
509 "RegSetValueExA failed\n");
511 "RegSetValueExA failed\n");
513 "RegSetValueExA failed\n");
515 "RegSetValueExA failed\n");
525 static const WCHAR foobarW[] = {
'f',
'o',
'o',
'b',
'a',
'r',0};
526 static const WCHAR testW[] = {
'T',
'e',
's',
't',0};
527 static const WCHAR xxxW[] = {
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',0};
538 ok( !
res,
"RegSetValueExA returned %d\n",
res );
552 ok( val_count == 4,
"val_count set to %d instead of 4\n", val_count );
553 ok( data_count == 0,
"data_count set to %d instead of 0\n", data_count );
556 ok( !
strcmp(
data,
"xxxxxxxxxx" ),
"data is '%s' instead of xxxxxxxxxx\n",
data );
562 memcpy( dataW, xxxW,
sizeof(xxxW) );
565 ok( val_count == 4,
"val_count set to %d instead of 4\n", val_count );
566 ok( data_count == 0,
"data_count set to %d instead of 0\n", data_count );
569 ok( !
memcmp( dataW, xxxW,
sizeof(xxxW) ),
"data is not 'xxxxxxxxxx'\n" );
572 ok(
res == 0,
"RegSetValueExA failed error %d\n",
res );
582 ok( val_count == 2,
"val_count set to %d\n", val_count );
583 ok( data_count == 7 ||
broken( data_count == 8 ),
"data_count set to %d instead of 7\n", data_count );
596 ok( val_count == 3,
"val_count set to %d\n", val_count );
597 ok( data_count == 7 ||
broken( data_count == 8 ),
"data_count set to %d instead of 7\n", data_count );
601 "value set to '%s' instead of 'Te' or 'xxxxxxxxxx'\n",
value );
603 "data set to '%s' instead of 'foobar' or 'xxxxxxx'\n",
data );
613 ok( val_count == 0,
"val_count set to %d\n", val_count );
614 ok( data_count == 7 ||
broken( data_count == 8 ),
"data_count set to %d instead of 7\n", data_count );
619 "data set to '%s' instead of 'foobar' or 'xxxxxxx'\n",
data );
629 ok( val_count == 20,
"val_count set to %d\n", val_count );
630 ok( data_count == 7,
"data_count set to %d instead of 7\n", data_count );
643 ok( val_count == 4,
"val_count set to %d instead of 4\n", val_count );
644 ok( data_count == 7,
"data_count set to %d instead of 7\n", data_count );
681 win_skip(
"RegSetValueExW is not implemented\n");
684 ok(
res == 0,
"RegSetValueExW failed error %d\n",
res );
691 memcpy( dataW, xxxW,
sizeof(xxxW) );
694 ok( val_count == 2,
"val_count set to %d\n", val_count );
695 ok( data_count == 7*
sizeof(
WCHAR),
"data_count set to %d instead of 7*sizeof(WCHAR)\n", data_count );
698 ok( !
memcmp( dataW, xxxW,
sizeof(xxxW) ),
"data modified\n" );
705 memcpy( dataW, xxxW,
sizeof(xxxW) );
708 ok( val_count == 3,
"val_count set to %d\n", val_count );
709 ok( data_count == 7*
sizeof(
WCHAR),
"data_count set to %d instead of 7*sizeof(WCHAR)\n", data_count );
712 ok( !
memcmp( dataW, xxxW,
sizeof(xxxW) ),
"data modified\n" );
719 memcpy( dataW, xxxW,
sizeof(xxxW) );
722 ok( val_count == 4,
"val_count set to %d instead of 4\n", val_count );
723 ok( data_count == 7*
sizeof(
WCHAR),
"data_count set to %d instead of 7*sizeof(WCHAR)\n", data_count );
726 ok( !
memcmp( dataW, xxxW,
sizeof(xxxW) ),
"data modified\n" );
733 memcpy( dataW, xxxW,
sizeof(xxxW) );
736 ok( val_count == 4,
"val_count set to %d instead of 4\n", val_count );
737 ok( data_count == 7*
sizeof(
WCHAR),
"data_count set to %d instead of 7*sizeof(WCHAR)\n", data_count );
747 memcpy( dataW, xxxW,
sizeof(xxxW) );
755 memcpy( dataW, xxxW,
sizeof(xxxW) );
763 memcpy( dataW, xxxW,
sizeof(xxxW) );
788 ok(
size == 0,
"size should have been set to 0 instead of %d\n",
size);
793 ok(
size ==
sizeof(
buffer),
"size shouldn't have been changed to %d\n",
size);
807 CHAR expanded[] =
"bar\\subdir1";
808 CHAR expanded2[] =
"ImARatherLongButIndeedNeededString\\subdir1";
812 win_skip(
"RegGetValue not available on this platform\n");
826 ok(
dw == 0x12345678,
"dw=%d\n",
dw);
839 ok(
dw == 0x12345678,
"dw=%d\n",
dw);
849 ok(
dw == 0,
"dw=%d\n",
dw);
864 ok(
dw == 0x12345678,
"dw=%d\n",
dw);
872 ok(
dw == 0x12345678,
"dw=%d\n",
dw);
875 qw[0] = qw[1] =
size =
type = 0xdeadbeef;
880 ok(qw[0] == 0x12345678 &&
881 qw[1] == 0x87654321,
"qw={%d,%d}\n", qw[0], qw[1]);
887 ok(
dw == 0xdeadbeef,
"dw=%d\n",
dw);
891 qw[0] = qw[1] =
size =
type = 0xdeadbeef;
896 ok(qw[0] == 0x12345678 &&
897 qw[1] == 0x87654321,
"qw={%d,%d}\n", qw[0], qw[1]);
956 ok(!
strcmp(expanded,
buf),
"expanded=\"%s\" buf=\"%s\"\n", expanded,
buf);
966 ok(!
strcmp(expanded2,
buf),
"expanded2=\"%s\" buf=\"%s\"\n", expanded2,
buf);
1001 ok(!
strcmp(expanded,
buf),
"expanded=\"%s\" buf=\"%s\"\n", expanded,
buf);
1021 ok(hkResult !=
NULL,
"expected hkResult != NULL\n");
1022 hkPreserve = hkResult;
1027 ok(hkResult != hkPreserve,
"expected hkResult != hkPreserve\n");
1028 ok(hkResult !=
NULL,
"hkResult != NULL\n");
1039 hkResult = hkPreserve;
1042 ok(hkResult ==
NULL,
"expected hkResult == NULL\n");
1045 hkResult = hkPreserve;
1048 ok(hkResult ==
NULL,
"expected hkResult == NULL\n");
1053 hkResult = hkPreserve;
1059 hkResult = hkPreserve;
1067 hkResult = hkPreserve;
1070 ok(hkResult ==
NULL,
"expected hkResult == NULL\n");
1075 hkResult = hkPreserve;
1078 "expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n",
ret);
1079 ok(hkResult == hkPreserve,
"expected hkResult == hkPreserve\n");
1095 "expected ERROR_BAD_PATHNAME or ERROR_FILE_NOT_FOUND, got %d\n",
ret);
1102 "expected ERROR_SUCCESS, ERROR_BAD_PATHNAME or ERROR_FILE_NOT_FOUND, got %d\n",
ret);
1123 hkResult = hkPreserve;
1126 ok(hkResult != hkPreserve,
"expected hkResult != hkPreserve\n");
1130 hkResult = hkPreserve;
1133 ok(hkResult != hkPreserve,
"expected hkResult != hkPreserve\n");
1137 hkResult = hkPreserve;
1140 ok(hkResult == hkPreserve,
"expected hkResult == hkPreserve\n");
1148 "RegOpenKeyEx with KEY_WOW64_32KEY failed (err=%u)\n",
ret);
1154 "RegOpenKeyEx with KEY_WOW64_64KEY failed (err=%u)\n",
ret);
1165 ok(hkResult !=
NULL,
"expected hkResult != NULL\n");
1170 ok(hkResult !=
NULL,
"expected hkResult != NULL\n");
1175 ok(hkResult !=
NULL,
"expected hkResult != NULL\n");
1180 ok(hkResult !=
NULL,
"expected hkResult != NULL\n");
1186 ok(hkResult !=
NULL,
"expected hkResult != NULL\n");
1194 if (!pIsWow64Process)
1196 win_skip(
"WOW64 flags are not recognized\n");
1204 "RegCreateKeyEx with KEY_WOW64_32KEY failed (err=%u)\n",
ret);
1207 "RegCreateKeyEx with KEY_WOW64_32KEY failed (err=%u)\n",
ret);
1213 "RegCreateKeyEx with KEY_WOW64_64KEY failed (err=%u)\n",
ret);
1216 "RegCreateKeyEx with KEY_WOW64_64KEY failed (err=%u)\n",
ret);
1219 0, 0, 0, 0, 0, 0, 0, &world_sid);
1221 "Expected AllocateAndInitializeSid to return TRUE, got %d, last error %u\n", bRet,
GetLastError());
1230 access.Trustee.ptstrName = (
char *)world_sid;
1234 "Expected SetEntriesInAclA to return ERROR_SUCCESS, got %u, last error %u\n",
ret,
GetLastError());
1239 "Expected InitializeSecurityDescriptor to return TRUE, got %d, last error %u\n", bRet,
GetLastError());
1243 "Expected SetSecurityDescriptorDacl to return TRUE, got %d, last error %u\n", bRet,
GetLastError());
1247 skip(
"not enough privileges to modify HKLM\n");
1255 "Expected RegSetKeySecurity to return success, got error %u\n",
error);
1259 "Expected RegSetKeySecurity to return success, got error %u\n",
error);
1264 "RegOpenKeyEx with KEY_WOW64_64KEY failed (err=%u)\n",
ret);
1270 "RegOpenKeyEx with KEY_WOW64_32KEY failed (err=%u)\n",
ret);
1298 ok(!
ret,
"RegCreateKeyExA failed with error %d\n",
ret);
1302 ok(!
ret,
"RegCreateKeyExA failed with error %d\n",
ret);
1312 ok(!
ret,
"RegCreateKeyExA failed with error %d\n",
ret);
1317 ok(!
ret,
"RegCreateKeyExA failed with error %d\n",
ret);
1321 ok(!
ret,
"RegCreateKeyExA failed with error %d\n",
ret);
1334 ok(!
ret,
"RegCreateKeyExA failed with error %d\n",
ret);
1356 "RegOpenKeyEx with KEY_WOW64_32KEY failed (err=%u)\n",
ret);
1362 "RegOpenKeyEx with KEY_WOW64_64KEY failed (err=%u)\n",
ret);
1369 if (!pIsWow64Process)
1371 win_skip(
"WOW64 flags are not recognized\n");
1379 "RegCreateKeyEx with KEY_WOW64_32KEY failed (err=%d)\n",
ret);
1382 "RegCreateKeyEx with KEY_WOW64_32KEY failed (err=%d)\n",
ret);
1388 "RegCreateKeyEx with KEY_WOW64_64KEY failed (err=%d)\n",
ret);
1391 "RegCreateKeyEx with KEY_WOW64_64KEY failed (err=%d)\n",
ret);
1394 0, 0, 0, 0, 0, 0, 0, &world_sid);
1396 "Expected AllocateAndInitializeSid to return TRUE, got %d, last error %u\n", bRet,
GetLastError());
1405 access.Trustee.ptstrName = (
char *)world_sid;
1409 "Expected SetEntriesInAclA to return ERROR_SUCCESS, got %u, last error %u\n", dwRet,
GetLastError());
1414 "Expected InitializeSecurityDescriptor to return TRUE, got %d, last error %u\n", bRet,
GetLastError());
1418 "Expected SetSecurityDescriptorDacl to return TRUE, got %d, last error %u\n", bRet,
GetLastError());
1422 skip(
"not enough privileges to modify HKLM\n");
1428 "Expected RegSetKeySecurity to return success, got error %u\n",
ret);
1432 "Expected RegSetKeySecurity to return success, got error %u\n",
ret);
1438 "RegOpenKeyEx with KEY_WOW64_64KEY failed (err=%u)\n",
ret);
1445 "RegOpenKeyEx with KEY_WOW64_32KEY failed (err=%u)\n",
ret);
1474 "expected ERROR_INVALID_HANDLE or ERROR_SUCCESS, got %d\n",
ret);
1479 "expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n",
ret);
1487 trace(
"The main handle is most likely closed, so re-opening\n");
1505 trace(
"We are probably running on NT4 or W2K as the main key is deleted,"
1506 " re-creating the main key\n");
1540 tp.PrivilegeCount = 1;
1541 tp.Privileges[0].Luid = luid;
1546 tp.Privileges[0].Attributes = 0;
1566 win_skip(
"Failed to set SE_BACKUP_NAME privileges, skipping tests\n");
1584 win_skip(
"Failed to set SE_RESTORE_NAME privileges, skipping tests\n");
1606 win_skip(
"Failed to set SE_RESTORE_NAME privileges, skipping tests\n");
1644 "RegConnectRegistryA failed err = %d\n", retl);
1651 "RegConnectRegistryA failed err = %d\n", retl);
1658 win_skip(
"OpenSCManagerA is not implemented\n");
1694 "Expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n",
ret);
1702 "Expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n",
ret);
1717 ok(!
val[0],
"Expected val to be untouched, got %s\n",
val);
1730 ok(!
val[0],
"Expected val to be untouched, got %s\n",
val);
1754 win_skip(
"RegQueryValueW is not implemented\n");
1759 ok(!valW[0],
"Expected valW to be untouched\n");
1768 ok(!valW[0],
"Expected valW to be untouched\n");
1772 size =
sizeof(valW);
1783 memset(valW,
'a',
sizeof(valW));
1784 size =
sizeof(valW);
1800 char classbuffer[32];
1801 WCHAR classbufferW[32];
1802 char expectbuffer[32];
1803 WCHAR expectbufferW[32];
1804 char subkey_class[] =
"subkey class";
1805 WCHAR subkey_classW[] = {
's',
'u',
'b',
'k',
'e',
'y',
' ',
'c',
'l',
'a',
's',
's',0};
1806 char subsubkey_class[] =
"subsubkey class";
1808 DWORD subkeys, maxsubkeylen, maxclasslen;
1817 ret =
RegQueryInfoKeyA(
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1820 ret =
RegQueryInfoKeyW(
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1824 ret =
RegQueryInfoKeyA(subkey,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1827 ret =
RegQueryInfoKeyW(subkey,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1831 memset(classbuffer, 0x55,
sizeof(classbuffer));
1832 ret =
RegQueryInfoKeyA(subkey, classbuffer,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1834 ok(classbuffer[0] == 0x55,
"classbuffer[0] = 0x%x\n", classbuffer[0]);
1836 memset(classbufferW, 0x55,
sizeof(classbufferW));
1837 ret =
RegQueryInfoKeyW(subkey, classbufferW,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1839 ok(classbufferW[0] == 0x5555,
"classbufferW[0] = 0x%x\n", classbufferW[0]);
1842 sdlen = classlen =0;
1843 ret =
RegQueryInfoKeyA(subkey,
NULL, &classlen,
NULL, &subkeys, &maxsubkeylen, &maxclasslen, &
values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite);
1845 ok(classlen ==
strlen(subkey_class),
"classlen = %u\n", classlen);
1846 ok(subkeys == 0,
"subkeys = %u\n", subkeys);
1847 ok(maxsubkeylen == 0,
"maxsubkeylen = %u\n", maxsubkeylen);
1848 ok(maxclasslen == 0,
"maxclasslen = %u\n", maxclasslen);
1850 ok(maxvaluenamelen == 0,
"maxvaluenamelen = %u\n", maxvaluenamelen);
1851 ok(maxvaluelen == 0,
"maxvaluelen = %u\n", maxvaluelen);
1856 sdlen = classlen = 0;
1857 ret =
RegQueryInfoKeyW(subkey,
NULL, &classlen,
NULL, &subkeys, &maxsubkeylen, &maxclasslen, &
values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite);
1859 ok(classlen ==
strlen(subkey_class),
"classlen = %u\n", classlen);
1860 ok(subkeys == 0,
"subkeys = %u\n", subkeys);
1861 ok(maxsubkeylen == 0,
"maxsubkeylen = %u\n", maxsubkeylen);
1862 ok(maxclasslen == 0,
"maxclasslen = %u\n", maxclasslen);
1864 ok(maxvaluenamelen == 0,
"maxvaluenamelen = %u\n", maxvaluenamelen);
1865 ok(maxvaluelen == 0,
"maxvaluelen = %u\n", maxvaluelen);
1877 sdlen = classlen = 0;
1878 ret =
RegQueryInfoKeyA(subkey,
NULL, &classlen,
NULL, &subkeys, &maxsubkeylen, &maxclasslen, &
values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite);
1880 ok(classlen ==
strlen(subkey_class),
"classlen = %u\n", classlen);
1881 ok(subkeys == 1,
"subkeys = %u\n", subkeys);
1882 ok(maxsubkeylen ==
strlen(
"subsubkey"),
"maxsubkeylen = %u\n", maxsubkeylen);
1883 ok(maxclasslen ==
strlen(subsubkey_class),
"maxclasslen = %u\n", maxclasslen);
1885 ok(maxvaluenamelen == 0,
"maxvaluenamelen = %u\n", maxvaluenamelen);
1886 ok(maxvaluelen ==
sizeof(
"data") *
sizeof(
WCHAR),
"maxvaluelen = %u\n", maxvaluelen);
1891 sdlen = classlen = 0;
1892 ret =
RegQueryInfoKeyW(subkey,
NULL, &classlen,
NULL, &subkeys, &maxsubkeylen, &maxclasslen, &
values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite);
1894 ok(classlen ==
strlen(subkey_class),
"classlen = %u\n", classlen);
1895 ok(subkeys == 1,
"subkeys = %u\n", subkeys);
1896 ok(maxsubkeylen ==
strlen(
"subsubkey"),
"maxsubkeylen = %u\n", maxsubkeylen);
1897 ok(maxclasslen ==
strlen(subsubkey_class),
"maxclasslen = %u\n", maxclasslen);
1899 ok(maxvaluenamelen == 0,
"maxvaluenamelen = %u\n", maxvaluenamelen);
1900 ok(maxvaluelen ==
sizeof(
"data") *
sizeof(
WCHAR),
"maxvaluelen = %u\n", maxvaluelen);
1913 ret =
RegQueryInfoKeyA(subkey,
NULL, &classlen,
NULL, &subkeys, &maxsubkeylen, &maxclasslen, &
values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite);
1916 ok(maxvaluenamelen ==
strlen(
"value one"),
"maxvaluenamelen = %u\n", maxvaluenamelen);
1917 ok(maxvaluelen ==
sizeof(
"second value data") *
sizeof(
WCHAR),
"maxvaluelen = %u\n", maxvaluelen);
1920 ret =
RegQueryInfoKeyW(subkey,
NULL, &classlen,
NULL, &subkeys, &maxsubkeylen, &maxclasslen, &
values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite);
1923 ok(maxvaluenamelen ==
strlen(
"value one"),
"maxvaluenamelen = %u\n", maxvaluenamelen);
1924 ok(maxvaluelen ==
sizeof(
"second value data") *
sizeof(
WCHAR),
"maxvaluelen = %u\n", maxvaluelen);
1927 memset(classbuffer, 0x55,
sizeof(classbuffer));
1929 ret =
RegQueryInfoKeyA(subkey, classbuffer, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1931 ok(classlen ==
strlen(subkey_class) ||
1932 classlen == 0,
"classlen = %u\n", classlen);
1933 memset(expectbuffer, 0x55,
sizeof(expectbuffer));
1934 ok(!
memcmp(classbuffer, expectbuffer,
sizeof(classbuffer)),
"classbuffer was modified\n");
1936 memset(classbufferW, 0x55,
sizeof(classbufferW));
1938 ret =
RegQueryInfoKeyW(subkey, classbufferW, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1940 ok(classlen ==
strlen(subkey_class) ||
1941 classlen == 0,
"classlen = %u\n", classlen);
1942 memset(expectbufferW, 0x55,
sizeof(expectbufferW));
1943 ok(!
memcmp(classbufferW, expectbufferW,
sizeof(classbufferW)),
"classbufferW was modified\n");
1946 memset(classbuffer, 0x55,
sizeof(classbuffer));
1948 ret =
RegQueryInfoKeyA(subkey, classbuffer, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1950 ok(classlen == 0,
"classlen = %u\n", classlen);
1951 memset(expectbuffer, 0x55,
sizeof(expectbuffer));
1952 expectbuffer[0] = 0;
1953 ok(!
memcmp(classbuffer, expectbuffer,
sizeof(classbuffer)),
"classbuffer was modified\n");
1955 memset(classbufferW, 0x55,
sizeof(classbufferW));
1957 ret =
RegQueryInfoKeyW(subkey, classbufferW, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1960 classlen ==
strlen(subkey_class),
"classlen = %u\n", classlen);
1961 memset(expectbufferW, 0x55,
sizeof(expectbufferW));
1962 ok(!
memcmp(classbufferW, expectbufferW,
sizeof(classbufferW)),
"classbufferW was modified\n");
1965 memset(classbuffer, 0x55,
sizeof(classbuffer));
1966 classlen =
sizeof(subkey_class) - 1;
1967 ret =
RegQueryInfoKeyA(subkey, classbuffer, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1969 ok(classlen ==
sizeof(subkey_class) - 2,
"classlen = %u\n", classlen);
1970 memset(expectbuffer, 0x55,
sizeof(expectbuffer));
1971 strcpy(expectbuffer, subkey_class);
1972 expectbuffer[
sizeof(subkey_class) - 2] = 0;
1973 expectbuffer[
sizeof(subkey_class) - 1] = 0x55;
1974 ok(!
memcmp(classbuffer, expectbuffer,
sizeof(classbuffer)),
1975 "classbuffer = %.*s, expected %s\n",
1976 (
int)
sizeof(classbuffer), classbuffer, expectbuffer);
1978 memset(classbufferW, 0x55,
sizeof(classbufferW));
1979 classlen =
sizeof(subkey_class) - 1;
1980 ret =
RegQueryInfoKeyW(subkey, classbufferW, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1982 ok(classlen ==
sizeof(subkey_class) - 2 ||
1983 classlen ==
strlen(subkey_class),
"classlen = %u\n", classlen);
1984 memset(expectbufferW, 0x55,
sizeof(expectbufferW));
1985 ok(!
memcmp(classbufferW, expectbufferW,
sizeof(classbufferW)),
"classbufferW was modified\n");
1988 memset(classbuffer, 0x55,
sizeof(classbuffer));
1989 classlen =
sizeof(subkey_class);
1990 ret =
RegQueryInfoKeyA(subkey, classbuffer, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1992 ok(classlen ==
sizeof(subkey_class) - 1,
"classlen = %u\n", classlen);
1993 memset(expectbuffer, 0x55,
sizeof(expectbuffer));
1994 strcpy(expectbuffer, subkey_class);
1995 ok(!
memcmp(classbuffer, expectbuffer,
sizeof(classbuffer)),
1996 "classbuffer = \"%.*s\", expected %s\n",
1997 (
int)
sizeof(classbuffer), classbuffer, expectbuffer);
1999 memset(classbuffer, 0x55,
sizeof(classbuffer));
2000 classlen = 0xdeadbeef;
2001 ret =
RegQueryInfoKeyA(subkey, classbuffer, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
2003 ok(classlen ==
sizeof(subkey_class) - 1,
"classlen = %u\n", classlen);
2004 memset(expectbuffer, 0x55,
sizeof(expectbuffer));
2005 strcpy(expectbuffer, subkey_class);
2006 ok(!
memcmp(classbuffer, expectbuffer,
sizeof(classbuffer)),
2007 "classbuffer = \"%.*s\", expected %s\n",
2008 (
int)
sizeof(classbuffer), classbuffer, expectbuffer);
2010 memset(classbufferW, 0x55,
sizeof(classbufferW));
2011 classlen =
sizeof(subkey_class);
2012 ret =
RegQueryInfoKeyW(subkey, classbufferW, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
2014 ok(classlen ==
sizeof(subkey_class) - 1,
"classlen = %u\n", classlen);
2015 memset(expectbufferW, 0x55,
sizeof(expectbufferW));
2016 lstrcpyW(expectbufferW, subkey_classW);
2017 ok(!
memcmp(classbufferW, expectbufferW,
sizeof(classbufferW)),
2018 "classbufferW = %s, expected %s\n",
2021 memset(classbufferW, 0x55,
sizeof(classbufferW));
2022 classlen = 0xdeadbeef;
2023 ret =
RegQueryInfoKeyW(subkey, classbufferW, &classlen,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
2025 ok(classlen ==
sizeof(subkey_class) - 1,
"classlen = %u\n", classlen);
2026 memset(expectbufferW, 0x55,
sizeof(expectbufferW));
2027 lstrcpyW(expectbufferW, subkey_classW);
2028 ok(!
memcmp(classbufferW, expectbufferW,
sizeof(classbufferW)),
2029 "classbufferW = %s, expected %s\n",
2042 static const char string[] =
"FullString";
2124 win_skip(
"Skipping RegCopyTreeA tests, function not present\n");
2134 ret = pRegCopyTreeA(
src,
"nonexistent_subkey",
dst);
2158 ret = pRegCopyTreeA(
src,
"subkey2",
dst);
2213 HKEY subkey, subkey2;
2217 if(!pRegDeleteTreeA) {
2218 win_skip(
"Skipping RegDeleteTreeA tests, function not present\n");
2233 ret = pRegDeleteTreeA(subkey,
"subkey2");
2236 "subkey2 was not deleted\n");
2239 "Default value of subkey no longer present\n");
2248 "subkey2 was not deleted\n");
2250 "Default value of subkey no longer present\n");
2264 ret = pRegDeleteTreeA(subkey,
NULL);
2267 "subkey was deleted\n");
2269 "subkey2 was not deleted\n");
2271 "subkey3 was not deleted\n");
2275 "Default value of subkey is not present\n");
2279 "Value is still present\n");
2285 ret = pRegDeleteTreeA(subkey,
"");
2297 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
ret);
2304 static const char keyname[] =
"test_rw_order";
2312 skip(
"Couldn't create key. Skipping.\n");
2317 "RegSetValueExA for value \"A\" failed\n");
2319 "RegSetValueExA for value \"C\" failed\n");
2321 "RegSetValueExA for value \"D\" failed\n");
2323 "RegSetValueExA for value \"B\" failed\n");
2326 &value_name_max_len,
NULL,
NULL,
NULL),
"RegQueryInfoKeyA failed\n");
2332 ok(
strcmp(value_buf,
"A") == 0,
"Expected name \"A\", got %s\n", value_buf);
2335 todo_wine ok(
strcmp(value_buf,
"C") == 0,
"Expected name \"C\", got %s\n", value_buf);
2338 todo_wine ok(
strcmp(value_buf,
"D") == 0,
"Expected name \"D\", got %s\n", value_buf);
2341 todo_wine ok(
strcmp(value_buf,
"B") == 0,
"Expected name \"B\", got %s\n", value_buf);
2348 static const WCHAR targetW[] = {
'\\',
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
'W',
'i',
'n',
'e',
2349 '\\',
'T',
'e',
's',
't',
'\\',
't',
'a',
'r',
'g',
'e',
't',0};
2357 if (!pRtlFormatCurrentUserKeyPath || !pNtDeleteKey)
2359 win_skip(
"Can't perform symlink tests\n" );
2363 pRtlFormatCurrentUserKeyPath( &target_str );
2365 target_len = target_str.
Length +
sizeof(targetW);
2416 ok(
len == target_len -
sizeof(
WCHAR),
"wrong len %u\n",
len );
2441 ok(
len == target_len -
sizeof(
WCHAR),
"wrong len %u\n",
len );
2450 ok(
len == target_len -
sizeof(
WCHAR),
"wrong len %u\n",
len );
2472 pRtlFreeUnicodeString( &target_str );
2498#define check_key_value(root,name,flags,expect) _check_key_value( __LINE__, root, name, flags, expect )
2503 HKEY key, root32, root64, key32, key64, native, op_key;
2512 skip(
"Not on Wow64, no redirection\n" );
2519 skip(
"not enough privileges to modify HKLM\n");
2551 ok(
dw == 32,
"wrong value %u\n",
dw );
2557 ok(
dw == 64,
"wrong value %u\n",
dw );
2569 trace(
"using Vista-style Wow6432Node handling\n" );
2583 trace(
"using Vista-style Wow6432Node handling\n" );
2671 ok(
dw == (is_vista ? 64 : 32) ||
broken(
dw == 32) ,
"wrong value %u\n",
dw );
2699 ok(
dw == 32 || (is_vista &&
dw == 64),
"wrong value %u\n",
dw );
2720 ok(
dw == 32,
"wrong value %u\n",
dw );
2744 if (pRegDeleteKeyExA)
2771 pRegDeleteKeyExA(native,
"AWineTest", 0, 0);
2781 win_skip(
"Can't write to registry\n");
2794 err = pRegDeleteKeyExA(op_key,
"AWineTest", opposite, 0);
2803 HKEY hkey, hklm, hkcr, hkeysub1, hklmsub1, hkcrsub1, hklmsub2, hkcrsub2;
2819 skip(
"not enough privileges to add a user class\n");
2822 ok(!
IS_HKCR(hkey),
"hkcr mask set in %p\n", hkey);
2829 "test key not found in hkcr: %d\n",
res);
2832 skip(
"HKCR key merging not supported\n");
2892 skip(
"not enough privileges to add a system class\n");
2895 ok(!
IS_HKCR(hklm),
"hkcr mask set in %p\n", hklm);
2901 "test key not found in hkcr: %d\n",
res);
2902 ok(
IS_HKCR(hkcr),
"hkcr mask not set in %p\n", hkcr);
2930 ok(!
IS_HKCR(hkey),
"hkcr mask set in %p\n", hkey);
2936 "test key not found in hkcr: %d\n",
res);
2937 ok(
IS_HKCR(hkcr),
"hkcr mask not set in %p\n", hkcr);
2975 ok(!
IS_HKCR(hklmsub1),
"hkcr mask set in %p\n", hklmsub1);
2979 ok(
IS_HKCR(hkcrsub1),
"hkcr mask not set in %p\n", hkcrsub1);
3002 ok(!
IS_HKCR(hkeysub1),
"hkcr mask set in %p\n", hkeysub1);
3040 ok(
IS_HKCR(hkcrsub2),
"hkcr mask not set in %p\n", hkcrsub2);
3050 ok(!
IS_HKCR(hklmsub2),
"hkcr mask set in %p\n", hklmsub2);
3070 ok(!
IS_HKCR(hklmsub1),
"hkcr mask set in %p\n", hklmsub1);
3102 HKEY hkcu=0, hklm=0, hkcr=0, hkcusub[2]={0}, hklmsub[2]={0};
3118 skip(
"failed to add a user class\n");
3125 "test key not found in hkcr: %d\n",
res);
3128 skip(
"HKCR key merging not supported\n");
3182 skip(
"not enough privileges to add a system class\n");
3234 "expected ERROR_KEY_DELETED, got %d\n",
res);
3239 "expected ERROR_KEY_DELETED, got %d\n",
res);
3285 "hkcr mask not set in %p\n", hkey);
3290 ok(!
IS_HKCR(hkey),
"hkcr mask set in %p\n", hkey);
3295 ok(!
IS_HKCR(hkey),
"hkcr mask set in %p\n", hkey);
3300 ok(!
IS_HKCR(hkey),
"hkcr mask set in %p\n", hkey);
3305 ok(!
IS_HKCR(hkey),
"hkcr mask set in %p\n", hkey);
3321 skip(
"Perflib\\009\\Counter does not exist, skipping perflib test\n");
3353 val_count =
sizeof(
value);
3361 val_count =
sizeof(
value);
3407 memset(longname,
'a', 400);
3411 "expect ERROR_FILE_NOT_FOUND, got %i\n",
res);
3432 if (!pRegDeleteKeyValueA)
3434 win_skip(
"RegDeleteKeyValue is not available.\n");
3459 ok(!
ret,
"failed with error %d\n",
ret);
3467 ret = pRegDeleteKeyValueA(
hkey_main,
"Subkey1",
"test");
3517 ok(dwret ==
WAIT_TIMEOUT,
"expected WAIT_TIMEOUT, got %u\n", dwret);
3522 ok(dwret ==
WAIT_OBJECT_0,
"expected WAIT_OBJECT_0, got %u\n", dwret);
3531 static char buf[16][64];
3536 if (
sizeof(
ll) >
sizeof(
unsigned long) &&
ll >> 32)
3544#define cmp_li(a, b, c) cmp_li_real(a, b, c, __LINE__)
3548 if (diff < 0) diff = -diff;
3549 ok_(__FILE__,
line)(diff <= slack,
"values don't match: %s/%s\n",
3555 static const WCHAR globalW[] = {
'G',
'l',
'o',
'b',
'a',
'l',0 };
3556 static const WCHAR dummyW[5] = {
'd',
'u',
'm',
'm',
'y' };
3557 static const char *
const names[] = {
NULL,
"",
"Global",
"2" "invalid counter name" };
3590 ok(
limit > 0,
"too many times ERROR_MORE_DATA returned\n");
3592 ok(dwret ==
ERROR_SUCCESS,
"expected ERROR_SUCCESS, got %d\n", dwret);
3601 ok(
pdb->Signature[0] ==
'P',
"expected Signature[0] = 'P', got 0x%x\n",
pdb->Signature[0]);
3602 ok(
pdb->Signature[1] ==
'E',
"expected Signature[1] = 'E', got 0x%x\n",
pdb->Signature[1]);
3603 ok(
pdb->Signature[2] ==
'R',
"expected Signature[2] = 'R', got 0x%x\n",
pdb->Signature[2]);
3604 ok(
pdb->Signature[3] ==
'F',
"expected Signature[3] = 'F', got 0x%x\n",
pdb->Signature[3]);
3613 cbData = 0xdeadbeef;
3616 ok(cbData == 0,
"got %u\n", cbData);
3621 ok(cbData == 0,
"got %u\n", cbData);
3623 cbData = 0xdeadbeef;
3627 ok(cbData == 0,
"got %u\n", cbData);
3633 ok(cbData == 0,
"got %u\n", cbData);
3635 cbData = 0xdeadbeef;
3639 ok(cbData == 0,
"got %u\n", cbData);
3645 ok(cbData == 0,
"got %u\n", cbData);
3650 cbData =
sizeof(
buf);
3670 ok(
pdb->Signature[0] ==
'P',
"got '%c'\n",
pdb->Signature[0]);
3671 ok(
pdb->Signature[1] ==
'E',
"got '%c'\n",
pdb->Signature[1]);
3672 ok(
pdb->Signature[2] ==
'R',
"got '%c'\n",
pdb->Signature[2]);
3673 ok(
pdb->Signature[3] ==
'F',
"got '%c'\n",
pdb->Signature[3]);
3675 ok(
pdb->LittleEndian == 1,
"got %u\n",
pdb->LittleEndian);
3676 ok(
pdb->Version == 1,
"got %u\n",
pdb->Version);
3677 ok(
pdb->Revision == 1,
"got %u\n",
pdb->Revision);
3678 len = (
sizeof(*pdb) +
pdb->SystemNameLength + 7) & ~7;
3679 ok(
pdb->TotalByteLength ==
len,
"got %u vs %u\n",
pdb->TotalByteLength,
len);
3680 ok(
pdb->HeaderLength ==
pdb->TotalByteLength,
"got %u\n",
pdb->HeaderLength);
3681 ok(
pdb->NumObjectTypes == 0,
"got %u\n",
pdb->NumObjectTypes);
3683 ok(
pdb->DefaultObject != 0,
"got %u\n",
pdb->DefaultObject);
3684 ok(
pdb->SystemTime.wYear == st.
wYear,
"got %u\n",
pdb->SystemTime.wYear);
3685 ok(
pdb->SystemTime.wMonth == st.
wMonth,
"got %u\n",
pdb->SystemTime.wMonth);
3686 ok(
pdb->SystemTime.wDayOfWeek == st.
wDayOfWeek,
"got %u\n",
pdb->SystemTime.wDayOfWeek);
3687 ok(
pdb->SystemTime.wDay == st.
wDay,
"got %u\n",
pdb->SystemTime.wDay);
3688 if (
U(
pdb->PerfTime).LowPart != 0x77777777)
3690 if (
U(
pdb->PerfFreq).LowPart != 0x77777777)
3693 ok(
pdb->SystemNameLength == (sysname_len + 1) *
sizeof(
WCHAR),
"expected %u, got %u\n",
3694 (sysname_len + 1) *
sizeof(
WCHAR),
pdb->SystemNameLength);
3695 ok(
pdb->SystemNameOffset ==
sizeof(*
pdb),
"got %u\n",
pdb->SystemNameOffset);
3699 len =
pdb->TotalByteLength - (
sizeof(*pdb) +
pdb->SystemNameLength);
3705 p =
buf +
sizeof(*pdb) +
pdb->SystemNameLength;
3734 cbData =
sizeof(
buf);
3739 cbData =
sizeof(
buf);
3744 ok(cbData ==
sizeof(
buf),
"got %u\n", cbData);
3749 if (pRegSetKeyValueW)
DWORD WINAPI SetEntriesInAclA(ULONG cCountOfExplicitEntries, PEXPLICIT_ACCESS_A pListOfExplicitEntries, PACL OldAcl, PACL *NewAcl)
#define SUB_CONTAINERS_AND_OBJECTS_INHERIT
@ TRUSTEE_IS_WELL_KNOWN_GROUP
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#define UlongToHandle(ul)
#define RegCloseKey(hKey)
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
#define ERROR_INSUFFICIENT_BUFFER
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegLoadKeyA(HKEY hKey, LPCSTR lpSubKey, LPCSTR lpFile)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegDeleteKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ REGSAM samDesired, _In_ DWORD Reserved)
LONG WINAPI RegFlushKey(HKEY hKey)
LONG WINAPI RegDeleteTreeA(IN HKEY hKey, IN LPCSTR lpSubKey OPTIONAL)
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)
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
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)
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
LONG WINAPI RegSetValueA(HKEY hKeyOriginal, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpData, DWORD cbData)
LONG WINAPI RegEnumKeyA(HKEY hKey, DWORD dwIndex, LPSTR lpName, DWORD cbName)
LONG WINAPI RegSetKeySecurity(HKEY hKey, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
LSTATUS WINAPI RegGetValueA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
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)
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)
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
LONG WINAPI RegCopyTreeA(IN HKEY hKeySrc, IN LPCSTR lpSubKey OPTIONAL, IN HKEY hKeyDest)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
LONG WINAPI RegSaveKeyA(HKEY hKey, LPCSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
LONG WINAPI RegConnectRegistryA(IN LPCSTR lpMachineName, IN HKEY hKey, OUT PHKEY phkResult)
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)
LONG WINAPI RegNotifyChangeKeyValue(HKEY hKey, BOOL bWatchSubtree, DWORD dwNotifyFilter, HANDLE hEvent, BOOL fAsynchronous)
LONG WINAPI RegSetValueW(HKEY hKeyOriginal, LPCWSTR lpSubKey, DWORD dwType, LPCWSTR lpData, DWORD cbData)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
LONG WINAPI RegDeleteKeyValueA(IN HKEY hKey, IN LPCSTR lpSubKey OPTIONAL, IN LPCSTR lpValueName OPTIONAL)
LONG WINAPI RegUnLoadKeyA(HKEY hKey, LPCSTR lpSubKey)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
LONG WINAPI RegSetKeyValueW(IN HKEY hKey, IN LPCWSTR lpSubKey OPTIONAL, IN LPCWSTR lpValueName OPTIONAL, IN DWORD dwType, IN LPCVOID lpData OPTIONAL, IN DWORD cbData)
BOOL WINAPI LookupPrivilegeValueA(LPCSTR lpSystemName, LPCSTR lpName, PLUID lpLuid)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
PVOID WINAPI FreeSid(PSID pSid)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define GetCurrentProcess()
#define ERROR_NO_MORE_ITEMS
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
#define ERROR_ACCESS_DENIED
static void cleanup(void)
static const WCHAR valueW[]
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableA(IN LPCSTR lpName, IN LPCSTR lpValue)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
VOID WINAPI GetSystemTime(OUT LPSYSTEMTIME lpSystemTime)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
#define RRF_RT_REG_BINARY
#define RRF_ZEROONFAILURE
#define RRF_RT_REG_EXPAND_SZ
static LPSTR get_temp_buffer(void)
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
UNICODE_STRING * PUNICODE_STRING
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLboolean GLenum GLenum GLvoid * values
GLuint GLint GLboolean GLint GLenum access
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static const WCHAR emptyW[]
REFIID LPVOID DWORD_PTR dw
const unsigned char size_t insize
unsigned char size_t * outsize
static const WCHAR testW[]
static const WCHAR globalW[]
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
double __cdecl remainder(double, double)
#define memcpy(s1, s2, n)
#define ERROR_ALREADY_EXISTS
#define ERROR_FILE_NOT_FOUND
#define sprintf(buf, format,...)
static void test_reg_copy_tree(void)
static BOOL set_privileges(LPCSTR privilege, BOOL set)
static DWORD get_key_value(HKEY root, const char *name, DWORD flags)
static void cmp_li_real(LARGE_INTEGER *l1, LARGE_INTEGER *l2, LONGLONG slack, int line)
static const char * wine_debugstr_an(const char *str, int n)
static void check_user_privs(void)
static void create_test_entries(void)
static const char * sTestpath2
static void test_enum_value(void)
static void test_string_termination(void)
static void test_reg_delete_tree(void)
static void test_RegNotifyChangeKeyValue(void)
static void test_redirection(void)
static void test_symlinks(void)
static void test_query_value_ex(void)
static void test_reg_open_key(void)
static void test_reg_query_value(void)
static void test_get_value(void)
static void test_reg_close_key(void)
static void test_classesroot(void)
static void test_reg_create_key(void)
static void test_reg_query_info(void)
static void test_RegQueryValueExPerformanceData(void)
#define test_hkey_main_Value_A(name, string, full_byte_len)
static void _test_hkey_main_Value_W(int line, LPCWSTR name, LPCWSTR string, DWORD full_byte_len)
#define ADVAPI32_GET_PROC(func)
static void test_perflib_key(void)
static void test_classesroot_mask(void)
static void test_reg_save_key(void)
static const DWORD ptr_size
static void InitFunctionPtrs(void)
#define check_key_value(root, name, flags, expect)
static void test_classesroot_enum(void)
static void _check_key_value(int line, HANDLE root, const char *name, DWORD flags, DWORD expect)
static const char * sTestpath1
static void test_reg_delete_key(void)
static void test_deleted_key(void)
static const char *static REGSAM
static void test_delete_key_value(void)
static void test_RegOpenCurrentUser(void)
static const char * dbgstr_longlong(ULONGLONG ll)
static void test_rw_order(void)
static void test_delete_value(void)
static void _test_hkey_main_Value_A(int line, LPCSTR name, LPCSTR string, DWORD full_byte_len)
#define test_hkey_main_Value_W(name, string, full_byte_len)
static void test_reg_load_key(void)
static void test_set_value(void)
static void setup_main_key(void)
static void test_reg_unload_key(void)
static void test_regconnectregistry(void)
static const CHAR emptyA[]
static const WCHAR foobarW[]
static HINSTANCE hkernel32
#define todo_wine_if(is_todo)
static const WCHAR dummyW[]
#define REG_OPTION_OPEN_LINK
#define REG_OPTION_CREATE_LINK
#define REG_OPTION_NON_VOLATILE
#define STANDARD_RIGHTS_ALL
#define KEY_ENUMERATE_SUB_KEYS
#define REG_OPTION_VOLATILE
DWORD WINAPI GetVersion()
#define delete_key(r, p, s)
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR lpMachineName, LPCSTR lpDatabaseName, DWORD dwDesiredAccess)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
BOOL WINAPI SHIM_OBJ_NAME() GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
__CRT_INLINE void __cdecl ftime(struct timeb *_Tmb)
DWORD WINAPI GetLastError(void)
#define MAX_COMPUTERNAME_LENGTH
#define ERROR_BAD_NETPATH
#define ERROR_UNSUPPORTED_TYPE
#define ERROR_BAD_PATHNAME
#define ERROR_KEY_DELETED
#define ERROR_NO_SYSTEM_RESOURCES
#define ERROR_CHILD_MUST_BE_VOLATILE
#define ERROR_DATATYPE_MISMATCH
#define ERROR_DLL_INIT_FAILED
struct _PERF_DATA_BLOCK PERF_DATA_BLOCK
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_CONFIG
#define HKEY_CURRENT_USER
#define REG_NOTIFY_CHANGE_NAME
#define HKEY_PERFORMANCE_TEXT
#define HKEY_PERFORMANCE_NLSTEXT
#define HKEY_PERFORMANCE_DATA
#define HKEY_CLASSES_ROOT
#define DACL_SECURITY_INFORMATION
#define SECURITY_WORLD_SID_AUTHORITY
#define TOKEN_ADJUST_PRIVILEGES
#define SECURITY_WORLD_RID
#define SECURITY_DESCRIPTOR_REVISION
#define SE_PRIVILEGE_ENABLED
#define SECURITY_DESCRIPTOR_MIN_LENGTH