mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 19:40:35 +00:00
shcore/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6dc3d258ce
commit
f3a87a92e9
|
@ -1,4 +1,3 @@
|
||||||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
|
||||||
TESTDLL = shcore.dll
|
TESTDLL = shcore.dll
|
||||||
IMPORTS = advapi32
|
IMPORTS = advapi32
|
||||||
|
|
||||||
|
|
|
@ -138,30 +138,30 @@ static void test_process_reference(void)
|
||||||
|
|
||||||
obj = (void *)0xdeadbeef;
|
obj = (void *)0xdeadbeef;
|
||||||
hr = pGetProcessReference(&obj);
|
hr = pGetProcessReference(&obj);
|
||||||
ok(hr == E_FAIL, "Unexpected hr %#x.\n", hr);
|
ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
|
||||||
ok(obj == NULL, "Unexpected pointer.\n");
|
ok(obj == NULL, "Unexpected pointer.\n");
|
||||||
|
|
||||||
test_unk_init(&test_unk);
|
test_unk_init(&test_unk);
|
||||||
test_unk_init(&test_unk2);
|
test_unk_init(&test_unk2);
|
||||||
|
|
||||||
pSetProcessReference(&test_unk.IUnknown_iface);
|
pSetProcessReference(&test_unk.IUnknown_iface);
|
||||||
ok(test_unk.refcount == 1, "Unexpected refcount %u.\n", test_unk.refcount);
|
ok(test_unk.refcount == 1, "Unexpected refcount %lu.\n", test_unk.refcount);
|
||||||
pSetProcessReference(&test_unk2.IUnknown_iface);
|
pSetProcessReference(&test_unk2.IUnknown_iface);
|
||||||
ok(test_unk.refcount == 1, "Unexpected refcount %u.\n", test_unk.refcount);
|
ok(test_unk.refcount == 1, "Unexpected refcount %lu.\n", test_unk.refcount);
|
||||||
ok(test_unk2.refcount == 1, "Unexpected refcount %u.\n", test_unk2.refcount);
|
ok(test_unk2.refcount == 1, "Unexpected refcount %lu.\n", test_unk2.refcount);
|
||||||
|
|
||||||
hr = pGetProcessReference(&obj);
|
hr = pGetProcessReference(&obj);
|
||||||
ok(hr == S_OK, "Failed to get reference, hr %#x.\n", hr);
|
ok(hr == S_OK, "Failed to get reference, hr %#lx.\n", hr);
|
||||||
ok(obj == &test_unk2.IUnknown_iface, "Unexpected pointer.\n");
|
ok(obj == &test_unk2.IUnknown_iface, "Unexpected pointer.\n");
|
||||||
ok(test_unk2.refcount == 2, "Unexpected refcount %u.\n", test_unk2.refcount);
|
ok(test_unk2.refcount == 2, "Unexpected refcount %lu.\n", test_unk2.refcount);
|
||||||
|
|
||||||
hmod = LoadLibraryA("shell32.dll");
|
hmod = LoadLibraryA("shell32.dll");
|
||||||
|
|
||||||
pSHGetInstanceExplorer = (void *)GetProcAddress(hmod, "SHGetInstanceExplorer");
|
pSHGetInstanceExplorer = (void *)GetProcAddress(hmod, "SHGetInstanceExplorer");
|
||||||
hr = pSHGetInstanceExplorer(&obj);
|
hr = pSHGetInstanceExplorer(&obj);
|
||||||
ok(hr == S_OK, "Failed to get reference, hr %#x.\n", hr);
|
ok(hr == S_OK, "Failed to get reference, hr %#lx.\n", hr);
|
||||||
ok(obj == &test_unk2.IUnknown_iface, "Unexpected pointer.\n");
|
ok(obj == &test_unk2.IUnknown_iface, "Unexpected pointer.\n");
|
||||||
ok(test_unk2.refcount == 3, "Unexpected refcount %u.\n", test_unk2.refcount);
|
ok(test_unk2.refcount == 3, "Unexpected refcount %lu.\n", test_unk2.refcount);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_SHUnicodeToAnsi(void)
|
static void test_SHUnicodeToAnsi(void)
|
||||||
|
@ -334,7 +334,7 @@ static void test_SHRegDuplicateHKey(void)
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
|
|
||||||
ret = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey);
|
ret = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey);
|
||||||
ok(!ret, "Failed to create test key, ret %d.\n", ret);
|
ok(!ret, "Failed to create test key, ret %ld.\n", ret);
|
||||||
|
|
||||||
hkey2 = pSHRegDuplicateHKey(hkey);
|
hkey2 = pSHRegDuplicateHKey(hkey);
|
||||||
ok(hkey2 != NULL && hkey2 != hkey, "Unexpected duplicate key.\n");
|
ok(hkey2 != NULL && hkey2 != hkey, "Unexpected duplicate key.\n");
|
||||||
|
@ -351,20 +351,20 @@ static void test_SHDeleteKey(void)
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
|
|
||||||
ret = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey);
|
ret = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey);
|
||||||
ok(!ret, "Failed to create test key, %d.\n", ret);
|
ok(!ret, "Failed to create test key, %ld.\n", ret);
|
||||||
|
|
||||||
ret = RegCreateKeyA(hkey, "delete_key", &hkey2);
|
ret = RegCreateKeyA(hkey, "delete_key", &hkey2);
|
||||||
ok(!ret, "Failed to create test key, %d.\n", ret);
|
ok(!ret, "Failed to create test key, %ld.\n", ret);
|
||||||
RegCloseKey(hkey2);
|
RegCloseKey(hkey2);
|
||||||
|
|
||||||
ret = RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test");
|
ret = RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test");
|
||||||
ok(ret == ERROR_ACCESS_DENIED, "Unexpected return value %d.\n", ret);
|
ok(ret == ERROR_ACCESS_DENIED, "Unexpected return value %ld.\n", ret);
|
||||||
|
|
||||||
ret = pSHDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test");
|
ret = pSHDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test");
|
||||||
ok(!ret, "Failed to delete a key, %d.\n", ret);
|
ok(!ret, "Unexpected retval %lu.\n", ret);
|
||||||
|
|
||||||
ret = RegCloseKey(hkey);
|
ret = RegCloseKey(hkey);
|
||||||
ok(!ret, "Failed to delete a key, %d.\n", ret);
|
ok(!ret, "Unexpected retval %lu.\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HKEY create_test_entries(void)
|
static HKEY create_test_entries(void)
|
||||||
|
@ -377,7 +377,7 @@ static HKEY create_test_entries(void)
|
||||||
SetEnvironmentVariableA("FOO", test_envvar2);
|
SetEnvironmentVariableA("FOO", test_envvar2);
|
||||||
|
|
||||||
ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKey);
|
ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKey);
|
||||||
ok(!ret, "RegCreateKeyA failed, ret=%u\n", ret);
|
ok(!ret, "Unexpected retval %lu.\n", ret);
|
||||||
|
|
||||||
if (hKey)
|
if (hKey)
|
||||||
{
|
{
|
||||||
|
@ -431,18 +431,18 @@ static void test_SHGetValue(void)
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
type = -1;
|
type = -1;
|
||||||
ret = pSHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", &type, buf, &size);
|
ret = pSHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", &type, buf, &size);
|
||||||
ok(!ret, "Failed to get value, ret %u.\n", ret);
|
ok(!ret, "Failed to get value, ret %lu.\n", ret);
|
||||||
|
|
||||||
ok(!strcmp(test_exp_path1, buf), "Unexpected value %s.\n", buf);
|
ok(!strcmp(test_exp_path1, buf), "Unexpected value %s.\n", buf);
|
||||||
ok(type == REG_SZ, "Unexpected value type %d.\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
strcpy(buf, initial_buffer);
|
strcpy(buf, initial_buffer);
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
type = -1;
|
type = -1;
|
||||||
ret = pSHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", &type, buf, &size);
|
ret = pSHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", &type, buf, &size);
|
||||||
ok(!ret, "Failed to get value, ret %u.\n", ret);
|
ok(!ret, "Failed to get value, ret %lu.\n", ret);
|
||||||
ok(!strcmp(test_path1, buf), "Unexpected value %s.\n", buf);
|
ok(!strcmp(test_path1, buf), "Unexpected value %s.\n", buf);
|
||||||
ok(type == REG_SZ, "Unexpected value type %d.\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
delete_key(hkey, "Software\\Wine", "Test");
|
delete_key(hkey, "Software\\Wine", "Test");
|
||||||
}
|
}
|
||||||
|
@ -457,31 +457,31 @@ static void test_SHRegGetValue(void)
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_EXPAND_SZ, &type, data, &size);
|
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_EXPAND_SZ, &type, data, &size);
|
||||||
ok(ret == ERROR_INVALID_PARAMETER, "SHRegGetValue failed, ret=%u\n", ret);
|
ok(ret == ERROR_INVALID_PARAMETER, "Unexpected retval %lu.\n", ret);
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_SZ, &type, data, &size);
|
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_SZ, &type, data, &size);
|
||||||
ok(ret == ERROR_SUCCESS, "SHRegGetValue failed, ret=%u\n", ret);
|
ok(!ret, "Unexpected retval %lu.\n", ret);
|
||||||
ok(!strcmp(data, test_exp_path1), "data = %s, expected %s\n", data, test_exp_path1);
|
ok(!strcmp(data, test_exp_path1), "data = %s, expected %s\n", data, test_exp_path1);
|
||||||
ok(type == REG_SZ, "type = %d, expected REG_SZ\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_DWORD, &type, data, &size);
|
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", SRRF_RT_REG_DWORD, &type, data, &size);
|
||||||
ok(ret == ERROR_UNSUPPORTED_TYPE, "SHRegGetValue failed, ret=%u\n", ret);
|
ok(ret == ERROR_UNSUPPORTED_TYPE, "Unexpected retval %lu.\n", ret);
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_EXPAND_SZ, &type, data, &size);
|
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_EXPAND_SZ, &type, data, &size);
|
||||||
ok(ret == ERROR_INVALID_PARAMETER, "SHRegGetValue failed, ret=%u\n", ret);
|
ok(ret == ERROR_INVALID_PARAMETER, "Unexpected retval %lu.\n", ret);
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_SZ, &type, data, &size);
|
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_SZ, &type, data, &size);
|
||||||
ok(ret == ERROR_SUCCESS, "SHRegGetValue failed, ret=%u\n", ret);
|
ok(!ret, "Unexpected retval %lu.\n", ret);
|
||||||
ok(!strcmp(data, test_path1), "data = %s, expected %s\n", data, test_path1);
|
ok(!strcmp(data, test_path1), "data = %s, expected %s\n", data, test_path1);
|
||||||
ok(type == REG_SZ, "type = %d, expected REG_SZ\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_QWORD, &type, data, &size);
|
ret = pSHRegGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", SRRF_RT_REG_QWORD, &type, data, &size);
|
||||||
ok(ret == ERROR_UNSUPPORTED_TYPE, "SHRegGetValue failed, ret=%u\n", ret);
|
ok(ret == ERROR_UNSUPPORTED_TYPE, "Unexpected retval %lu.\n", ret);
|
||||||
|
|
||||||
delete_key(hkey, "Software\\Wine", "Test");
|
delete_key(hkey, "Software\\Wine", "Test");
|
||||||
}
|
}
|
||||||
|
@ -496,7 +496,7 @@ static void test_SHQueryValueEx(void)
|
||||||
testkey = create_test_entries();
|
testkey = create_test_entries();
|
||||||
|
|
||||||
ret = RegOpenKeyExA(HKEY_CURRENT_USER, REG_TEST_KEY, 0, KEY_QUERY_VALUE, &hKey);
|
ret = RegOpenKeyExA(HKEY_CURRENT_USER, REG_TEST_KEY, 0, KEY_QUERY_VALUE, &hKey);
|
||||||
ok(!ret, "Failed to open a key, ret %u.\n", ret);
|
ok(!ret, "Failed to open a key, ret %lu.\n", ret);
|
||||||
|
|
||||||
/****** SHQueryValueExA ******/
|
/****** SHQueryValueExA ******/
|
||||||
|
|
||||||
|
@ -507,28 +507,28 @@ static void test_SHQueryValueEx(void)
|
||||||
* Case 1.1 All arguments are NULL
|
* Case 1.1 All arguments are NULL
|
||||||
*/
|
*/
|
||||||
ret = pSHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, NULL);
|
ret = pSHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, NULL);
|
||||||
ok(!ret, "Failed to query value, ret %u.\n", ret);
|
ok(!ret, "Failed to query value, ret %lu.\n", ret);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Case 1.2 dwType is set
|
* Case 1.2 dwType is set
|
||||||
*/
|
*/
|
||||||
type = -1;
|
type = -1;
|
||||||
ret = pSHQueryValueExA( hKey, "Test1", NULL, &type, NULL, NULL);
|
ret = pSHQueryValueExA( hKey, "Test1", NULL, &type, NULL, NULL);
|
||||||
ok(!ret, "Failed to query value, ret %u.\n", ret);
|
ok(!ret, "Failed to query value, ret %lu.\n", ret);
|
||||||
ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
size = 6;
|
size = 6;
|
||||||
ret = pSHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, &size);
|
ret = pSHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, &size);
|
||||||
ok(!ret, "Failed to query value, ret %u.\n", ret);
|
ok(!ret, "Failed to query value, ret %lu.\n", ret);
|
||||||
ok(size == buffer_len1, "Buffer sizes (%u) and (%u) are not equal\n", size, buffer_len1);
|
ok(size == buffer_len1, "Buffer sizes %lu and %lu are not equal\n", size, buffer_len1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expanded > unexpanded
|
* Expanded > unexpanded
|
||||||
*/
|
*/
|
||||||
size = 6;
|
size = 6;
|
||||||
ret = pSHQueryValueExA( hKey, "Test3", NULL, NULL, NULL, &size);
|
ret = pSHQueryValueExA( hKey, "Test3", NULL, NULL, NULL, &size);
|
||||||
ok(!ret, "Failed to query value, ret %u.\n", ret);
|
ok(!ret, "Failed to query value, ret %lu.\n", ret);
|
||||||
ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
|
ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Case 1 string shrinks during expanding
|
* Case 1 string shrinks during expanding
|
||||||
|
@ -537,10 +537,10 @@ static void test_SHQueryValueEx(void)
|
||||||
size = 6;
|
size = 6;
|
||||||
type = -1;
|
type = -1;
|
||||||
ret = pSHQueryValueExA( hKey, "Test1", NULL, &type, buf, &size);
|
ret = pSHQueryValueExA( hKey, "Test1", NULL, &type, buf, &size);
|
||||||
ok(ret == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got (%u)\n", ret);
|
ok(ret == ERROR_MORE_DATA, "Unexpected retval %ld.\n", ret);
|
||||||
ok(!strcmp(initial_buffer, buf), "Comparing (%s) with (%s) failed\n", buf, initial_buffer);
|
ok(!strcmp(initial_buffer, buf), "Comparing (%s) with (%s) failed\n", buf, initial_buffer);
|
||||||
ok(size == buffer_len1, "Buffer sizes (%u) and (%u) are not equal\n", size, buffer_len1);
|
ok(size == buffer_len1, "Buffer sizes %lu and %lu are not equal\n", size, buffer_len1);
|
||||||
ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* string grows during expanding
|
* string grows during expanding
|
||||||
|
@ -550,10 +550,10 @@ static void test_SHQueryValueEx(void)
|
||||||
size = 6;
|
size = 6;
|
||||||
type = -1;
|
type = -1;
|
||||||
ret = pSHQueryValueExA( hKey, "Test3", NULL, &type, buf, &size);
|
ret = pSHQueryValueExA( hKey, "Test3", NULL, &type, buf, &size);
|
||||||
ok(ret == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got (%u)\n", ret);
|
ok(ret == ERROR_MORE_DATA, "Unexpected retval %ld.\n", ret);
|
||||||
ok(!strcmp(initial_buffer, buf), "Comparing (%s) with (%s) failed\n", buf, initial_buffer);
|
ok(!strcmp(initial_buffer, buf), "Comparing (%s) with (%s) failed\n", buf, initial_buffer);
|
||||||
ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
|
ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
|
||||||
ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* string grows during expanding
|
* string grows during expanding
|
||||||
|
@ -565,15 +565,15 @@ static void test_SHQueryValueEx(void)
|
||||||
size = strlen(test_envvar2) - 2;
|
size = strlen(test_envvar2) - 2;
|
||||||
type = -1;
|
type = -1;
|
||||||
ret = pSHQueryValueExA(hKey, "Test3", NULL, &type, buf, &size);
|
ret = pSHQueryValueExA(hKey, "Test3", NULL, &type, buf, &size);
|
||||||
ok(ret == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got (%u)\n", ret);
|
ok(ret == ERROR_MORE_DATA, "Unexpected retval %ld.\n", ret);
|
||||||
|
|
||||||
todo_wine
|
todo_wine
|
||||||
{
|
{
|
||||||
ok(!strcmp("", buf), "Unexpanded string %s.\n", buf);
|
ok(!strcmp("", buf), "Unexpanded string %s.\n", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
|
ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
|
||||||
ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* string grows during expanding
|
* string grows during expanding
|
||||||
|
@ -585,7 +585,7 @@ static void test_SHQueryValueEx(void)
|
||||||
size = exp_len2 - 4;
|
size = exp_len2 - 4;
|
||||||
type = -1;
|
type = -1;
|
||||||
ret = pSHQueryValueExA( hKey, "Test3", NULL, &type, buf, &size);
|
ret = pSHQueryValueExA( hKey, "Test3", NULL, &type, buf, &size);
|
||||||
ok(ret == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got (%u)\n", ret);
|
ok(ret == ERROR_MORE_DATA, "Unexpected retval %ld.\n", ret);
|
||||||
|
|
||||||
todo_wine
|
todo_wine
|
||||||
{
|
{
|
||||||
|
@ -593,8 +593,8 @@ static void test_SHQueryValueEx(void)
|
||||||
"Expected empty or first part of the string \"%s\", got \"%s\"\n", test_envvar2, buf);
|
"Expected empty or first part of the string \"%s\", got \"%s\"\n", test_envvar2, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
|
ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
|
||||||
ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The buffer is NULL but the size is set
|
* The buffer is NULL but the size is set
|
||||||
|
@ -603,9 +603,9 @@ static void test_SHQueryValueEx(void)
|
||||||
size = 6;
|
size = 6;
|
||||||
type = -1;
|
type = -1;
|
||||||
ret = pSHQueryValueExA( hKey, "Test3", NULL, &type, NULL, &size);
|
ret = pSHQueryValueExA( hKey, "Test3", NULL, &type, NULL, &size);
|
||||||
ok(!ret, "Failed to query value, ret %u.\n", ret);
|
ok(!ret, "Failed to query value, ret %lu.\n", ret);
|
||||||
ok(size >= buffer_len2, "Buffer size (%u) should be >= (%u)\n", size, buffer_len2);
|
ok(size >= buffer_len2, "Buffer size %lu should be >= %lu.\n", size, buffer_len2);
|
||||||
ok(type == REG_SZ, "Expected REG_SZ, got (%u)\n", type);
|
ok(type == REG_SZ, "Unexpected type %ld.\n", type);
|
||||||
|
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
|
@ -622,7 +622,7 @@ static void test_SHRegGetPath(void)
|
||||||
|
|
||||||
strcpy(buf, initial_buffer);
|
strcpy(buf, initial_buffer);
|
||||||
ret = pSHRegGetPathA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", buf, 0);
|
ret = pSHRegGetPathA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", buf, 0);
|
||||||
ok(!ret, "Failed to get path, ret %u.\n", ret);
|
ok(!ret, "Failed to get path, ret %lu.\n", ret);
|
||||||
ok(!strcmp(test_exp_path1, buf), "Unexpected path %s.\n", buf);
|
ok(!strcmp(test_exp_path1, buf), "Unexpected path %s.\n", buf);
|
||||||
|
|
||||||
delete_key(hkey, "Software\\Wine", "Test");
|
delete_key(hkey, "Software\\Wine", "Test");
|
||||||
|
@ -645,14 +645,14 @@ static void test_SHCopyKey(void)
|
||||||
|
|
||||||
hKeyDst = NULL;
|
hKeyDst = NULL;
|
||||||
ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst);
|
ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst);
|
||||||
ok(!ret, "Failed to create a test key, ret %d.\n", ret);
|
ok(!ret, "Failed to create a test key, ret %ld.\n", ret);
|
||||||
|
|
||||||
hKeySrc = NULL;
|
hKeySrc = NULL;
|
||||||
ret = RegOpenKeyA(HKEY_LOCAL_MACHINE, REG_CURRENT_VERSION, &hKeySrc);
|
ret = RegOpenKeyA(HKEY_LOCAL_MACHINE, REG_CURRENT_VERSION, &hKeySrc);
|
||||||
ok(!ret, "Failed to open a test key, ret %d.\n", ret);
|
ok(!ret, "Failed to open a test key, ret %ld.\n", ret);
|
||||||
|
|
||||||
ret = pSHCopyKeyA(hKeySrc, NULL, hKeyDst, 0);
|
ret = pSHCopyKeyA(hKeySrc, NULL, hKeyDst, 0);
|
||||||
ok(!ret, "Copy failed, ret=(%u)\n", ret);
|
ok(!ret, "Copy failed, ret %lu.\n", ret);
|
||||||
|
|
||||||
RegCloseKey(hKeySrc);
|
RegCloseKey(hKeySrc);
|
||||||
RegCloseKey(hKeyDst);
|
RegCloseKey(hKeyDst);
|
||||||
|
@ -660,7 +660,7 @@ static void test_SHCopyKey(void)
|
||||||
/* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */
|
/* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */
|
||||||
hKeyDst = NULL;
|
hKeyDst = NULL;
|
||||||
ret = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Shell Folders", &hKeyDst);
|
ret = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Shell Folders", &hKeyDst);
|
||||||
ok(!ret, "Failed to open a test key, ret %d.\n", ret);
|
ok(!ret, "Failed to open a test key, ret %ld.\n", ret);
|
||||||
|
|
||||||
/* And the we copied the values too */
|
/* And the we copied the values too */
|
||||||
ok(!pSHQueryValueExA(hKeyDst, "Common AppData", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n");
|
ok(!pSHQueryValueExA(hKeyDst, "Common AppData", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n");
|
||||||
|
@ -676,7 +676,7 @@ static void _check_file_size(const CHAR *filename, LONG exp_size, int line)
|
||||||
DWORD file_size = 0xdeadbeef;
|
DWORD file_size = 0xdeadbeef;
|
||||||
handle = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
|
handle = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
|
||||||
file_size = GetFileSize(handle, NULL);
|
file_size = GetFileSize(handle, NULL);
|
||||||
ok_(__FILE__,line)(file_size == exp_size, "got wrong file size: %d.\n", file_size);
|
ok_(__FILE__,line)(file_size == exp_size, "got wrong file size: %ld.\n", file_size);
|
||||||
CloseHandle(handle);
|
CloseHandle(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -688,11 +688,11 @@ static void _check_stream_size(IStream *obj, LONG exp_size, int line)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
stream_size.QuadPart = 0xdeadbeef;
|
stream_size.QuadPart = 0xdeadbeef;
|
||||||
hr = pIStream_Size(obj, &stream_size);
|
hr = pIStream_Size(obj, &stream_size);
|
||||||
ok_(__FILE__,line)(hr == S_OK, "IStream_Size failed: 0x%08x.\n", hr);
|
ok_(__FILE__,line)(hr == S_OK, "IStream_Size failed: hr %#lx.\n", hr);
|
||||||
ok_(__FILE__,line)(stream_size.QuadPart == exp_size, "Size(): got wrong size of stream: %s.\n",
|
ok_(__FILE__,line)(stream_size.QuadPart == exp_size, "Size(): got wrong size of stream: %s.\n",
|
||||||
wine_dbgstr_longlong(stream_size.QuadPart));
|
wine_dbgstr_longlong(stream_size.QuadPart));
|
||||||
hr = IStream_Stat(obj, &stat, STATFLAG_NONAME);
|
hr = IStream_Stat(obj, &stat, STATFLAG_NONAME);
|
||||||
ok_(__FILE__,line)(hr == S_OK, "IStream_Stat failed: 0x%08x.\n", hr);
|
ok_(__FILE__,line)(hr == S_OK, "IStream_Stat failed: hr %#lx.\n", hr);
|
||||||
ok_(__FILE__,line)(stat.cbSize.QuadPart == exp_size, "Stat(): got wrong size of stream: %s.\n",
|
ok_(__FILE__,line)(stat.cbSize.QuadPart == exp_size, "Stat(): got wrong size of stream: %s.\n",
|
||||||
wine_dbgstr_longlong(stat.cbSize.QuadPart));
|
wine_dbgstr_longlong(stat.cbSize.QuadPart));
|
||||||
}
|
}
|
||||||
|
@ -706,7 +706,7 @@ static void _check_stream_pos(IStream *obj, LONG exp_pos, int line)
|
||||||
move.QuadPart = 0;
|
move.QuadPart = 0;
|
||||||
pos.QuadPart = 0xdeadbeef;
|
pos.QuadPart = 0xdeadbeef;
|
||||||
hr = IStream_Seek(obj, move, STREAM_SEEK_CUR, &pos);
|
hr = IStream_Seek(obj, move, STREAM_SEEK_CUR, &pos);
|
||||||
ok_(__FILE__,line)(hr == S_OK, "IStream_Seek failed: 0x%08x.\n", hr);
|
ok_(__FILE__,line)(hr == S_OK, "IStream_Seek failed: hr %#lx.\n", hr);
|
||||||
ok_(__FILE__,line)(pos.QuadPart == exp_pos, "got wrong position: %s.\n",
|
ok_(__FILE__,line)(pos.QuadPart == exp_pos, "got wrong position: %s.\n",
|
||||||
wine_dbgstr_longlong(pos.QuadPart));
|
wine_dbgstr_longlong(pos.QuadPart));
|
||||||
}
|
}
|
||||||
|
@ -722,32 +722,32 @@ static void test_stream_size(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
handle = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
|
handle = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
|
||||||
ok(handle != INVALID_HANDLE_VALUE, "File creation failed: 0x%08x.\n", GetLastError());
|
ok(handle != INVALID_HANDLE_VALUE, "File creation failed: %lu.\n", GetLastError());
|
||||||
WriteFile(handle, test_data, sizeof(test_data), &written, NULL);
|
WriteFile(handle, test_data, sizeof(test_data), &written, NULL);
|
||||||
ok(written == sizeof(test_data), "Failed to write data into file.\n");
|
ok(written == sizeof(test_data), "Failed to write data into file.\n");
|
||||||
CloseHandle(handle);
|
CloseHandle(handle);
|
||||||
|
|
||||||
/* in read-only mode, SetSize() will success but it has no effect on Size() and the file */
|
/* in read-only mode, SetSize() will success but it has no effect on Size() and the file */
|
||||||
hr = pSHCreateStreamOnFileA(filename, STGM_FAILIFTHERE|STGM_READ, &stream);
|
hr = pSHCreateStreamOnFileA(filename, STGM_FAILIFTHERE|STGM_READ, &stream);
|
||||||
ok(hr == S_OK, "SHCreateStreamOnFileA failed: 0x%08x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||||
CHECK_STREAM_SIZE(stream, sizeof(test_data));
|
CHECK_STREAM_SIZE(stream, sizeof(test_data));
|
||||||
stream_size.QuadPart = 0;
|
stream_size.QuadPart = 0;
|
||||||
hr = IStream_SetSize(stream, stream_size);
|
hr = IStream_SetSize(stream, stream_size);
|
||||||
ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||||
CHECK_STREAM_SIZE(stream, sizeof(test_data));
|
CHECK_STREAM_SIZE(stream, sizeof(test_data));
|
||||||
CHECK_STREAM_POS(stream, 0);
|
CHECK_STREAM_POS(stream, 0);
|
||||||
stream_size.QuadPart = 100;
|
stream_size.QuadPart = 100;
|
||||||
hr = IStream_SetSize(stream, stream_size);
|
hr = IStream_SetSize(stream, stream_size);
|
||||||
ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||||
CHECK_STREAM_SIZE(stream, sizeof(test_data));
|
CHECK_STREAM_SIZE(stream, sizeof(test_data));
|
||||||
CHECK_STREAM_POS(stream, 100);
|
CHECK_STREAM_POS(stream, 100);
|
||||||
IStream_Release(stream);
|
IStream_Release(stream);
|
||||||
CHECK_FILE_SIZE(filename, sizeof(test_data));
|
CHECK_FILE_SIZE(filename, sizeof(test_data));
|
||||||
|
|
||||||
hr = pSHCreateStreamOnFileA(filename, STGM_FAILIFTHERE|STGM_WRITE, &stream);
|
hr = pSHCreateStreamOnFileA(filename, STGM_FAILIFTHERE|STGM_WRITE, &stream);
|
||||||
ok(hr == S_OK, "SHCreateStreamOnFileA failed: 0x%08x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||||
hr = pSHCreateStreamOnFileA(filename, STGM_FAILIFTHERE|STGM_READ, &stream2);
|
hr = pSHCreateStreamOnFileA(filename, STGM_FAILIFTHERE|STGM_READ, &stream2);
|
||||||
ok(hr == S_OK, "SHCreateStreamOnFileA failed: 0x%08x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||||
CHECK_STREAM_SIZE(stream, sizeof(test_data));
|
CHECK_STREAM_SIZE(stream, sizeof(test_data));
|
||||||
CHECK_STREAM_SIZE(stream2, sizeof(test_data));
|
CHECK_STREAM_SIZE(stream2, sizeof(test_data));
|
||||||
CHECK_STREAM_POS(stream, 0);
|
CHECK_STREAM_POS(stream, 0);
|
||||||
|
@ -755,7 +755,7 @@ static void test_stream_size(void)
|
||||||
|
|
||||||
stream_size.QuadPart = 0;
|
stream_size.QuadPart = 0;
|
||||||
hr = IStream_SetSize(stream, stream_size);
|
hr = IStream_SetSize(stream, stream_size);
|
||||||
ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||||
CHECK_STREAM_SIZE(stream, 0);
|
CHECK_STREAM_SIZE(stream, 0);
|
||||||
CHECK_STREAM_SIZE(stream2, 0);
|
CHECK_STREAM_SIZE(stream2, 0);
|
||||||
CHECK_STREAM_POS(stream, 0);
|
CHECK_STREAM_POS(stream, 0);
|
||||||
|
@ -763,7 +763,7 @@ static void test_stream_size(void)
|
||||||
|
|
||||||
stream_size.QuadPart = 100;
|
stream_size.QuadPart = 100;
|
||||||
hr = IStream_SetSize(stream, stream_size);
|
hr = IStream_SetSize(stream, stream_size);
|
||||||
ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||||
CHECK_STREAM_SIZE(stream, 100);
|
CHECK_STREAM_SIZE(stream, 100);
|
||||||
CHECK_STREAM_SIZE(stream2, 100);
|
CHECK_STREAM_SIZE(stream2, 100);
|
||||||
CHECK_STREAM_POS(stream, 0);
|
CHECK_STREAM_POS(stream, 0);
|
||||||
|
@ -771,7 +771,7 @@ static void test_stream_size(void)
|
||||||
|
|
||||||
stream_size.QuadPart = 90;
|
stream_size.QuadPart = 90;
|
||||||
hr = IStream_SetSize(stream2, stream_size);
|
hr = IStream_SetSize(stream2, stream_size);
|
||||||
ok(hr == S_OK, "IStream_SetSize failed: 0x%08x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||||
CHECK_STREAM_SIZE(stream, 100);
|
CHECK_STREAM_SIZE(stream, 100);
|
||||||
CHECK_STREAM_SIZE(stream2, 100);
|
CHECK_STREAM_SIZE(stream2, 100);
|
||||||
CHECK_STREAM_POS(stream, 0);
|
CHECK_STREAM_POS(stream, 0);
|
||||||
|
|
Loading…
Reference in a new issue