Commit b73e3102 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

setupapi/tests: Enable compilation with long types.

parent 0e4c1084
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = setupapi.dll
IMPORTS = advapi32 cabinet ole32 setupapi shell32 uuid user32
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -42,13 +42,13 @@ static void test_SetupPromptForDiskA(void)
memset(buffer, 0, sizeof(buffer));
ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, "kernel32.dll", NULL, IDF_CHECKFIRST, buffer, sizeof(buffer) - 1, &length);
ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret);
ok(length == strlen(path) + 1, "Expect length %u, got %u\n", lstrlenA(path) + 1, length);
ok(length == strlen(path) + 1, "Expect length %u, got %lu\n", lstrlenA(path) + 1, length);
ok(!strcmp(path, buffer), "Expected path %s, got %s\n", debugstr_a(path), debugstr_a(buffer));
memset(buffer, 0, sizeof(buffer));
ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, "kernel32.dll", NULL, IDF_CHECKFIRST, NULL, 0, &length);
ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %d\n", ret);
ok(length == strlen(path) + 1, "Expect length %u, got %u\n", lstrlenA(path) + 1, length);
ok(length == strlen(path) + 1, "Expect length %u, got %lu\n", lstrlenA(path) + 1, length);
memset(buffer, 0, sizeof(buffer));
ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, "kernel32.dll", NULL, IDF_CHECKFIRST, buffer, 1, &length);
......@@ -61,7 +61,7 @@ static void test_SetupPromptForDiskA(void)
memset(buffer, 0, sizeof(buffer));
ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, "kernel32.dll", NULL, IDF_CHECKFIRST, buffer, strlen(path) + 1, &length);
ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret);
ok(length == strlen(path) + 1, "Expect length %u, got %u\n", lstrlenA(path) + 1, length);
ok(length == strlen(path) + 1, "Expect length %u, got %lu\n", lstrlenA(path) + 1, length);
ok(!strcmp(path, buffer), "Expected path %s, got %s\n", debugstr_a(path), debugstr_a(buffer));
}
......@@ -77,13 +77,13 @@ static void test_SetupPromptForDiskW(void)
memset(buffer, 0, sizeof(buffer));
ret = SetupPromptForDiskW(0, L"Test", L"Testdisk", path, L"kernel32.dll", NULL, IDF_CHECKFIRST, buffer, ARRAY_SIZE(buffer) - 1, &length);
ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret);
ok(length == lstrlenW(path) + 1, "Expect length %u, got %u\n", lstrlenW(path) + 1, length);
ok(length == lstrlenW(path) + 1, "Expect length %u, got %lu\n", lstrlenW(path) + 1, length);
ok(!lstrcmpW(path, buffer), "Expected path %s, got %s\n", debugstr_w(path), debugstr_w(buffer));
memset(buffer, 0, sizeof(buffer));
ret = SetupPromptForDiskW(0, L"Test", L"Testdisk", path, L"kernel32.dll", NULL, IDF_CHECKFIRST, NULL, 0, &length);
ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %d\n", ret);
ok(length == lstrlenW(path) + 1, "Expect length %u, got %u\n", lstrlenW(path) + 1, length);
ok(length == lstrlenW(path) + 1, "Expect length %u, got %lu\n", lstrlenW(path) + 1, length);
memset(buffer, 0, sizeof(buffer));
ret = SetupPromptForDiskW(0, L"Test", L"Testdisk", path, L"kernel32.dll", NULL, IDF_CHECKFIRST, buffer, 1, &length);
......@@ -96,7 +96,7 @@ static void test_SetupPromptForDiskW(void)
memset(buffer, 0, sizeof(buffer));
ret = SetupPromptForDiskW(0, L"Test", L"Testdisk", path, L"kernel32.dll", NULL, IDF_CHECKFIRST, buffer, lstrlenW(path) + 1, &length);
ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret);
ok(length == lstrlenW(path) + 1, "Expect length %u, got %u\n", lstrlenW(path) + 1, length);
ok(length == lstrlenW(path) + 1, "Expect length %u, got %lu\n", lstrlenW(path) + 1, length);
ok(!lstrcmpW(path, buffer), "Expected path %s, got %s\n", debugstr_w(path), debugstr_w(buffer));
}
......
......@@ -52,7 +52,7 @@ static void test_SetupCreateDiskSpaceListA(void)
"Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
if (!ret)
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
else
ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
......@@ -63,7 +63,7 @@ static void test_SetupCreateDiskSpaceListA(void)
"Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win9x/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -72,7 +72,7 @@ static void test_SetupCreateDiskSpaceListA(void)
"Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win9x/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -81,7 +81,7 @@ static void test_SetupCreateDiskSpaceListA(void)
"Expected SetupCreateDiskSpaceListA to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win9x/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
}
......@@ -113,7 +113,7 @@ static void test_SetupCreateDiskSpaceListW(void)
"Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
if (!ret)
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
else
ok(SetupDestroyDiskSpaceList(ret), "Expected SetupDestroyDiskSpaceList to succeed\n");
......@@ -124,7 +124,7 @@ static void test_SetupCreateDiskSpaceListW(void)
"Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -133,7 +133,7 @@ static void test_SetupCreateDiskSpaceListW(void)
"Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -142,7 +142,7 @@ static void test_SetupCreateDiskSpaceListW(void)
"Expected SetupCreateDiskSpaceListW to return NULL, got %p\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
broken(GetLastError() == 0xdeadbeef), /* NT4/Win2k */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
}
......@@ -154,25 +154,25 @@ static void test_SetupDuplicateDiskSpaceListA(void)
duplicate = SetupDuplicateDiskSpaceListA(NULL, NULL, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(NULL, (void *)0xdeadbeef, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(NULL, NULL, 0xdeadbeef, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(NULL, NULL, 0, ~0U);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
handle = SetupCreateDiskSpaceListA(NULL, 0, 0);
ok(handle != NULL,
......@@ -188,25 +188,25 @@ static void test_SetupDuplicateDiskSpaceListA(void)
duplicate = SetupDuplicateDiskSpaceListA(handle, (void *)0xdeadbeef, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0xdeadbeef, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, SPDSL_IGNORE_DISK);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, ~0U);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, 0);
ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
......@@ -230,25 +230,25 @@ static void test_SetupDuplicateDiskSpaceListW(void)
}
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(NULL, (void *)0xdeadbeef, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(NULL, NULL, 0xdeadbeef, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(NULL, NULL, 0, ~0U);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
handle = SetupCreateDiskSpaceListW(NULL, 0, 0);
ok(handle != NULL,
......@@ -264,25 +264,25 @@ static void test_SetupDuplicateDiskSpaceListW(void)
duplicate = SetupDuplicateDiskSpaceListW(handle, (void *)0xdeadbeef, 0, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0xdeadbeef, 0);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, SPDSL_IGNORE_DISK);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, ~0U);
ok(!duplicate, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, 0);
ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate);
......@@ -303,7 +303,7 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void)
ret = SetupQuerySpaceRequiredOnDriveA(NULL, NULL, NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -312,14 +312,14 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void)
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveA(NULL, "", NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -328,7 +328,7 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void)
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %lu\n",
GetLastError());
handle = SetupCreateDiskSpaceListA(NULL, 0, 0);
......@@ -340,7 +340,7 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void)
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_DRIVE, /* Win9x */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -350,14 +350,14 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void)
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_DRIVE, /* Win9x */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveA(handle, "", NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_DRIVE,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -366,7 +366,7 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void)
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_DRIVE,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
ok(SetupDestroyDiskSpaceList(handle),
......@@ -390,7 +390,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void)
}
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -399,14 +399,14 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void)
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveW(NULL, emptyW, NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -415,7 +415,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void)
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %lu\n",
GetLastError());
handle = SetupCreateDiskSpaceListA(NULL, 0, 0);
......@@ -427,7 +427,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void)
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_DRIVE, /* NT4/Win2k/XP/Win2k3 */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -437,14 +437,14 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void)
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_INVALID_DRIVE, /* NT4/Win2k/XP/Win2k3 */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupQuerySpaceRequiredOnDriveW(handle, emptyW, NULL, NULL, 0);
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_DRIVE,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -453,7 +453,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void)
ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret);
ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n");
ok(GetLastError() == ERROR_INVALID_DRIVE,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
ok(SetupDestroyDiskSpaceList(handle),
......
......@@ -62,7 +62,7 @@ static void load_resource(const char *name, const char *filename)
void *ptr;
file = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", filename, GetLastError());
ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", filename, GetLastError());
res = FindResourceA(NULL, name, "TESTDLL");
ok( res != 0, "couldn't find resource\n" );
......@@ -78,9 +78,9 @@ static void create_inf_file(LPCSTR filename, const char *data)
BOOL ret;
HANDLE handle = CreateFileA(filename, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
ok(handle != INVALID_HANDLE_VALUE, "Failed to create %s, error %u.\n", filename, GetLastError());
ok(handle != INVALID_HANDLE_VALUE, "Failed to create %s, error %lu.\n", filename, GetLastError());
ret = WriteFile(handle, data, strlen(data), &res, NULL);
ok(ret, "Failed to write file, error %u.\n", GetLastError());
ok(ret, "Failed to write file, error %lu.\n", GetLastError());
CloseHandle(handle);
}
......@@ -292,7 +292,7 @@ static void create_cab_file(const CHAR *name, const CHAR *files)
res = add_file(hfci, ptr, tcompTYPE_MSZIP);
ok(res, "Failed to add file: %s\n", ptr);
res = DeleteFileA(ptr);
ok(res, "Failed to delete file %s, error %u\n", ptr, GetLastError());
ok(res, "Failed to delete file %s, error %lu\n", ptr, GetLastError());
ptr += lstrlenA(ptr) + 1;
}
......@@ -339,7 +339,7 @@ static void ok_registry(BOOL expectsuccess)
ret = RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest");
ok((expectsuccess && ret == ERROR_SUCCESS) ||
(!expectsuccess && ret == ERROR_FILE_NOT_FOUND),
"Expected registry key Software\\Wine\\setupapitest to %s, RegDeleteKey returned %d\n",
"Expected registry key Software\\Wine\\setupapitest to %s, RegDeleteKey returned %ld\n",
expectsuccess ? "exist" : "not exist",
ret);
}
......@@ -356,7 +356,7 @@ static void test_cmdline(void)
run_cmdline("DefaultInstall", 128, path);
ok_registry(TRUE);
ret = DeleteFileA(inffile);
ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError());
ok(ret, "Expected source inf to exist, last error was %ld\n", GetLastError());
/* Test handling of spaces in path, unquoted and quoted */
create_inf_file(infwithspaces, cmdline_inf);
......@@ -370,7 +370,7 @@ static void test_cmdline(void)
ok_registry(FALSE);
ret = DeleteFileA(infwithspaces);
ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError());
ok(ret, "Expected source inf to exist, last error was %ld\n", GetLastError());
}
static const char *cmdline_inf_reg = "[Version]\n"
......@@ -409,7 +409,7 @@ static void test_registry(void)
RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest");
}
ret = DeleteFileA(inffile);
ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError());
ok(ret, "Expected source inf to exist, last error was %ld\n", GetLastError());
}
static void test_install_from(void)
......@@ -435,7 +435,7 @@ static void test_install_from(void)
ret = SetupInstallFromInfSectionA(NULL, infhandle, "DefaultInstall", SPINST_REGISTRY, key,
"A:\\", 0, NULL, NULL, NULL, NULL);
ok(ret, "Unexpected failure\n");
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08x\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
/* Check if the registry key is recursively deleted */
res = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest", &key);
......@@ -470,7 +470,7 @@ static void test_install_svc_from(void)
ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_SECTION_NOT_FOUND,
"Expected ERROR_SECTION_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_SECTION_NOT_FOUND, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -482,7 +482,7 @@ static void test_install_svc_from(void)
ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_SECTION_NOT_FOUND,
"Expected ERROR_SECTION_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_SECTION_NOT_FOUND, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -494,7 +494,7 @@ static void test_install_svc_from(void)
ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -506,7 +506,7 @@ static void test_install_svc_from(void)
ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -518,7 +518,7 @@ static void test_install_svc_from(void)
ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -530,7 +530,7 @@ static void test_install_svc_from(void)
ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -542,7 +542,7 @@ static void test_install_svc_from(void)
ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError());
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -561,7 +561,7 @@ static void test_install_svc_from(void)
}
ok(ret, "Expected success\n");
ok(GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %08x\n", GetLastError());
"Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -573,7 +573,7 @@ static void test_install_svc_from(void)
SetLastError(0xdeadbeef);
ret = DeleteService(svc_handle);
ok(ret, "Service could not be deleted : %d\n", GetLastError());
ok(ret, "Service could not be deleted : %ld\n", GetLastError());
CloseServiceHandle(svc_handle);
CloseServiceHandle(scm_handle);
......@@ -588,7 +588,7 @@ static void test_install_svc_from(void)
SetLastError(0xdeadbeef);
ret = SetupInstallServicesFromInfSectionA(infhandle, "XSP.InstallPerVer", 0);
ok(ret, "Expected success\n");
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08x\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -602,7 +602,7 @@ static void test_install_svc_from(void)
SetLastError(0xdeadbeef);
ret = SetupInstallServicesFromInfSectionA(infhandle, "Winetest.Services", 0);
ok(ret, "Expected success\n");
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08x\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
SetupCloseInfFile(infhandle);
DeleteFileA(inffile);
......@@ -664,11 +664,11 @@ static void test_service_install(const char *executable, const char *argument)
lstrcatA(driver, "\\system32\\drivers\\winetest.sys");
ret = CopyFileA(executable, "winetest.sys", TRUE);
ok(ret, "CopyFileA failed, error %u\n", GetLastError());
ok(ret, "CopyFileA failed, error %lu\n", GetLastError());
for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
winetest_push_context("%u", i);
winetest_push_context("%lu", i);
sprintf(buffer, inf, tests[i].add_service_flags, argument, tests[i].service_type, tests[i].start_type);
create_inf_file(inffile, buffer);
......@@ -687,20 +687,20 @@ static void test_service_install(const char *executable, const char *argument)
ret = StartServiceA(svc_handle, 0, NULL);
if (!tests[i].expect_start_error)
ok(ret, "StartServiceA failed, error %u\n", GetLastError());
ok(ret, "StartServiceA failed, error %lu\n", GetLastError());
else
{
ok(!ret, "StartServiceA succeeded\n");
ok(GetLastError() == tests[i].expect_start_error, "got error %u\n", GetLastError());
ok(GetLastError() == tests[i].expect_start_error, "got error %lu\n", GetLastError());
}
ret = QueryServiceStatus(svc_handle, &status);
ok(ret, "QueryServiceStatus failed: %u\n", GetLastError());
ok(ret, "QueryServiceStatus failed: %lu\n", GetLastError());
while (status.dwCurrentState == SERVICE_START_PENDING)
{
Sleep(100);
ret = QueryServiceStatus(svc_handle, &status);
ok(ret, "QueryServiceStatus failed: %u\n", GetLastError());
ok(ret, "QueryServiceStatus failed: %lu\n", GetLastError());
}
ret = ControlService(svc_handle, SERVICE_CONTROL_STOP, &status);
......@@ -708,13 +708,13 @@ static void test_service_install(const char *executable, const char *argument)
{
Sleep(100);
ret = QueryServiceStatus(svc_handle, &status);
ok(ret, "QueryServiceStatus failed: %u\n", GetLastError());
ok(ret, "QueryServiceStatus failed: %lu\n", GetLastError());
}
ok(status.dwCurrentState == SERVICE_STOPPED, "expected SERVICE_STOPPED, got %d\n", status.dwCurrentState);
ok(status.dwCurrentState == SERVICE_STOPPED, "expected SERVICE_STOPPED, got %ld\n", status.dwCurrentState);
SetLastError(0xdeadbeef);
ret = DeleteService(svc_handle);
ok(ret, "Service could not be deleted : %d\n", GetLastError());
ok(ret, "Service could not be deleted : %ld\n", GetLastError());
CloseServiceHandle(svc_handle);
CloseServiceHandle(scm_handle);
......@@ -807,17 +807,17 @@ static void test_inffilelistA(void)
*/
if (!GetTempFileNameA(CURR_DIR, "inftest", 1, dir))
{
win_skip("GetTempFileNameA failed with error %d\n", GetLastError());
win_skip("GetTempFileNameA failed with error %ld\n", GetLastError());
return;
}
if (!CreateDirectoryA(dir, NULL ))
{
win_skip("CreateDirectoryA(%s) failed with error %d\n", dir, GetLastError());
win_skip("CreateDirectoryA(%s) failed with error %ld\n", dir, GetLastError());
return;
}
if (!SetCurrentDirectoryA(dir))
{
win_skip("SetCurrentDirectoryA failed with error %d\n", GetLastError());
win_skip("SetCurrentDirectoryA failed with error %ld\n", GetLastError());
RemoveDirectoryA(dir);
return;
}
......@@ -831,7 +831,7 @@ static void test_inffilelistA(void)
ret = SetupGetInfFileListA(dir, INF_STYLE_OLDNT | INF_STYLE_WIN4, buffer,
MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListA to succeed!\n");
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
ok(expected == outsize, "expected required buffersize to be %ld, got %ld\n",
expected, outsize);
for(p = buffer; lstrlenA(p) && (outsize > (p - buffer)); p+=lstrlenA(p) + 1)
ok(!lstrcmpA(p,inffile2) || !lstrcmpA(p,inffile),
......@@ -872,7 +872,7 @@ static void test_inffilelist(void)
expected = 0;
SetLastError(0xdeadbeef);
ret = SetupGetInfFileListW(NULL, INF_STYLE_WIN4, NULL, 0, &expected);
ok(ret, "expected SetupGetInfFileListW to succeed! Error: %d\n", GetLastError());
ok(ret, "expected SetupGetInfFileListW to succeed! Error: %ld\n", GetLastError());
ok(expected > 0, "expected required buffersize to be at least 1\n");
/* check if an empty string doesn't behaves like NULL */
......@@ -886,17 +886,17 @@ static void test_inffilelist(void)
*/
if (!GetTempFileNameA(CURR_DIR, "inftest", 1, dirA))
{
win_skip("GetTempFileNameA failed with error %d\n", GetLastError());
win_skip("GetTempFileNameA failed with error %ld\n", GetLastError());
return;
}
if (!CreateDirectoryA(dirA, NULL ))
{
win_skip("CreateDirectoryA(%s) failed with error %d\n", dirA, GetLastError());
win_skip("CreateDirectoryA(%s) failed with error %ld\n", dirA, GetLastError());
return;
}
if (!SetCurrentDirectoryA(dirA))
{
win_skip("SetCurrentDirectoryA failed with error %d\n", GetLastError());
win_skip("SetCurrentDirectoryA failed with error %ld\n", GetLastError());
RemoveDirectoryA(dirA);
return;
}
......@@ -910,9 +910,9 @@ static void test_inffilelist(void)
SetLastError(0xdeadbeef);
ret = SetupGetInfFileListW(dir, INF_STYLE_WIN4, NULL, 0, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
ok(outsize == 1, "expected required buffersize to be 1, got %d\n", outsize);
ok(outsize == 1, "expected required buffersize to be 1, got %ld\n", outsize);
ok(ERROR_PATH_NOT_FOUND == GetLastError(),
"expected error ERROR_PATH_NOT_FOUND, got %d\n", GetLastError());
"expected error ERROR_PATH_NOT_FOUND, got %ld\n", GetLastError());
create_inf_file(inffile, inf);
create_inf_file(inffile2, inf);
......@@ -927,7 +927,7 @@ static void test_inffilelist(void)
ret = SetupGetInfFileListW(dir, INF_STYLE_WIN4, NULL, 0, &outsize);
ok(!ret, "expected SetupGetInfFileListW to fail!\n");
ok(ERROR_DIRECTORY == GetLastError(),
"expected error ERROR_DIRECTORY, got %d\n", GetLastError());
"expected error ERROR_DIRECTORY, got %ld\n", GetLastError());
/* make the filename look like directory
*/
......@@ -937,7 +937,7 @@ static void test_inffilelist(void)
ret = SetupGetInfFileListW(dir, INF_STYLE_WIN4, NULL, 0, &outsize);
ok(!ret, "expected SetupGetInfFileListW to fail!\n");
ok(ERROR_DIRECTORY == GetLastError(),
"expected error ERROR_DIRECTORY, got %d\n", GetLastError());
"expected error ERROR_DIRECTORY, got %ld\n", GetLastError());
/* now check the buffer contents of a valid call
*/
......@@ -945,7 +945,7 @@ static void test_inffilelist(void)
expected = 3 + strlen(inffile) + strlen(inffile2);
ret = SetupGetInfFileListW(dir, INF_STYLE_WIN4, buffer, MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
ok(expected == outsize, "expected required buffersize to be %ld, got %ld\n",
expected, outsize);
for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW),
......@@ -956,7 +956,7 @@ static void test_inffilelist(void)
create_inf_file(inffile2, inf2);
ret = SetupGetInfFileListW(dir, INF_STYLE_WIN4, buffer, MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
ok(expected == outsize, "expected required buffersize to be %ld, got %ld\n",
expected, outsize);
for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW),
......@@ -968,7 +968,7 @@ static void test_inffilelist(void)
expected = 3 + strlen(inffile) + strlen(inffile2);
ret = SetupGetInfFileListW(dir, INF_STYLE_WIN4, buffer, MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
ok(expected == outsize, "expected required buffersize to be %ld, got %ld\n",
expected, outsize);
for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW),
......@@ -979,7 +979,7 @@ static void test_inffilelist(void)
expected = 2 + strlen(invalid_inf);
ret = SetupGetInfFileListW(dir, INF_STYLE_OLDNT, buffer, MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
ok(expected == outsize, "expected required buffersize to be %ld, got %ld\n",
expected, outsize);
for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
ok(!lstrcmpW(p,invalid_infW), "unexpected filename %s\n",wine_dbgstr_w(p));
......@@ -990,7 +990,7 @@ static void test_inffilelist(void)
ret = SetupGetInfFileListW(dir, INF_STYLE_OLDNT | INF_STYLE_WIN4, buffer,
MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
ok(expected == outsize, "expected required buffersize to be %ld, got %ld\n",
expected, outsize);
for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW) || !lstrcmpW(p,invalid_infW),
......@@ -1036,12 +1036,12 @@ static void check_dirid(int dirid, LPCSTR expected)
ret = ERROR_FILE_NOT_FOUND;
}
ok(ret == ERROR_SUCCESS, "Failed getting value for dirid %i, err=%d\n", dirid, ret);
ok(ret == ERROR_SUCCESS, "Failed getting value for dirid %i, err=%ld\n", dirid, ret);
ok(!strcmp(actual, expected), "Expected path for dirid %i was \"%s\", got \"%s\"\n", dirid, expected, actual);
ok_registry(TRUE);
ret = DeleteFileA(inffile);
ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError());
ok(ret, "Expected source inf to exist, last error was %ld\n", GetLastError());
}
/* Test dirid values */
......@@ -1118,21 +1118,21 @@ static void test_install_files_queue(void)
sprintf(path, "%s\\%s", CURR_DIR, inffile);
hinf = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
ok(hinf != INVALID_HANDLE_VALUE, "Failed to open INF file, error %#x.\n", GetLastError());
ok(hinf != INVALID_HANDLE_VALUE, "Failed to open INF file, error %#lx.\n", GetLastError());
ret = CreateDirectoryA("src", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("src/alpha", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("src/alpha/beta", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("src/beta", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = SetupSetDirectoryIdA(hinf, 40000, CURR_DIR);
ok(ret, "Failed to set directory ID, error %u.\n", GetLastError());
ok(ret, "Failed to set directory ID, error %lu.\n", GetLastError());
ret = CreateDirectoryA("dst", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
create_file("src/one.txt");
create_file("src/beta/two.txt");
......@@ -1144,19 +1144,19 @@ static void test_install_files_queue(void)
create_file("dst/ten.txt");
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
context = SetupInitDefaultQueueCallbackEx(NULL, INVALID_HANDLE_VALUE, 0, 0, 0);
ok(!!context, "Failed to create callback context, error %#x.\n", GetLastError());
ok(!!context, "Failed to create callback context, error %#lx.\n", GetLastError());
ret = SetupInstallFilesFromInfSectionA(hinf, NULL, queue, "DefaultInstall", "src", 0);
ok(ret, "Failed to install files, error %#x.\n", GetLastError());
ok(ret, "Failed to install files, error %#lx.\n", GetLastError());
ok(file_exists("src/one.txt"), "Source file should exist.\n");
ok(!file_exists("dst/one.txt"), "Destination file should not exist.\n");
ret = SetupCommitFileQueueA(NULL, queue, SetupDefaultQueueCallbackA, context);
ok(ret, "Failed to commit queue, error %#x.\n", GetLastError());
ok(ret, "Failed to commit queue, error %#lx.\n", GetLastError());
ok(file_exists("src/one.txt"), "Source file should exist.\n");
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
......@@ -1173,7 +1173,7 @@ static void test_install_files_queue(void)
SetupTermDefaultQueueCallback(context);
ret = SetupCloseFileQueue(queue);
ok(ret, "Failed to close queue, error %#x.\n", GetLastError());
ok(ret, "Failed to close queue, error %#lx.\n", GetLastError());
SetupCloseInfFile(hinf);
delete_file("src/one.txt");
......@@ -1188,7 +1188,7 @@ static void test_install_files_queue(void)
delete_file("src/");
delete_file("dst/");
ret = DeleteFileA(inffile);
ok(ret, "Failed to delete INF file, error %u.\n", GetLastError());
ok(ret, "Failed to delete INF file, error %lu.\n", GetLastError());
}
static unsigned int got_need_media, got_copy_error, got_start_copy;
......@@ -1196,7 +1196,7 @@ static unsigned int testmode;
static UINT WINAPI need_media_cb(void *context, UINT message, UINT_PTR param1, UINT_PTR param2)
{
if (winetest_debug > 1) trace("%p, %#x, %#lx, %#lx\n", context, message, param1, param2);
if (winetest_debug > 1) trace("%p, %#x, %#Ix, %#Ix\n", context, message, param1, param2);
if (message == SPFILENOTIFY_NEEDMEDIA)
{
......@@ -1213,9 +1213,9 @@ static UINT WINAPI need_media_cb(void *context, UINT message, UINT_PTR param1, U
path[0] = 0;
if (testmode == 0)
ok(media->Flags == SP_COPY_WARNIFSKIP, "Got Flags %#x.\n", media->Flags);
ok(media->Flags == SP_COPY_WARNIFSKIP, "Got Flags %#lx.\n", media->Flags);
else
ok(!media->Flags, "Got Flags %#x for test %u.\n", media->Flags, testmode);
ok(!media->Flags, "Got Flags %#lx for test %u.\n", media->Flags, testmode);
switch (testmode)
{
......@@ -1331,7 +1331,7 @@ static UINT WINAPI need_media_cb(void *context, UINT message, UINT_PTR param1, U
static UINT WINAPI need_media_newpath_cb(void *context, UINT message, UINT_PTR param1, UINT_PTR param2)
{
if (winetest_debug > 1) trace("%p, %#x, %#lx, %#lx\n", context, message, param1, param2);
if (winetest_debug > 1) trace("%p, %#x, %#Ix, %#Ix\n", context, message, param1, param2);
if (message == SPFILENOTIFY_NEEDMEDIA)
{
......@@ -1413,12 +1413,12 @@ static void run_queue_(unsigned int line, HSPFILEQ queue, PSP_FILE_CALLBACK_A cb
{
void *context = SetupInitDefaultQueueCallbackEx(NULL, INVALID_HANDLE_VALUE, 0, 0, 0);
BOOL ret;
ok_(__FILE__,line)(!!context, "Failed to create callback context, error %#x.\n", GetLastError());
ok_(__FILE__,line)(!!context, "Failed to create callback context, error %#lx.\n", GetLastError());
ret = SetupCommitFileQueueA(NULL, queue, cb, context);
ok_(__FILE__,line)(ret, "Failed to commit queue, error %#x.\n", GetLastError());
ok_(__FILE__,line)(ret, "Failed to commit queue, error %#lx.\n", GetLastError());
SetupTermDefaultQueueCallback(context);
ret = SetupCloseFileQueue(queue);
ok_(__FILE__,line)(ret, "Failed to close queue, error %#x.\n", GetLastError());
ok_(__FILE__,line)(ret, "Failed to close queue, error %#lx.\n", GetLastError());
}
static void test_install_file(void)
......@@ -1448,16 +1448,16 @@ static void test_install_file(void)
sprintf(path, "%s\\%s", CURR_DIR, inffile);
hinf = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
ok(hinf != INVALID_HANDLE_VALUE, "Failed to open INF file, error %#x.\n", GetLastError());
ok(hinf != INVALID_HANDLE_VALUE, "Failed to open INF file, error %#lx.\n", GetLastError());
ret = CreateDirectoryA("src", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("src/alpha", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("src/beta", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("dst", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
create_file("src/one.txt");
create_file("src/beta/two.txt");
create_file("src/alpha/three.txt");
......@@ -1467,13 +1467,13 @@ static void test_install_file(void)
SetLastError(0xdeadbeef);
ret = SetupInstallFileA(hinf, &infctx, "one.txt", "src", "one.txt", 0, NULL, NULL);
ok(ret, "Expected success.\n");
ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#x.\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#lx.\n", GetLastError());
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
SetLastError(0xdeadbeef);
ret = SetupInstallFileA(hinf, &infctx, "one.txt", "src", "one.txt", SP_COPY_REPLACEONLY, NULL, NULL);
ok(!ret, "Expected failure.\n");
ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#x.\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#lx.\n", GetLastError());
ok(!file_exists("dst/one.txt"), "Destination file should not exist.\n");
ret = SetupFindFirstLineA(hinf, "section1", "two.txt", &infctx);
......@@ -1481,7 +1481,7 @@ static void test_install_file(void)
SetLastError(0xdeadbeef);
ret = SetupInstallFileA(hinf, &infctx, "two.txt", "src", "two.txt", 0, NULL, NULL);
todo_wine ok(ret, "Expected success.\n");
todo_wine ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#x.\n", GetLastError());
todo_wine ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#lx.\n", GetLastError());
todo_wine ok(delete_file("dst/two.txt"), "Destination file should exist.\n");
ret = SetupFindFirstLineA(hinf, "section1", "three.txt", &infctx);
......@@ -1489,7 +1489,7 @@ static void test_install_file(void)
SetLastError(0xdeadbeef);
ret = SetupInstallFileA(hinf, &infctx, "three.txt", "src", "three.txt", 0, NULL, NULL);
ok(!ret, "Expected failure.\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Got unexpected error %#x.\n", GetLastError());
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Got unexpected error %#lx.\n", GetLastError());
ok(!file_exists("dst/three.txt"), "Destination file should not exist.\n");
ret = SetupFindFirstLineA(hinf, "section1", "three.txt", &infctx);
......@@ -1497,7 +1497,7 @@ static void test_install_file(void)
SetLastError(0xdeadbeef);
ret = SetupInstallFileA(hinf, &infctx, "three.txt", "src/alpha", "three.txt", 0, NULL, NULL);
ok(ret, "Expected success.\n");
ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#x.\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Got unexpected error %#lx.\n", GetLastError());
ok(delete_file("dst/three.txt"), "Destination file should exist.\n");
SetupCloseInfFile(hinf);
......@@ -1547,16 +1547,16 @@ static void test_need_media(void)
sprintf(path, "%s\\%s", CURR_DIR, inffile);
hinf = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
ok(hinf != INVALID_HANDLE_VALUE, "Failed to open INF file, error %#x.\n", GetLastError());
ok(hinf != INVALID_HANDLE_VALUE, "Failed to open INF file, error %#lx.\n", GetLastError());
ret = CreateDirectoryA("src", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("src/alpha", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("src/beta", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("dst", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
create_file("src/one.txt");
create_file("src/beta/two.txt");
create_file("src/alpha/three.txt");
......@@ -1565,19 +1565,19 @@ static void test_need_media(void)
create_cab_file("src/alpha/tessares.cab", "seven.txt\0eight.txt\0");
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", "File One", NULL, "dst", NULL, SP_COPY_WARNIFSKIP);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
got_need_media = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", "File One", NULL,
"dst", NULL, SP_COPY_WARNIFSKIP | SP_COPY_REPLACEONLY);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(!file_exists("dst/one.txt"), "Destination file should exist.\n");
......@@ -1587,9 +1587,9 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 1;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", "beta", "two.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/two.txt"), "Destination file should exist.\n");
......@@ -1599,9 +1599,9 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 2;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", "beta", "two.txt", "desc", "faketag", "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/two.txt"), "Destination file should exist.\n");
......@@ -1611,32 +1611,32 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 3;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopySectionA(queue, "src", hinf, NULL, "section1", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
got_need_media = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupInstallFilesFromInfSectionA(hinf, NULL, queue, "install_section", "src", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
got_need_media = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueDefaultCopyA(queue, hinf, "src", NULL, "one.txt", 0);
ok(!ret, "Expected failure.\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got error %#x.\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got error %#lx.\n", GetLastError());
ret = SetupQueueDefaultCopyA(queue, hinf, "src", "one.txt", "one.txt", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
......@@ -1644,18 +1644,18 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 4;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopySectionA(queue, "src", hinf, NULL, "section2", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/two.txt"), "Destination file should exist.\n");
got_need_media = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueDefaultCopyA(queue, hinf, "src", "two.txt", "two.txt", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/two.txt"), "Destination file should exist.\n");
......@@ -1663,18 +1663,18 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 5;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopySectionA(queue, "src", hinf, NULL, "section3", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/three.txt"), "Destination file should exist.\n");
got_need_media = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueDefaultCopyA(queue, hinf, "src", "three.txt", "three.txt", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/three.txt"), "Destination file should exist.\n");
......@@ -1684,13 +1684,13 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 6;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", "beta", "two.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src/alpha", NULL, "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 2, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
......@@ -1704,9 +1704,9 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 8;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopySectionA(queue, "src", hinf, NULL, "section4", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());\
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());\
run_queue(queue, need_media_cb);
ok(got_need_media == 2, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
......@@ -1718,11 +1718,11 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 10;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", "desc1", NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", "beta", "two.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 2, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
......@@ -1731,11 +1731,11 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 12;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", "desc1", "faketag", "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", "beta", "two.txt", "desc1", "faketag2", "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 2, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
......@@ -1746,11 +1746,11 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 14;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "four.txt", "desc", "treis.cab", "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", "alpha", "five.txt", "desc", "treis.cab", "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/four.txt"), "Destination file should exist.\n");
......@@ -1759,11 +1759,11 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 15;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", "alpha", "seven.txt", "desc", "tessares.cab", "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "eight.txt", "desc", "tessares.cab", "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/seven.txt"), "Destination file should exist.\n");
......@@ -1772,9 +1772,9 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 16;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueDefaultCopyA(queue, hinf, "src/alpha", "six.txt", "six.txt", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/six.txt"), "Destination file should exist.\n");
......@@ -1784,9 +1784,9 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 1;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", "beta", "two.txt", NULL, NULL, "dst", NULL, SP_COPY_SOURCE_ABSOLUTE);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/two.txt"), "Destination file should exist.\n");
......@@ -1794,9 +1794,9 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 1;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", "beta", "two.txt", NULL, NULL, "dst", NULL, SP_COPY_SOURCEPATH_ABSOLUTE);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/two.txt"), "Destination file should exist.\n");
......@@ -1804,9 +1804,9 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 5;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopySectionA(queue, "src", hinf, NULL, "section3", SP_COPY_SOURCE_ABSOLUTE);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/three.txt"), "Destination file should exist.\n");
......@@ -1814,9 +1814,9 @@ static void test_need_media(void)
got_need_media = 0;
testmode = 5;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopySectionA(queue, "src", hinf, NULL, "section3", SP_COPY_SOURCEPATH_ABSOLUTE);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(delete_file("dst/three.txt"), "Destination file should exist.\n");
......@@ -1826,11 +1826,11 @@ static void test_need_media(void)
testmode = 0;
got_need_media = got_copy_error = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", "alpha", "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(!got_copy_error, "Got %u copy errors.\n", got_copy_error);
......@@ -1846,11 +1846,11 @@ static void test_need_media(void)
testmode = 1;
got_need_media = got_copy_error = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", "alpha", "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", "beta", "two.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(!got_copy_error, "Got %u copy errors.\n", got_copy_error);
......@@ -1859,11 +1859,11 @@ static void test_need_media(void)
got_need_media = got_copy_error = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", "alpha\\", "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "six.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(!got_copy_error, "Got %u copy errors.\n", got_copy_error);
......@@ -1876,11 +1876,11 @@ static void test_need_media(void)
testmode = 2;
got_need_media = got_copy_error = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", "alpha", "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 2, "Got %u callbacks.\n", got_need_media);
ok(!got_copy_error, "Got %u copy errors.\n", got_copy_error);
......@@ -1892,11 +1892,11 @@ static void test_need_media(void)
testmode = 0;
got_need_media = got_copy_error = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "fake.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(got_copy_error == 1, "Got %u copy errors.\n", got_copy_error);
......@@ -1907,13 +1907,13 @@ static void test_need_media(void)
testmode = 3;
got_need_media = got_copy_error = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "six.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(got_copy_error == 1, "Got %u copy errors.\n", got_copy_error);
......@@ -1926,13 +1926,13 @@ static void test_need_media(void)
testmode = 4;
got_need_media = got_copy_error = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "six.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(got_copy_error == 2, "Got %u copy errors.\n", got_copy_error);
......@@ -1945,11 +1945,11 @@ static void test_need_media(void)
testmode = 0;
got_need_media = got_copy_error = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "four.txt", "desc", "treis.cab", "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", "alpha", "five.txt", "desc", "treis.cab", "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(!got_copy_error, "Got %u copy errors.\n", got_copy_error);
......@@ -1961,11 +1961,11 @@ static void test_need_media(void)
testmode = 5;
got_need_media = got_copy_error = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "fake", "alpha", "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 2, "Got %u callbacks.\n", got_need_media);
ok(!got_copy_error, "Got %u copy errors.\n", got_copy_error);
......@@ -1975,7 +1975,7 @@ static void test_need_media(void)
testmode = 6;
got_need_media = got_copy_error = got_start_copy = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
copy_params.QueueHandle = queue;
copy_params.SourceFilename = "one.txt";
/* Leaving TargetDirectory NULL causes it to be filled with garbage on
......@@ -1983,7 +1983,7 @@ static void test_need_media(void)
* from LayoutInf. */
copy_params.TargetDirectory = "dst";
ret = SetupQueueCopyIndirectA(&copy_params);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(!got_copy_error, "Got %u copy errors.\n", got_copy_error);
......@@ -1992,7 +1992,7 @@ static void test_need_media(void)
got_need_media = got_copy_error = got_start_copy = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
copy_params.LayoutInf = hinf;
copy_params.QueueHandle = queue;
/* In fact this fails with ERROR_INVALID_PARAMETER on 8+. */
......@@ -2019,7 +2019,7 @@ static void test_need_media(void)
delete_file("src/");
delete_file("dst/");
ret = DeleteFileA(inffile);
ok(ret, "Failed to delete INF file, error %u.\n", GetLastError());
ok(ret, "Failed to delete INF file, error %lu.\n", GetLastError());
}
static void test_close_queue(void)
......@@ -2028,11 +2028,11 @@ static void test_close_queue(void)
BOOL ret;
context = SetupInitDefaultQueueCallback(NULL);
ok(!!context, "Failed to create callback context, error %#x.\n", GetLastError());
ok(!!context, "Failed to create callback context, error %#lx.\n", GetLastError());
ret = SetupCloseFileQueue(context);
ok(!ret, "Expected failure.\n");
ok(GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected error %u.\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_HANDLE, "Got unexpected error %lu.\n", GetLastError());
SetupTermDefaultQueueCallback(context);
}
......@@ -2041,7 +2041,7 @@ static unsigned int start_copy_ret;
static UINT WINAPI start_copy_cb(void *context, UINT message, UINT_PTR param1, UINT_PTR param2)
{
if (winetest_debug > 1) trace("%p, %#x, %#lx, %#lx\n", context, message, param1, param2);
if (winetest_debug > 1) trace("%p, %#x, %#Ix, %#Ix\n", context, message, param1, param2);
if (message == SPFILENOTIFY_STARTCOPY)
{
......@@ -2066,7 +2066,7 @@ static void test_start_copy(void)
BOOL ret;
ret = CreateDirectoryA("src", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
create_file("src/one.txt");
create_file("src/two.txt");
create_file("src/three.txt");
......@@ -2074,15 +2074,15 @@ static void test_start_copy(void)
start_copy_ret = FILEOP_DOIT;
got_start_copy = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "two.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, start_copy_cb);
todo_wine ok(got_start_copy == 3, "Got %u callbacks.\n", got_start_copy);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
......@@ -2092,13 +2092,13 @@ static void test_start_copy(void)
start_copy_ret = FILEOP_SKIP;
got_start_copy = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "two.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
run_queue(queue, start_copy_cb);
ok(got_start_copy == 3, "Got %u callbacks.\n", got_start_copy);
ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
......@@ -2108,18 +2108,18 @@ static void test_start_copy(void)
start_copy_ret = FILEOP_ABORT;
got_start_copy = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "one.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "two.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "src", NULL, "three.txt", NULL, NULL, "dst", NULL, 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
context = SetupInitDefaultQueueCallbackEx(NULL, INVALID_HANDLE_VALUE, 0, 0, 0);
SetLastError(0xdeadbeef);
ret = SetupCommitFileQueueA(NULL, queue, start_copy_cb, context);
ok(!ret, "Expected failure.\n");
ok(GetLastError() == 0xdeadf00d, "Got unexpected error %u.\n", GetLastError());
ok(GetLastError() == 0xdeadf00d, "Got unexpected error %lu.\n", GetLastError());
SetupTermDefaultQueueCallback(context);
SetupCloseFileQueue(queue);
ok(got_start_copy == 2, "Got %u callbacks.\n", got_start_copy);
......@@ -2155,54 +2155,54 @@ static void test_register_dlls(void)
create_inf_file("test.inf", inf_data);
sprintf(path, "%s\\test.inf", CURR_DIR);
hinf = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
ok(hinf != INVALID_HANDLE_VALUE, "Failed to open INF file, error %#x.\n", GetLastError());
ok(hinf != INVALID_HANDLE_VALUE, "Failed to open INF file, error %#lx.\n", GetLastError());
load_resource("selfreg.dll", "winetest_selfreg.dll");
ret = SetupSetDirectoryIdA(hinf, 40000, CURR_DIR);
ok(ret, "Failed to set directory ID, error %u.\n", GetLastError());
ok(ret, "Failed to set directory ID, error %lu.\n", GetLastError());
RegDeleteKeyA(HKEY_CURRENT_USER, "winetest_setupapi_selfreg");
ret = SetupInstallFromInfSectionA(NULL, hinf, "DefaultInstall", SPINST_REGSVR,
NULL, "C:\\", 0, SetupDefaultQueueCallbackA, context, NULL, NULL);
ok(ret, "Failed to install, error %#x.\n", GetLastError());
ok(ret, "Failed to install, error %#lx.\n", GetLastError());
l = RegOpenKeyA(HKEY_CURRENT_USER, "winetest_setupapi_selfreg", &key);
ok(!l, "Got error %u.\n", l);
ok(!l, "Got error %lu.\n", l);
RegCloseKey(key);
ret = SetupInstallFromInfSectionA(NULL, hinf, "DefaultInstall", SPINST_UNREGSVR,
NULL, "C:\\", 0, SetupDefaultQueueCallbackA, context, NULL, NULL);
ok(ret, "Failed to install, error %#x.\n", GetLastError());
ok(ret, "Failed to install, error %#lx.\n", GetLastError());
l = RegOpenKeyA(HKEY_CURRENT_USER, "winetest_setupapi_selfreg", &key);
ok(l == ERROR_FILE_NOT_FOUND, "Got error %u.\n", l);
ok(l == ERROR_FILE_NOT_FOUND, "Got error %lu.\n", l);
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ret = SetupInstallFromInfSectionA(NULL, hinf, "DefaultInstall", SPINST_REGSVR,
NULL, "C:\\", 0, SetupDefaultQueueCallbackA, context, NULL, NULL);
ok(ret, "Failed to install, error %#x.\n", GetLastError());
ok(ret, "Failed to install, error %#lx.\n", GetLastError());
l = RegOpenKeyA(HKEY_CURRENT_USER, "winetest_setupapi_selfreg", &key);
ok(!l, "Got error %u.\n", l);
ok(!l, "Got error %lu.\n", l);
RegCloseKey(key);
ret = SetupInstallFromInfSectionA(NULL, hinf, "DefaultInstall", SPINST_UNREGSVR,
NULL, "C:\\", 0, SetupDefaultQueueCallbackA, context, NULL, NULL);
ok(ret, "Failed to install, error %#x.\n", GetLastError());
ok(ret, "Failed to install, error %#lx.\n", GetLastError());
l = RegOpenKeyA(HKEY_CURRENT_USER, "winetest_setupapi_selfreg", &key);
ok(l == ERROR_FILE_NOT_FOUND, "Got error %u.\n", l);
ok(l == ERROR_FILE_NOT_FOUND, "Got error %lu.\n", l);
CoUninitialize();
SetupCloseInfFile(hinf);
ret = DeleteFileA("test.inf");
ok(ret, "Failed to delete INF file, error %u.\n", GetLastError());
ok(ret, "Failed to delete INF file, error %lu.\n", GetLastError());
ret = DeleteFileA("winetest_selfreg.dll");
ok(ret, "Failed to delete test DLL, error %u.\n", GetLastError());
ok(ret, "Failed to delete test DLL, error %lu.\n", GetLastError());
}
static unsigned int start_rename_ret, got_start_rename;
......@@ -2233,9 +2233,9 @@ static void test_rename(void)
BOOL ret;
ret = CreateDirectoryA("a", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
ret = CreateDirectoryA("b", NULL);
ok(ret, "Failed to create test directory, error %u.\n", GetLastError());
ok(ret, "Failed to create test directory, error %lu.\n", GetLastError());
create_file("a/one.txt");
create_file("b/three.txt");
......@@ -2244,17 +2244,17 @@ static void test_rename(void)
start_rename_ret = FILEOP_DOIT;
got_start_rename = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueCopyA(queue, "b", NULL, "one.txt", NULL, NULL, "b", "two.txt", 0);
ok(ret, "Failed to queue copy, error %#x.\n", GetLastError());
ok(ret, "Failed to queue copy, error %#lx.\n", GetLastError());
ret = SetupQueueRenameA(queue, "a", "one.txt", "b", "one.txt");
ok(ret, "Failed to queue rename, error %#x.\n", GetLastError());
ok(ret, "Failed to queue rename, error %#lx.\n", GetLastError());
ret = SetupQueueRenameA(queue, "b", "three.txt", NULL, "four.txt");
ok(ret, "Failed to queue rename, error %#x.\n", GetLastError());
ok(ret, "Failed to queue rename, error %#lx.\n", GetLastError());
ret = SetupQueueRenameA(queue, "b", "six.txt", "b", "seven.txt");
ok(ret, "Failed to queue rename, error %#x.\n", GetLastError());
ok(ret, "Failed to queue rename, error %#lx.\n", GetLastError());
ret = SetupQueueRenameA(queue, "a", "five.txt", "b", "six.txt");
ok(ret, "Failed to queue rename, error %#x.\n", GetLastError());
ok(ret, "Failed to queue rename, error %#lx.\n", GetLastError());
run_queue(queue, start_rename_cb);
ok(got_start_rename == 4, "Got %u callbacks.\n", got_start_rename);
ok(!delete_file("a/one.txt"), "File should not exist.\n");
......@@ -2274,13 +2274,13 @@ static void test_rename(void)
start_rename_ret = FILEOP_SKIP;
got_start_rename = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#lx.\n", GetLastError());
ret = SetupQueueRenameA(queue, "a", "one.txt", "a", "two.txt");
ok(ret, "Failed to queue rename, error %#x.\n", GetLastError());
ok(ret, "Failed to queue rename, error %#lx.\n", GetLastError());
ret = SetupQueueRenameA(queue, "a", "three.txt", "a", "four.txt");
ok(ret, "Failed to queue rename, error %#x.\n", GetLastError());
ok(ret, "Failed to queue rename, error %#lx.\n", GetLastError());
ret = SetupQueueRenameA(queue, "a", "five.txt", "a", "six.txt");
ok(ret, "Failed to queue rename, error %#x.\n", GetLastError());
ok(ret, "Failed to queue rename, error %#lx.\n", GetLastError());
run_queue(queue, start_rename_cb);
ok(got_start_rename == 3, "Got %u callbacks.\n", got_start_rename);
ok(!delete_file("a/one.txt"), "File should not exist.\n");
......@@ -2291,8 +2291,8 @@ static void test_rename(void)
ok(delete_file("a/six.txt"), "File should exist.\n");
SetupCloseFileQueue(queue);
ok(delete_file("a/"), "Failed to delete directory, error %u.\n", GetLastError());
ok(delete_file("b/"), "Failed to delete directory, error %u.\n", GetLastError());
ok(delete_file("a/"), "Failed to delete directory, error %lu.\n", GetLastError());
ok(delete_file("b/"), "Failed to delete directory, error %lu.\n", GetLastError());
}
static WCHAR service_name[] = L"Wine Test Service";
......@@ -2321,7 +2321,7 @@ static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_
SetEvent( stop_event );
return NO_ERROR;
default:
trace( "got service ctrl %x\n", ctrl );
trace( "got service ctrl %lx\n", ctrl );
status.dwCurrentState = SERVICE_RUNNING;
SetServiceStatus( service_handle, &status );
return NO_ERROR;
......@@ -2389,7 +2389,7 @@ START_TEST(install)
/* Set CBT hook to disallow MessageBox creation in current thread */
hhook = SetWindowsHookExA(WH_CBT, cbt_hook_proc, 0, GetCurrentThreadId());
ok(!!hhook, "Failed to set hook, error %u.\n", GetLastError());
ok(!!hhook, "Failed to set hook, error %lu.\n", GetLastError());
test_cmdline();
test_registry();
......
......@@ -57,9 +57,9 @@ static void create_file(const char *name, const char *data)
BOOL ret;
file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
ok(file != INVALID_HANDLE_VALUE, "Failed to create %s, error %u.\n", name, GetLastError());
ok(file != INVALID_HANDLE_VALUE, "Failed to create %s, error %lu.\n", name, GetLastError());
ret = WriteFile(file, data, strlen(data), &size, NULL);
ok(ret && size == strlen(data), "Failed to write %s, error %u.\n", name, GetLastError());
ok(ret && size == strlen(data), "Failed to write %s, error %lu.\n", name, GetLastError());
CloseHandle(file);
}
......@@ -103,24 +103,24 @@ static void test_original_file_name(LPCSTR original, LPCSTR dest)
}
hinf = SetupOpenInfFileA(dest, NULL, INF_STYLE_WIN4, NULL);
ok(hinf != NULL, "SetupOpenInfFileA failed with error %d\n", GetLastError());
ok(hinf != NULL, "SetupOpenInfFileA failed with error %ld\n", GetLastError());
res = SetupGetInfInformationA(hinf, INFINFO_INF_SPEC_IS_HINF, NULL, 0, &size);
ok(res, "SetupGetInfInformation failed with error %d\n", GetLastError());
ok(res, "SetupGetInfInformation failed with error %ld\n", GetLastError());
pspii = HeapAlloc(GetProcessHeap(), 0, size);
res = SetupGetInfInformationA(hinf, INFINFO_INF_SPEC_IS_HINF, pspii, size, NULL);
ok(res, "SetupGetInfInformation failed with error %d\n", GetLastError());
ok(res, "SetupGetInfInformation failed with error %ld\n", GetLastError());
spofi.cbSize = 0;
res = pSetupQueryInfOriginalFileInformationA(pspii, 0, NULL, &spofi);
ok(!res && GetLastError() == ERROR_INVALID_USER_BUFFER,
"SetupQueryInfOriginalFileInformationA should have failed with ERROR_INVALID_USER_BUFFER instead of %d\n", GetLastError());
"SetupQueryInfOriginalFileInformationA should have failed with ERROR_INVALID_USER_BUFFER instead of %ld\n", GetLastError());
spofi.cbSize = sizeof(spofi);
res = pSetupQueryInfOriginalFileInformationA(pspii, 0, NULL, &spofi);
ok(res, "SetupQueryInfOriginalFileInformationA failed with error %d\n", GetLastError());
ok(res, "SetupQueryInfOriginalFileInformationA failed with error %ld\n", GetLastError());
ok(!spofi.OriginalCatalogName[0], "spofi.OriginalCatalogName should have been \"\" instead of \"%s\"\n", spofi.OriginalCatalogName);
ok(!strcmp(original, spofi.OriginalInfName), "spofi.OriginalInfName of %s didn't match real original name %s\n", spofi.OriginalInfName, original);
......@@ -151,7 +151,7 @@ static void test_SetupCopyOEMInf(void)
res = SetupCopyOEMInfA(NULL, NULL, 0, SP_COPY_NOOVERWRITE, NULL, 0, NULL, NULL);
ok(res == FALSE, "Expected FALSE, got %d\n", res);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* try empty SourceInfFileName */
SetLastError(0xdeadbeef);
......@@ -159,14 +159,14 @@ static void test_SetupCopyOEMInf(void)
ok(res == FALSE, "Expected FALSE, got %d\n", res);
ok(GetLastError() == ERROR_FILE_NOT_FOUND ||
GetLastError() == ERROR_INVALID_PARAMETER, /* Vista, W2K8 */
"Unexpected error : %d\n", GetLastError());
"Unexpected error : %ld\n", GetLastError());
/* try a relative nonexistent SourceInfFileName */
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA("nonexistent", NULL, 0, SP_COPY_NOOVERWRITE, NULL, 0, NULL, NULL);
ok(res == FALSE, "Expected FALSE, got %d\n", res);
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
"Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
/* try an absolute nonexistent SourceInfFileName */
strcpy(path, CURR_DIR);
......@@ -175,7 +175,7 @@ static void test_SetupCopyOEMInf(void)
res = SetupCopyOEMInfA(path, NULL, 0, SP_COPY_NOOVERWRITE, NULL, 0, NULL, NULL);
ok(res == FALSE, "Expected FALSE, got %d\n", res);
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
"Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
get_temp_filename(tmpfile);
create_file(tmpfile, inf_data1);
......@@ -195,7 +195,7 @@ static void test_SetupCopyOEMInf(void)
return;
}
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
ok(file_exists(tmpfile), "Expected tmpfile to exist\n");
/* try SP_COPY_REPLACEONLY, dest does not exist */
......@@ -203,7 +203,7 @@ static void test_SetupCopyOEMInf(void)
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, SP_COPY_REPLACEONLY, NULL, 0, NULL, NULL);
ok(res == FALSE, "Expected FALSE, got %d\n", res);
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
"Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
ok(file_exists(tmpfile), "Expected source inf to exist\n");
/* Test a successful call. */
......@@ -219,7 +219,7 @@ static void test_SetupCopyOEMInf(void)
return;
}
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(file_exists(path), "Expected source inf to exist.\n");
ok(file_exists(dest), "Expected dest file to exist.\n");
ok(is_in_inf_dir(dest), "Got unexpected path '%s'.\n", dest);
......@@ -229,7 +229,7 @@ static void test_SetupCopyOEMInf(void)
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, sizeof(dest), NULL, NULL);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(file_exists(path), "Expected source inf to exist.\n");
ok(file_exists(dest), "Expected dest file to exist.\n");
ok(!strcmp(orig_dest, dest), "Expected '%s', got '%s'.\n", orig_dest, dest);
......@@ -238,7 +238,7 @@ static void test_SetupCopyOEMInf(void)
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, SP_COPY_REPLACEONLY, dest, sizeof(dest), NULL, NULL);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(file_exists(path), "Expected source inf to exist.\n");
ok(file_exists(dest), "Expected dest file to exist.\n");
ok(!strcmp(orig_dest, dest), "Expected '%s', got '%s'.\n", orig_dest, dest);
......@@ -248,13 +248,13 @@ static void test_SetupCopyOEMInf(void)
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, SP_COPY_NOOVERWRITE, dest, sizeof(dest), NULL, NULL);
ok(res == FALSE, "Expected FALSE, got %d\n", res);
ok(GetLastError() == ERROR_FILE_EXISTS,
"Expected ERROR_FILE_EXISTS, got %d\n", GetLastError());
"Expected ERROR_FILE_EXISTS, got %ld\n", GetLastError());
ok(!strcmp(orig_dest, dest), "Expected '%s', got '%s'.\n", orig_dest, dest);
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, NULL, 0, NULL, NULL);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(file_exists(path), "Expected source inf to exist.\n");
ok(file_exists(orig_dest), "Expected dest file to exist.\n");
......@@ -264,39 +264,39 @@ static void test_SetupCopyOEMInf(void)
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, 5, &size, NULL);
ok(res == FALSE, "Expected FALSE, got %d\n", res);
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
ok(file_exists(path), "Expected source inf to exist\n");
ok(file_exists(orig_dest), "Expected dest inf to exist\n");
ok(!strcmp(dest, "aaa"), "Expected dest to be unchanged\n");
ok(size == strlen(orig_dest) + 1, "Got %d.\n", size);
ok(size == strlen(orig_dest) + 1, "Got %ld.\n", size);
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, sizeof(dest), &size, NULL);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(!strcmp(orig_dest, dest), "Expected '%s', got '%s'.\n", orig_dest, dest);
ok(size == strlen(dest) + 1, "Got %d.\n", size);
ok(size == strlen(dest) + 1, "Got %ld.\n", size);
test_original_file_name(strrchr(path, '\\') + 1, dest);
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, sizeof(dest), NULL, &filepart);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(!strcmp(orig_dest, dest), "Expected '%s', got '%s'.\n", orig_dest, dest);
ok(filepart == strrchr(dest, '\\') + 1, "Got unexpected file part %s.\n", filepart);
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, SP_COPY_DELETESOURCE, NULL, 0, NULL, NULL);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(!file_exists(path), "Expected source inf to not exist\n");
strcpy(pnf, dest);
*(strrchr(pnf, '.') + 1) = 'p';
res = SetupUninstallOEMInfA(strrchr(dest, '\\') + 1, 0, NULL);
ok(res, "Failed to uninstall '%s', error %u.\n", dest, GetLastError());
ok(res, "Failed to uninstall '%s', error %lu.\n", dest, GetLastError());
todo_wine ok(!file_exists(dest), "Expected inf '%s' to not exist\n", dest);
DeleteFileA(dest);
ok(!file_exists(pnf), "Expected pnf '%s' to not exist\n", pnf);
......@@ -305,7 +305,7 @@ static void test_SetupCopyOEMInf(void)
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, sizeof(dest), NULL, NULL);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(is_in_inf_dir(dest), "Got unexpected path '%s'.\n", dest);
strcpy(orig_dest, dest);
......@@ -313,12 +313,12 @@ static void test_SetupCopyOEMInf(void)
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, sizeof(dest), NULL, NULL);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(is_in_inf_dir(dest), "Got unexpected path '%s'.\n", dest);
ok(strcmp(dest, orig_dest), "Expected INF files to be copied to different paths.\n");
res = SetupUninstallOEMInfA(strrchr(dest, '\\') + 1, 0, NULL);
ok(res, "Failed to uninstall '%s', error %u.\n", dest, GetLastError());
ok(res, "Failed to uninstall '%s', error %lu.\n", dest, GetLastError());
todo_wine ok(!file_exists(dest), "Expected inf '%s' to not exist\n", dest);
DeleteFileA(dest);
strcpy(pnf, dest);
......@@ -326,7 +326,7 @@ static void test_SetupCopyOEMInf(void)
todo_wine ok(!file_exists(pnf), "Expected pnf '%s' to not exist\n", pnf);
res = SetupUninstallOEMInfA(strrchr(orig_dest, '\\') + 1, 0, NULL);
ok(res, "Failed to uninstall '%s', error %u.\n", orig_dest, GetLastError());
ok(res, "Failed to uninstall '%s', error %lu.\n", orig_dest, GetLastError());
todo_wine ok(!file_exists(orig_dest), "Expected inf '%s' to not exist\n", dest);
DeleteFileA(orig_dest);
strcpy(pnf, dest);
......@@ -337,19 +337,19 @@ static void test_SetupCopyOEMInf(void)
strcat(orig_dest, "\\inf\\");
strcat(orig_dest, tmpfile);
res = CopyFileA(tmpfile, orig_dest, TRUE);
ok(res, "Failed to copy file, error %u.\n", GetLastError());
ok(res, "Failed to copy file, error %lu.\n", GetLastError());
SetLastError(0xdeadbeef);
res = SetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, sizeof(dest), NULL, NULL);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(!strcasecmp(dest, orig_dest), "Expected '%s', got '%s'.\n", orig_dest, dest);
/* Since it wasn't actually installed, SetupUninstallOEMInf would fail here. */
res = DeleteFileA(dest);
ok(res, "Failed to delete '%s', error %u.\n", tmpfile, GetLastError());
ok(res, "Failed to delete '%s', error %lu.\n", tmpfile, GetLastError());
res = DeleteFileA(tmpfile);
ok(res, "Failed to delete '%s', error %u.\n", tmpfile, GetLastError());
ok(res, "Failed to delete '%s', error %lu.\n", tmpfile, GetLastError());
}
static void create_source_file(LPSTR filename, const BYTE *data, DWORD size)
......@@ -466,8 +466,8 @@ static void test_SetupGetFileCompressionInfo(void)
ret = SetupGetFileCompressionInfoA(source, &name, &source_size, &target_size, &type);
ok(!ret, "SetupGetFileCompressionInfo failed unexpectedly\n");
ok(name && !lstrcmpA(name, source), "got %s, expected %s\n", name, source);
ok(source_size == sizeof(uncompressed), "got %d\n", source_size);
ok(target_size == sizeof(uncompressed), "got %d\n", target_size);
ok(source_size == sizeof(uncompressed), "got %ld\n", source_size);
ok(target_size == sizeof(uncompressed), "got %ld\n", target_size);
ok(type == FILE_COMPRESSION_NONE, "got %d, expected FILE_COMPRESSION_NONE\n", type);
MyFree(name);
......@@ -492,16 +492,16 @@ static void test_SetupGetFileCompressionInfoEx(void)
ret = pSetupGetFileCompressionInfoExA(source, NULL, 0, &required_len, NULL, NULL, NULL);
ok(!ret, "SetupGetFileCompressionInfoEx succeeded unexpectedly\n");
ok(required_len == lstrlenA(source) + 1, "got %d, expected %d\n", required_len, lstrlenA(source) + 1);
ok(required_len == lstrlenA(source) + 1, "got %ld, expected %d\n", required_len, lstrlenA(source) + 1);
create_source_file(source, comp_lzx, sizeof(comp_lzx));
ret = pSetupGetFileCompressionInfoExA(source, name, sizeof(name), &required_len, &source_size, &target_size, &type);
ok(ret, "SetupGetFileCompressionInfoEx failed unexpectedly: %d\n", ret);
ok(!lstrcmpA(name, source), "got %s, expected %s\n", name, source);
ok(required_len == lstrlenA(source) + 1, "got %d, expected %d\n", required_len, lstrlenA(source) + 1);
ok(source_size == sizeof(comp_lzx), "got %d\n", source_size);
ok(target_size == sizeof(uncompressed), "got %d\n", target_size);
ok(required_len == lstrlenA(source) + 1, "got %ld, expected %d\n", required_len, lstrlenA(source) + 1);
ok(source_size == sizeof(comp_lzx), "got %ld\n", source_size);
ok(target_size == sizeof(uncompressed), "got %ld\n", target_size);
ok(type == FILE_COMPRESSION_WINLZA, "got %d, expected FILE_COMPRESSION_WINLZA\n", type);
DeleteFileA(source);
......@@ -510,9 +510,9 @@ static void test_SetupGetFileCompressionInfoEx(void)
ret = pSetupGetFileCompressionInfoExA(source, name, sizeof(name), &required_len, &source_size, &target_size, &type);
ok(ret, "SetupGetFileCompressionInfoEx failed unexpectedly: %d\n", ret);
ok(!lstrcmpA(name, source), "got %s, expected %s\n", name, source);
ok(required_len == lstrlenA(source) + 1, "got %d, expected %d\n", required_len, lstrlenA(source) + 1);
ok(source_size == sizeof(comp_zip), "got %d\n", source_size);
ok(target_size == sizeof(comp_zip), "got %d\n", target_size);
ok(required_len == lstrlenA(source) + 1, "got %ld, expected %d\n", required_len, lstrlenA(source) + 1);
ok(source_size == sizeof(comp_zip), "got %ld\n", source_size);
ok(target_size == sizeof(comp_zip), "got %ld\n", target_size);
ok(type == FILE_COMPRESSION_NONE, "got %d, expected FILE_COMPRESSION_NONE\n", type);
DeleteFileA(source);
......@@ -521,9 +521,9 @@ static void test_SetupGetFileCompressionInfoEx(void)
ret = pSetupGetFileCompressionInfoExA(source, name, sizeof(name), &required_len, &source_size, &target_size, &type);
ok(ret, "SetupGetFileCompressionInfoEx failed unexpectedly: %d\n", ret);
ok(!lstrcmpA(name, source), "got %s, expected %s\n", name, source);
ok(required_len == lstrlenA(source) + 1, "got %d, expected %d\n", required_len, lstrlenA(source) + 1);
ok(source_size == sizeof(comp_cab_lzx), "got %d\n", source_size);
ok(target_size == sizeof(uncompressed), "got %d\n", target_size);
ok(required_len == lstrlenA(source) + 1, "got %ld, expected %d\n", required_len, lstrlenA(source) + 1);
ok(source_size == sizeof(comp_cab_lzx), "got %ld\n", source_size);
ok(target_size == sizeof(uncompressed), "got %ld\n", target_size);
ok(type == FILE_COMPRESSION_MSZIP, "got %d, expected FILE_COMPRESSION_MSZIP\n", type);
DeleteFileA(source);
......@@ -532,9 +532,9 @@ static void test_SetupGetFileCompressionInfoEx(void)
ret = pSetupGetFileCompressionInfoExA(source, name, sizeof(name), &required_len, &source_size, &target_size, &type);
ok(ret, "SetupGetFileCompressionInfoEx failed unexpectedly: %d\n", ret);
ok(!lstrcmpA(name, source), "got %s, expected %s\n", name, source);
ok(required_len == lstrlenA(source) + 1, "got %d, expected %d\n", required_len, lstrlenA(source) + 1);
ok(source_size == sizeof(comp_cab_zip), "got %d\n", source_size);
ok(target_size == sizeof(uncompressed), "got %d\n", target_size);
ok(required_len == lstrlenA(source) + 1, "got %ld, expected %d\n", required_len, lstrlenA(source) + 1);
ok(source_size == sizeof(comp_cab_zip), "got %ld\n", source_size);
ok(target_size == sizeof(uncompressed), "got %ld\n", target_size);
ok(type == FILE_COMPRESSION_MSZIP, "got %d, expected FILE_COMPRESSION_MSZIP\n", type);
DeleteFileA(source);
}
......@@ -593,7 +593,7 @@ static void test_SetupDecompressOrCopyFile(void)
invalid_parameters[i].target,
invalid_parameters[i].type);
ok(ret == ERROR_INVALID_PARAMETER,
"[%d] Expected SetupDecompressOrCopyFileA to return ERROR_INVALID_PARAMETER, got %u\n",
"[%d] Expected SetupDecompressOrCopyFileA to return ERROR_INVALID_PARAMETER, got %lu\n",
i, ret);
/* try an invalid compression type */
......@@ -602,7 +602,7 @@ static void test_SetupDecompressOrCopyFile(void)
invalid_parameters[i].target,
invalid_parameters[i].type);
ok(ret == ERROR_INVALID_PARAMETER,
"[%d] Expected SetupDecompressOrCopyFileA to return ERROR_INVALID_PARAMETER, got %u\n",
"[%d] Expected SetupDecompressOrCopyFileA to return ERROR_INVALID_PARAMETER, got %lu\n",
i, ret);
}
......@@ -615,23 +615,23 @@ static void test_SetupDecompressOrCopyFile(void)
/* no compression tests */
ret = SetupDecompressOrCopyFileA(source, target, NULL);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
ok(compare_file_data(target, uncompressed, sizeof(uncompressed)), "incorrect target file\n");
/* try overwriting existing file */
ret = SetupDecompressOrCopyFileA(source, target, NULL);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
DeleteFileA(target);
type = FILE_COMPRESSION_NONE;
ret = SetupDecompressOrCopyFileA(source, target, &type);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
ok(compare_file_data(target, uncompressed, sizeof(uncompressed)), "incorrect target file\n");
DeleteFileA(target);
type = FILE_COMPRESSION_WINLZA;
ret = SetupDecompressOrCopyFileA(source, target, &type);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
ok(compare_file_data(target, uncompressed, sizeof(uncompressed)), "incorrect target file\n");
DeleteFileA(target);
......@@ -640,7 +640,7 @@ static void test_SetupDecompressOrCopyFile(void)
create_source_file(source, comp_lzx, sizeof(comp_lzx));
ret = SetupDecompressOrCopyFileA(source, target, NULL);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
DeleteFileA(target);
/* zip compression tests */
......@@ -648,7 +648,7 @@ static void test_SetupDecompressOrCopyFile(void)
create_source_file(source, comp_zip, sizeof(comp_zip));
ret = SetupDecompressOrCopyFileA(source, target, NULL);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
ok(compare_file_data(target, comp_zip, sizeof(comp_zip)), "incorrect target file\n");
DeleteFileA(target);
......@@ -660,23 +660,23 @@ static void test_SetupDecompressOrCopyFile(void)
lstrcpyA(p + 1, "wine");
ret = SetupDecompressOrCopyFileA(source, target, NULL);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
ok(compare_file_data(target, uncompressed, sizeof(uncompressed)), "incorrect target file\n");
/* try overwriting existing file */
ret = SetupDecompressOrCopyFileA(source, target, NULL);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
/* try zip compression */
type = FILE_COMPRESSION_MSZIP;
ret = SetupDecompressOrCopyFileA(source, target, &type);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
ok(compare_file_data(target, uncompressed, sizeof(uncompressed)), "incorrect target file\n");
/* try no compression */
type = FILE_COMPRESSION_NONE;
ret = SetupDecompressOrCopyFileA(source, target, &type);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %d\n", ret);
ok(!ret, "SetupDecompressOrCopyFile failed unexpectedly: %ld\n", ret);
ok(compare_file_data(target, comp_cab_zip, sizeof(comp_cab_zip)), "incorrect target file\n");
/* Show that SetupDecompressOrCopyFileA simply extracts the first file it
......@@ -694,7 +694,7 @@ static void test_SetupDecompressOrCopyFile(void)
lstrcpyA(p + 1, zip_multi_tests[i].filename);
ret = SetupDecompressOrCopyFileA(source, target, NULL);
ok(!ret, "[%d] SetupDecompressOrCopyFile failed unexpectedly: %d\n", i, ret);
ok(!ret, "[%d] SetupDecompressOrCopyFile failed unexpectedly: %ld\n", i, ret);
ok(compare_file_data(target, zip_multi_tests[i].expected_buffer, zip_multi_tests[i].buffer_size),
"[%d] incorrect target file\n", i);
DeleteFileA(target);
......@@ -710,14 +710,14 @@ static void test_SetupUninstallOEMInf(void)
SetLastError(0xdeadbeef);
ret = SetupUninstallOEMInfA(NULL, 0, NULL);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %08x\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetupUninstallOEMInfA("", 0, NULL);
todo_wine
{
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %08x\n", GetLastError());
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError());
}
SetLastError(0xdeadbeef);
......@@ -725,7 +725,7 @@ static void test_SetupUninstallOEMInf(void)
todo_wine
{
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %08x\n", GetLastError());
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %08lx\n", GetLastError());
}
}
......@@ -751,7 +751,7 @@ static void test_defaultcallback(void)
ctxt = SetupInitDefaultQueueCallbackEx(owner, progress, WM_USER, 0, NULL);
ok(ctxt != NULL, "got %p\n", ctxt);
ok(ctxt->magic == magic || broken(ctxt->magic != magic) /* win2000 */, "got magic 0x%08x\n", ctxt->magic);
ok(ctxt->magic == magic || broken(ctxt->magic != magic) /* win2000 */, "got magic 0x%08lx\n", ctxt->magic);
if (ctxt->magic == magic)
{
ok(ctxt->owner == owner, "got %p, expected %p\n", ctxt->owner, owner);
......@@ -767,7 +767,7 @@ static void test_defaultcallback(void)
}
ctxt = SetupInitDefaultQueueCallback(owner);
ok(ctxt->magic == magic, "got magic 0x%08x\n", ctxt->magic);
ok(ctxt->magic == magic, "got magic 0x%08lx\n", ctxt->magic);
ok(ctxt->owner == owner, "got %p, expected %p\n", ctxt->owner, owner);
ok(ctxt->progress == NULL, "got %p, expected %p\n", ctxt->progress, progress);
ok(ctxt->message == 0, "got %d\n", ctxt->message);
......@@ -783,7 +783,7 @@ static void test_SetupLogError(void)
ret = SetupLogErrorA("Test without opening\r\n", LogSevInformation);
error = GetLastError();
ok(!ret, "SetupLogError succeeded\n");
ok(error == ERROR_FILE_INVALID, "got wrong error: %d\n", error);
ok(error == ERROR_FILE_INVALID, "got wrong error: %ld\n", error);
SetLastError(0xdeadbeef);
ret = SetupOpenLog(FALSE);
......@@ -792,24 +792,24 @@ static void test_SetupLogError(void)
skip("SetupOpenLog() failed on insufficient permissions\n");
return;
}
ok(ret, "SetupOpenLog failed, error %d\n", GetLastError());
ok(ret, "SetupOpenLog failed, error %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetupLogErrorA("Test with wrong log severity\r\n", LogSevMaximum);
error = GetLastError();
ok(!ret, "SetupLogError succeeded\n");
ok(error == 0xdeadbeef, "got wrong error: %d\n", error);
ok(error == 0xdeadbeef, "got wrong error: %ld\n", error);
ret = SetupLogErrorA("Test without EOL", LogSevInformation);
ok(ret, "SetupLogError failed\n");
SetLastError(0xdeadbeef);
ret = SetupLogErrorA(NULL, LogSevInformation);
ok(ret || broken(!ret && GetLastError() == ERROR_INVALID_PARAMETER /* Win Vista+ */),
"SetupLogError failed: %08x\n", GetLastError());
"SetupLogError failed: %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetupOpenLog(FALSE);
ok(ret, "SetupOpenLog failed, error %d\n", GetLastError());
ok(ret, "SetupOpenLog failed, error %ld\n", GetLastError());
SetupCloseLog();
}
......@@ -833,14 +833,14 @@ static void _check_device_interface(int line, const char *instance_id, const GUI
devinfo = SetupDiGetClassDevsA(guid, instance_id, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);
ret = SetupDiEnumDeviceInfo(devinfo, 0, &device_data);
ok_(__FILE__, line)(ret || broken(!ret) /* <= Win7 */,
"SetupDiEnumDeviceInfo failed, error %u.\n", GetLastError());
"SetupDiEnumDeviceInfo failed, error %lu.\n", GetLastError());
if (!ret)
{
SetupDiDestroyDeviceInfoList(devinfo);
return;
}
ret = SetupDiEnumDeviceInterfaces(devinfo, &device_data, guid, 0, &iface_data);
ok_(__FILE__, line)(ret, "SetupDiEnumDeviceInterfaces failed, error %u.\n", GetLastError());
ok_(__FILE__, line)(ret, "SetupDiEnumDeviceInterfaces failed, error %lu.\n", GetLastError());
ok_(__FILE__, line)(IsEqualGUID(&iface_data.InterfaceClassGuid, guid),
"Expected guid %s, got %s.\n", wine_dbgstr_guid(guid),
wine_dbgstr_guid(&iface_data.InterfaceClassGuid));
......@@ -859,14 +859,14 @@ static void test_device_interfaces(void)
/* GPUs */
devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_DISPLAY, NULL, NULL, DIGCF_PRESENT);
ok(devinfo != INVALID_HANDLE_VALUE, "SetupDiGetClassDevsW failed, error %u.\n", GetLastError());
ok(devinfo != INVALID_HANDLE_VALUE, "SetupDiGetClassDevsW failed, error %lu.\n", GetLastError());
while ((ret = SetupDiEnumDeviceInfo(devinfo, device_idx, &device_data)))
{
ret = SetupDiGetDeviceInstanceIdA(devinfo, &device_data, instance_id,
ARRAY_SIZE(instance_id), &size);
ok(ret, "SetupDiGetDeviceInstanceIdA failed, error %u.\n", GetLastError());
ok(ret, "SetupDiGetDeviceInstanceIdA failed, error %lu.\n", GetLastError());
winetest_push_context("GPU %d", device_idx);
winetest_push_context("GPU %ld", device_idx);
check_device_interface(instance_id, &GUID_DEVINTERFACE_DISPLAY_ADAPTER);
check_device_interface(instance_id, &GUID_DISPLAY_DEVICE_ARRIVAL);
......@@ -875,21 +875,21 @@ static void test_device_interfaces(void)
++device_idx;
}
error = GetLastError();
ok(error == ERROR_NO_MORE_ITEMS, "Expected error %u, got %u.\n", ERROR_NO_MORE_ITEMS, error);
ok(error == ERROR_NO_MORE_ITEMS, "Expected error %u, got %lu.\n", ERROR_NO_MORE_ITEMS, error);
ok(device_idx > 0, "Expected at least one GPU.\n");
SetupDiDestroyDeviceInfoList(devinfo);
/* Monitors */
device_idx = 0;
devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_MONITOR, L"DISPLAY", NULL, DIGCF_PRESENT);
ok(devinfo != INVALID_HANDLE_VALUE, "SetupDiGetClassDevsW failed, error %u.\n", GetLastError());
ok(devinfo != INVALID_HANDLE_VALUE, "SetupDiGetClassDevsW failed, error %lu.\n", GetLastError());
while ((ret = SetupDiEnumDeviceInfo(devinfo, device_idx, &device_data)))
{
ret = SetupDiGetDeviceInstanceIdA(devinfo, &device_data, instance_id,
ARRAY_SIZE(instance_id), &size);
ok(ret, "SetupDiGetDeviceInstanceIdA failed, error %u.\n", GetLastError());
ok(ret, "SetupDiGetDeviceInstanceIdA failed, error %lu.\n", GetLastError());
winetest_push_context("Monitor %d", device_idx);
winetest_push_context("Monitor %ld", device_idx);
check_device_interface(instance_id, &GUID_DEVINTERFACE_MONITOR);
......@@ -897,7 +897,7 @@ static void test_device_interfaces(void)
++device_idx;
}
error = GetLastError();
ok(error == ERROR_NO_MORE_ITEMS, "Expected error %u, got %u.\n", ERROR_NO_MORE_ITEMS, error);
ok(error == ERROR_NO_MORE_ITEMS, "Expected error %u, got %lu.\n", ERROR_NO_MORE_ITEMS, error);
ok(device_idx > 0 || broken(device_idx == 0) /* w7u_2qxl TestBot */,
"Expected at least one monitor.\n");
SetupDiDestroyDeviceInfoList(devinfo);
......
......@@ -164,13 +164,13 @@ static void test_invalid_files(void)
err_line = 0xdeadbeef;
hinf = test_file_contents( invalid_files[i].data, invalid_files[i].data_size, &err_line );
err = GetLastError();
trace( "hinf=%p err=0x%x line=%d\n", hinf, err, err_line );
trace( "hinf=%p err=0x%lx line=%d\n", hinf, err, err_line );
if (invalid_files[i].error) /* should fail */
{
ok( hinf == INVALID_HANDLE_VALUE, "file %u: Open succeeded\n", i );
todo_wine_if (invalid_files[i].todo)
{
ok( err == invalid_files[i].error, "file %u: Bad error %u/%u\n",
ok( err == invalid_files[i].error, "file %u: Bad error %lu/%lu\n",
i, err, invalid_files[i].error );
ok( err_line == invalid_files[i].err_line, "file %u: Bad error line %d/%d\n",
i, err_line, invalid_files[i].err_line );
......@@ -181,7 +181,7 @@ static void test_invalid_files(void)
todo_wine_if (invalid_files[i].todo)
{
ok( hinf != INVALID_HANDLE_VALUE, "file %u: Open failed\n", i );
ok( err == 0, "file %u: Error code set to %u\n", i, err );
ok( err == 0, "file %u: Error code set to %lu\n", i, err );
}
}
SetupCloseInfFile( hinf );
......@@ -240,23 +240,23 @@ static void test_section_names(void)
{
SetLastError( 0xdeadbeef );
hinf = test_file_contents( section_names[i].data, strlen(section_names[i].data), &err_line );
ok( hinf != INVALID_HANDLE_VALUE, "line %u: open failed err %u\n", i, GetLastError() );
ok( hinf != INVALID_HANDLE_VALUE, "line %u: open failed err %lu\n", i, GetLastError() );
if (hinf == INVALID_HANDLE_VALUE) continue;
ret = SetupGetLineCountA( hinf, section_names[i].section );
err = GetLastError();
trace( "hinf=%p ret=%d err=0x%x\n", hinf, ret, err );
trace( "hinf=%p ret=%ld err=0x%lx\n", hinf, ret, err );
if (ret != -1)
{
ok( !section_names[i].error, "line %u: section name %s found\n",
i, section_names[i].section );
ok( !err, "line %u: bad error code %u\n", i, err );
ok( !err, "line %u: bad error code %lu\n", i, err );
}
else
{
ok( section_names[i].error, "line %u: section name %s not found\n",
i, section_names[i].section );
ok( err == section_names[i].error, "line %u: bad error %u/%u\n",
ok( err == section_names[i].error, "line %u: bad error %lu/%lu\n",
i, err, section_names[i].error );
}
SetupCloseInfFile( hinf );
......@@ -299,7 +299,7 @@ static void test_enum_sections(void)
SetLastError( 0xdeadbeef );
ret = pSetupEnumInfSectionsA( hinf, index, buffer, sizeof(buffer), &len );
ok( ret, "SetupEnumInfSectionsA failed err %u\n", GetLastError() );
ok( ret, "SetupEnumInfSectionsA failed err %lu\n", GetLastError() );
ok( len == 3 || len == 8, "wrong len %u\n", len );
ok( !lstrcmpiA( buffer, "version" ) || !lstrcmpiA( buffer, "s1" ) ||
!lstrcmpiA( buffer, "s2" ) || !lstrcmpiA( buffer, "s3" ) || !lstrcmpiA( buffer, "strings" ),
......@@ -408,12 +408,12 @@ static const char *check_key( INFCONTEXT *context, const char *wanted )
if (!key)
{
ok( !wanted, "missing key %s\n", wanted );
ok( err == 0 || err == ERROR_INVALID_PARAMETER, "last error set to %u\n", err );
ok( err == 0 || err == ERROR_INVALID_PARAMETER, "last error set to %lu\n", err );
}
else
{
ok( !strcmp( key, wanted ), "bad key %s/%s\n", key, wanted );
ok( err == 0, "last error set to %u\n", err );
ok( err == 0, "last error set to %lu\n", err );
}
return key;
}
......@@ -439,7 +439,7 @@ static void test_key_names(void)
data_size += key_names[i].data_size;
SetLastError( 0xdeadbeef );
hinf = test_file_contents( buffer, data_size, &err_line );
ok( hinf != INVALID_HANDLE_VALUE, "line %u: open failed err %u\n", i, GetLastError() );
ok( hinf != INVALID_HANDLE_VALUE, "line %u: open failed err %lu\n", i, GetLastError() );
if (hinf == INVALID_HANDLE_VALUE) continue;
ret = SetupFindFirstLineA( hinf, "Test", key_names[i].key, &context );
......@@ -449,11 +449,11 @@ static void test_key_names(void)
{
ret = SetupFindFirstLineA( hinf, "Test", "%foo%", &context );
ok(!ret, "SetupFindFirstLine() should not match unsubstituted keys\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND, "got wrong error %u\n", GetLastError());
ok(GetLastError() == ERROR_LINE_NOT_FOUND, "got wrong error %lu\n", GetLastError());
}
ret = SetupFindFirstLineA( hinf, "Test", 0, &context );
ok(ret, "SetupFindFirstLineA failed: le=%u\n", GetLastError());
ok(ret, "SetupFindFirstLineA failed: le=%lu\n", GetLastError());
if (!ret)
{
SetupCloseInfFile( hinf );
......@@ -469,7 +469,7 @@ static void test_key_names(void)
err = GetLastError();
if (field)
{
ok( err == 0, "line %u: bad error %u\n", i, err );
ok( err == 0, "line %u: bad error %lu\n", i, err );
if (key_names[i].fields[index])
{
if (i == 52)
......@@ -499,7 +499,7 @@ static void test_key_names(void)
else
{
ok( err == 0 || err == ERROR_INVALID_PARAMETER,
"line %u: bad error %u\n", i, err );
"line %u: bad error %lu\n", i, err );
if (key_names[i].fields[index])
ok( 0, "line %u: missing field %s\n", i, key_names[i].fields[index] );
}
......@@ -523,13 +523,13 @@ static void test_close_inf_file(void)
SetupCloseInfFile(NULL);
ok(GetLastError() == 0xdeadbeef ||
GetLastError() == ERROR_INVALID_PARAMETER, /* Win9x, WinMe */
"Expected 0xdeadbeef, got %u\n", GetLastError());
"Expected 0xdeadbeef, got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
SetupCloseInfFile(INVALID_HANDLE_VALUE);
ok(GetLastError() == 0xdeadbeef ||
GetLastError() == ERROR_INVALID_PARAMETER, /* Win9x, WinMe */
"Expected 0xdeadbeef, got %u\n", GetLastError());
"Expected 0xdeadbeef, got %lu\n", GetLastError());
}
static const char *contents = "[Version]\n"
......@@ -610,7 +610,7 @@ static void test_pSetupGetField(void)
fieldW = pSetupGetFieldW( &context, 4 );
ok( fieldW == NULL, "Expected NULL, got %p\n", fieldW );
ok( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() );
"Expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() );
}
else
{
......@@ -623,7 +623,7 @@ static void test_pSetupGetField(void)
fieldA = pSetupGetFieldA( &context, 4 );
ok( fieldA == NULL, "Expected NULL, got %p\n", fieldA );
ok( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() );
"Expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() );
}
SetupCloseInfFile( hinf );
......@@ -677,13 +677,13 @@ static void test_SetupGetIntField(void)
ok( retb, "%u: Expected success\n", i );
ok( GetLastError() == ERROR_SUCCESS ||
GetLastError() == 0xdeadbeef /* win9x, NT4 */,
"%u: Expected ERROR_SUCCESS or 0xdeadbeef, got %u\n", i, GetLastError() );
"%u: Expected ERROR_SUCCESS or 0xdeadbeef, got %lu\n", i, GetLastError() );
}
else
{
ok( !retb, "%u: Expected failure\n", i );
ok( GetLastError() == keys[i].err,
"%u: Expected %d, got %u\n", i, keys[i].err, GetLastError() );
"%u: Expected %ld, got %lu\n", i, keys[i].err, GetLastError() );
}
ok( intfield == keys[i].value, "%u: Expected %d, got %d\n", i, keys[i].value, intfield );
......@@ -716,91 +716,91 @@ static void test_GLE(void)
retb = SetupFindFirstLineA( hinf, "ImNotThere", NULL, &context );
ok(!retb, "Expected failure\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_LINE_NOT_FOUND, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupFindFirstLineA( hinf, "ImNotThere", "ImNotThere", &context );
ok(!retb, "Expected failure\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_LINE_NOT_FOUND, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupFindFirstLineA( hinf, "Sectionname", NULL, &context );
ok(retb, "Expected success\n");
ok(GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %08x\n", GetLastError());
"Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupFindFirstLineA( hinf, "Sectionname", "ImNotThere", &context );
ok(!retb, "Expected failure\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_LINE_NOT_FOUND, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupFindFirstLineA( hinf, "Sectionname", "Keyname1", &context );
ok(retb, "Expected success\n");
ok(GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %08x\n", GetLastError());
"Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupFindNextMatchLineA( &context, "ImNotThere", &context );
ok(!retb, "Expected failure\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_LINE_NOT_FOUND, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupFindNextMatchLineA( &context, "Keyname2", &context );
ok(retb, "Expected success\n");
ok(GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %08x\n", GetLastError());
"Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retl = SetupGetLineCountA( hinf, "ImNotThere");
ok(retl == -1, "Expected -1, got %d\n", retl);
ok(retl == -1, "Expected -1, got %ld\n", retl);
ok(GetLastError() == ERROR_SECTION_NOT_FOUND,
"Expected ERROR_SECTION_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_SECTION_NOT_FOUND, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retl = SetupGetLineCountA( hinf, "Sectionname");
ok(retl == 2, "Expected 2, got %d\n", retl);
ok(retl == 2, "Expected 2, got %ld\n", retl);
ok(GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %08x\n", GetLastError());
"Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupGetLineTextA( NULL, hinf, "ImNotThere", "ImNotThere", buf, bufsize, &retsize);
ok(!retb, "Expected failure\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_LINE_NOT_FOUND, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupGetLineTextA( NULL, hinf, "Sectionname", "ImNotThere", buf, bufsize, &retsize);
ok(!retb, "Expected failure\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_LINE_NOT_FOUND, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupGetLineTextA( NULL, hinf, "Sectionname", "Keyname1", buf, bufsize, &retsize);
ok(retb, "Expected success\n");
ok(GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %08x\n", GetLastError());
"Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupGetLineByIndexA( hinf, "ImNotThere", 1, &context );
ok(!retb, "Expected failure\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_LINE_NOT_FOUND, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupGetLineByIndexA( hinf, "Sectionname", 1, &context );
ok(retb, "Expected success\n");
ok(GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %08x\n", GetLastError());
"Expected ERROR_SUCCESS, got %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
retb = SetupGetLineByIndexA( hinf, "Sectionname", 3, &context );
ok(!retb, "Expected failure\n");
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
"Expected ERROR_LINE_NOT_FOUND, got %08lx\n", GetLastError());
SetupCloseInfFile( hinf );
}
......
......@@ -171,7 +171,7 @@ static void test_SetupGetInfInformation(void)
broken(GetLastError() == ERROR_PATH_NOT_FOUND) || /* NT4 */
broken(GetLastError() == ERROR_INVALID_NAME) || /* win2k */
broken(GetLastError() == ERROR_GENERAL_SYNTAX), /* another win2k / winMe */
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
/* try an invalid inf filename */
......@@ -185,7 +185,7 @@ static void test_SetupGetInfInformation(void)
ret = SetupGetInfInformationA(NULL, INFINFO_INF_NAME_IS_ABSOLUTE, NULL, 0, &size);
ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
}
......@@ -197,7 +197,7 @@ static void test_SetupGetInfInformation(void)
ret = SetupGetInfInformationA(inf_filename, -1, NULL, 0, &size);
ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
/* try a nonexistent inf file */
......@@ -206,7 +206,7 @@ static void test_SetupGetInfInformation(void)
ret = SetupGetInfInformationA("idontexist", INFINFO_INF_NAME_IS_ABSOLUTE, NULL, 0, &size);
ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
"Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
/* successfully open the inf file */
......@@ -220,7 +220,7 @@ static void test_SetupGetInfInformation(void)
ret = SetupGetInfInformationA(inf_filename, INFINFO_INF_NAME_IS_ABSOLUTE, NULL, size, &size);
ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* set ReturnBuffer to NULL and ReturnBufferSize to non-zero value 'size-1' */
ret = SetupGetInfInformationA(inf_filename, INFINFO_INF_NAME_IS_ABSOLUTE, NULL, size-1, &size);
......@@ -241,7 +241,7 @@ static void test_SetupGetInfInformation(void)
ret = SetupGetInfInformationA(inf_filename, INFINFO_INF_NAME_IS_ABSOLUTE, info, size - 1, &size);
ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
/* successfully get the inf information */
ret = SetupGetInfInformationA(inf_filename, INFINFO_INF_NAME_IS_ABSOLUTE, info, size, &size);
......@@ -267,7 +267,7 @@ static void test_SetupGetInfInformation(void)
skip("need admin rights\n");
goto done;
}
ok(ret, "can't create inf file %u\n", GetLastError());
ok(ret, "can't create inf file %lu\n", GetLastError());
HeapFree(GetProcessHeap(), 0, info);
info = alloc_inf_info("test.inf", INFINFO_DEFAULT_SEARCH, &size);
......@@ -289,7 +289,7 @@ static void test_SetupGetInfInformation(void)
/* test the INFINFO_DEFAULT_SEARCH search flag */
ret = SetupGetInfInformationA("test.inf", INFINFO_DEFAULT_SEARCH, info, size, &size);
ok(ret == TRUE, "Expected SetupGetInfInformation to succeed: %d\n", GetLastError());
ok(ret == TRUE, "Expected SetupGetInfInformation to succeed: %ld\n", GetLastError());
ok(check_info_filename(info, inf_one), "Expected returned filename to be equal\n");
HeapFree(GetProcessHeap(), 0, info);
......@@ -330,7 +330,7 @@ static void test_SetupGetSourceFileLocation(void)
ret = SetupGetSourceFileLocationA(hinf, NULL, "lanconf.exe", &source_id, buffer, sizeof(buffer), &required);
ok(ret, "SetupGetSourceFileLocation failed\n");
ok(required == 1, "unexpected required size: %d\n", required);
ok(required == 1, "unexpected required size: %ld\n", required);
ok(source_id == 2, "unexpected source id: %d\n", source_id);
ok(!lstrcmpA("", buffer), "unexpected result string: %s\n", buffer);
......@@ -343,7 +343,7 @@ static void test_SetupGetSourceFileLocation(void)
hinf = SetupOpenInfFileA(inf_filename, NULL, INF_STYLE_WIN4, NULL);
error = GetLastError();
ok(hinf == INVALID_HANDLE_VALUE, "could open inf file\n");
ok(error == ERROR_WRONG_INF_STYLE, "got wrong error: %d\n", error);
ok(error == ERROR_WRONG_INF_STYLE, "got wrong error: %ld\n", error);
hinf = SetupOpenInfFileA(inf_filename, NULL, INF_STYLE_OLDNT, NULL);
ok(hinf != INVALID_HANDLE_VALUE, "could not open inf file\n");
......@@ -376,7 +376,7 @@ static void test_SetupGetSourceInfo(void)
ret = SetupGetSourceInfoA(hinf, 2, SRCINFO_PATH, buffer, sizeof(buffer), &required);
ok(ret, "SetupGetSourceInfoA failed\n");
ok(required == 1, "unexpected required size: %d\n", required);
ok(required == 1, "unexpected required size: %ld\n", required);
ok(!lstrcmpA("", buffer), "unexpected result string: %s\n", buffer);
required = 0;
......@@ -385,7 +385,7 @@ static void test_SetupGetSourceInfo(void)
ret = SetupGetSourceInfoA(hinf, 2, SRCINFO_TAGFILE, buffer, sizeof(buffer), &required);
ok(ret, "SetupGetSourceInfoA failed\n");
ok(required == 28, "unexpected required size: %d\n", required);
ok(required == 28, "unexpected required size: %ld\n", required);
ok(!lstrcmpA("LANCOM\\LANtools\\lanconf.cab", buffer), "unexpected result string: %s\n", buffer);
required = 0;
......@@ -394,7 +394,7 @@ static void test_SetupGetSourceInfo(void)
ret = SetupGetSourceInfoA(hinf, 2, SRCINFO_DESCRIPTION, buffer, sizeof(buffer), &required);
ok(ret, "SetupGetSourceInfoA failed\n");
ok(required == 19, "unexpected required size: %d\n", required);
ok(required == 19, "unexpected required size: %ld\n", required);
ok(!lstrcmpA("LANCOM Software CD", buffer), "unexpected result string: %s\n", buffer);
SetupCloseInfFile(hinf);
......@@ -428,7 +428,7 @@ static void test_SetupGetTargetPath(void)
ret = SetupGetTargetPathA(hinf, &ctx, NULL, buffer, sizeof(buffer), &required);
ok(ret, "SetupGetTargetPathA failed\n");
ok(required == 10, "unexpected required size: %d\n", required);
ok(required == 10, "unexpected required size: %ld\n", required);
/* Retrieve the system drive from the windows directory.
* (%SystemDrive% is not available on Win9x)
*/
......@@ -452,7 +452,7 @@ static void test_SetupGetTargetPath(void)
lstrcpyA(destfile, WIN_DIR);
ok(required == lstrlenA(destfile) + 1, "unexpected required size: %d\n", required);
ok(required == lstrlenA(destfile) + 1, "unexpected required size: %ld\n", required);
ok(!lstrcmpiA(buffer, destfile), "unexpected path: %s\n", buffer);
SetupCloseInfFile(hinf);
......@@ -470,7 +470,7 @@ static void test_SetupGetTargetPath(void)
GetSystemDirectoryA(destfile, MAX_PATH);
ok(required == lstrlenA(destfile) + 1, "unexpected required size: %d\n", required);
ok(required == lstrlenA(destfile) + 1, "unexpected required size: %ld\n", required);
ok(!lstrcmpiA(buffer, destfile), "unexpected path: %s\n", buffer);
SetupCloseInfFile(hinf);
......@@ -488,7 +488,7 @@ static void test_SetupGetTargetPath(void)
lstrcpyA(destfile, WIN_DIR);
ok(required == lstrlenA(destfile) + 1, "unexpected required size: %d\n", required);
ok(required == lstrlenA(destfile) + 1, "unexpected required size: %ld\n", required);
ok(!lstrcmpiA(buffer, destfile), "unexpected path: %s\n", buffer);
SetupCloseInfFile(hinf);
......@@ -506,7 +506,7 @@ static void test_SetupGetTargetPath(void)
lstrcpyA(destfile, WIN_DIR);
ok(required == lstrlenA(destfile) + 1, "unexpected required size: %d\n", required);
ok(required == lstrlenA(destfile) + 1, "unexpected required size: %ld\n", required);
ok(!lstrcmpiA(buffer, destfile), "unexpected path: %s\n", buffer);
SetupCloseInfFile(hinf);
......
......@@ -69,7 +69,7 @@ static void create_source_fileW(LPWSTR filename, const BYTE *data, DWORD size)
static UINT CALLBACK dummy_callbackA(PVOID Context, UINT Notification,
UINT_PTR Param1, UINT_PTR Param2)
{
ok(0, "Received unexpected notification (%p, %u, %lu, %lu)\n", Context,
ok(0, "Received unexpected notification (%p, %u, %Iu, %Iu)\n", Context,
Notification, Param1, Param2);
return 0;
}
......@@ -77,7 +77,7 @@ static UINT CALLBACK dummy_callbackA(PVOID Context, UINT Notification,
static UINT CALLBACK dummy_callbackW(PVOID Context, UINT Notification,
UINT_PTR Param1, UINT_PTR Param2)
{
ok(0, "Received unexpected notification (%p, %u, %lu, %lu)\n", Context,
ok(0, "Received unexpected notification (%p, %u, %Iu, %Iu)\n", Context,
Notification, Param1, Param2);
return 0;
}
......@@ -117,7 +117,7 @@ static void test_invalid_parametersA(void)
ok(!ret, "[%d] Expected SetupIterateCabinetA to return 0, got %d\n", i, ret);
todo_wine_if (invalid_parameters[i].todo_lasterror)
ok(GetLastError() == invalid_parameters[i].expected_lasterror,
"[%d] Expected GetLastError() to return %u, got %u\n",
"[%d] Expected GetLastError() to return %lu, got %lu\n",
i, invalid_parameters[i].expected_lasterror, GetLastError());
}
......@@ -126,7 +126,7 @@ static void test_invalid_parametersA(void)
ok(!ret, "Expected SetupIterateCabinetA to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY ||
GetLastError() == ERROR_FILE_NOT_FOUND, /* Win9x/NT4/Win2k */
"Expected GetLastError() to return ERROR_NOT_ENOUGH_MEMORY, got %u\n",
"Expected GetLastError() to return ERROR_NOT_ENOUGH_MEMORY, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -134,7 +134,7 @@ static void test_invalid_parametersA(void)
ok(!ret, "Expected SetupIterateCabinetA to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY ||
GetLastError() == ERROR_FILE_NOT_FOUND, /* Win9x/NT4/Win2k */
"Expected GetLastError() to return ERROR_NOT_ENOUGH_MEMORY, got %u\n",
"Expected GetLastError() to return ERROR_NOT_ENOUGH_MEMORY, got %lu\n",
GetLastError());
DeleteFileA(source);
......@@ -183,7 +183,7 @@ static void test_invalid_parametersW(void)
ok(!ret, "[%d] Expected SetupIterateCabinetW to return 0, got %d\n", i, ret);
todo_wine_if (invalid_parameters[i].todo_lasterror)
ok(GetLastError() == invalid_parameters[i].expected_lasterror,
"[%d] Expected GetLastError() to return %u, got %u\n",
"[%d] Expected GetLastError() to return %lu, got %lu\n",
i, invalid_parameters[i].expected_lasterror, GetLastError());
}
......@@ -192,7 +192,7 @@ static void test_invalid_parametersW(void)
ok(!ret, "Expected SetupIterateCabinetW to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_NOT_ENOUGH_MEMORY, /* Vista/Win2k8 */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -200,7 +200,7 @@ static void test_invalid_parametersW(void)
ok(!ret, "Expected SetupIterateCabinetW to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_NOT_ENOUGH_MEMORY, /* Vista/Win2k8 */
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -208,7 +208,7 @@ static void test_invalid_parametersW(void)
ok(!ret, "Expected SetupIterateCabinetW to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY ||
GetLastError() == ERROR_FILE_NOT_FOUND, /* NT4/Win2k */
"Expected GetLastError() to return ERROR_NOT_ENOUGH_MEMORY, got %u\n",
"Expected GetLastError() to return ERROR_NOT_ENOUGH_MEMORY, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
......@@ -216,7 +216,7 @@ static void test_invalid_parametersW(void)
ok(!ret, "Expected SetupIterateCabinetW to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY ||
GetLastError() == ERROR_FILE_NOT_FOUND, /* NT4/Win2k */
"Expected GetLastError() to return ERROR_NOT_ENOUGH_MEMORY, got %u\n",
"Expected GetLastError() to return ERROR_NOT_ENOUGH_MEMORY, got %lu\n",
GetLastError());
DeleteFileW(source);
......@@ -250,14 +250,14 @@ static void test_invalid_callbackA(void)
ret = SetupIterateCabinetA(source, 0, NULL, NULL);
ok(!ret, "Expected SetupIterateCabinetA to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_DATA,
"Expected GetLastError() to return ERROR_INVALID_DATA, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_DATA, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupIterateCabinetA(source, 0, crash_callbackA, NULL);
ok(!ret, "Expected SetupIterateCabinetA to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_DATA,
"Expected GetLastError() to return ERROR_INVALID_DATA, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_DATA, got %lu\n",
GetLastError());
DeleteFileA(source);
......@@ -284,14 +284,14 @@ static void test_invalid_callbackW(void)
ret = SetupIterateCabinetW(source, 0, NULL, NULL);
ok(!ret, "Expected SetupIterateCabinetW to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_DATA,
"Expected GetLastError() to return ERROR_INVALID_DATA, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_DATA, got %lu\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = SetupIterateCabinetW(source, 0, crash_callbackW, NULL);
ok(!ret, "Expected SetupIterateCabinetW to return 0, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_DATA,
"Expected GetLastError() to return ERROR_INVALID_DATA, got %u\n",
"Expected GetLastError() to return ERROR_INVALID_DATA, got %lu\n",
GetLastError());
DeleteFileW(source);
......@@ -342,8 +342,8 @@ static UINT CALLBACK simple_callbackA(void *context, UINT message, UINT_PTR para
ok(index < ARRAY_SIZE(expected_files), "%u: Got unexpected file.\n", index);
ok(!strcmp(info->NameInCabinet, expected_files[index].nameA),
"%u: Got file name %s.\n", index, debugstr_a(info->NameInCabinet));
ok(info->FileSize == expected_files[index].size, "%u: Got file size %u.\n", index, info->FileSize);
ok(!info->Win32Error, "%u: Got error %u.\n", index, info->Win32Error);
ok(info->FileSize == expected_files[index].size, "%u: Got file size %lu.\n", index, info->FileSize);
ok(!info->Win32Error, "%u: Got error %lu.\n", index, info->Win32Error);
ok(info->DosDate == 14545, "%u: Got date %u.\n", index, info->DosDate);
ok(info->DosTime == 18672, "%u: Got time %u.\n", index, info->DosTime);
ok(info->DosAttribs == FILE_ATTRIBUTE_ARCHIVE, "%u: Got attributes %#x.\n", index, info->DosAttribs);
......@@ -410,12 +410,12 @@ static void test_simple_enumerationA(void)
{
snprintf(path, ARRAY_SIZE(path), "%s\\%s", temp, expected_files[i].nameA);
ret = DeleteFileA(path);
ok(ret, "Failed to delete %s, error %u.\n", debugstr_a(path), GetLastError());
ok(ret, "Failed to delete %s, error %lu.\n", debugstr_a(path), GetLastError());
}
snprintf(path, ARRAY_SIZE(path), "%s\\testcab.cab", temp);
ret = DeleteFileA(path);
ok(ret, "Failed to delete %s, error %u.\n", debugstr_a(path), GetLastError());
ok(ret, "Failed to delete %s, error %lu.\n", debugstr_a(path), GetLastError());
}
static UINT CALLBACK simple_callbackW(void *context, UINT message, UINT_PTR param1, UINT_PTR param2)
......@@ -450,8 +450,8 @@ static UINT CALLBACK simple_callbackW(void *context, UINT message, UINT_PTR para
ok(index < ARRAY_SIZE(expected_files), "%u: Got unexpected file.\n", index);
ok(!wcscmp(info->NameInCabinet, expected_files[index].nameW),
"%u: Got file name %s.\n", index, debugstr_w(info->NameInCabinet));
ok(info->FileSize == expected_files[index].size, "%u: Got file size %u.\n", index, info->FileSize);
ok(!info->Win32Error, "%u: Got error %u.\n", index, info->Win32Error);
ok(info->FileSize == expected_files[index].size, "%u: Got file size %lu.\n", index, info->FileSize);
ok(!info->Win32Error, "%u: Got error %lu.\n", index, info->Win32Error);
ok(info->DosDate == 14545, "%u: Got date %u.\n", index, info->DosDate);
ok(info->DosTime == 18672, "%u: Got time %u.\n", index, info->DosTime);
ok(info->DosAttribs == FILE_ATTRIBUTE_ARCHIVE, "%u: Got attributes %#x.\n", index, info->DosAttribs);
......@@ -518,12 +518,12 @@ static void test_simple_enumerationW(void)
{
swprintf(path, ARRAY_SIZE(path), L"%s\\%s", temp, expected_files[i].nameW);
ret = DeleteFileW(path);
ok(ret, "Failed to delete %s, error %u.\n", debugstr_w(path), GetLastError());
ok(ret, "Failed to delete %s, error %lu.\n", debugstr_w(path), GetLastError());
}
swprintf(path, ARRAY_SIZE(path), L"%s\\testcab.cab", temp);
ret = DeleteFileW(path);
ok(ret, "Failed to delete %s, error %u.\n", debugstr_w(path), GetLastError());
ok(ret, "Failed to delete %s, error %lu.\n", debugstr_w(path), GetLastError());
}
START_TEST(setupcab)
......
......@@ -87,15 +87,15 @@ static void test_StringTableAddString(void)
retval=pStringTableAddString(table,String,0);
ok(retval!=-1,"Failed to add String to String Table\n");
ok(hstring==retval,"string handle %x != String handle %x in String Table\n", hstring, retval);
ok(hstring==retval,"string handle %lx != String handle %lx in String Table\n", hstring, retval);
hfoo=pStringTableAddString(table,foo,0);
ok(hfoo!=-1,"Failed to add foo to String Table\n");
ok(hfoo!=hstring,"foo and string share the same ID %x in String Table\n", hfoo);
ok(hfoo!=hstring,"foo and string share the same ID %lx in String Table\n", hfoo);
/* case sensitive */
hString=pStringTableAddString(table,String,ST_CASE_SENSITIVE_COMPARE);
ok(hstring!=hString,"String handle and string share same ID %x in Table\n", hstring);
ok(hstring!=hString,"String handle and string share same ID %lx in Table\n", hstring);
pStringTableDestroy(table);
}
......@@ -115,15 +115,15 @@ static void test_StringTableAddStringEx(void)
retval = pStringTableAddStringEx(table, String, 0, NULL, 0);
ok(retval != -1, "Failed to add String to String Table\n");
ok(hstring == retval, "string handle %x != String handle %x in String Table\n", hstring, retval);
ok(hstring == retval, "string handle %lx != String handle %lx in String Table\n", hstring, retval);
hfoo = pStringTableAddStringEx(table, foo, 0, NULL, 0);
ok(hfoo != -1, "Failed to add foo to String Table\n");
ok(hfoo != hstring, "foo and string share the same ID %x in String Table\n", hfoo);
ok(hfoo != hstring, "foo and string share the same ID %lx in String Table\n", hfoo);
/* case sensitive */
hString = pStringTableAddStringEx(table, String, ST_CASE_SENSITIVE_COMPARE, NULL, 0);
ok(hstring != hString, "String handle and string share same ID %x in Table\n", hstring);
ok(hstring != hString, "String handle and string share same ID %lx in Table\n", hstring);
pStringTableDestroy(table);
......@@ -133,19 +133,19 @@ static void test_StringTableAddStringEx(void)
extra = 10;
hstring = pStringTableAddStringEx(table, string, 0, &extra, 4);
ok(hstring != -1, "failed to add string, %d\n", hstring);
ok(hstring != -1, "failed to add string, %ld\n", hstring);
extra = 0;
ret = pStringTableGetExtraData(table, hstring, &extra, 4);
ok(ret && extra == 10, "got %d, extra %d\n", ret, extra);
ok(ret && extra == 10, "got %d, extra %ld\n", ret, extra);
extra = 11;
hstring = pStringTableAddStringEx(table, string, 0, &extra, 4);
ok(hstring != -1, "failed to add string, %d\n", hstring);
ok(hstring != -1, "failed to add string, %ld\n", hstring);
extra = 0;
ret = pStringTableGetExtraData(table, hstring, &extra, 4);
ok(ret && extra == 10, "got %d, extra %d\n", ret, extra);
ok(ret && extra == 10, "got %d, extra %ld\n", ret, extra);
pStringTableDestroy(table);
}
......@@ -188,7 +188,7 @@ static void test_StringTableLookUpString(void)
retval=pStringTableLookUpString(table,string,0);
ok(retval!=-1,"Failed find string in String Table 1\n");
ok(retval==hstring,
"Lookup for string (%x) does not match previous handle (%x) in String Table 1\n",
"Lookup for string (%lx) does not match previous handle (%lx) in String Table 1\n",
retval, hstring);
retval=pStringTableLookUpString(table2,string,0);
......@@ -203,7 +203,7 @@ static void test_StringTableLookUpString(void)
retval=pStringTableLookUpString(table,foo,0);
ok(retval!=-1,"Failed find foo in String Table 1\n");
ok(retval==hfoo,
"Lookup for foo (%x) does not match previous handle (%x) in String Table 1\n",
"Lookup for foo (%lx) does not match previous handle (%lx) in String Table 1\n",
retval, hfoo);
retval=pStringTableLookUpString(table2,foo,0);
......@@ -214,7 +214,7 @@ static void test_StringTableLookUpString(void)
retval2=pStringTableLookUpString(table,String,ST_CASE_SENSITIVE_COMPARE);
ok(retval!=retval2,"Lookup of string equals String in Table 1\n");
ok(retval==hString,
"Lookup for String (%x) does not match previous handle (%x) in String Table 1\n",
"Lookup for String (%lx) does not match previous handle (%lx) in String Table 1\n",
retval, hString);
pStringTableDestroy(table);
......@@ -247,7 +247,7 @@ static void test_StringTableLookUpStringEx(void)
retval = pStringTableLookUpStringEx(table, string, 0, NULL, 0);
ok(retval != ~0u, "Failed find string in String Table 1\n");
ok(retval == hstring,
"Lookup for string (%x) does not match previous handle (%x) in String Table 1\n",
"Lookup for string (%lx) does not match previous handle (%lx) in String Table 1\n",
retval, hstring);
retval = pStringTableLookUpStringEx(table2, string, 0, NULL, 0);
......@@ -262,7 +262,7 @@ static void test_StringTableLookUpStringEx(void)
retval=pStringTableLookUpStringEx(table, foo, 0, NULL, 0);
ok(retval != ~0u, "Failed find foo in String Table 1\n");
ok(retval == hfoo,
"Lookup for foo (%x) does not match previous handle (%x) in String Table 1\n",
"Lookup for foo (%lx) does not match previous handle (%lx) in String Table 1\n",
retval, hfoo);
retval = pStringTableLookUpStringEx(table2, foo, 0, NULL, 0);
......@@ -273,7 +273,7 @@ static void test_StringTableLookUpStringEx(void)
retval2 = pStringTableLookUpStringEx(table, String, ST_CASE_SENSITIVE_COMPARE, NULL, 0);
ok(retval != retval2, "Lookup of string equals String in Table 1\n");
ok(retval == hString,
"Lookup for String (%x) does not match previous handle (%x) in String Table 1\n",
"Lookup for String (%lx) does not match previous handle (%lx) in String Table 1\n",
retval, hString);
pStringTableDestroy(table);
......@@ -318,10 +318,10 @@ static void test_StringTableStringFromId(void)
/* correct */
id2 = pStringTableLookUpString(table, string, 0);
ok(id2 == id, "got %d and %d\n", id2, id);
ok(id2 == id, "got %ld and %ld\n", id2, id);
string2 = pStringTableStringFromId(table, id2);
ok(string2 != NULL, "failed to lookup string %d\n", id2);
ok(string2 != NULL, "failed to lookup string %ld\n", id2);
ok(!lstrcmpiW(string, string2), "got %s, expected %s\n", wine_dbgstr_w(string2), wine_dbgstr_w(string));
pStringTableDestroy(table);
......@@ -347,14 +347,14 @@ static void test_stringtable_layout(void)
ptr = (struct stringtable*)table;
ok(ptr->data != NULL, "got %p\n", ptr->data);
/* first data offset is right after bucket area */
ok(ptr->nextoffset == 509*sizeof(DWORD), "got %d\n", ptr->nextoffset);
ok(ptr->allocated != 0, "got %d\n", ptr->allocated);
ok(ptr->nextoffset == 509*sizeof(DWORD), "got %ld\n", ptr->nextoffset);
ok(ptr->allocated != 0, "got %ld\n", ptr->allocated);
todo_wine {
ok(ptr->unk[0] != 0, "got %lx\n", ptr->unk[0]);
ok(ptr->unk[1] != 0, "got %lx\n", ptr->unk[1]);
ok(ptr->unk[0] != 0, "got %Ix\n", ptr->unk[0]);
ok(ptr->unk[1] != 0, "got %Ix\n", ptr->unk[1]);
}
ok(ptr->max_extra_size == 0, "got %d\n", ptr->max_extra_size);
ok(ptr->lcid == GetThreadLocale(), "got %x, thread lcid %x\n", ptr->lcid, GetThreadLocale());
ok(ptr->max_extra_size == 0, "got %ld\n", ptr->max_extra_size);
ok(ptr->lcid == GetThreadLocale(), "got %lx, thread lcid %lx\n", ptr->lcid, GetThreadLocale());
pStringTableDestroy(table);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment