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

wininet/tests: Enable compilation with long types.

parent c31fc180
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = wininet.dll
IMPORTS = wininet crypt32 ws2_32 user32 advapi32 shell32
......
......@@ -55,7 +55,7 @@ static void test_getfile_no_open(void)
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_NOT_INITIALIZED ||
GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_INTERNET_NOT_INITIALIZED or ERROR_INVALID_HANDLE (win98), got %d\n", GetLastError());
"Expected ERROR_INTERNET_NOT_INITIALIZED or ERROR_INVALID_HANDLE (win98), got %ld\n", GetLastError());
}
static void test_connect(HINTERNET hInternet)
......@@ -74,25 +74,25 @@ static void test_connect(HINTERNET hInternet)
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if (!hFtp)
{
skip("No ftp connection could be made to ftp.winehq.org %u\n", GetLastError());
skip("No ftp connection could be made to ftp.winehq.org %lu\n", GetLastError());
return;
}
ok(GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", GetLastError());
"Expected ERROR_SUCCESS, got %ld\n", GetLastError());
InternetCloseHandle(hFtp);
SetLastError(0xdeadbeef);
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, NULL, "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
ok ( hFtp == NULL, "Expected InternetConnect to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", "IEUser@",
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
ok(!hFtp, "Expected InternetConnect to fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Using a NULL username and password will be interpreted as anonymous ftp. The username will be 'anonymous' the password
* is created via some simple heuristics (see dlls/wininet/ftp.c).
......@@ -109,9 +109,9 @@ static void test_connect(HINTERNET hInternet)
SetLastError(0xdeadbeef);
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
}
ok ( hFtp != NULL, "InternetConnect failed : %d\n", GetLastError());
ok ( hFtp != NULL, "InternetConnect failed : %ld\n", GetLastError());
ok ( GetLastError() == ERROR_SUCCESS,
"ERROR_SUCCESS, got %d\n", GetLastError());
"ERROR_SUCCESS, got %ld\n", GetLastError());
InternetCloseHandle(hFtp);
SetLastError(0xdeadbeef);
......@@ -120,12 +120,12 @@ static void test_connect(HINTERNET hInternet)
if (!hFtp)
{
ok(GetLastError() == ERROR_INTERNET_LOGIN_FAILURE,
"Expected ERROR_INTERNET_LOGIN_FAILURE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_LOGIN_FAILURE, got %ld\n", GetLastError());
}
else
{
ok(GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", GetLastError());
"Expected ERROR_SUCCESS, got %ld\n", GetLastError());
InternetCloseHandle(hFtp);
}
}
......@@ -139,34 +139,34 @@ static void test_createdir(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpCreateDirectoryA(NULL, "new_directory_deadbeef");
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
/* No directory-name */
SetLastError(0xdeadbeef);
bRet = FtpCreateDirectoryA(hFtp, NULL);
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Parameters are OK, but we shouldn't be allowed to create the directory */
SetLastError(0xdeadbeef);
bRet = FtpCreateDirectoryA(hFtp, "new_directory_deadbeef");
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %ld\n", GetLastError());
/* One small test to show that handle type is checked before parameters */
SetLastError(0xdeadbeef);
bRet = FtpCreateDirectoryA(hConnect, NULL);
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
bRet = FtpCreateDirectoryA(hConnect, "new_directory_deadbeef");
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
}
static void test_deletefile(HINTERNET hFtp, HINTERNET hConnect)
......@@ -178,34 +178,34 @@ static void test_deletefile(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpDeleteFileA(NULL, "non_existent_file_deadbeef");
ok ( bRet == FALSE, "Expected FtpDeleteFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
/* No filename */
SetLastError(0xdeadbeef);
bRet = FtpDeleteFileA(hFtp, NULL);
ok ( bRet == FALSE, "Expected FtpDeleteFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Parameters are OK but remote file should not be there */
SetLastError(0xdeadbeef);
bRet = FtpDeleteFileA(hFtp, "non_existent_file_deadbeef");
ok ( bRet == FALSE, "Expected FtpDeleteFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %ld\n", GetLastError());
/* One small test to show that handle type is checked before parameters */
SetLastError(0xdeadbeef);
bRet = FtpDeleteFileA(hConnect, NULL);
ok ( bRet == FALSE, "Expected FtpDeleteFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
bRet = FtpDeleteFileA(hConnect, "non_existent_file_deadbeef");
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
}
static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
......@@ -227,14 +227,14 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_HANDLE ||
GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_HANDLE (win98) or ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE (win98) or ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Test to show session handle is checked before 'condition flags' */
SetLastError(0xdeadbeef);
bRet = FtpGetFileA(NULL, "welcome.msg", "should_be_non_existing_deadbeef", FALSE, FILE_ATTRIBUTE_NORMAL, 5, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
/* Make sure we start clean */
......@@ -246,7 +246,7 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpGetFileA(hFtp, NULL, "should_be_non_existing_deadbeef", FALSE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA 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 (GetFileAttributesA("should_be_non_existing_deadbeef") == INVALID_FILE_ATTRIBUTES,
"Local file should not have been created\n");
DeleteFileA("should_be_non_existing_deadbeef");
......@@ -256,7 +256,7 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpGetFileA(hFtp, "welcome.msg", NULL, FALSE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Zero attributes */
bRet = FtpGetFileA(hFtp, "welcome.msg", "should_be_existing_non_deadbeef", FALSE, 0, FTP_TRANSFER_TYPE_UNKNOWN, 0);
......@@ -270,7 +270,7 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpGetFileA(hFtp, "welcome.msg", "should_be_non_existing_deadbeef", FALSE, FILE_ATTRIBUTE_NORMAL, 0xffffffff, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR || GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INTERNET_EXTENDED_ERROR or ERROR_INVALID_PARAMETER (win98), got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR or ERROR_INVALID_PARAMETER (win98), got %ld\n", GetLastError());
ok (GetFileAttributesA("should_be_non_existing_deadbeef") == INVALID_FILE_ATTRIBUTES,
"Local file should not have been created\n");
DeleteFileA("should_be_non_existing_deadbeef");
......@@ -280,7 +280,7 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpGetFileA(hFtp, "should_be_non_existing_deadbeef", "should_also_be_non_existing_deadbeef", FALSE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %ld\n", GetLastError());
/* Currently Wine always creates the local file (even on failure) which is not correct, hence the test */
ok (GetFileAttributesA("should_also_be_non_existing_deadbeef") == INVALID_FILE_ATTRIBUTES,
"Local file should not have been created\n");
......@@ -294,13 +294,13 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
/* Create a temporary local file */
SetLastError(0xdeadbeef);
hFile = CreateFileA("should_also_be_non_existing_deadbeef", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
ok ( hFile != NULL, "Error creating a local file : %d\n", GetLastError());
ok ( hFile != NULL, "Error creating a local file : %ld\n", GetLastError());
CloseHandle(hFile);
SetLastError(0xdeadbeef);
bRet = FtpGetFileA(hFtp, "should_be_non_existing_deadbeef", "should_also_be_non_existing_deadbeef", FALSE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %ld\n", GetLastError());
/* Currently Wine always creates the local file (even on failure) which is not correct, hence the test */
ok (GetFileAttributesA("should_also_be_non_existing_deadbeef") == INVALID_FILE_ATTRIBUTES,
"Local file should not have been created\n");
......@@ -311,7 +311,7 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
SetLastError(0xdeadbeef);
bRet = FtpGetFileA(hFtp, "welcome.msg", "should_be_existing_non_deadbeef", FALSE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == TRUE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
ok ( GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
if (GetFileAttributesA("should_be_existing_non_deadbeef") != INVALID_FILE_ATTRIBUTES)
{
......@@ -320,21 +320,21 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpGetFileA(hFtp, "welcome.msg", "should_be_non_existing_deadbeef", FALSE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == TRUE, "Expected FtpGetFileA to succeed\n");
ok ( GetLastError() == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %d\n", GetLastError());
"Expected ERROR_SUCCESS, got %ld\n", GetLastError());
/* Should fail as fFailIfExists is set to TRUE */
SetLastError(0xdeadbeef);
bRet = FtpGetFileA(hFtp, "welcome.msg", "should_be_non_existing_deadbeef", TRUE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_FILE_EXISTS,
"Expected ERROR_FILE_EXISTS, got %d\n", GetLastError());
"Expected ERROR_FILE_EXISTS, got %ld\n", GetLastError());
/* Prove that the existence of the local file is checked first (or at least reported last) */
SetLastError(0xdeadbeef);
bRet = FtpGetFileA(hFtp, "should_be_non_existing_deadbeef", "should_be_non_existing_deadbeef", TRUE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_FILE_EXISTS,
"Expected ERROR_FILE_EXISTS, got %d\n", GetLastError());
"Expected ERROR_FILE_EXISTS, got %ld\n", GetLastError());
DeleteFileA("should_be_existing_non_deadbeef");
}
......@@ -345,20 +345,20 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE ||
GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE (win98) or ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE (win98) or ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Test to show that 'session handle type' is checked before 'condition flags' */
SetLastError(0xdeadbeef);
bRet = FtpGetFileA(hConnect, "welcome.msg", "should_be_non_existing_deadbeef", FALSE, FILE_ATTRIBUTE_NORMAL, 5, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
bRet = FtpGetFileA(hConnect, "should_be_non_existing_deadbeef", "should_be_non_existing_deadbeef", TRUE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpGetFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
}
static void trace_extended_error(DWORD error)
......@@ -370,7 +370,7 @@ static void trace_extended_error(DWORD error)
{
char *text = HeapAlloc(GetProcessHeap(), 0, ++buflen);
InternetGetLastResponseInfoA(&code, text, &buflen);
trace("%u %s\n", code, text);
trace("%lu %s\n", code, text);
HeapFree(GetProcessHeap(), 0, text);
}
}
......@@ -384,7 +384,7 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
hOpenFile = FtpOpenFileA(NULL, "welcome.msg", GENERIC_READ, FTP_TRANSFER_TYPE_ASCII, 0);
ok ( !hOpenFile, "Expected FtpOpenFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
InternetCloseHandle(hOpenFile); /* Just in case */
/* No filename */
......@@ -392,7 +392,7 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
hOpenFile = FtpOpenFileA(hFtp, NULL, GENERIC_READ, FTP_TRANSFER_TYPE_ASCII, 0);
ok ( !hOpenFile, "Expected FtpOpenFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
InternetCloseHandle(hOpenFile); /* Just in case */
/* Illegal access flags */
......@@ -400,7 +400,7 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
hOpenFile = FtpOpenFileA(hFtp, "welcome.msg", 0, FTP_TRANSFER_TYPE_ASCII, 0);
ok ( !hOpenFile, "Expected FtpOpenFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
InternetCloseHandle(hOpenFile); /* Just in case */
/* Illegal combination of access flags */
......@@ -408,7 +408,7 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
hOpenFile = FtpOpenFileA(hFtp, "welcome.msg", GENERIC_READ|GENERIC_WRITE, FTP_TRANSFER_TYPE_ASCII, 0);
ok ( !hOpenFile, "Expected FtpOpenFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
InternetCloseHandle(hOpenFile); /* Just in case */
/* Illegal condition flags */
......@@ -416,7 +416,7 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
hOpenFile = FtpOpenFileA(hFtp, "welcome.msg", GENERIC_READ, 0xffffffff, 0);
ok ( !hOpenFile, "Expected FtpOpenFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR || GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INTERNET_EXTENDED_ERROR or ERROR_INVALID_PARAMETER (win98), got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR or ERROR_INVALID_PARAMETER (win98), got %ld\n", GetLastError());
InternetCloseHandle(hOpenFile); /* Just in case */
SetLastError(0xdeadbeef);
......@@ -424,7 +424,7 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
ok ( hOpenFile != NULL, "Expected FtpOpenFileA to succeed\n");
ok ( GetLastError() == ERROR_SUCCESS ||
broken(GetLastError() == ERROR_FILE_NOT_FOUND), /* Win98 */
"Expected ERROR_SUCCESS, got %u\n", GetLastError());
"Expected ERROR_SUCCESS, got %lu\n", GetLastError());
if (hOpenFile)
{
......@@ -439,7 +439,7 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
error = GetLastError();
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA to fail\n");
ok ( error == ERROR_FTP_TRANSFER_IN_PROGRESS || broken(error == ERROR_INTERNET_EXTENDED_ERROR),
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", error);
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %ld\n", error);
trace_extended_error(error);
SetLastError(0xdeadbeef);
......@@ -447,7 +447,7 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
error = GetLastError();
ok ( bRet == FALSE, "Expected FtpDeleteFileA to fail\n");
ok ( error == ERROR_FTP_TRANSFER_IN_PROGRESS || broken(error == ERROR_INTERNET_EXTENDED_ERROR),
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", error);
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %ld\n", error);
trace_extended_error(error);
SetLastError(0xdeadbeef);
......@@ -455,7 +455,7 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
error = GetLastError();
ok ( bRet == FALSE || broken(bRet == TRUE), "Expected FtpGetFileA to fail\n");
ok ( error == ERROR_FTP_TRANSFER_IN_PROGRESS || broken(error == ERROR_SUCCESS),
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", error);
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %ld\n", error);
DeleteFileA("should_be_non_existing_deadbeef"); /* Just in case */
SetLastError(0xdeadbeef);
......@@ -463,20 +463,20 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
error = GetLastError();
ok ( bRet == FALSE || broken(bRet == TRUE), "Expected FtpOpenFileA to fail\n");
ok ( error == ERROR_FTP_TRANSFER_IN_PROGRESS || broken(error == ERROR_SUCCESS),
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", error);
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %ld\n", error);
InternetCloseHandle(hOpenFile2); /* Just in case */
/* Create a temporary local file */
SetLastError(0xdeadbeef);
hFile = CreateFileA("now_existing_local", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
ok ( hFile != NULL, "Error creating a local file : %d\n", GetLastError());
ok ( hFile != NULL, "Error creating a local file : %ld\n", GetLastError());
CloseHandle(hFile);
SetLastError(0xdeadbeef);
bRet = FtpPutFileA(hFtp, "now_existing_local", "non_existing_remote", FTP_TRANSFER_TYPE_UNKNOWN, 0);
error = GetLastError();
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( error == ERROR_FTP_TRANSFER_IN_PROGRESS || broken(error == ERROR_INTERNET_EXTENDED_ERROR),
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", error);
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %ld\n", error);
DeleteFileA("now_existing_local");
SetLastError(0xdeadbeef);
......@@ -484,14 +484,14 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
error = GetLastError();
ok ( bRet == FALSE, "Expected FtpRemoveDirectoryA to fail\n");
ok ( error == ERROR_FTP_TRANSFER_IN_PROGRESS || broken(error == ERROR_INTERNET_EXTENDED_ERROR),
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", error);
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %ld\n", error);
SetLastError(0xdeadbeef);
bRet = FtpRenameFileA(hFtp , "should_be_non_existing_deadbeef", "new");
error = GetLastError();
ok ( bRet == FALSE, "Expected FtpRenameFileA to fail\n");
ok ( error == ERROR_FTP_TRANSFER_IN_PROGRESS || broken(error == ERROR_INTERNET_EXTENDED_ERROR),
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", error);
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %ld\n", error);
}
InternetCloseHandle(hOpenFile);
......@@ -501,14 +501,14 @@ static void test_openfile(HINTERNET hFtp, HINTERNET hConnect)
hOpenFile = FtpOpenFileA(hConnect, "welcome.msg", GENERIC_READ, 5, 0);
ok ( !hOpenFile, "Expected FtpOpenFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
InternetCloseHandle(hOpenFile); /* Just in case */
SetLastError(0xdeadbeef);
hOpenFile = FtpOpenFileA(hConnect, "welcome.msg", GENERIC_READ, FTP_TRANSFER_TYPE_ASCII, 0);
ok ( hOpenFile == NULL, "Expected FtpOpenFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
InternetCloseHandle(hOpenFile); /* Just in case */
}
......@@ -532,14 +532,14 @@ static void test_putfile(HINTERNET hFtp, HINTERNET hConnect)
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_HANDLE ||
GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_HANDLE (win98) or ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE (win98) or ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Test to show session handle is checked before 'condition flags' */
SetLastError(0xdeadbeef);
bRet = FtpPutFileA(NULL, "non_existing_local", "non_existing_remote", 5, 0);
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
/* Start clean */
DeleteFileA("non_existing_local");
......@@ -549,33 +549,33 @@ static void test_putfile(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpPutFileA(hFtp, NULL, "non_existing_remote", FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* No remote file given */
SetLastError(0xdeadbeef);
bRet = FtpPutFileA(hFtp, "non_existing_local", NULL, FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Illegal condition flags */
SetLastError(0xdeadbeef);
bRet = FtpPutFileA(hFtp, "non_existing_local", "non_existing_remote", 5, 0);
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_FILE_NOT_FOUND or ERROR_INVALID_PARAMETER (win98), got %d\n", GetLastError());
"Expected ERROR_FILE_NOT_FOUND or ERROR_INVALID_PARAMETER (win98), got %ld\n", GetLastError());
/* Parameters are OK but local file doesn't exist */
SetLastError(0xdeadbeef);
bRet = FtpPutFileA(hFtp, "non_existing_local", "non_existing_remote", FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpPutFileA 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());
/* Create a temporary local file */
SetLastError(0xdeadbeef);
hFile = CreateFileA("now_existing_local", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
ok ( hFile != NULL, "Error creating a local file : %d\n", GetLastError());
ok ( hFile != NULL, "Error creating a local file : %ld\n", GetLastError());
CloseHandle(hFile);
/* Local file exists but we shouldn't be allowed to 'put' the file */
......@@ -583,7 +583,7 @@ static void test_putfile(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpPutFileA(hFtp, "now_existing_local", "non_existing_remote", FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %ld\n", GetLastError());
DeleteFileA("now_existing_local");
......@@ -593,20 +593,20 @@ static void test_putfile(HINTERNET hFtp, HINTERNET hConnect)
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE ||
GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE (win98) or ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE (win98) or ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Test to show that 'session handle type' is checked before 'condition flags' */
SetLastError(0xdeadbeef);
bRet = FtpPutFileA(hConnect, "non_existing_local", "non_existing_remote", 5, 0);
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
bRet = FtpPutFileA(hConnect, "non_existing_local", "non_existing_remote", FTP_TRANSFER_TYPE_UNKNOWN, 0);
ok ( bRet == FALSE, "Expected FtpPutFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
}
static void test_removedir(HINTERNET hFtp, HINTERNET hConnect)
......@@ -618,41 +618,41 @@ static void test_removedir(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpRemoveDirectoryA(NULL, "should_be_non_existing_deadbeef_dir");
ok ( bRet == FALSE, "Expected FtpRemoveDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
/* No remote directory given */
SetLastError(0xdeadbeef);
bRet = FtpRemoveDirectoryA(hFtp, NULL);
ok ( bRet == FALSE, "Expected FtpRemoveDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Remote directory doesn't exist */
SetLastError(0xdeadbeef);
bRet = FtpRemoveDirectoryA(hFtp, "should_be_non_existing_deadbeef_dir");
ok ( bRet == FALSE, "Expected FtpRemoveDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %ld\n", GetLastError());
/* We shouldn't be allowed to remove that directory */
SetLastError(0xdeadbeef);
bRet = FtpRemoveDirectoryA(hFtp, "pub");
ok ( bRet == FALSE, "Expected FtpRemoveDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %ld\n", GetLastError());
/* One small test to show that handle type is checked before parameters */
SetLastError(0xdeadbeef);
bRet = FtpRemoveDirectoryA(hConnect, NULL);
ok ( bRet == FALSE, "Expected FtpRemoveDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
bRet = FtpRemoveDirectoryA(hConnect, "should_be_non_existing_deadbeef_dir");
ok ( bRet == FALSE, "Expected FtpRemoveDirectoryA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
}
static void test_renamefile(HINTERNET hFtp, HINTERNET hConnect)
......@@ -664,41 +664,41 @@ static void test_renamefile(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpRenameFileA(NULL , "should_be_non_existing_deadbeef", "new");
ok ( bRet == FALSE, "Expected FtpRenameFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
/* No 'existing' file */
SetLastError(0xdeadbeef);
bRet = FtpRenameFileA(hFtp , NULL, "new");
ok ( bRet == FALSE, "Expected FtpRenameFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* No new file */
SetLastError(0xdeadbeef);
bRet = FtpRenameFileA(hFtp , "should_be_non_existing_deadbeef", NULL);
ok ( bRet == FALSE, "Expected FtpRenameFileA to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Existing file shouldn't be there */
SetLastError(0xdeadbeef);
bRet = FtpRenameFileA(hFtp , "should_be_non_existing_deadbeef", "new");
ok ( bRet == FALSE, "Expected FtpRenameFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %ld\n", GetLastError());
/* One small test to show that handle type is checked before parameters */
SetLastError(0xdeadbeef);
bRet = FtpRenameFileA(hConnect , "should_be_non_existing_deadbeef", NULL);
ok ( bRet == FALSE, "Expected FtpRenameFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
bRet = FtpRenameFileA(hConnect , "should_be_non_existing_deadbeef", "new");
ok ( bRet == FALSE, "Expected FtpRenameFileA to fail\n");
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError());
}
static void test_command(HINTERNET hFtp)
......@@ -748,36 +748,36 @@ static void test_command(HINTERNET hFtp)
error = GetLastError();
ok(ret == command_test[i].ret, "%d: expected FtpCommandA to %s\n", i, command_test[i].ret ? "succeed" : "fail");
ok(error == command_test[i].error, "%d: expected error %u, got %u\n", i, command_test[i].error, error);
ok(error == command_test[i].error, "%d: expected error %lu, got %lu\n", i, command_test[i].error, error);
size = 0;
ret = InternetGetLastResponseInfoA(&error, NULL, NULL);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "%d: ret %d, lasterr %d\n", i, ret, GetLastError());
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "%d: ret %d, lasterr %ld\n", i, ret, GetLastError());
ret = InternetGetLastResponseInfoA(NULL, NULL, &size);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "%d: ret %d, lasterr %d\n", i, ret, GetLastError());
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "%d: ret %d, lasterr %ld\n", i, ret, GetLastError());
/* Zero size */
size = 0;
ret = InternetGetLastResponseInfoA(&error, NULL, &size);
ok((ret && size == 0) || (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER), "%d: got ret %d, size %d, lasterr %d\n", i, ret, size, GetLastError());
ok((ret && size == 0) || (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER), "%d: got ret %d, size %ld, lasterr %ld\n", i, ret, size, GetLastError());
/* Positive size, NULL buffer */
size++;
ret = InternetGetLastResponseInfoA(&error, NULL, &size);
ok((ret && size == 0) || (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER), "%d: got ret %d, size %u, lasterr %d\n", i, ret, size, GetLastError());
ok((ret && size == 0) || (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER), "%d: got ret %d, size %lu, lasterr %ld\n", i, ret, size, GetLastError());
/* When buffer is 1 char too short, it succeeds but trims the string: */
orig_size = size;
buffer = HeapAlloc(GetProcessHeap(), 0, size);
ok(buffer != NULL, "%d: no memory\n", i);
ret = InternetGetLastResponseInfoA(&error, buffer, &size);
ok(ret, "%d: got ret %d\n", i, ret);
ok(orig_size == 0 ? size == 0 : size == orig_size - 1, "%d: got orig_size %d, size %d\n", i, orig_size, size);
ok(size == 0 || strlen(buffer) == size, "%d: size %d, buffer size %d\n", i, size, size ? strlen(buffer) : 0);
ok(orig_size == 0 ? size == 0 : size == orig_size - 1, "%d: got orig_size %ld, size %ld\n", i, orig_size, size);
ok(size == 0 || strlen(buffer) == size, "%d: size %ld, buffer size %Id\n", i, size, size ? strlen(buffer) : 0);
HeapFree(GetProcessHeap(), 0, buffer);
/* Long enough buffer */
buffer = HeapAlloc(GetProcessHeap(), 0, ++size);
ok(buffer != NULL, "%d: no memory\n", i);
ret = InternetGetLastResponseInfoA(&error, buffer, &size);
ok(ret, "%d: got ret %d\n", i, ret);
ok(size == 0 || strlen(buffer) == size, "%d: size %d, buffer size %d\n", i, size, size ? strlen(buffer) : 0);
ok(size == 0 || strlen(buffer) == size, "%d: size %ld, buffer size %Id\n", i, size, size ? strlen(buffer) : 0);
had_error_zero |= (error == 0);
had_error_zero_size_positive |= (error == 0 && size > 0);
HeapFree(GetProcessHeap(), 0, buffer);
......@@ -805,7 +805,7 @@ static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
hSearch2 = FtpFindFirstFileA(hFtp, "welcome.msg", &findData, 0, 0);
todo_wine ok ( hSearch2 == NULL, "Expected FtpFindFirstFileA to fail\n" );
todo_wine ok ( GetLastError() == ERROR_FTP_TRANSFER_IN_PROGRESS,
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", GetLastError() );
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %ld\n", GetLastError() );
InternetCloseHandle(hSearch2); /* Just in case */
InternetCloseHandle(hSearch);
......@@ -852,7 +852,7 @@ static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
ok ( hOpenFile != NULL, "Expected FtpOpenFileA to succeed\n" );
ok ( GetLastError() == ERROR_SUCCESS ||
broken(GetLastError() == ERROR_FILE_NOT_FOUND), /* Win98 */
"Expected ERROR_SUCCESS, got %u\n", GetLastError() );
"Expected ERROR_SUCCESS, got %lu\n", GetLastError() );
/* This should fail as the OpenFile handle wasn't closed */
SetLastError(0xdeadbeef);
......@@ -862,10 +862,10 @@ static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
"Expected FtpFindFirstFileA to fail\n" );
if (!hSearch)
ok ( error == ERROR_FTP_TRANSFER_IN_PROGRESS || broken(error == ERROR_INTERNET_EXTENDED_ERROR),
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", error );
"Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %ld\n", error );
else
{
ok( error == ERROR_SUCCESS, "wrong error %u on success\n", GetLastError() );
ok( error == ERROR_SUCCESS, "wrong error %lu on success\n", GetLastError() );
InternetCloseHandle(hSearch);
}
......@@ -876,7 +876,7 @@ static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
hSearch = FtpFindFirstFileA(hFtp, "this_file_should_not_exist", &findData, 0, 0);
ok ( hSearch == NULL, "Expected FtpFindFirstFileA to fail\n" );
todo_wine ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError() );
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %ld\n", GetLastError() );
InternetCloseHandle(hSearch); /* Just in case */
/* Test using a nonexistent filename and a wildcard */
......@@ -884,7 +884,7 @@ static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
hSearch = FtpFindFirstFileA(hFtp, "this_file_should_not_exist*", &findData, 0, 0);
ok ( hSearch == NULL, "Expected FtpFindFirstFileA to fail\n" );
todo_wine ok ( GetLastError() == ERROR_NO_MORE_FILES,
"Expected ERROR_NO_MORE_FILES, got %d\n", GetLastError() );
"Expected ERROR_NO_MORE_FILES, got %ld\n", GetLastError() );
InternetCloseHandle(hSearch); /* Just in case */
/* Test using an invalid handle type */
......@@ -892,7 +892,7 @@ static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
hSearch = FtpFindFirstFileA(hConnect, "welcome.msg", &findData, 0, 0);
ok ( hSearch == NULL, "Expected FtpFindFirstFileA to fail\n" );
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError() );
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %ld\n", GetLastError() );
InternetCloseHandle(hSearch); /* Just in case */
}
......@@ -920,45 +920,45 @@ static void test_get_current_dir(HINTERNET hFtp, HINTERNET hConnect)
SetLastError(0xdeadbeef);
bRet = FtpGetCurrentDirectoryA( NULL, NULL, 0 );
ok ( bRet == FALSE, "Expected FtpGetCurrentDirectoryA to fail\n" );
ok ( GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got: %d\n", GetLastError());
ok ( GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got: %ld\n", GetLastError());
/* test with NULL parameters instead of expected LPSTR/LPDWORD */
SetLastError(0xdeadbeef);
bRet = FtpGetCurrentDirectoryA( hFtp, NULL, 0 );
ok ( bRet == FALSE, "Expected FtpGetCurrentDirectoryA to fail\n" );
ok ( GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got: %d\n", GetLastError());
ok ( GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got: %ld\n", GetLastError());
/* test with no valid handle and valid parameters */
SetLastError(0xdeadbeef);
bRet = FtpGetCurrentDirectoryA( NULL, lpszCurrentDirectory, &dwCurrentDirectoryLen );
ok ( bRet == FALSE, "Expected FtpGetCurrentDirectoryA to fail\n" );
ok ( GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got: %d\n", GetLastError());
ok ( GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got: %ld\n", GetLastError());
/* test with invalid dwCurrentDirectory and all other parameters correct */
SetLastError(0xdeadbeef);
bRet = FtpGetCurrentDirectoryA( hFtp, lpszCurrentDirectory, 0 );
ok ( bRet == FALSE, "Expected FtpGetCurrentDirectoryA to fail\n" );
ok ( GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got: %d\n", GetLastError());
ok ( GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got: %ld\n", GetLastError());
/* test with invalid lpszCurrentDirectory and all other parameters correct */
SetLastError(0xdeadbeef);
bRet = FtpGetCurrentDirectoryA( hFtp, NULL, &dwCurrentDirectoryLen );
ok ( bRet == FALSE, "Expected FtpGetCurrentDirectoryA to fail\n" );
ok ( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got: %d\n", GetLastError());
ok ( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got: %ld\n", GetLastError());
/* test to show it checks the handle type */
SetLastError(0xdeadbeef);
bRet = FtpGetCurrentDirectoryA( hConnect, lpszCurrentDirectory, &dwCurrentDirectoryLen );
ok ( bRet == FALSE, "Expected FtpGetCurrentDirectoryA to fail\n" );
ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got: %d\n", GetLastError());
"Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got: %ld\n", GetLastError());
/* test for the current directory with legitimate values */
SetLastError(0xdeadbeef);
bRet = FtpGetCurrentDirectoryA( hFtp, lpszCurrentDirectory, &dwCurrentDirectoryLen );
ok ( bRet == TRUE, "Expected FtpGetCurrentDirectoryA to pass\n" );
ok ( !strcmp(lpszCurrentDirectory, "/pub"), "Expected returned value \"%s\" to match \"/pub\"\n", lpszCurrentDirectory);
ok ( GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got: %d\n", GetLastError());
ok ( GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got: %ld\n", GetLastError());
/* test for the current directory with a size only large enough to
* fit the string and not the null terminating character */
......@@ -968,7 +968,7 @@ static void test_get_current_dir(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpGetCurrentDirectoryA( hFtp, lpszCurrentDirectory, &dwCurrentDirectoryLen );
ok ( bRet == FALSE, "Expected FtpGetCurrentDirectoryA to fail\n");
ok ( strcmp(lpszCurrentDirectory, "/pub"), "Expected returned value \"%s\" to not match \"/pub\"\n", lpszCurrentDirectory);
ok ( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got: %d\n", GetLastError());
ok ( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got: %ld\n", GetLastError());
/* test for the current directory with a size large enough to store
* the expected string as well as the null terminating character */
......@@ -977,7 +977,7 @@ static void test_get_current_dir(HINTERNET hFtp, HINTERNET hConnect)
bRet = FtpGetCurrentDirectoryA( hFtp, lpszCurrentDirectory, &dwCurrentDirectoryLen );
ok ( bRet == TRUE, "Expected FtpGetCurrentDirectoryA to pass\n");
ok ( !strcmp(lpszCurrentDirectory, "/pub"), "Expected returned value \"%s\" to match \"/pub\"\n", lpszCurrentDirectory);
ok ( GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got: %d\n", GetLastError());
ok ( GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got: %ld\n", GetLastError());
}
static void WINAPI status_callback(HINTERNET handle, DWORD_PTR ctx, DWORD status, LPVOID info, DWORD info_len)
......@@ -988,7 +988,7 @@ static void WINAPI status_callback(HINTERNET handle, DWORD_PTR ctx, DWORD status
case INTERNET_STATUS_NAME_RESOLVED:
case INTERNET_STATUS_CONNECTING_TO_SERVER:
case INTERNET_STATUS_CONNECTED_TO_SERVER:
trace("%p %lx %u %s %u\n", handle, ctx, status, (char *)info, info_len);
trace("%p %Ix %lu %s %lu\n", handle, ctx, status, (char *)info, info_len);
break;
default:
break;
......@@ -1008,12 +1008,12 @@ static void test_status_callbacks(HINTERNET hInternet)
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 1);
if (!hFtp)
{
skip("No ftp connection could be made to ftp.winehq.org %u\n", GetLastError());
skip("No ftp connection could be made to ftp.winehq.org %lu\n", GetLastError());
return;
}
ret = InternetCloseHandle(hFtp);
ok(ret, "InternetCloseHandle failed %u\n", GetLastError());
ok(ret, "InternetCloseHandle failed %lu\n", GetLastError());
cb = pInternetSetStatusCallbackA(hInternet, NULL);
ok(cb == status_callback, "expected check_status got %p\n", cb);
......@@ -1036,7 +1036,7 @@ START_TEST(ftp)
SetLastError(0xdeadbeef);
hInternet = InternetOpenA("winetest", 0, NULL, NULL, 0);
ok(hInternet != NULL, "InternetOpen failed: %u\n", GetLastError());
ok(hInternet != NULL, "InternetOpen failed: %lu\n", GetLastError());
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if (!hFtp)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -68,7 +68,7 @@ static void test_InternetCanonicalizeUrlA(void)
SetLastError(0xdeadbeef);
res = InternetCanonicalizeUrlA(url, buffer, &dwSize, 0);
ok( !res && (GetLastError() == ERROR_INSUFFICIENT_BUFFER) && (dwSize == (urllen+1)),
"got %u and %u with size %u for '%s' (%d)\n",
"got %lu and %lu with size %lu for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
......@@ -80,7 +80,7 @@ static void test_InternetCanonicalizeUrlA(void)
res = InternetCanonicalizeUrlA(url, buffer, &dwSize, 0);
/* dwSize is nr. of needed bytes with the terminating '\0' */
ok( !res && (GetLastError() == ERROR_INSUFFICIENT_BUFFER) && (dwSize == (urllen+1)),
"got %u and %u with size %u for '%s' (%d)\n",
"got %lu and %lu with size %lu for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
/* buffer has the required size */
......@@ -91,7 +91,7 @@ static void test_InternetCanonicalizeUrlA(void)
res = InternetCanonicalizeUrlA(url, buffer, &dwSize, 0);
/* dwSize is nr. of copied bytes without the terminating '\0' */
ok( res && (dwSize == urllen) && (lstrcmpA(url, buffer) == 0),
"got %u and %u with size %u for '%s' (%d)\n",
"got %lu and %lu with size %lu for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
memset(buffer, '#', sizeof(buffer)-1);
......@@ -99,8 +99,8 @@ static void test_InternetCanonicalizeUrlA(void)
dwSize = sizeof(buffer);
SetLastError(0xdeadbeef);
res = InternetCanonicalizeUrlA("file:///C:/Program%20Files/Atmel/AVR%20Tools/STK500/STK500.xml", buffer, &dwSize, ICU_DECODE | ICU_NO_ENCODE);
ok(res, "InternetCanonicalizeUrlA failed %u\n", GetLastError());
ok(dwSize == lstrlenA(buffer), "got %d expected %d\n", dwSize, lstrlenA(buffer));
ok(res, "InternetCanonicalizeUrlA failed %lu\n", GetLastError());
ok(dwSize == lstrlenA(buffer), "got %ld expected %d\n", dwSize, lstrlenA(buffer));
ok(!lstrcmpA("file://C:\\Program Files\\Atmel\\AVR Tools\\STK500\\STK500.xml", buffer),
"got %s expected 'file://C:\\Program Files\\Atmel\\AVR Tools\\STK500\\STK500.xml'\n", buffer);
......@@ -112,7 +112,7 @@ static void test_InternetCanonicalizeUrlA(void)
res = InternetCanonicalizeUrlA(url, buffer, &dwSize, 0);
/* dwSize is nr. of copied bytes without the terminating '\0' */
ok( res && (dwSize == urllen) && (lstrcmpA(url, buffer) == 0),
"got %u and %u with size %u for '%s' (%d)\n",
"got %lu and %lu with size %lu for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
......@@ -123,7 +123,7 @@ static void test_InternetCanonicalizeUrlA(void)
SetLastError(0xdeadbeef);
res = InternetCanonicalizeUrlA(NULL, buffer, &dwSize, 0);
ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER),
"got %u and %u with size %u for '%s' (%d)\n",
"got %lu and %lu with size %lu for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
memset(buffer, '#', urllen + 4);
......@@ -132,7 +132,7 @@ static void test_InternetCanonicalizeUrlA(void)
SetLastError(0xdeadbeef);
res = InternetCanonicalizeUrlA(url, NULL, &dwSize, 0);
ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER),
"got %u and %u with size %u for '%s' (%d)\n",
"got %lu and %lu with size %lu for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
memset(buffer, '#', urllen + 4);
......@@ -141,7 +141,7 @@ static void test_InternetCanonicalizeUrlA(void)
SetLastError(0xdeadbeef);
res = InternetCanonicalizeUrlA(url, buffer, NULL, 0);
ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER),
"got %u and %u with size %u for '%s' (%d)\n",
"got %lu and %lu with size %lu for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
/* test with trailing space */
......@@ -153,7 +153,7 @@ static void test_InternetCanonicalizeUrlA(void)
res = InternetSetOptionA(NULL, 0xdeadbeef, buffer, sizeof(buffer));
ok(!res, "InternetSetOptionA succeeded\n");
ok(GetLastError() == ERROR_INTERNET_INVALID_OPTION,
"InternetSetOptionA failed %u, expected ERROR_INTERNET_INVALID_OPTION\n", GetLastError());
"InternetSetOptionA failed %lu, expected ERROR_INTERNET_INVALID_OPTION\n", GetLastError());
}
/* ############################### */
......@@ -171,8 +171,8 @@ static void test_InternetQueryOptionA(void)
SetLastError(0xdeadbeef);
len = 0xdeadbeef;
retval = InternetQueryOptionA(NULL, INTERNET_OPTION_PROXY, NULL, &len);
ok(!retval && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got wrong error %x(%u)\n", retval, GetLastError());
ok(len >= sizeof(INTERNET_PROXY_INFOA) && len != 0xdeadbeef,"len = %u\n", len);
ok(!retval && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got wrong error %x(%lu)\n", retval, GetLastError());
ok(len >= sizeof(INTERNET_PROXY_INFOA) && len != 0xdeadbeef,"len = %lu\n", len);
hinet = InternetOpenA(useragent,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL, 0);
ok((hinet != 0x0),"InternetOpen Failed\n");
......@@ -181,15 +181,15 @@ static void test_InternetQueryOptionA(void)
retval=InternetQueryOptionA(NULL,INTERNET_OPTION_USER_AGENT,NULL,&len);
err=GetLastError();
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code%d\n",err);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code%ld\n",err);
SetLastError(0xdeadbeef);
len=strlen(useragent)+1;
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,NULL,&len);
err=GetLastError();
ok(len == strlen(useragent)+1,"Got wrong user agent length %d instead of %d\n",len,lstrlenA(useragent));
ok(len == strlen(useragent)+1,"Got wrong user agent length %ld instead of %d\n",len,lstrlenA(useragent));
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code %d\n",err);
ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code %ld\n",err);
len=strlen(useragent)+1;
buffer=HeapAlloc(GetProcessHeap(),0,len);
......@@ -198,7 +198,7 @@ static void test_InternetQueryOptionA(void)
if (retval)
{
ok(!strcmp(useragent,buffer),"Got wrong user agent string %s instead of %s\n",buffer,useragent);
ok(len == strlen(useragent),"Got wrong user agent length %d instead of %d\n",len,lstrlenA(useragent));
ok(len == strlen(useragent),"Got wrong user agent length %ld instead of %d\n",len,lstrlenA(useragent));
}
HeapFree(GetProcessHeap(),0,buffer);
......@@ -207,9 +207,9 @@ static void test_InternetQueryOptionA(void)
buffer=HeapAlloc(GetProcessHeap(),0,100);
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,buffer,&len);
err=GetLastError();
ok(len == strlen(useragent) + 1,"Got wrong user agent length %d instead of %d\n", len, lstrlenA(useragent) + 1);
ok(len == strlen(useragent) + 1,"Got wrong user agent length %ld instead of %d\n", len, lstrlenA(useragent) + 1);
ok(!retval, "Got wrong return value %d\n", retval);
ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code %d\n", err);
ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code %ld\n", err);
HeapFree(GetProcessHeap(),0,buffer);
hurl = InternetConnectA(hinet,"www.winehq.org",INTERNET_DEFAULT_HTTP_PORT,NULL,NULL,INTERNET_SERVICE_HTTP,0,0);
......@@ -218,25 +218,25 @@ static void test_InternetQueryOptionA(void)
len=0;
retval = InternetQueryOptionA(hurl,INTERNET_OPTION_USER_AGENT,NULL,&len);
err=GetLastError();
ok(len == 0,"Got wrong user agent length %d instead of 0\n",len);
ok(len == 0,"Got wrong user agent length %ld instead of 0\n",len);
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %d\n",err);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %ld\n",err);
SetLastError(0xdeadbeef);
len = sizeof(DWORD);
retval = InternetQueryOptionA(hurl,INTERNET_OPTION_REQUEST_FLAGS,NULL,&len);
err = GetLastError();
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %d\n",err);
ok(len == sizeof(DWORD), "len = %d\n", len);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %ld\n",err);
ok(len == sizeof(DWORD), "len = %ld\n", len);
SetLastError(0xdeadbeef);
len = sizeof(DWORD);
retval = InternetQueryOptionA(NULL,INTERNET_OPTION_REQUEST_FLAGS,NULL,&len);
err = GetLastError();
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %d\n",err);
ok(!len, "len = %d\n", len);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %ld\n",err);
ok(!len, "len = %ld\n", len);
InternetCloseHandle(hurl);
InternetCloseHandle(hinet);
......@@ -248,21 +248,21 @@ static void test_InternetQueryOptionA(void)
len=0;
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,NULL,&len);
err=GetLastError();
ok(len == 1,"Got wrong user agent length %d instead of %d\n",len,1);
ok(len == 1,"Got wrong user agent length %ld instead of %d\n",len,1);
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%d\n",err);
ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%ld\n",err);
InternetCloseHandle(hinet);
val = 12345;
res = InternetSetOptionA(NULL, INTERNET_OPTION_CONNECT_TIMEOUT, &val, sizeof(val));
ok(res, "InternetSetOptionA(INTERNET_OPTION_CONNECT_TIMEOUT) failed (%u)\n", GetLastError());
ok(res, "InternetSetOptionA(INTERNET_OPTION_CONNECT_TIMEOUT) failed (%lu)\n", GetLastError());
len = sizeof(val);
res = InternetQueryOptionA(NULL, INTERNET_OPTION_CONNECT_TIMEOUT, &val, &len);
ok(res, "InternetQueryOptionA failed %d)\n", GetLastError());
ok(val == 12345, "val = %d\n", val);
ok(len == sizeof(val), "len = %d\n", len);
ok(res, "InternetQueryOptionA failed %ld)\n", GetLastError());
ok(val == 12345, "val = %ld\n", val);
ok(len == sizeof(val), "len = %ld\n", len);
hinet = InternetOpenA(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL, 0);
ok((hinet != 0x0),"InternetOpen Failed\n");
......@@ -270,42 +270,42 @@ static void test_InternetQueryOptionA(void)
len=0;
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,NULL,&len);
err=GetLastError();
ok(len == 1,"Got wrong user agent length %d instead of %d\n",len,1);
ok(len == 1,"Got wrong user agent length %ld instead of %d\n",len,1);
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%d\n",err);
ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%ld\n",err);
len = sizeof(val);
val = 0xdeadbeef;
res = InternetQueryOptionA(hinet, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, &len);
ok(!res, "InternetQueryOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n");
ok(GetLastError() == ERROR_INTERNET_INVALID_OPERATION, "GetLastError() = %u\n", GetLastError());
ok(GetLastError() == ERROR_INTERNET_INVALID_OPERATION, "GetLastError() = %lu\n", GetLastError());
val = 2;
res = InternetSetOptionA(hinet, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val));
ok(!res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n");
ok(GetLastError() == ERROR_INTERNET_INVALID_OPERATION, "GetLastError() = %u\n", GetLastError());
ok(GetLastError() == ERROR_INTERNET_INVALID_OPERATION, "GetLastError() = %lu\n", GetLastError());
len = sizeof(val);
res = InternetQueryOptionA(hinet, INTERNET_OPTION_CONNECT_TIMEOUT, &val, &len);
ok(res, "InternetQueryOptionA failed %d)\n", GetLastError());
ok(val == 12345, "val = %d\n", val);
ok(len == sizeof(val), "len = %d\n", len);
ok(res, "InternetQueryOptionA failed %ld)\n", GetLastError());
ok(val == 12345, "val = %ld\n", val);
ok(len == sizeof(val), "len = %ld\n", len);
val = 1;
res = InternetSetOptionA(hinet, INTERNET_OPTION_CONNECT_TIMEOUT, &val, sizeof(val));
ok(res, "InternetSetOptionA(INTERNET_OPTION_CONNECT_TIMEOUT) failed (%u)\n", GetLastError());
ok(res, "InternetSetOptionA(INTERNET_OPTION_CONNECT_TIMEOUT) failed (%lu)\n", GetLastError());
len = sizeof(val);
res = InternetQueryOptionA(hinet, INTERNET_OPTION_CONNECT_TIMEOUT, &val, &len);
ok(res, "InternetQueryOptionA failed %d)\n", GetLastError());
ok(val == 1, "val = %d\n", val);
ok(len == sizeof(val), "len = %d\n", len);
ok(res, "InternetQueryOptionA failed %ld)\n", GetLastError());
ok(val == 1, "val = %ld\n", val);
ok(len == sizeof(val), "len = %ld\n", len);
len = sizeof(val);
res = InternetQueryOptionA(NULL, INTERNET_OPTION_CONNECT_TIMEOUT, &val, &len);
ok(res, "InternetQueryOptionA failed %d)\n", GetLastError());
ok(val == 12345, "val = %d\n", val);
ok(len == sizeof(val), "len = %d\n", len);
ok(res, "InternetQueryOptionA failed %ld)\n", GetLastError());
ok(val == 12345, "val = %ld\n", val);
ok(len == sizeof(val), "len = %ld\n", len);
InternetCloseHandle(hinet);
}
......@@ -319,15 +319,15 @@ static void test_max_conns(void)
val = 0xdeadbeef;
res = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, &len);
ok(res,"Got wrong return value %x\n", res);
ok(len == sizeof(val), "got %d\n", len);
trace("INTERNET_OPTION_MAX_CONNS_PER_SERVER: %d\n", val);
ok(len == sizeof(val), "got %ld\n", len);
trace("INTERNET_OPTION_MAX_CONNS_PER_SERVER: %ld\n", val);
len = sizeof(val);
val = 0xdeadbeef;
res = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER, &val, &len);
ok(res,"Got wrong return value %x\n", res);
ok(len == sizeof(val), "got %d\n", len);
trace("INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: %d\n", val);
ok(len == sizeof(val), "got %ld\n", len);
trace("INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: %ld\n", val);
val = 3;
res = InternetSetOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val));
......@@ -337,24 +337,24 @@ static void test_max_conns(void)
val = 0xdeadbeef;
res = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, &len);
ok(res,"Got wrong return value %x\n", res);
ok(len == sizeof(val), "got %d\n", len);
ok(val == 3, "got %d\n", val);
ok(len == sizeof(val), "got %ld\n", len);
ok(val == 3, "got %ld\n", val);
val = 0;
res = InternetSetOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val));
ok(!res || broken(res), /* <= w2k3 */
"InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER, 0) succeeded\n");
if (!res) ok(GetLastError() == ERROR_BAD_ARGUMENTS, "GetLastError() = %u\n", GetLastError());
if (!res) ok(GetLastError() == ERROR_BAD_ARGUMENTS, "GetLastError() = %lu\n", GetLastError());
val = 2;
res = InternetSetOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val)-1);
ok(!res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n");
ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %u\n", GetLastError());
ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %lu\n", GetLastError());
val = 2;
res = InternetSetOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val)+1);
ok(!res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n");
ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %u\n", GetLastError());
ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %lu\n", GetLastError());
}
static void test_get_cookie(void)
......@@ -366,9 +366,9 @@ static void test_get_cookie(void)
SetLastError(0xdeadbeef);
ret = InternetGetCookieA("http://www.example.com", NULL, NULL, &len);
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS,
"InternetGetCookie should have failed with %s and error %d\n",
"InternetGetCookie should have failed with %s and error %ld\n",
ret ? "TRUE" : "FALSE", GetLastError());
ok(!len, "len = %u\n", len);
ok(!len, "len = %lu\n", len);
}
......@@ -405,13 +405,13 @@ static void test_complicated_cookie(void)
len = 1024;
ret = InternetGetCookieA("http://testing.example.com", NULL, NULL, &len);
ok(ret == TRUE,"InternetGetCookie failed\n");
ok(len == 19, "len = %u\n", len);
ok(len == 19, "len = %lu\n", len);
len = 1024;
memset(buffer, 0xac, sizeof(buffer));
ret = InternetGetCookieA("http://testing.example.com", NULL, buffer, &len);
ok(ret == TRUE,"InternetGetCookie failed\n");
ok(len == 19, "len = %u\n", len);
ok(len == 19, "len = %lu\n", len);
ok(strlen(buffer) == 18, "strlen(buffer) = %u\n", lstrlenA(buffer));
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
......@@ -426,27 +426,27 @@ static void test_complicated_cookie(void)
memset(buffer, 0xac, sizeof(buffer));
ret = InternetGetCookieA("http://testing.example.com", NULL, buffer, &len);
ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"InternetGetCookie returned: %x(%u), expected ERROR_INSUFFICIENT_BUFFER\n", ret, GetLastError());
ok(len == 19, "len = %u\n", len);
"InternetGetCookie returned: %x(%lu), expected ERROR_INSUFFICIENT_BUFFER\n", ret, GetLastError());
ok(len == 19, "len = %lu\n", len);
len = 1024;
ret = InternetGetCookieW(testing_example_comW, NULL, NULL, &len);
ok(ret == TRUE,"InternetGetCookieW failed\n");
ok(len == 38, "len = %u\n", len);
ok(len == 38, "len = %lu\n", len);
len = 1024;
memset(wbuf, 0xac, sizeof(wbuf));
ret = InternetGetCookieW(testing_example_comW, NULL, wbuf, &len);
ok(ret == TRUE,"InternetGetCookieW failed\n");
ok(len == 19 || broken(len==18), "len = %u\n", len);
ok(len == 19 || broken(len==18), "len = %lu\n", len);
ok(lstrlenW(wbuf) == 18, "strlenW(wbuf) = %u\n", lstrlenW(wbuf));
len = 10;
memset(wbuf, 0xac, sizeof(wbuf));
ret = InternetGetCookieW(testing_example_comW, NULL, wbuf, &len);
ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"InternetGetCookieW returned: %x(%u), expected ERROR_INSUFFICIENT_BUFFER\n", ret, GetLastError());
ok(len == 38, "len = %u\n", len);
"InternetGetCookieW returned: %x(%lu), expected ERROR_INSUFFICIENT_BUFFER\n", ret, GetLastError());
ok(len == 38, "len = %lu\n", len);
len = 1024;
ret = InternetGetCookieA("http://testing.example.com/foobar", NULL, buffer, &len);
......@@ -511,7 +511,7 @@ static void test_complicated_cookie(void)
len = 1024;
ret = InternetGetCookieA("http://testing.example.com/bar/foo", NULL, buffer, &len);
ok(ret == TRUE,"InternetGetCookie failed\n");
ok(len == 24, "len = %u\n", len);
ok(len == 24, "len = %lu\n", len);
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
ok(strstr(buffer,"E=F")!=NULL,"E=F missing\n");
......@@ -525,38 +525,38 @@ static void test_complicated_cookie(void)
len = 1024;
ret = InternetGetCookieA("http://testing.example.com/bar/foo", "A", buffer, &len);
ok(ret == TRUE,"InternetGetCookie failed\n");
ok(len == 24, "len = %u\n", len);
ok(len == 24, "len = %lu\n", len);
/* test persistent cookies */
ret = InternetSetCookieA("http://testing.example.com", NULL, "A=B; expires=Fri, 01-Jan-2038 00:00:00 GMT");
ok(ret, "InternetSetCookie failed with error %d\n", GetLastError());
ok(ret, "InternetSetCookie failed with error %ld\n", GetLastError());
/* test invalid expires parameter */
ret = InternetSetCookieA("http://testing.example.com", NULL, "Q=R; expires=");
ok(ret, "InternetSetCookie failed %#x.\n", GetLastError());
ok(ret, "InternetSetCookie failed %#lx.\n", GetLastError());
len = 1024;
memset(buffer, 0xac, sizeof(buffer));
ret = InternetGetCookieA("http://testing.example.com/", NULL, buffer, &len);
ok(ret, "InternetGetCookie failed %#x.\n", GetLastError());
ok(len == 29, "got len %u.\n", len);
ok(ret, "InternetGetCookie failed %#lx.\n", GetLastError());
ok(len == 29, "got len %lu.\n", len);
ok(!!strstr(buffer, "Q=R"), "cookie is not present.\n");
len = sizeof(buffer);
ret = InternetGetCookieA("http://testing.example.com/foobar", NULL, buffer, &len);
ok(ret, "got error %#x\n", GetLastError());
ok(len == 29, "got len %u\n", len);
ok(ret, "got error %#lx\n", GetLastError());
ok(len == 29, "got len %lu\n", len);
ok(!!strstr(buffer, "A=B"), "cookie is not present\n");
/* remove persistent cookie */
ret = InternetSetCookieA("http://testing.example.com", NULL, "A=B");
ok(ret, "InternetSetCookie failed with error %d\n", GetLastError());
ok(ret, "InternetSetCookie failed with error %ld\n", GetLastError());
/* try setting cookie for different domain */
ret = InternetSetCookieA("http://www.aaa.example.com/bar",NULL,"E=F; domain=different.com");
ok(!ret, "InternetSetCookie succeeded\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %d\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %ld\n", GetLastError());
ret = InternetSetCookieA("http://www.aaa.example.com.pl/bar",NULL,"E=F; domain=example.com.pl");
ok(ret, "InternetSetCookie failed with error: %d\n", GetLastError());
ok(ret, "InternetSetCookie failed with error: %ld\n", GetLastError());
ret = InternetSetCookieA("http://www.aaa.example.com.pl/bar",NULL,"E=F; domain=com.pl");
todo_wine ok(!ret, "InternetSetCookie succeeded\n");
}
......@@ -573,45 +573,45 @@ static void test_cookie_attrs(void)
}
ret = InternetSetCookieA("http://cookie.attrs.com/bar", NULL, "A=data; httponly");
ok(!ret && GetLastError() == ERROR_INVALID_OPERATION, "InternetSetCookie returned: %x (%u)\n", ret, GetLastError());
ok(!ret && GetLastError() == ERROR_INVALID_OPERATION, "InternetSetCookie returned: %x (%lu)\n", ret, GetLastError());
SetLastError(0xdeadbeef);
state = InternetSetCookieExA("http://cookie.attrs.com/bar", NULL, "A=data; httponly", 0, 0);
ok(state == COOKIE_STATE_REJECT && GetLastError() == ERROR_INVALID_OPERATION,
"InternetSetCookieEx returned: %x (%u)\n", ret, GetLastError());
"InternetSetCookieEx returned: %x (%lu)\n", ret, GetLastError());
size = sizeof(buf);
ret = InternetGetCookieExA("http://cookie.attrs.com/", NULL, buf, &size, INTERNET_COOKIE_HTTPONLY, NULL);
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookieEx returned: %x (%u)\n", ret, GetLastError());
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookieEx returned: %x (%lu)\n", ret, GetLastError());
state = InternetSetCookieExA("http://cookie.attrs.com/bar",NULL,"A=data; httponly", INTERNET_COOKIE_HTTPONLY, 0);
ok(state == COOKIE_STATE_ACCEPT,"InternetSetCookieEx failed: %u\n", GetLastError());
ok(state == COOKIE_STATE_ACCEPT,"InternetSetCookieEx failed: %lu\n", GetLastError());
size = sizeof(buf);
ret = InternetGetCookieA("http://cookie.attrs.com/", NULL, buf, &size);
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookie returned: %x (%u)\n", ret, GetLastError());
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookie returned: %x (%lu)\n", ret, GetLastError());
size = sizeof(buf);
ret = InternetGetCookieExA("http://cookie.attrs.com/", NULL, buf, &size, 0, NULL);
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookieEx returned: %x (%u)\n", ret, GetLastError());
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookieEx returned: %x (%lu)\n", ret, GetLastError());
size = sizeof(buf);
ret = InternetGetCookieExA("http://cookie.attrs.com/", NULL, buf, &size, INTERNET_COOKIE_HTTPONLY, NULL);
ok(ret, "InternetGetCookieEx failed: %u\n", GetLastError());
ok(ret, "InternetGetCookieEx failed: %lu\n", GetLastError());
ok(!strcmp(buf, "A=data"), "data = %s\n", buf);
/* Try to override httponly cookie with non-httponly one */
ret = InternetSetCookieA("http://cookie.attrs.com/bar", NULL, "A=test");
ok(!ret && GetLastError() == ERROR_INVALID_OPERATION, "InternetSetCookie returned: %x (%u)\n", ret, GetLastError());
ok(!ret && GetLastError() == ERROR_INVALID_OPERATION, "InternetSetCookie returned: %x (%lu)\n", ret, GetLastError());
SetLastError(0xdeadbeef);
state = InternetSetCookieExA("http://cookie.attrs.com/bar", NULL, "A=data", 0, 0);
ok(state == COOKIE_STATE_REJECT && GetLastError() == ERROR_INVALID_OPERATION,
"InternetSetCookieEx returned: %x (%u)\n", ret, GetLastError());
"InternetSetCookieEx returned: %x (%lu)\n", ret, GetLastError());
size = sizeof(buf);
ret = InternetGetCookieExA("http://cookie.attrs.com/", NULL, buf, &size, INTERNET_COOKIE_HTTPONLY, NULL);
ok(ret, "InternetGetCookieEx failed: %u\n", GetLastError());
ok(ret, "InternetGetCookieEx failed: %lu\n", GetLastError());
ok(!strcmp(buf, "A=data"), "data = %s\n", buf);
}
......@@ -629,22 +629,22 @@ static void test_cookie_url(void)
len = sizeof(buf);
res = InternetGetCookieA("about:blank", NULL, buf, &len);
ok(!res && GetLastError() == ERROR_INVALID_PARAMETER,
"InternetGetCookeA failed: %u, expected ERROR_INVALID_PARAMETER\n", GetLastError());
"InternetGetCookeA failed: %lu, expected ERROR_INVALID_PARAMETER\n", GetLastError());
len = ARRAY_SIZE(bufw);
res = InternetGetCookieW(about_blankW, NULL, bufw, &len);
ok(!res && GetLastError() == ERROR_INVALID_PARAMETER,
"InternetGetCookeW failed: %u, expected ERROR_INVALID_PARAMETER\n", GetLastError());
"InternetGetCookeW failed: %lu, expected ERROR_INVALID_PARAMETER\n", GetLastError());
len = sizeof(buf);
res = pInternetGetCookieExA("about:blank", NULL, buf, &len, 0, NULL);
ok(!res && GetLastError() == ERROR_INVALID_PARAMETER,
"InternetGetCookeExA failed: %u, expected ERROR_INVALID_PARAMETER\n", GetLastError());
"InternetGetCookeExA failed: %lu, expected ERROR_INVALID_PARAMETER\n", GetLastError());
len = ARRAY_SIZE(bufw);
res = pInternetGetCookieExW(about_blankW, NULL, bufw, &len, 0, NULL);
ok(!res && GetLastError() == ERROR_INVALID_PARAMETER,
"InternetGetCookeExW failed: %u, expected ERROR_INVALID_PARAMETER\n", GetLastError());
"InternetGetCookeExW failed: %lu, expected ERROR_INVALID_PARAMETER\n", GetLastError());
p = long_url + strlen(long_url);
memset(p, 'x', long_url+sizeof(long_url)-p);
......@@ -652,16 +652,16 @@ static void test_cookie_url(void)
p[0] = '/';
p[2] = 0;
res = InternetSetCookieA(long_url, NULL, "A=B");
ok(res, "InternetSetCookieA failed: %u\n", GetLastError());
ok(res, "InternetSetCookieA failed: %lu\n", GetLastError());
len = sizeof(buf);
res = InternetGetCookieA(long_url, NULL, buf, &len);
ok(res, "InternetGetCookieA failed: %u\n", GetLastError());
ok(res, "InternetGetCookieA failed: %lu\n", GetLastError());
ok(!strcmp(buf, "A=B"), "buf = %s\n", buf);
len = sizeof(buf);
res = InternetGetCookieA("http://long.url.test.com/", NULL, buf, &len);
ok(!res && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookieA failed: %u\n", GetLastError());
ok(!res && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookieA failed: %lu\n", GetLastError());
}
static void test_null(void)
......@@ -744,7 +744,7 @@ static void test_null(void)
sz = 0;
r = InternetGetCookieW(NULL, NULL, NULL, &sz);
ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_INTERNET_UNRECOGNIZED_SCHEME,
"wrong error %u\n", GetLastError());
"wrong error %lu\n", GetLastError());
ok( r == FALSE, "return wrong\n");
r = InternetGetCookieW(szServer, NULL, NULL, &sz);
......@@ -762,7 +762,7 @@ static void test_null(void)
ok( r == TRUE, "return wrong\n");
/* sz is 14 on XP SP2 and beyond, 30 on XP SP1 and before, 16 on IE11 */
ok( sz == 14 || sz == 16 || sz == 30, "sz wrong, got %u, expected 14, 16 or 30\n", sz);
ok( sz == 14 || sz == 16 || sz == 30, "sz wrong, got %lu, expected 14, 16 or 30\n", sz);
sz = 0x20;
memset(buffer, 0, sizeof buffer);
......@@ -770,7 +770,7 @@ static void test_null(void)
ok( r == TRUE, "return wrong\n");
/* sz == lstrlenW(buffer) only in XP SP1 */
ok( sz == 1 + lstrlenW(buffer) || sz == lstrlenW(buffer), "sz wrong %d\n", sz);
ok( sz == 1 + lstrlenW(buffer) || sz == lstrlenW(buffer), "sz wrong %ld\n", sz);
/* before XP SP2, buffer is "server; server" */
ok( !lstrcmpW(szExpect, buffer) || !lstrcmpW(szServer, buffer) || !lstrcmpW(szServer2, buffer),
......@@ -789,9 +789,9 @@ static void test_version(void)
size = sizeof(version);
res = InternetQueryOptionA(NULL, INTERNET_OPTION_VERSION, &version, &size);
ok(res, "Could not get version: %u\n", GetLastError());
ok(version.dwMajorVersion == 1, "dwMajorVersion=%d, expected 1\n", version.dwMajorVersion);
ok(version.dwMinorVersion == 2, "dwMinorVersion=%d, expected 2\n", version.dwMinorVersion);
ok(res, "Could not get version: %lu\n", GetLastError());
ok(version.dwMajorVersion == 1, "dwMajorVersion=%ld, expected 1\n", version.dwMajorVersion);
ok(version.dwMinorVersion == 2, "dwMinorVersion=%ld, expected 2\n", version.dwMinorVersion);
}
static void InternetTimeFromSystemTimeA_test(void)
......@@ -803,10 +803,10 @@ static void InternetTimeFromSystemTimeA_test(void)
DWORD error;
ret = pInternetTimeFromSystemTimeA( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) );
ok( ret, "InternetTimeFromSystemTimeA failed (%u)\n", GetLastError() );
ok( ret, "InternetTimeFromSystemTimeA failed (%lu)\n", GetLastError() );
ok( !memcmp( string, expect, sizeof(expect) ),
"InternetTimeFromSystemTimeA failed (%u)\n", GetLastError() );
"InternetTimeFromSystemTimeA failed (%lu)\n", GetLastError() );
/* test NULL time parameter */
SetLastError(0xdeadbeef);
......@@ -814,7 +814,7 @@ static void InternetTimeFromSystemTimeA_test(void)
error = GetLastError();
ok( !ret, "InternetTimeFromSystemTimeA should have returned FALSE\n" );
ok( error == ERROR_INVALID_PARAMETER,
"InternetTimeFromSystemTimeA failed with ERROR_INVALID_PARAMETER instead of %u\n",
"InternetTimeFromSystemTimeA failed with ERROR_INVALID_PARAMETER instead of %lu\n",
error );
/* test NULL string parameter */
......@@ -823,7 +823,7 @@ static void InternetTimeFromSystemTimeA_test(void)
error = GetLastError();
ok( !ret, "InternetTimeFromSystemTimeA should have returned FALSE\n" );
ok( error == ERROR_INVALID_PARAMETER,
"InternetTimeFromSystemTimeA failed with ERROR_INVALID_PARAMETER instead of %u\n",
"InternetTimeFromSystemTimeA failed with ERROR_INVALID_PARAMETER instead of %lu\n",
error );
/* test invalid format parameter */
......@@ -832,7 +832,7 @@ static void InternetTimeFromSystemTimeA_test(void)
error = GetLastError();
ok( !ret, "InternetTimeFromSystemTimeA should have returned FALSE\n" );
ok( error == ERROR_INVALID_PARAMETER,
"InternetTimeFromSystemTimeA failed with ERROR_INVALID_PARAMETER instead of %u\n",
"InternetTimeFromSystemTimeA failed with ERROR_INVALID_PARAMETER instead of %lu\n",
error );
/* test too small buffer size */
......@@ -841,7 +841,7 @@ static void InternetTimeFromSystemTimeA_test(void)
error = GetLastError();
ok( !ret, "InternetTimeFromSystemTimeA should have returned FALSE\n" );
ok( error == ERROR_INSUFFICIENT_BUFFER,
"InternetTimeFromSystemTimeA failed with ERROR_INSUFFICIENT_BUFFER instead of %u\n",
"InternetTimeFromSystemTimeA failed with ERROR_INSUFFICIENT_BUFFER instead of %lu\n",
error );
}
......@@ -855,10 +855,10 @@ static void InternetTimeFromSystemTimeW_test(void)
DWORD error;
ret = pInternetTimeFromSystemTimeW( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) );
ok( ret, "InternetTimeFromSystemTimeW failed (%u)\n", GetLastError() );
ok( ret, "InternetTimeFromSystemTimeW failed (%lu)\n", GetLastError() );
ok( !memcmp( string, expect, sizeof(expect) ),
"InternetTimeFromSystemTimeW failed (%u)\n", GetLastError() );
"InternetTimeFromSystemTimeW failed (%lu)\n", GetLastError() );
/* test NULL time parameter */
SetLastError(0xdeadbeef);
......@@ -866,7 +866,7 @@ static void InternetTimeFromSystemTimeW_test(void)
error = GetLastError();
ok( !ret, "InternetTimeFromSystemTimeW should have returned FALSE\n" );
ok( error == ERROR_INVALID_PARAMETER,
"InternetTimeFromSystemTimeW failed with ERROR_INVALID_PARAMETER instead of %u\n",
"InternetTimeFromSystemTimeW failed with ERROR_INVALID_PARAMETER instead of %lu\n",
error );
/* test NULL string parameter */
......@@ -875,7 +875,7 @@ static void InternetTimeFromSystemTimeW_test(void)
error = GetLastError();
ok( !ret, "InternetTimeFromSystemTimeW should have returned FALSE\n" );
ok( error == ERROR_INVALID_PARAMETER,
"InternetTimeFromSystemTimeW failed with ERROR_INVALID_PARAMETER instead of %u\n",
"InternetTimeFromSystemTimeW failed with ERROR_INVALID_PARAMETER instead of %lu\n",
error );
/* test invalid format parameter */
......@@ -884,7 +884,7 @@ static void InternetTimeFromSystemTimeW_test(void)
error = GetLastError();
ok( !ret, "InternetTimeFromSystemTimeW should have returned FALSE\n" );
ok( error == ERROR_INVALID_PARAMETER,
"InternetTimeFromSystemTimeW failed with ERROR_INVALID_PARAMETER instead of %u\n",
"InternetTimeFromSystemTimeW failed with ERROR_INVALID_PARAMETER instead of %lu\n",
error );
/* test too small buffer size */
......@@ -893,7 +893,7 @@ static void InternetTimeFromSystemTimeW_test(void)
error = GetLastError();
ok( !ret, "InternetTimeFromSystemTimeW should have returned FALSE\n" );
ok( error == ERROR_INSUFFICIENT_BUFFER,
"InternetTimeFromSystemTimeW failed with ERROR_INSUFFICIENT_BUFFER instead of %u\n",
"InternetTimeFromSystemTimeW failed with ERROR_INSUFFICIENT_BUFFER instead of %lu\n",
error );
}
......@@ -946,7 +946,7 @@ static void test_InternetTimeToSystemTime(void)
ret = pInternetTimeToSystemTimeA(test->string, NULL, 0);
ok(!ret, "InternetTimeToSystemTimeA succeeded.\n");
ret = pInternetTimeToSystemTimeA(test->string, &time, 0);
ok(ret, "InternetTimeToSystemTimeA failed: %u.\n", GetLastError());
ok(ret, "InternetTimeToSystemTimeA failed: %lu.\n", GetLastError());
todo_wine_if(test->todo)
ok(!test->match || !memcmp(&time, test->expect, sizeof(*test->expect)),
"Got unexpected system time.\n");
......@@ -957,7 +957,7 @@ static void test_InternetTimeToSystemTime(void)
ret = pInternetTimeToSystemTimeW(buffer, NULL, 0);
ok(!ret, "InternetTimeToSystemTimeW succeeded.\n");
ret = pInternetTimeToSystemTimeW(buffer, &time, 0);
ok(ret, "InternetTimeToSystemTimeW failed: %u.\n", GetLastError());
ok(ret, "InternetTimeToSystemTimeW failed: %lu.\n", GetLastError());
todo_wine_if(test->todo)
ok(!test->match || !memcmp(&time, test->expect, sizeof(*test->expect)),
"Got unexpected system time.\n");
......@@ -1090,32 +1090,32 @@ static void test_PrivacyGetSetZonePreferenceW(void)
zone = 3;
type = 0;
ret = pPrivacyGetZonePreferenceW(zone, type, NULL, NULL, NULL);
ok(ret == 0, "expected ret == 0, got %u\n", ret);
ok(ret == 0, "expected ret == 0, got %lu\n", ret);
old_template = 0;
ret = pPrivacyGetZonePreferenceW(zone, type, &old_template, NULL, NULL);
ok(ret == 0, "expected ret == 0, got %u\n", ret);
ok(ret == 0, "expected ret == 0, got %lu\n", ret);
trace("template %u\n", old_template);
trace("template %lu\n", old_template);
if(old_template == PRIVACY_TEMPLATE_ADVANCED) {
pref_size = ARRAY_SIZE(pref);
ret = pPrivacyGetZonePreferenceW(zone, type, &old_template, pref, &pref_size);
ok(ret == 0, "expected ret == 0, got %u\n", ret);
ok(ret == 0, "expected ret == 0, got %lu\n", ret);
}
template = 5;
ret = pPrivacySetZonePreferenceW(zone, type, template, NULL);
ok(ret == 0, "expected ret == 0, got %u\n", ret);
ok(ret == 0, "expected ret == 0, got %lu\n", ret);
template = 0;
ret = pPrivacyGetZonePreferenceW(zone, type, &template, NULL, NULL);
ok(ret == 0, "expected ret == 0, got %u\n", ret);
ok(template == 5, "expected template == 5, got %u\n", template);
ok(ret == 0, "expected ret == 0, got %lu\n", ret);
ok(template == 5, "expected template == 5, got %lu\n", template);
template = 5;
ret = pPrivacySetZonePreferenceW(zone, type, old_template, pref_size ? pref : NULL);
ok(ret == 0, "expected ret == 0, got %u\n", ret);
ok(ret == 0, "expected ret == 0, got %lu\n", ret);
}
static void test_InternetSetOption(void)
......@@ -1126,43 +1126,43 @@ static void test_InternetSetOption(void)
BOOL ret;
ses = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
ok(ses != 0, "InternetOpen failed: 0x%08x\n", GetLastError());
ok(ses != 0, "InternetOpen failed: 0x%08lx\n", GetLastError());
con = InternetConnectA(ses, "www.winehq.org", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
ok(con != 0, "InternetConnect failed: 0x%08x\n", GetLastError());
ok(con != 0, "InternetConnect failed: 0x%08lx\n", GetLastError());
req = HttpOpenRequestA(con, "GET", "/", NULL, NULL, NULL, 0, 0);
ok(req != 0, "HttpOpenRequest failed: 0x%08x\n", GetLastError());
ok(req != 0, "HttpOpenRequest failed: 0x%08lx\n", GetLastError());
/* INTERNET_OPTION_POLICY tests */
SetLastError(0xdeadbeef);
ret = InternetSetOptionW(ses, INTERNET_OPTION_POLICY, NULL, 0);
ok(ret == FALSE, "InternetSetOption should've failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError should've "
"given ERROR_INVALID_PARAMETER, gave: 0x%08x\n", GetLastError());
"given ERROR_INVALID_PARAMETER, gave: 0x%08lx\n", GetLastError());
SetLastError(0xdeadbeef);
ret = InternetQueryOptionW(ses, INTERNET_OPTION_POLICY, NULL, 0);
ok(ret == FALSE, "InternetQueryOption should've failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError should've "
"given ERROR_INVALID_PARAMETER, gave: 0x%08x\n", GetLastError());
"given ERROR_INVALID_PARAMETER, gave: 0x%08lx\n", GetLastError());
/* INTERNET_OPTION_ERROR_MASK tests */
SetLastError(0xdeadbeef);
size = sizeof(ulArg);
ret = InternetQueryOptionW(NULL, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, &size);
ok(ret == FALSE, "InternetQueryOption should've failed\n");
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError());
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %lx\n", GetLastError());
SetLastError(0xdeadbeef);
ulArg = 11;
ret = InternetSetOptionA(NULL, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
ok(ret == FALSE, "InternetSetOption should've failed\n");
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError());
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %lx\n", GetLastError());
SetLastError(0xdeadbeef);
ulArg = 11;
ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, 20);
ok(ret == FALSE, "InternetSetOption should've failed\n");
ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %d\n", GetLastError());
ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %ld\n", GetLastError());
ulArg = 11;
ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
......@@ -1172,13 +1172,13 @@ static void test_InternetSetOption(void)
ulArg = 4;
ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
ok(ret == FALSE, "InternetSetOption should've failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %lx\n", GetLastError());
SetLastError(0xdeadbeef);
ulArg = 16;
ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
ok(ret == FALSE, "InternetSetOption should've failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %lx\n", GetLastError());
ret = InternetSetOptionA(req, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
ok(ret == TRUE, "InternetSetOption should've succeeded\n");
......@@ -1195,19 +1195,19 @@ static void test_InternetSetOption(void)
SetLastError(0xdeadbeef);
ret = InternetSetOptionA(req, INTERNET_OPTION_REFRESH, NULL, 0);
ok(ret == FALSE, "InternetSetOption should've failed\n");
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %u\n", GetLastError());
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %lu\n", GetLastError());
SetLastError(0xdeadbeef);
ret = InternetSetOptionA(con, INTERNET_OPTION_REFRESH, NULL, 0);
ok(ret == FALSE, "InternetSetOption should've failed\n");
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %u\n", GetLastError());
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %lu\n", GetLastError());
ret = InternetCloseHandle(req);
ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError());
ok(ret == TRUE, "InternetCloseHandle failed: 0x%08lx\n", GetLastError());
ret = InternetCloseHandle(con);
ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError());
ok(ret == TRUE, "InternetCloseHandle failed: 0x%08lx\n", GetLastError());
ret = InternetCloseHandle(ses);
ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError());
ok(ret == TRUE, "InternetCloseHandle failed: 0x%08lx\n", GetLastError());
}
static void test_end_browser_session(void)
......@@ -1224,12 +1224,12 @@ static void test_end_browser_session(void)
ok(len != 0, "len = 0\n");
ret = InternetSetOptionA(NULL, INTERNET_OPTION_END_BROWSER_SESSION, NULL, 0);
ok(ret, "InternetSetOption(INTERNET_OPTION_END_BROWSER_SESSION) failed: %u\n", GetLastError());
ok(ret, "InternetSetOption(INTERNET_OPTION_END_BROWSER_SESSION) failed: %lu\n", GetLastError());
len = 1024;
ret = InternetGetCookieA("http://www.example.com/test_end", NULL, NULL, &len);
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookie returned %x (%u)\n", ret, GetLastError());
ok(!len, "len = %u\n", len);
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookie returned %x (%lu)\n", ret, GetLastError());
ok(!len, "len = %lu\n", len);
}
#define verifyProxyEnable(e) r_verifyProxyEnable(__LINE__, e)
......@@ -1242,15 +1242,15 @@ static void r_verifyProxyEnable(LONG l, DWORD exp)
static const CHAR szProxyEnable[] = "ProxyEnable";
ret = RegOpenKeyA(HKEY_CURRENT_USER, szInternetSettings, &hkey);
ok_(__FILE__,l) (!ret, "RegOpenKeyA failed: 0x%08x\n", ret);
ok_(__FILE__,l) (!ret, "RegOpenKeyA failed: 0x%08lx\n", ret);
ret = RegQueryValueExA(hkey, szProxyEnable, 0, &type, (BYTE*)&val, &size);
ok_(__FILE__,l) (!ret, "RegQueryValueExA failed: 0x%08x\n", ret);
ok_(__FILE__,l) (type == REG_DWORD, "Expected regtype to be REG_DWORD, was: %d\n", type);
ok_(__FILE__,l) (val == exp, "Expected ProxyEnabled to be %d, got: %d\n", exp, val);
ok_(__FILE__,l) (!ret, "RegQueryValueExA failed: 0x%08lx\n", ret);
ok_(__FILE__,l) (type == REG_DWORD, "Expected regtype to be REG_DWORD, was: %ld\n", type);
ok_(__FILE__,l) (val == exp, "Expected ProxyEnabled to be %ld, got: %ld\n", exp, val);
ret = RegCloseKey(hkey);
ok_(__FILE__,l) (!ret, "RegCloseKey failed: 0x%08x\n", ret);
ok_(__FILE__,l) (!ret, "RegCloseKey failed: 0x%08lx\n", ret);
}
static void test_Option_PerConnectionOption(void)
......@@ -1303,7 +1303,7 @@ static void test_Option_PerConnectionOption(void)
"Retrieved proxy server should've been %s, was: %s\n",
wine_dbgstr_w(proxy_srvW), wine_dbgstr_w(list.pOptions[0].Value.pszValue));
ok(list.pOptions[1].Value.dwValue == PROXY_TYPE_PROXY,
"Retrieved flags should've been PROXY_TYPE_PROXY, was: %d\n",
"Retrieved flags should've been PROXY_TYPE_PROXY, was: %ld\n",
list.pOptions[1].Value.dwValue);
verifyProxyEnable(1);
......@@ -1334,7 +1334,7 @@ static void test_Option_PerConnectionOption(void)
&list, &size);
ok(ret == TRUE, "InternetQueryOption should've succeeded\n");
ok(list.pOptions[0].Value.dwValue == PROXY_TYPE_DIRECT,
"Retrieved flags should've been PROXY_TYPE_DIRECT, was: %d\n",
"Retrieved flags should've been PROXY_TYPE_DIRECT, was: %ld\n",
list.pOptions[0].Value.dwValue);
verifyProxyEnable(0);
......@@ -1364,7 +1364,7 @@ static void test_Option_PerConnectionOption(void)
&list, &size);
ok(ret == TRUE, "InternetQueryOption should've succeeded\n");
todo_wine ok(list.pOptions[0].Value.dwValue == (PROXY_TYPE_PROXY | PROXY_TYPE_DIRECT),
"Retrieved flags should've been PROXY_TYPE_PROXY | PROXY_TYPE_DIRECT, was: %d\n",
"Retrieved flags should've been PROXY_TYPE_PROXY | PROXY_TYPE_DIRECT, was: %ld\n",
list.pOptions[0].Value.dwValue);
verifyProxyEnable(1);
......@@ -1431,7 +1431,7 @@ static void test_Option_PerConnectionOptionA(void)
"Retrieved proxy server should've been \"%s\", was: \"%s\"\n",
proxy_srv, list.pOptions[0].Value.pszValue);
ok(list.pOptions[1].Value.dwValue == PROXY_TYPE_PROXY,
"Retrieved flags should've been PROXY_TYPE_PROXY, was: %d\n",
"Retrieved flags should've been PROXY_TYPE_PROXY, was: %ld\n",
list.pOptions[1].Value.dwValue);
HeapFree(GetProcessHeap(), 0, list.pOptions[0].Value.pszValue);
......@@ -1514,17 +1514,17 @@ static void test_InternetErrorDlg(void)
};
res = InternetErrorDlg(NULL, NULL, ERROR_INTERNET_SEC_CERT_ERRORS, 0, NULL);
ok(res == ERROR_INVALID_HANDLE, "Got %d\n", res);
ok(res == ERROR_INVALID_HANDLE, "Got %ld\n", res);
ses = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
ok(ses != 0, "InternetOpen failed: 0x%08x\n", GetLastError());
ok(ses != 0, "InternetOpen failed: 0x%08lx\n", GetLastError());
con = InternetConnectA(ses, "www.winehq.org", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
ok(con != 0, "InternetConnect failed: 0x%08x\n", GetLastError());
ok(con != 0, "InternetConnect failed: 0x%08lx\n", GetLastError());
req = HttpOpenRequestA(con, "GET", "/", NULL, NULL, NULL, 0, 0);
ok(req != 0, "HttpOpenRequest failed: 0x%08x\n", GetLastError());
ok(req != 0, "HttpOpenRequest failed: 0x%08lx\n", GetLastError());
hwnd = GetDesktopWindow();
ok(hwnd != NULL, "GetDesktopWindow failed (%d)\n", GetLastError());
ok(hwnd != NULL, "GetDesktopWindow failed (%ld)\n", GetLastError());
for(i = INTERNET_ERROR_BASE; i < INTERNET_ERROR_LAST; i++)
{
......@@ -1544,11 +1544,11 @@ static void test_InternetErrorDlg(void)
res = InternetErrorDlg(hwnd, (HANDLE)0xdeadbeef, i, FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
if(res == ERROR_CALL_NOT_IMPLEMENTED)
{
ok(test_flags & FLAG_UNIMPL, "%i is unexpectedly unimplemented.\n", i);
ok(test_flags & FLAG_UNIMPL, "%li is unexpectedly unimplemented.\n", i);
continue;
}
else
ok(res == ERROR_INVALID_HANDLE, "Got %d (%d)\n", res, i);
ok(res == ERROR_INVALID_HANDLE, "Got %ld (%ld)\n", res, i);
/* With a valid req */
if(i == ERROR_INTERNET_NEED_UI)
......@@ -1580,14 +1580,14 @@ static void test_InternetErrorDlg(void)
break;
}
ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
ok(res == expected, "Got %ld, expected %ld (%ld)\n", res, expected, i);
/* Same thing with NULL hwnd */
res = InternetErrorDlg(NULL, req, i, FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
ok(res == expected, "Got %ld, expected %ld (%ld)\n", res, expected, i);
res = InternetErrorDlg(NULL, req, i, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i);
ok(res == expected2, "Got %ld, expected %ld (%ld)\n", res, expected2, i);
/* With a null req */
if(test_flags & FLAG_NEEDREQ)
......@@ -1597,24 +1597,24 @@ static void test_InternetErrorDlg(void)
}
res = InternetErrorDlg(hwnd, NULL, i, FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
ok(res == expected, "Got %ld, expected %ld (%ld)\n", res, expected, i);
res = InternetErrorDlg(NULL, NULL, i, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i);
ok(res == expected2, "Got %ld, expected %ld (%ld)\n", res, expected2, i);
}
res = InternetErrorDlg(NULL, req, 0xdeadbeef, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
ok(res == ERROR_SUCCESS, "Got %d, expected ERROR_SUCCESS\n", res);
ok(res == ERROR_SUCCESS, "Got %ld, expected ERROR_SUCCESS\n", res);
res = InternetErrorDlg(NULL, NULL, 0xdeadbeef, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
ok(res == ERROR_SUCCESS, "Got %d, expected ERROR_SUCCESS\n", res);
ok(res == ERROR_SUCCESS, "Got %ld, expected ERROR_SUCCESS\n", res);
res = InternetCloseHandle(req);
ok(res == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError());
ok(res == TRUE, "InternetCloseHandle failed: 0x%08lx\n", GetLastError());
res = InternetCloseHandle(con);
ok(res == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError());
ok(res == TRUE, "InternetCloseHandle failed: 0x%08lx\n", GetLastError());
res = InternetCloseHandle(ses);
ok(res == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError());
ok(res == TRUE, "InternetCloseHandle failed: 0x%08lx\n", GetLastError());
}
static void test_InternetGetConnectedStateExA(void)
......@@ -1631,7 +1631,7 @@ static void test_InternetGetConnectedStateExA(void)
flags = 0;
buffer[0] = 0;
res = pInternetGetConnectedStateExA(&flags, buffer, sizeof(buffer), 0);
trace("Internet Connection: Flags 0x%02x - Name '%s'\n", flags, buffer);
trace("Internet Connection: Flags 0x%02lx - Name '%s'\n", flags, buffer);
todo_wine
ok (flags & INTERNET_RAS_INSTALLED, "Missing RAS flag\n");
if(!res) {
......@@ -1688,14 +1688,14 @@ static void test_InternetGetConnectedStateExA(void)
res = pInternetGetConnectedStateExA(&flags, buffer, sz, 0);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
ok(sz - 1 == strlen(buffer), "Expected %u bytes, got %u\n", sz - 1, lstrlenA(buffer));
ok(sz - 1 == strlen(buffer), "Expected %lu bytes, got %u\n", sz - 1, lstrlenA(buffer));
buffer[0] = 0;
flags = 0;
res = pInternetGetConnectedStateExA(&flags, buffer, sz / 2, 0);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
ok(sz / 2 - 1 == strlen(buffer), "Expected %u bytes, got %u\n", sz / 2 - 1, lstrlenA(buffer));
ok(sz / 2 - 1 == strlen(buffer), "Expected %lu bytes, got %u\n", sz / 2 - 1, lstrlenA(buffer));
buffer[0] = 0;
flags = 0;
......@@ -1733,7 +1733,7 @@ static void test_InternetGetConnectedStateExW(void)
flags = 0;
buffer[0] = 0;
res = pInternetGetConnectedStateExW(&flags, buffer, ARRAY_SIZE(buffer), 0);
trace("Internet Connection: Flags 0x%02x - Name '%s'\n", flags, wine_dbgstr_w(buffer));
trace("Internet Connection: Flags 0x%02lx - Name '%s'\n", flags, wine_dbgstr_w(buffer));
todo_wine
ok (flags & INTERNET_RAS_INSTALLED, "Missing RAS flag\n");
if(!res) {
......@@ -1793,7 +1793,7 @@ static void test_InternetGetConnectedStateExW(void)
if (flags & INTERNET_CONNECTION_MODEM)
ok(!buffer[0], "Expected 0 bytes, got %u\n", lstrlenW(buffer));
else
ok(sz - 1 == lstrlenW(buffer), "Expected %u bytes, got %u\n", sz - 1, lstrlenW(buffer));
ok(sz - 1 == lstrlenW(buffer), "Expected %lu bytes, got %u\n", sz - 1, lstrlenW(buffer));
buffer[0] = 0;
flags = 0;
......@@ -1803,7 +1803,7 @@ static void test_InternetGetConnectedStateExW(void)
if (flags & INTERNET_CONNECTION_MODEM)
ok(!buffer[0], "Expected 0 bytes, got %u\n", lstrlenW(buffer));
else
ok(sz / 2 - 1 == lstrlenW(buffer), "Expected %u bytes, got %u\n", sz / 2 - 1, lstrlenW(buffer));
ok(sz / 2 - 1 == lstrlenW(buffer), "Expected %lu bytes, got %u\n", sz / 2 - 1, lstrlenW(buffer));
buffer[0] = 0;
flags = 0;
......@@ -1838,55 +1838,55 @@ static void test_format_message(HMODULE hdll)
/* These messages come from wininet and not the system. */
ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM , NULL, ERROR_INTERNET_TIMEOUT,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret == 0, "FormatMessageA returned %d\n", ret);
ok(ret == 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_TIMEOUT,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_INTERNAL_ERROR,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_INVALID_URL,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_UNRECOGNIZED_SCHEME,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_NAME_NOT_RESOLVED,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_INVALID_OPERATION,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0 || broken(!ret) /* XP, w2k3 */, "FormatMessageA returned %d\n", ret);
ok(ret != 0 || broken(!ret) /* XP, w2k3 */, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_OPERATION_CANCELLED,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_ITEM_NOT_FOUND,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_CANNOT_CONNECT,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_CONNECTION_ABORTED,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_SEC_CERT_DATE_INVALID,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_SEC_CERT_CN_INVALID,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ok(ret != 0, "FormatMessageA returned %ld\n", ret);
}
/* ############################### */
......
......@@ -212,14 +212,14 @@ static void test_crack_url(const crack_url_test_t *test)
zero_compsA(&url, 1, 1, 1, 1, 1, 1);
b = InternetCrackUrlA(test->url, strlen(test->url), 0, &url);
ok(b, "InternetCrackUrl failed with error %d\n", GetLastError());
ok(b, "InternetCrackUrl failed with error %ld\n", GetLastError());
if(test->scheme_off == -1)
ok(!url.lpszScheme, "[%s] url.lpszScheme = %p, expected NULL\n", test->url, url.lpszScheme);
else
ok(url.lpszScheme == test->url+test->scheme_off, "[%s] url.lpszScheme = %p, expected %p\n",
test->url, url.lpszScheme, test->url+test->scheme_off);
ok(url.dwSchemeLength == test->scheme_len, "[%s] url.lpszSchemeLength = %d, expected %d\n",
ok(url.dwSchemeLength == test->scheme_len, "[%s] url.lpszSchemeLength = %ld, expected %d\n",
test->url, url.dwSchemeLength, test->scheme_len);
ok(url.nScheme == test->scheme, "[%s] url.nScheme = %d, expected %d\n", test->url, url.nScheme, test->scheme);
......@@ -233,7 +233,7 @@ static void test_crack_url(const crack_url_test_t *test)
win_skip("skipping broken dwHostNameLength result\n");
return;
}
ok(url.dwHostNameLength == test->host_len, "[%s] url.lpszHostNameLength = %d, expected %d\n",
ok(url.dwHostNameLength == test->host_len, "[%s] url.lpszHostNameLength = %ld, expected %d\n",
test->url, url.dwHostNameLength, test->host_len);
ok(url.nPort == test->port, "[%s] nPort = %d, expected %d\n", test->url, url.nPort, test->port);
......@@ -243,7 +243,7 @@ static void test_crack_url(const crack_url_test_t *test)
else
ok(url.lpszUserName == test->url+test->user_off, "[%s] url.lpszUserName = %p, expected %p\n",
test->url, url.lpszUserName, test->url+test->user_off);
ok(url.dwUserNameLength == test->user_len, "[%s] url.lpszUserNameLength = %d, expected %d\n",
ok(url.dwUserNameLength == test->user_len, "[%s] url.lpszUserNameLength = %ld, expected %d\n",
test->url, url.dwUserNameLength, test->user_len);
if(test->pass_off == -1)
......@@ -251,7 +251,7 @@ static void test_crack_url(const crack_url_test_t *test)
else
ok(url.lpszPassword == test->url+test->pass_off, "[%s] url.lpszPassword = %p, expected %p\n",
test->url, url.lpszPassword, test->url+test->pass_off);
ok(url.dwPasswordLength == test->pass_len, "[%s] url.lpszPasswordLength = %d, expected %d\n",
ok(url.dwPasswordLength == test->pass_len, "[%s] url.lpszPasswordLength = %ld, expected %d\n",
test->url, url.dwPasswordLength, test->pass_len);
if(test->path_off == -1)
......@@ -259,7 +259,7 @@ static void test_crack_url(const crack_url_test_t *test)
else
ok(url.lpszUrlPath == test->url+test->path_off, "[%s] url.lpszUrlPath = %p, expected %p\n",
test->url, url.lpszUrlPath, test->url+test->path_off);
ok(url.dwUrlPathLength == test->path_len, "[%s] url.lpszUrlPathLength = %d, expected %d\n",
ok(url.dwUrlPathLength == test->path_len, "[%s] url.lpszUrlPathLength = %ld, expected %d\n",
test->url, url.dwUrlPathLength, test->path_len);
if(test->extra_off == -1)
......@@ -267,7 +267,7 @@ static void test_crack_url(const crack_url_test_t *test)
else
ok(url.lpszExtraInfo == test->url+test->extra_off, "[%s] url.lpszExtraInfo = %p, expected %p\n",
test->url, url.lpszExtraInfo, test->url+test->extra_off);
ok(url.dwExtraInfoLength == test->extra_len, "[%s] url.lpszExtraInfoLength = %d, expected %d\n",
ok(url.dwExtraInfoLength == test->extra_len, "[%s] url.lpszExtraInfoLength = %ld, expected %d\n",
test->url, url.dwExtraInfoLength, test->extra_len);
/* test InternetCrackUrlW with NULL buffers */
......@@ -287,26 +287,26 @@ static void test_crack_url(const crack_url_test_t *test)
HeapFree(GetProcessHeap(), 0, buf);
return;
}
ok(b, "InternetCrackUrl failed with error %d\n", GetLastError());
ok(b, "InternetCrackUrl failed with error %ld\n", GetLastError());
if(test->scheme_off == -1)
ok(!urlw.lpszScheme, "[%s] urlw.lpszScheme = %p, expected NULL\n", test->url, urlw.lpszScheme);
else
ok(urlw.lpszScheme == buf+test->scheme_off, "[%s] urlw.lpszScheme = %p, expected %p\n",
test->url, urlw.lpszScheme, buf+test->scheme_off);
ok(urlw.dwSchemeLength == test->scheme_len, "[%s] urlw.lpszSchemeLength = %d, expected %d\n",
ok(urlw.dwSchemeLength == test->scheme_len, "[%s] urlw.lpszSchemeLength = %ld, expected %d\n",
test->url, urlw.dwSchemeLength, test->scheme_len);
ok(urlw.nScheme == test->scheme, "[%s] urlw.nScheme = %d, expected %d\n", test->url, urlw.nScheme, test->scheme);
if(test->host_off == -1) {
ok(!urlw.lpszHostName, "[%s] urlw.lpszHostName = %p, expected NULL\n", test->url, urlw.lpszHostName);
ok(urlw.dwHostNameLength == 0 || broken(urlw.dwHostNameLength == 1), "[%s] urlw.lpszHostNameLength = %d, expected %d\n",
ok(urlw.dwHostNameLength == 0 || broken(urlw.dwHostNameLength == 1), "[%s] urlw.lpszHostNameLength = %ld, expected %d\n",
test->url, urlw.dwHostNameLength, test->host_len);
}else {
ok(urlw.lpszHostName == buf+test->host_off, "[%s] urlw.lpszHostName = %p, expected %p\n",
test->url, urlw.lpszHostName, test->url+test->host_off);
ok(urlw.dwHostNameLength == test->host_len, "[%s] urlw.lpszHostNameLength = %d, expected %d\n",
ok(urlw.dwHostNameLength == test->host_len, "[%s] urlw.lpszHostNameLength = %ld, expected %d\n",
test->url, urlw.dwHostNameLength, test->host_len);
}
......@@ -314,23 +314,23 @@ static void test_crack_url(const crack_url_test_t *test)
if(test->user_off == -1) {
ok(!urlw.lpszUserName, "[%s] urlw.lpszUserName = %p\n", test->url, urlw.lpszUserName);
ok(urlw.dwUserNameLength == 0 || broken(urlw.dwUserNameLength == 1), "[%s] urlw.lpszUserNameLength = %d, expected %d\n",
ok(urlw.dwUserNameLength == 0 || broken(urlw.dwUserNameLength == 1), "[%s] urlw.lpszUserNameLength = %ld, expected %d\n",
test->url, urlw.dwUserNameLength, test->user_len);
}else {
ok(urlw.lpszUserName == buf+test->user_off, "[%s] urlw.lpszUserName = %p, expected %p\n",
test->url, urlw.lpszUserName, buf+test->user_off);
ok(urlw.dwUserNameLength == test->user_len, "[%s] urlw.lpszUserNameLength = %d, expected %d\n",
ok(urlw.dwUserNameLength == test->user_len, "[%s] urlw.lpszUserNameLength = %ld, expected %d\n",
test->url, urlw.dwUserNameLength, test->user_len);
}
if(test->pass_off == -1) {
ok(!urlw.lpszPassword, "[%s] urlw.lpszPassword = %p\n", test->url, urlw.lpszPassword);
ok(urlw.dwPasswordLength == 0 || broken(urlw.dwPasswordLength), "[%s] urlw.lpszPasswordLength = %d, expected %d\n",
ok(urlw.dwPasswordLength == 0 || broken(urlw.dwPasswordLength), "[%s] urlw.lpszPasswordLength = %ld, expected %d\n",
test->url, urlw.dwPasswordLength, test->pass_len);
}else {
ok(urlw.lpszPassword == buf+test->pass_off, "[%s] urlw.lpszPassword = %p, expected %p\n",
test->url, urlw.lpszPassword, buf+test->pass_off);
ok(urlw.dwPasswordLength == test->pass_len, "[%s] urlw.lpszPasswordLength = %d, expected %d\n",
ok(urlw.dwPasswordLength == test->pass_len, "[%s] urlw.lpszPasswordLength = %ld, expected %d\n",
test->url, urlw.dwPasswordLength, test->pass_len);
}
......@@ -339,17 +339,17 @@ static void test_crack_url(const crack_url_test_t *test)
else
ok(urlw.lpszUrlPath == buf+test->path_off, "[%s] urlw.lpszUrlPath = %p, expected %p\n",
test->url, urlw.lpszUrlPath, buf+test->path_off);
ok(urlw.dwUrlPathLength == test->path_len, "[%s] urlw.lpszUrlPathLength = %d, expected %d\n",
ok(urlw.dwUrlPathLength == test->path_len, "[%s] urlw.lpszUrlPathLength = %ld, expected %d\n",
test->url, urlw.dwUrlPathLength, test->path_len);
if(test->extra_off == -1) {
ok(!urlw.lpszExtraInfo, "[%s] url.lpszExtraInfo = %p, expected NULL\n", test->url, urlw.lpszExtraInfo);
ok(urlw.dwExtraInfoLength == 0 || broken(urlw.dwExtraInfoLength == 1), "[%s] urlw.lpszExtraInfoLength = %d, expected %d\n",
ok(urlw.dwExtraInfoLength == 0 || broken(urlw.dwExtraInfoLength == 1), "[%s] urlw.lpszExtraInfoLength = %ld, expected %d\n",
test->url, urlw.dwExtraInfoLength, test->extra_len);
}else {
ok(urlw.lpszExtraInfo == buf+test->extra_off, "[%s] urlw.lpszExtraInfo = %p, expected %p\n",
test->url, urlw.lpszExtraInfo, buf+test->extra_off);
ok(urlw.dwExtraInfoLength == test->extra_len, "[%s] urlw.lpszExtraInfoLength = %d, expected %d\n",
ok(urlw.dwExtraInfoLength == test->extra_len, "[%s] urlw.lpszExtraInfoLength = %ld, expected %d\n",
test->url, urlw.dwExtraInfoLength, test->extra_len);
}
......@@ -376,9 +376,9 @@ static void test_crack_url(const crack_url_test_t *test)
url.dwExtraInfoLength = buf_len;
b = InternetCrackUrlA(test->url, strlen(test->url), 0, &url);
ok(b, "InternetCrackUrlA failed with error %d\n", GetLastError());
ok(b, "InternetCrackUrlA failed with error %ld\n", GetLastError());
ok(url.dwSchemeLength == strlen(test->exp_scheme), "[%s] Got wrong scheme length: %d\n",
ok(url.dwSchemeLength == strlen(test->exp_scheme), "[%s] Got wrong scheme length: %ld\n",
test->url, url.dwSchemeLength);
ok(!strcmp(scheme_a, test->exp_scheme), "[%s] Got wrong scheme, expected: %s, got: %s\n",
test->url, test->exp_scheme, scheme_a);
......@@ -386,7 +386,7 @@ static void test_crack_url(const crack_url_test_t *test)
ok(url.nScheme == test->scheme, "[%s] Got wrong nScheme, expected: %d, got: %d\n",
test->url, test->scheme, url.nScheme);
ok(url.dwHostNameLength == strlen(test->exp_hostname), "[%s] Got wrong hostname length: %d\n",
ok(url.dwHostNameLength == strlen(test->exp_hostname), "[%s] Got wrong hostname length: %ld\n",
test->url, url.dwHostNameLength);
ok(!strcmp(hostname_a, test->exp_hostname), "[%s] Got wrong hostname, expected: %s, got: %s\n",
test->url, test->exp_hostname, hostname_a);
......@@ -394,22 +394,22 @@ static void test_crack_url(const crack_url_test_t *test)
ok(url.nPort == test->port, "[%s] Got wrong port, expected: %d, got: %d\n",
test->url, test->port, url.nPort);
ok(url.dwUserNameLength == strlen(test->exp_username), "[%s] Got wrong username length: %d\n",
ok(url.dwUserNameLength == strlen(test->exp_username), "[%s] Got wrong username length: %ld\n",
test->url, url.dwUserNameLength);
ok(!strcmp(username_a, test->exp_username), "[%s] Got wrong username, expected: %s, got: %s\n",
test->url, test->exp_username, username_a);
ok(url.dwPasswordLength == strlen(test->exp_password), "[%s] Got wrong password length: %d\n",
ok(url.dwPasswordLength == strlen(test->exp_password), "[%s] Got wrong password length: %ld\n",
test->url, url.dwPasswordLength);
ok(!strcmp(password_a, test->exp_password), "[%s] Got wrong password, expected: %s, got: %s\n",
test->url, test->exp_password, password_a);
ok(url.dwUrlPathLength == strlen(test->exp_urlpath), "[%s] Got wrong urlpath length: %d\n",
ok(url.dwUrlPathLength == strlen(test->exp_urlpath), "[%s] Got wrong urlpath length: %ld\n",
test->url, url.dwUrlPathLength);
ok(!strcmp(urlpath_a, test->exp_urlpath), "[%s] Got wrong urlpath, expected: %s, got: %s\n",
test->url, test->exp_urlpath, urlpath_a);
ok(url.dwExtraInfoLength == strlen(test->exp_extrainfo), "[%s] Got wrong extrainfo length: %d\n",
ok(url.dwExtraInfoLength == strlen(test->exp_extrainfo), "[%s] Got wrong extrainfo length: %ld\n",
test->url, url.dwExtraInfoLength);
ok(!strcmp(extrainfo_a, test->exp_extrainfo), "[%s] Got wrong extrainfo, expected: %s, got: %s\n",
test->url, test->exp_extrainfo, extrainfo_a);
......@@ -431,9 +431,9 @@ static void test_crack_url(const crack_url_test_t *test)
urlw.dwExtraInfoLength = buf_len;
b = InternetCrackUrlW(buf, lstrlenW(buf), 0, &urlw);
ok(b, "InternetCrackUrlW failed with error %d\n", GetLastError());
ok(b, "InternetCrackUrlW failed with error %ld\n", GetLastError());
ok(urlw.dwSchemeLength == strlen(test->exp_scheme), "[%s] Got wrong scheme length: %d\n",
ok(urlw.dwSchemeLength == strlen(test->exp_scheme), "[%s] Got wrong scheme length: %ld\n",
test->url, urlw.dwSchemeLength);
ok(!strcmp_wa(scheme_w, test->exp_scheme), "[%s] Got wrong scheme, expected: %s, got: %s\n",
test->url, test->exp_scheme, wine_dbgstr_w(scheme_w));
......@@ -441,7 +441,7 @@ static void test_crack_url(const crack_url_test_t *test)
ok(urlw.nScheme == test->scheme, "[%s] Got wrong nScheme, expected: %d, got: %d\n",
test->url, test->scheme, urlw.nScheme);
ok(urlw.dwHostNameLength == strlen(test->exp_hostname), "[%s] Got wrong hostname length: %d\n",
ok(urlw.dwHostNameLength == strlen(test->exp_hostname), "[%s] Got wrong hostname length: %ld\n",
test->url, urlw.dwHostNameLength);
ok(!strcmp_wa(hostname_w, test->exp_hostname), "[%s] Got wrong hostname, expected: %s, got: %s\n",
test->url, test->exp_hostname, wine_dbgstr_w(hostname_w));
......@@ -449,22 +449,22 @@ static void test_crack_url(const crack_url_test_t *test)
ok(urlw.nPort == test->port, "[%s] Got wrong port, expected: %d, got: %d\n",
test->url, test->port, urlw.nPort);
ok(urlw.dwUserNameLength == strlen(test->exp_username), "[%s] Got wrong username length: %d\n",
ok(urlw.dwUserNameLength == strlen(test->exp_username), "[%s] Got wrong username length: %ld\n",
test->url, urlw.dwUserNameLength);
ok(!strcmp_wa(username_w, test->exp_username), "[%s] Got wrong username, expected: %s, got: %s\n",
test->url, test->exp_username, wine_dbgstr_w(username_w));
ok(urlw.dwPasswordLength == strlen(test->exp_password), "[%s] Got wrong password length: %d\n",
ok(urlw.dwPasswordLength == strlen(test->exp_password), "[%s] Got wrong password length: %ld\n",
test->url, urlw.dwPasswordLength);
ok(!strcmp_wa(password_w, test->exp_password), "[%s] Got wrong password, expected: %s, got: %s\n",
test->url, test->exp_password, wine_dbgstr_w(password_w));
ok(urlw.dwUrlPathLength == strlen(test->exp_urlpath), "[%s] Got wrong urlpath length: %d\n",
ok(urlw.dwUrlPathLength == strlen(test->exp_urlpath), "[%s] Got wrong urlpath length: %ld\n",
test->url, urlw.dwUrlPathLength);
ok(!strcmp_wa(urlpath_w, test->exp_urlpath), "[%s] Got wrong urlpath, expected: %s, got: %s\n",
test->url, test->exp_urlpath, wine_dbgstr_w(urlpath_w));
ok(urlw.dwExtraInfoLength == strlen(test->exp_extrainfo), "[%s] Got wrong extrainfo length: %d\n",
ok(urlw.dwExtraInfoLength == strlen(test->exp_extrainfo), "[%s] Got wrong extrainfo length: %ld\n",
test->url, urlw.dwExtraInfoLength);
ok(!strcmp_wa(extrainfo_w, test->exp_extrainfo), "[%s] Got wrong extrainfo, expected: %s, got: %s\n",
test->url, test->exp_extrainfo, wine_dbgstr_w(extrainfo_w));
......@@ -507,12 +507,12 @@ static void test_long_url(void)
zero_compsA(&url_comp, 0, 0, 0, 0, 0, 100);
url_comp.lpszExtraInfo = long_buf;
b = InternetCrackUrlA(long_url, strlen(long_url), 0, &url_comp);
ok(!b && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "InternetCrackUrlA returned %x with error %d\n", b, GetLastError());
ok(!b && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "InternetCrackUrlA returned %x with error %ld\n", b, GetLastError());
zero_compsA(&url_comp, 4, 0, 0, 0, 0, 0);
url_comp.lpszScheme = long_buf;
b = InternetCrackUrlA(long_url, strlen(long_url), 0, &url_comp);
ok(!b && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "InternetCrackUrlA returned %x with error %d\n", b, GetLastError());
ok(!b && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "InternetCrackUrlA returned %x with error %ld\n", b, GetLastError());
}
static void InternetCrackUrl_test(void)
......@@ -549,21 +549,21 @@ static void InternetCrackUrl_test(void)
SetLastError(0xdeadbeef);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
GLE = GetLastError();
ok(ret==firstret && (GLE==firstGLE), "InternetCrackUrl returned %d with GLE=%d (expected to return %d)\n",
ok(ret==firstret && (GLE==firstGLE), "InternetCrackUrl returned %d with GLE=%ld (expected to return %d)\n",
ret, GLE, firstret);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 0, 1024, 1024, 1024);
SetLastError(0xdeadbeef);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
GLE = GetLastError();
ok(ret==firstret && (GLE==firstGLE), "InternetCrackUrl returned %d with GLE=%d (expected to return %d)\n",
ok(ret==firstret && (GLE==firstGLE), "InternetCrackUrl returned %d with GLE=%ld (expected to return %d)\n",
ret, GLE, firstret);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 0, 1024, 1024);
SetLastError(0xdeadbeef);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
GLE = GetLastError();
ok(ret==firstret && (GLE==firstGLE), "InternetCrackUrl returned %d with GLE=%d (expected to return %d)\n",
ok(ret==firstret && (GLE==firstGLE), "InternetCrackUrl returned %d with GLE=%ld (expected to return %d)\n",
ret, GLE, firstret);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 0, 1024);
......@@ -572,7 +572,7 @@ static void InternetCrackUrl_test(void)
GLE = GetLastError();
todo_wine
ok(ret==0 && (GLE==ERROR_INVALID_HANDLE || GLE==ERROR_INSUFFICIENT_BUFFER),
"InternetCrackUrl returned %d with GLE=%d (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
"InternetCrackUrl returned %d with GLE=%ld (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
ret, GLE);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 1024, 0);
......@@ -581,7 +581,7 @@ static void InternetCrackUrl_test(void)
GLE = GetLastError();
todo_wine
ok(ret==0 && (GLE==ERROR_INVALID_HANDLE || GLE==ERROR_INSUFFICIENT_BUFFER),
"InternetCrackUrl returned %d with GLE=%d (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
"InternetCrackUrl returned %d with GLE=%ld (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
ret, GLE);
copy_compsA(&urlSrc, &urlComponents, 0, 0, 0, 0, 0, 0);
......@@ -589,12 +589,12 @@ static void InternetCrackUrl_test(void)
GLE = GetLastError();
todo_wine
ok(ret==0 && GLE==ERROR_INVALID_PARAMETER,
"InternetCrackUrl returned %d with GLE=%d (expected to return 0 and ERROR_INVALID_PARAMETER)\n",
"InternetCrackUrl returned %d with GLE=%ld (expected to return 0 and ERROR_INVALID_PARAMETER)\n",
ret, GLE);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 1024, 1024);
ret = InternetCrackUrlA("about://host/blank", 0,0,&urlComponents);
ok(ret, "InternetCrackUrl failed with %d\n", GetLastError());
ok(ret, "InternetCrackUrl failed with %ld\n", GetLastError());
ok(!strcmp(urlComponents.lpszScheme, "about"), "lpszScheme was \"%s\" instead of \"about\"\n", urlComponents.lpszScheme);
ok(!strcmp(urlComponents.lpszHostName, "host"), "lpszHostName was \"%s\" instead of \"host\"\n", urlComponents.lpszHostName);
ok(!strcmp(urlComponents.lpszUrlPath, "/blank"), "lpszUrlPath was \"%s\" instead of \"/blank\"\n", urlComponents.lpszUrlPath);
......@@ -605,7 +605,7 @@ static void InternetCrackUrl_test(void)
ret = InternetCrackUrlA(NULL, 0, 0, &urlComponents);
GLE = GetLastError();
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
ok(GLE == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GLE);
ok(GLE == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GLE);
/* try an empty lpszUrl, GetLastError returns 12006, whatever that means
* we just need to fail and not return success
......@@ -658,9 +658,9 @@ static void InternetCrackUrl_test(void)
* that length, it stops there. */
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 1024, 1024);
ret = InternetCrackUrlA("http://x.org", 13 /* includes the nul */, 0, &urlComponents);
ok(ret, "InternetCrackUrlA failed with error %d\n", GetLastError());
ok(ret, "InternetCrackUrlA failed with error %ld\n", GetLastError());
ok(urlComponents.dwHostNameLength == 5,
"Expected dwHostNameLength of 5, got %d\n", urlComponents.dwHostNameLength);
"Expected dwHostNameLength of 5, got %ld\n", urlComponents.dwHostNameLength);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 1024, 1024);
ret = InternetCrackUrlA("http://\0x.org", 13, 0, &urlComponents);
......@@ -668,9 +668,9 @@ static void InternetCrackUrl_test(void)
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 1024, 1024);
ret = InternetCrackUrlA("http://x.org\0/x", 15, 0, &urlComponents);
ok(ret, "InternetCrackUrlA failed with error %d\n", GetLastError());
ok(ret, "InternetCrackUrlA failed with error %ld\n", GetLastError());
ok(urlComponents.dwUrlPathLength == 0,
"Expected dwUrlPathLength of 0, got %d\n", urlComponents.dwUrlPathLength);
"Expected dwUrlPathLength of 0, got %ld\n", urlComponents.dwUrlPathLength);
}
static void InternetCrackUrlW_test(void)
......@@ -721,7 +721,7 @@ static void InternetCrackUrlW_test(void)
ok( !r, "InternetCrackUrlW succeeded unexpectedly\n");
ok( error == ERROR_INVALID_PARAMETER ||
broken(error == ERROR_INTERNET_UNRECOGNIZED_SCHEME), /* IE5 */
"expected ERROR_INVALID_PARAMETER got %u\n", error);
"expected ERROR_INVALID_PARAMETER got %lu\n", error);
if (error == ERROR_INVALID_PARAMETER)
{
......@@ -730,7 +730,7 @@ static void InternetCrackUrlW_test(void)
r = InternetCrackUrlW(url, 0, 0, NULL );
error = GetLastError();
ok( !r, "InternetCrackUrlW succeeded unexpectedly\n");
ok( error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", error);
ok( error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %lu\n", error);
}
r = InternetCrackUrlW(url, 0, 0, &comp );
......@@ -804,7 +804,7 @@ static void InternetCrackUrlW_test(void)
r = InternetCrackUrlW(url2, 0, 0, &comp);
ok(!r, "InternetCrackUrl should have failed\n");
ok(GetLastError() == ERROR_INTERNET_UNRECOGNIZED_SCHEME,
"InternetCrackUrl should have failed with error ERROR_INTERNET_UNRECOGNIZED_SCHEME instead of error %d\n",
"InternetCrackUrl should have failed with error ERROR_INTERNET_UNRECOGNIZED_SCHEME instead of error %ld\n",
GetLastError());
/* Test to see whether cracking a URL without a filename initializes urlpart */
......@@ -854,9 +854,9 @@ static void InternetCrackUrlW_test(void)
comp.lpszHostName = host;
comp.dwHostNameLength = ARRAY_SIZE(host);
r = InternetCrackUrlW(url3, 13 /* includes the nul */, 0, &comp);
ok(r, "InternetCrackUrlW failed with error %d\n", GetLastError());
ok(r, "InternetCrackUrlW failed with error %ld\n", GetLastError());
ok(comp.dwHostNameLength == 5,
"Expected dwHostNameLength of 5, got %d\n", comp.dwHostNameLength);
"Expected dwHostNameLength of 5, got %ld\n", comp.dwHostNameLength);
host[0] = 0;
memset(&comp, 0, sizeof(comp));
......@@ -875,9 +875,9 @@ static void InternetCrackUrlW_test(void)
comp.lpszUrlPath = urlpart;
comp.dwUrlPathLength = ARRAY_SIZE(urlpart);
r = InternetCrackUrlW(url5, 15, 0, &comp);
ok(r, "InternetCrackUrlW failed with error %d\n", GetLastError());
ok(r, "InternetCrackUrlW failed with error %ld\n", GetLastError());
ok(comp.dwUrlPathLength == 0,
"Expected dwUrlPathLength of 0, got %d\n", comp.dwUrlPathLength);
"Expected dwUrlPathLength of 0, got %ld\n", comp.dwUrlPathLength);
}
static void fill_url_components(URL_COMPONENTSA *lpUrlComponents)
......@@ -932,8 +932,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(NULL, 0, NULL, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
ok(len == -1, "Expected len -1, got %d\n", len);
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
ok(len == -1, "Expected len -1, got %ld\n", len);
/* test zero'ed lpUrlComponents */
ZeroMemory(&urlComp, sizeof(urlComp));
......@@ -941,8 +941,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, NULL, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
ok(len == -1, "Expected len -1, got %d\n", len);
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
ok(len == -1, "Expected len -1, got %ld\n", len);
/* test valid lpUrlComponents, NULL lpdwUrlLength */
fill_url_components(&urlComp);
......@@ -950,7 +950,7 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, NULL, NULL);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* test valid lpUrlComponents, empty szUrl
* lpdwUrlLength is size of buffer required on exit, including
......@@ -960,8 +960,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, NULL, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(len == 51, "Expected len 51, got %d\n", len);
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
ok(len == 51, "Expected len 51, got %ld\n", len);
/* test correct size, NULL szUrl */
fill_url_components(&urlComp);
......@@ -969,8 +969,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, NULL, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(len == 51, "Expected len 51, got %d\n", len);
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
ok(len == 51, "Expected len 51, got %ld\n", len);
/* test valid lpUrlComponents, alloc-ed szUrl, small size */
SetLastError(0xdeadbeef);
......@@ -979,8 +979,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(len == 51, "Expected len 51, got %d\n", len);
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
ok(len == 51, "Expected len 51, got %ld\n", len);
/* alloc-ed szUrl, NULL lpszScheme
* shows that it uses nScheme instead
......@@ -988,7 +988,7 @@ static void InternetCreateUrlA_test(void)
urlComp.lpszScheme = NULL;
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 50, "Expected len 50, got %d\n", len);
ok(len == 50, "Expected len 50, got %ld\n", len);
ok(!strcmp(szUrl, CREATE_URL1), "Expected %s, got %s\n", CREATE_URL1, szUrl);
/* alloc-ed szUrl, invalid nScheme
......@@ -999,14 +999,14 @@ static void InternetCreateUrlA_test(void)
len++;
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 50, "Expected len 50, got %d\n", len);
ok(len == 50, "Expected len 50, got %ld\n", len);
/* test valid lpUrlComponents, alloc-ed szUrl */
fill_url_components(&urlComp);
len = 51;
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 50, "Expected len 50, got %d\n", len);
ok(len == 50, "Expected len 50, got %ld\n", len);
ok(strstr(szUrl, "80") == NULL, "Didn't expect to find 80 in szUrl\n");
ok(!strcmp(szUrl, CREATE_URL1), "Expected %s, got %s\n", CREATE_URL1, szUrl);
......@@ -1016,7 +1016,7 @@ static void InternetCreateUrlA_test(void)
len = 42;
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 41, "Expected len 41, got %d\n", len);
ok(len == 41, "Expected len 41, got %ld\n", len);
ok(!strcmp(szUrl, CREATE_URL2), "Expected %s, got %s\n", CREATE_URL2, szUrl);
/* valid username, empty password */
......@@ -1025,7 +1025,7 @@ static void InternetCreateUrlA_test(void)
len = 51;
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 50, "Expected len 50, got %d\n", len);
ok(len == 50, "Expected len 50, got %ld\n", len);
ok(!strcmp(szUrl, CREATE_URL3), "Expected %s, got %s\n", CREATE_URL3, szUrl);
/* valid password, NULL username
......@@ -1038,8 +1038,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
ok(len == 42, "Expected len 42, got %d\n", len);
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
ok(len == 42, "Expected len 42, got %ld\n", len);
ok(!strcmp(szUrl, CREATE_URL3), "Expected %s, got %s\n", CREATE_URL3, szUrl);
/* valid password, empty username
......@@ -1050,7 +1050,7 @@ static void InternetCreateUrlA_test(void)
len = 51;
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 50, "Expected len 50, got %d\n", len);
ok(len == 50, "Expected len 50, got %ld\n", len);
ok(!strcmp(szUrl, CREATE_URL5), "Expected %s, got %s\n", CREATE_URL5, szUrl);
/* NULL username, NULL password */
......@@ -1060,7 +1060,7 @@ static void InternetCreateUrlA_test(void)
len = 42;
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 32, "Expected len 32, got %d\n", len);
ok(len == 32, "Expected len 32, got %ld\n", len);
ok(!strcmp(szUrl, CREATE_URL4), "Expected %s, got %s\n", CREATE_URL4, szUrl);
/* empty username, empty password */
......@@ -1070,7 +1070,7 @@ static void InternetCreateUrlA_test(void)
len = 51;
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 50, "Expected len 50, got %d\n", len);
ok(len == 50, "Expected len 50, got %ld\n", len);
ok(!strcmp(szUrl, CREATE_URL5), "Expected %s, got %s\n", CREATE_URL5, szUrl);
/* shows that nScheme is ignored, as the appearance of the port number
......@@ -1084,7 +1084,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL6), "Expected len %d, got %d\n", lstrlenA(CREATE_URL6) + 1, len);
ok(len == strlen(CREATE_URL6), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL6) + 1, len);
ok(!strcmp(szUrl, CREATE_URL6), "Expected %s, got %s\n", CREATE_URL6, szUrl);
/* if lpszScheme != "http" or nPort != 80, display nPort */
......@@ -1095,7 +1095,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 53, "Expected len 53, got %d\n", len);
ok(len == 53, "Expected len 53, got %ld\n", len);
ok(strstr(szUrl, "42") != NULL, "Expected to find 42 in szUrl\n");
ok(!strcmp(szUrl, CREATE_URL7), "Expected %s, got %s\n", CREATE_URL7, szUrl);
......@@ -1121,7 +1121,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL1), "Expected len %d, got %d\n", lstrlenA(CREATE_URL1), len);
ok(len == strlen(CREATE_URL1), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL1), len);
ok(!strcmp(szUrl, CREATE_URL1), "Expected %s, got %s\n", CREATE_URL1, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -1146,7 +1146,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL8), "Expected len %d, got %d\n", lstrlenA(CREATE_URL8), len);
ok(len == strlen(CREATE_URL8), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL8), len);
ok(!strcmp(szUrl, CREATE_URL8), "Expected %s, got %s\n", CREATE_URL8, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -1162,7 +1162,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL9), "Expected len %d, got %d\n", lstrlenA(CREATE_URL9), len);
ok(len == strlen(CREATE_URL9), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL9), len);
ok(!strcmp(szUrl, CREATE_URL9), "Expected %s, got %s\n", CREATE_URL9, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -1177,7 +1177,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL10), "Expected len %d, got %d\n", lstrlenA(CREATE_URL10), len);
ok(len == strlen(CREATE_URL10), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL10), len);
ok(!strcmp(szUrl, CREATE_URL10), "Expected %s, got %s\n", CREATE_URL10, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -1190,7 +1190,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL11), "Expected len %d, got %d\n", lstrlenA(CREATE_URL11), len);
ok(len == strlen(CREATE_URL11), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL11), len);
ok(!strcmp(szUrl, CREATE_URL11), "Expected %s, got %s\n", CREATE_URL11, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -1207,7 +1207,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL12), "Expected len %d, got %d\n", lstrlenA(CREATE_URL12), len);
ok(len == strlen(CREATE_URL12), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL12), len);
ok(!strcmp(szUrl, CREATE_URL12), "Expected %s, got %s\n", CREATE_URL12, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -1227,7 +1227,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, len);
InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL13), "Got len %u\n", len);
ok(len == strlen(CREATE_URL13), "Got len %lu\n", len);
ok(!strcmp(szUrl, CREATE_URL13), "Expected \"%s\", got \"%s\"\n", CREATE_URL13, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......
......@@ -51,7 +51,7 @@ static BOOL ie10_cache = FALSE;
static void check_cache_entry_infoA(const char *returnedfrom, INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo)
{
ok(lpCacheEntryInfo->dwStructSize == sizeof(*lpCacheEntryInfo), "%s: dwStructSize was %d\n", returnedfrom, lpCacheEntryInfo->dwStructSize);
ok(lpCacheEntryInfo->dwStructSize == sizeof(*lpCacheEntryInfo), "%s: dwStructSize was %ld\n", returnedfrom, lpCacheEntryInfo->dwStructSize);
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_url), "%s: lpszSourceUrlName should be %s instead of %s\n", returnedfrom, test_url, lpCacheEntryInfo->lpszSourceUrlName);
ok(!strcmp(lpCacheEntryInfo->lpszLocalFileName, filenameA), "%s: lpszLocalFileName should be %s instead of %s\n", returnedfrom, filenameA, lpCacheEntryInfo->lpszLocalFileName);
ok(!strcmp(lpCacheEntryInfo->lpszFileExtension, "html"), "%s: lpszFileExtension should be html instead of %s\n", returnedfrom, lpCacheEntryInfo->lpszFileExtension);
......@@ -70,11 +70,11 @@ static void test_find_url_cache_entriesA(void)
SetLastError(0xdeadbeef);
hEnumHandle = FindFirstUrlCacheEntryA(NULL, NULL, &cbCacheEntryInfo);
ok(!hEnumHandle, "FindFirstUrlCacheEntry should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "FindFirstUrlCacheEntry should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "FindFirstUrlCacheEntry should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo * sizeof(char));
cbCacheEntryInfoSaved = cbCacheEntryInfo;
hEnumHandle = FindFirstUrlCacheEntryA(NULL, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(hEnumHandle != NULL, "FindFirstUrlCacheEntry failed with error %d\n", GetLastError());
ok(hEnumHandle != NULL, "FindFirstUrlCacheEntry failed with error %ld\n", GetLastError());
while (TRUE)
{
if (!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_url))
......@@ -98,11 +98,11 @@ static void test_find_url_cache_entriesA(void)
if (!ret)
break;
}
ok(ret, "FindNextUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "FindNextUrlCacheEntry failed with error %ld\n", GetLastError());
ok(found, "Committed url cache entry not found during enumeration\n");
ret = FindCloseUrlCache(hEnumHandle);
ok(ret, "FindCloseUrlCache failed with error %d\n", GetLastError());
ok(ret, "FindCloseUrlCache failed with error %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
}
......@@ -116,24 +116,24 @@ static void test_GetUrlCacheEntryInfoExA(void)
ret = GetUrlCacheEntryInfoExA(NULL, NULL, NULL, NULL, NULL, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx with NULL URL and NULL args should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"GetUrlCacheEntryInfoEx with NULL URL and NULL args should have set last error to ERROR_INVALID_PARAMETER instead of %d\n", GetLastError());
"GetUrlCacheEntryInfoEx with NULL URL and NULL args should have set last error to ERROR_INVALID_PARAMETER instead of %ld\n", GetLastError());
cbCacheEntryInfo = sizeof(INTERNET_CACHE_ENTRY_INFOA);
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA("", NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetUrlCacheEntryInfoEx should have set last error to ERROR_FILE_NOT_FOUND instead of %d\n", GetLastError());
"GetUrlCacheEntryInfoEx should have set last error to ERROR_FILE_NOT_FOUND instead of %ld\n", GetLastError());
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, NULL, NULL, 0);
ok(ret, "GetUrlCacheEntryInfoEx with NULL args failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfoEx with NULL args failed with error %ld\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"GetUrlCacheEntryInfoEx should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
"GetUrlCacheEntryInfoEx should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
......@@ -141,30 +141,30 @@ static void test_GetUrlCacheEntryInfoExA(void)
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
ok(ret == ie10_cache, "GetUrlCacheEntryInfoEx returned %x\n", ret);
if (!ret) ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetUrlCacheEntryInfoEx should have set last error to ERROR_FILE_NOT_FOUND instead of %d\n", GetLastError());
"GetUrlCacheEntryInfoEx should have set last error to ERROR_FILE_NOT_FOUND instead of %ld\n", GetLastError());
/* Unicode version of function seems to ignore 0x200 flag */
ret = GetUrlCacheEntryInfoExW(test_urlW, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
ok(ret || broken(old_ie && !ret), "GetUrlCacheEntryInfoExW failed with error %d\n", GetLastError());
ok(ret || broken(old_ie && !ret), "GetUrlCacheEntryInfoExW failed with error %ld\n", GetLastError());
ret = GetUrlCacheEntryInfoExA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
ok(ret, "GetUrlCacheEntryInfoEx failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfoEx failed with error %ld\n", GetLastError());
if (ret) check_cache_entry_infoA("GetUrlCacheEntryInfoEx", lpCacheEntryInfo);
lpCacheEntryInfo->CacheEntryType |= 0x10000000; /* INSTALLED_CACHE_ENTRY */
ret = SetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, CACHE_ENTRY_ATTRIBUTE_FC);
ok(ret, "SetUrlCacheEntryInfoA failed with error %d\n", GetLastError());
ok(ret, "SetUrlCacheEntryInfoA failed with error %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
ok(ret, "GetUrlCacheEntryInfoEx failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfoEx failed with error %ld\n", GetLastError());
cbCacheEntryInfo = 100000;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetUrlCacheEntryInfoEx should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetUrlCacheEntryInfoEx should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
......@@ -173,12 +173,12 @@ static void test_GetUrlCacheEntryInfoExA(void)
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, &cbRedirectUrl, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoExA(test_url, NULL, &cbCacheEntryInfo, NULL, &cbRedirectUrl, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
}
static void test_RetrieveUrlCacheEntryA(void)
......@@ -190,7 +190,7 @@ static void test_RetrieveUrlCacheEntryA(void)
SetLastError(0xdeadbeef);
ret = RetrieveUrlCacheEntryFileA(NULL, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_PARAMETER instead of %d\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_PARAMETER instead of %ld\n", GetLastError());
if (0)
{
......@@ -198,14 +198,14 @@ static void test_RetrieveUrlCacheEntryA(void)
SetLastError(0xdeadbeef);
ret = RetrieveUrlCacheEntryFileA(test_url, NULL, NULL, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_PARAMETER instead of %d\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_PARAMETER instead of %ld\n", GetLastError());
}
SetLastError(0xdeadbeef);
cbCacheEntryInfo = 100000;
ret = RetrieveUrlCacheEntryFileA(NULL, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_PARAMETER instead of %d\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_PARAMETER, "RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_PARAMETER instead of %ld\n", GetLastError());
}
static void test_IsUrlCacheEntryExpiredA(void)
......@@ -228,7 +228,7 @@ static void test_IsUrlCacheEntryExpiredA(void)
ret = IsUrlCacheEntryExpiredA(NULL, 0, &ft);
ok(ret != ie10_cache, "IsUrlCacheEntryExpiredA returned %x\n", ret);
ok(ft.dwLowDateTime == 0xdeadbeef && ft.dwHighDateTime == 0xbaadf00d,
"expected time to be unchanged, got (%u,%u)\n",
"expected time to be unchanged, got (%lu,%lu)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
ret = IsUrlCacheEntryExpiredA(test_url, 0, NULL);
ok(ret != ie10_cache, "IsUrlCacheEntryExpiredA returned %x\n", ret);
......@@ -242,7 +242,7 @@ static void test_IsUrlCacheEntryExpiredA(void)
ret = IsUrlCacheEntryExpiredA(test_url, 0, &ft);
ok(!ret, "expected FALSE\n");
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
"expected time (0,0), got (%lu,%lu)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
/* Same behavior with bogus flags. */
......@@ -251,17 +251,17 @@ static void test_IsUrlCacheEntryExpiredA(void)
ret = IsUrlCacheEntryExpiredA(test_url, 0xffffffff, &ft);
ok(!ret, "expected FALSE\n");
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
"expected time (0,0), got (%lu,%lu)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
/* Set the expire time to a point in the past.. */
ret = GetUrlCacheEntryInfoA(test_url, NULL, &size);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
info = HeapAlloc(GetProcessHeap(), 0, size);
ret = GetUrlCacheEntryInfoA(test_url, info, &size);
ok(ret, "GetUrlCacheEntryInfo failed: %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed: %ld\n", GetLastError());
GetSystemTimeAsFileTime(&info->ExpireTime);
exp_time.u.LowPart = info->ExpireTime.dwLowDateTime;
exp_time.u.HighPart = info->ExpireTime.dwHighDateTime;
......@@ -269,7 +269,7 @@ static void test_IsUrlCacheEntryExpiredA(void)
info->ExpireTime.dwLowDateTime = exp_time.u.LowPart;
info->ExpireTime.dwHighDateTime = exp_time.u.HighPart;
ret = SetUrlCacheEntryInfoA(test_url, info, CACHE_ENTRY_EXPTIME_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
ok(ret, "SetUrlCacheEntryInfo failed: %ld\n", GetLastError());
ft.dwLowDateTime = 0xdeadbeef;
ft.dwHighDateTime = 0xbaadf00d;
/* and the entry should be expired. */
......@@ -277,14 +277,14 @@ static void test_IsUrlCacheEntryExpiredA(void)
ok(ret, "expected TRUE\n");
/* The modified time returned is 0. */
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
"expected time (0,0), got (%lu,%lu)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
/* Set the expire time to a point in the future.. */
exp_time.QuadPart += 20 * 60 * (ULONGLONG)10000000;
info->ExpireTime.dwLowDateTime = exp_time.u.LowPart;
info->ExpireTime.dwHighDateTime = exp_time.u.HighPart;
ret = SetUrlCacheEntryInfoA(test_url, info, CACHE_ENTRY_EXPTIME_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
ok(ret, "SetUrlCacheEntryInfo failed: %ld\n", GetLastError());
ft.dwLowDateTime = 0xdeadbeef;
ft.dwHighDateTime = 0xbaadf00d;
/* and the entry should no longer be expired. */
......@@ -292,19 +292,19 @@ static void test_IsUrlCacheEntryExpiredA(void)
ok(!ret, "expected FALSE\n");
/* The modified time returned is still 0. */
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
"expected time (0,0), got (%lu,%lu)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
/* Set the modified time... */
GetSystemTimeAsFileTime(&info->LastModifiedTime);
ret = SetUrlCacheEntryInfoA(test_url, info, CACHE_ENTRY_MODTIME_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
ok(ret, "SetUrlCacheEntryInfo failed: %ld\n", GetLastError());
/* and the entry should still be unexpired.. */
ret = IsUrlCacheEntryExpiredA(test_url, 0, &ft);
ok(!ret, "expected FALSE\n");
/* but the modified time returned is the last modified time just set. */
ok(ft.dwLowDateTime == info->LastModifiedTime.dwLowDateTime &&
ft.dwHighDateTime == info->LastModifiedTime.dwHighDateTime,
"expected time (%u,%u), got (%u,%u)\n",
"expected time (%lu,%lu), got (%lu,%lu)\n",
info->LastModifiedTime.dwLowDateTime,
info->LastModifiedTime.dwHighDateTime,
ft.dwLowDateTime, ft.dwHighDateTime);
......@@ -316,7 +316,7 @@ static void test_IsUrlCacheEntryExpiredA(void)
ret = IsUrlCacheEntryExpiredA(uncached_url, 0, &ft);
ok(ret != ie10_cache, "IsUrlCacheEntryExpiredA returned %x\n", ret);
ok(!ft.dwLowDateTime && !ft.dwHighDateTime,
"expected time (0,0), got (%u,%u)\n",
"expected time (0,0), got (%lu,%lu)\n",
ft.dwLowDateTime, ft.dwHighDateTime);
}
......@@ -327,7 +327,7 @@ static void _check_file_exists(LONG l, LPCSTR filename)
file = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
ok_(__FILE__,l)(file != INVALID_HANDLE_VALUE,
"expected file to exist, CreateFile failed with error %d\n",
"expected file to exist, CreateFile failed with error %ld\n",
GetLastError());
CloseHandle(file);
}
......@@ -357,10 +357,10 @@ static void create_and_write_file(LPCSTR filename, void *data, DWORD len)
file = CreateFileA(filename, GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed with error %d\n", GetLastError());
ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed with error %ld\n", GetLastError());
ret = WriteFile(file, data, len, &written, NULL);
ok(ret, "WriteFile failed with error %d\n", GetLastError());
ok(ret, "WriteFile failed with error %ld\n", GetLastError());
CloseHandle(file);
}
......@@ -380,10 +380,10 @@ static void test_urlcacheA(void)
int len;
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA1, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
check_file_exists(filenameA1);
DeleteFileA(filenameA1);
......@@ -392,24 +392,24 @@ static void test_urlcacheA(void)
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA(test_url1, NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
cbCacheEntryInfo = 0;
ret = GetUrlCacheEntryInfoA(test_url1, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"GetUrlCacheEntryInfo should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
"GetUrlCacheEntryInfo should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url1, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
ok(!memcmp(&lpCacheEntryInfo->ExpireTime, &filetime_zero, sizeof(FILETIME)),
"expected zero ExpireTime\n");
ok(!memcmp(&lpCacheEntryInfo->LastModifiedTime, &filetime_zero, sizeof(FILETIME)),
"expected zero LastModifiedTime\n");
ok(lpCacheEntryInfo->CacheEntryType == (NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY) ||
broken(lpCacheEntryInfo->CacheEntryType == NORMAL_CACHE_ENTRY /* NT4/W2k */),
"expected type NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY, got %08x\n",
"expected type NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY, got %08lx\n",
lpCacheEntryInfo->CacheEntryType);
ok(!U(*lpCacheEntryInfo).dwExemptDelta, "expected dwExemptDelta 0, got %d\n",
ok(!U(*lpCacheEntryInfo).dwExemptDelta, "expected dwExemptDelta 0, got %ld\n",
U(*lpCacheEntryInfo).dwExemptDelta);
/* Make sure there is a notable change in timestamps */
......@@ -419,15 +419,15 @@ static void test_urlcacheA(void)
GetSystemTimeAsFileTime(&now);
ret = CommitUrlCacheEntryA(test_url1, NULL, now, now, NORMAL_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), NULL, NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
cbCacheEntryInfo = 0;
ret = GetUrlCacheEntryInfoA(test_url1, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
lpCacheEntryInfo2 = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url1, lpCacheEntryInfo2, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
/* but it does change the time.. */
ok(memcmp(&lpCacheEntryInfo2->ExpireTime, &filetime_zero, sizeof(FILETIME)),
"expected positive ExpireTime\n");
......@@ -435,11 +435,11 @@ static void test_urlcacheA(void)
"expected positive LastModifiedTime\n");
ok(lpCacheEntryInfo2->CacheEntryType == (NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY) ||
broken(lpCacheEntryInfo2->CacheEntryType == NORMAL_CACHE_ENTRY /* NT4/W2k */),
"expected type NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY, got %08x\n",
"expected type NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY, got %08lx\n",
lpCacheEntryInfo2->CacheEntryType);
/* and set the headers. */
ok(lpCacheEntryInfo2->dwHeaderInfoSize == 19,
"expected headers size 19, got %d\n",
"expected headers size 19, got %ld\n",
lpCacheEntryInfo2->dwHeaderInfoSize);
/* Hit rate gets incremented by 1 */
ok((lpCacheEntryInfo->dwHitRate + 1) == lpCacheEntryInfo2->dwHitRate,
......@@ -456,18 +456,18 @@ static void test_urlcacheA(void)
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo2);
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = RetrieveUrlCacheEntryFileA(test_url, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"RetrieveUrlCacheEntryFile should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
"RetrieveUrlCacheEntryFile should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = RetrieveUrlCacheEntryFileA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo, 0);
ok(ret, "RetrieveUrlCacheEntryFile failed with error %d\n", GetLastError());
ok(ret, "RetrieveUrlCacheEntryFile failed with error %ld\n", GetLastError());
if (ret) check_cache_entry_infoA("RetrieveUrlCacheEntryFile", lpCacheEntryInfo);
......@@ -478,12 +478,12 @@ static void test_urlcacheA(void)
ret = RetrieveUrlCacheEntryFileA(test_url1, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INVALID_DATA || GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_DATA instead of %d\n", GetLastError());
"RetrieveUrlCacheEntryFile should have set last error to ERROR_INVALID_DATA instead of %ld\n", GetLastError());
if (pUnlockUrlCacheEntryFileA)
{
ret = pUnlockUrlCacheEntryFileA(test_url, 0);
ok(ret, "UnlockUrlCacheEntryFileA failed with error %d\n", GetLastError());
ok(ret, "UnlockUrlCacheEntryFileA failed with error %ld\n", GetLastError());
}
/* test Find*UrlCacheEntry functions */
......@@ -496,9 +496,9 @@ static void test_urlcacheA(void)
if (pDeleteUrlCacheEntryA)
{
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
ok(ret, "DeleteUrlCacheEntryA failed with error %ld\n", GetLastError());
ret = pDeleteUrlCacheEntryA(test_url1);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
ok(ret, "DeleteUrlCacheEntryA failed with error %ld\n", GetLastError());
}
SetLastError(0xdeadbeef);
......@@ -507,10 +507,10 @@ static void test_urlcacheA(void)
/* Creating two entries with the same URL */
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA1, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
ok(lstrcmpiA(filenameA, filenameA1), "expected a different file name\n");
......@@ -522,12 +522,12 @@ static void test_urlcacheA(void)
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero,
filetime_zero, NORMAL_CACHE_ENTRY, (LPBYTE)ok_header,
strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
check_file_exists(filenameA);
check_file_exists(filenameA1);
ret = CommitUrlCacheEntryA(test_url, filenameA1, filetime_zero,
filetime_zero, COOKIE_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
/* By committing the same URL a second time, the prior entry is
* overwritten...
*/
......@@ -536,16 +536,16 @@ static void test_urlcacheA(void)
ret = GetUrlCacheEntryInfoA(test_url, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
/* with the previous entry type retained.. */
ok(lpCacheEntryInfo->CacheEntryType & NORMAL_CACHE_ENTRY,
"expected cache entry type NORMAL_CACHE_ENTRY, got %d (0x%08x)\n",
"expected cache entry type NORMAL_CACHE_ENTRY, got %ld (0x%08lx)\n",
lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType);
/* and the headers overwritten.. */
ok(!lpCacheEntryInfo->dwHeaderInfoSize, "expected headers size 0, got %d\n",
ok(!lpCacheEntryInfo->dwHeaderInfoSize, "expected headers size 0, got %ld\n",
lpCacheEntryInfo->dwHeaderInfoSize);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
/* and the previous filename shouldn't exist. */
......@@ -555,7 +555,7 @@ static void test_urlcacheA(void)
if (pDeleteUrlCacheEntryA)
{
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
ok(ret, "DeleteUrlCacheEntryA failed with error %ld\n", GetLastError());
check_file_not_exists(filenameA);
check_file_not_exists(filenameA1);
/* Just in case, clean up files */
......@@ -567,22 +567,22 @@ static void test_urlcacheA(void)
* unlocked:
*/
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = RetrieveUrlCacheEntryFileA(test_url, NULL, &cbCacheEntryInfo, 0);
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = RetrieveUrlCacheEntryFileA(test_url, lpCacheEntryInfo,
&cbCacheEntryInfo, 0);
ok(ret, "RetrieveUrlCacheEntryFile failed with error %d\n", GetLastError());
ok(ret, "RetrieveUrlCacheEntryFile failed with error %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
......@@ -591,16 +591,16 @@ static void test_urlcacheA(void)
ret = pDeleteUrlCacheEntryA(test_url);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_SHARING_VIOLATION,
"Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError());
"Expected ERROR_SHARING_VIOLATION, got %ld\n", GetLastError());
check_file_exists(filenameA);
}
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
memset(lpCacheEntryInfo, 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
ok(lpCacheEntryInfo->CacheEntryType & 0x400000,
"CacheEntryType hasn't PENDING_DELETE_CACHE_ENTRY set, (flags %08x)\n",
"CacheEntryType hasn't PENDING_DELETE_CACHE_ENTRY set, (flags %08lx)\n",
lpCacheEntryInfo->CacheEntryType);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
......@@ -608,7 +608,7 @@ static void test_urlcacheA(void)
{
check_file_exists(filenameA);
ret = pUnlockUrlCacheEntryFileA(test_url, 0);
ok(ret, "UnlockUrlCacheEntryFileA failed: %d\n", GetLastError());
ok(ret, "UnlockUrlCacheEntryFileA failed: %ld\n", GetLastError());
/* By unlocking the already-deleted cache entry, the file associated
* with it is deleted..
*/
......@@ -622,14 +622,14 @@ static void test_urlcacheA(void)
ret = pDeleteUrlCacheEntryA(test_url);
ok(!ret, "Expected failure\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());
}
/* Test whether preventing a file from being deleted causes
* DeleteUrlCacheEntryA to fail.
*/
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
check_file_exists(filenameA);
......@@ -637,17 +637,17 @@ static void test_urlcacheA(void)
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero,
filetime_zero, NORMAL_CACHE_ENTRY, (LPBYTE)ok_header,
strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
check_file_exists(filenameA);
hFile = CreateFileA(filenameA, GENERIC_READ, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA failed: %d\n",
ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA failed: %ld\n",
GetLastError());
if (pDeleteUrlCacheEntryA)
{
/* DeleteUrlCacheEntryA should succeed.. */
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
ok(ret, "DeleteUrlCacheEntryA failed with error %ld\n", GetLastError());
}
CloseHandle(hFile);
if (pDeleteUrlCacheEntryA)
......@@ -656,7 +656,7 @@ static void test_urlcacheA(void)
ret = pDeleteUrlCacheEntryA(test_url);
ok(!ret, "Expected failure\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());
}
/* and the file should be untouched. */
check_file_exists(filenameA);
......@@ -671,126 +671,126 @@ static void test_urlcacheA(void)
NULL);
ok(ret == ie10_cache, "CommitUrlCacheEntryA returned %x\n", ret);
if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = CommitUrlCacheEntryA(test_url, NULL, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
ok(ret == ie10_cache, "CommitUrlCacheEntryA returned %x\n", ret);
if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
"expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoA(test_url, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
ok(lpCacheEntryInfo->CacheEntryType & (NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY),
"expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %d (0x%08x)\n",
"expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %ld (0x%08lx)\n",
lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType);
ok(U(*lpCacheEntryInfo).dwExemptDelta == 86400,
"expected dwExemptDelta 86400, got %d\n",
"expected dwExemptDelta 86400, got %ld\n",
U(*lpCacheEntryInfo).dwExemptDelta);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
if (pDeleteUrlCacheEntryA)
{
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
ok(ret, "DeleteUrlCacheEntryA failed with error %ld\n", GetLastError());
/* When explicitly deleting the cache entry, the file is also deleted */
check_file_not_exists(filenameA);
}
/* Test once again, setting the exempt delta via SetUrlCacheEntryInfo */
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
cbCacheEntryInfo = 0;
SetLastError(0xdeadbeef);
ret = GetUrlCacheEntryInfoA(test_url, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
ok(lpCacheEntryInfo->CacheEntryType & (NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY),
"expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %d (0x%08x)\n",
"expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %ld (0x%08lx)\n",
lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType);
ok(U(*lpCacheEntryInfo).dwExemptDelta == 86400,
"expected dwExemptDelta 86400, got %d\n",
"expected dwExemptDelta 86400, got %ld\n",
U(*lpCacheEntryInfo).dwExemptDelta);
U(*lpCacheEntryInfo).dwExemptDelta = 0;
ret = SetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo,
CACHE_ENTRY_EXEMPT_DELTA_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
ok(ret, "SetUrlCacheEntryInfo failed: %ld\n", GetLastError());
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(!U(*lpCacheEntryInfo).dwExemptDelta, "expected dwExemptDelta 0, got %d\n",
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
ok(!U(*lpCacheEntryInfo).dwExemptDelta, "expected dwExemptDelta 0, got %ld\n",
U(*lpCacheEntryInfo).dwExemptDelta);
/* See whether a sticky cache entry has the flag cleared once the exempt
* delta is meaningless.
*/
ok(lpCacheEntryInfo->CacheEntryType & (NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY),
"expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %d (0x%08x)\n",
"expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %ld (0x%08lx)\n",
lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType);
/* Recommit of Url entry keeps dwExemptDelta */
U(*lpCacheEntryInfo).dwExemptDelta = 8600;
ret = SetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo,
CACHE_ENTRY_EXEMPT_DELTA_FC);
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
ok(ret, "SetUrlCacheEntryInfo failed: %ld\n", GetLastError());
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA1, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
create_and_write_file(filenameA1, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA(test_url, filenameA1, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
ok(U(*lpCacheEntryInfo).dwExemptDelta == 8600 || (ie10_cache && U(*lpCacheEntryInfo).dwExemptDelta == 86400),
"expected dwExemptDelta 8600, got %d\n", U(*lpCacheEntryInfo).dwExemptDelta);
"expected dwExemptDelta 8600, got %ld\n", U(*lpCacheEntryInfo).dwExemptDelta);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
if (pDeleteUrlCacheEntryA)
{
ret = pDeleteUrlCacheEntryA(test_url);
ok(ret, "DeleteUrlCacheEntryA failed with error %d\n", GetLastError());
ok(ret, "DeleteUrlCacheEntryA failed with error %ld\n", GetLastError());
check_file_not_exists(filenameA);
}
/* Test if files with identical hash keys are handled correctly */
ret = CommitUrlCacheEntryA(test_hash_collisions1, NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
ret = CommitUrlCacheEntryA(test_hash_collisions2, NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
cbCacheEntryInfo = 0;
ret = GetUrlCacheEntryInfoA(test_hash_collisions1, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_hash_collisions1, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_hash_collisions1),
"got incorrect entry: %s\n", lpCacheEntryInfo->lpszSourceUrlName);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
......@@ -799,42 +799,42 @@ static void test_urlcacheA(void)
ret = GetUrlCacheEntryInfoA(test_hash_collisions2, NULL, &cbCacheEntryInfo);
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
"expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
ret = GetUrlCacheEntryInfoA(test_hash_collisions2, lpCacheEntryInfo, &cbCacheEntryInfo);
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
ok(ret, "GetUrlCacheEntryInfo failed with error %ld\n", GetLastError());
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_hash_collisions2),
"got incorrect entry: %s\n", lpCacheEntryInfo->lpszSourceUrlName);
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
if (pDeleteUrlCacheEntryA) {
ret = pDeleteUrlCacheEntryA(test_hash_collisions1);
ok(ret, "DeleteUrlCacheEntry failed: %d\n", GetLastError());
ok(ret, "DeleteUrlCacheEntry failed: %ld\n", GetLastError());
ret = pDeleteUrlCacheEntryA(test_hash_collisions2);
ok(ret, "DeleteUrlCacheEntry failed: %d\n", GetLastError());
ok(ret, "DeleteUrlCacheEntry failed: %ld\n", GetLastError());
}
len = strlen(long_url);
memset(long_url+len, 'a', sizeof(long_url)-len);
long_url[sizeof(long_url)-1] = 0;
ret = CreateUrlCacheEntryA(long_url, 0, NULL, filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
check_file_exists(filenameA);
DeleteFileA(filenameA);
ret = CreateUrlCacheEntryA(long_url, 0, "extension", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
check_file_exists(filenameA);
DeleteFileA(filenameA);
long_url[250] = 0;
ret = CreateUrlCacheEntryA(long_url, 0, NULL, filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
check_file_exists(filenameA);
DeleteFileA(filenameA);
ret = CreateUrlCacheEntryA(long_url, 0, "extension", filenameA, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
check_file_exists(filenameA);
DeleteFileA(filenameA);
}
......@@ -900,88 +900,88 @@ static void test_urlcacheW(void)
SetLastError(0xdeadbeef);
ret = CreateUrlCacheEntryW(urls[i].url, 0, NULL, bufW, 0);
if(urls[i].err != 0) {
ok(!ret, "%d) CreateUrlCacheEntryW succeeded\n", i);
ok(urls[i].err == GetLastError(), "%d) GetLastError() = %d\n", i, GetLastError());
ok(!ret, "%ld) CreateUrlCacheEntryW succeeded\n", i);
ok(urls[i].err == GetLastError(), "%ld) GetLastError() = %ld\n", i, GetLastError());
continue;
}
ok(ret, "%d) CreateUrlCacheEntryW failed: %d\n", i, GetLastError());
ok(ret, "%ld) CreateUrlCacheEntryW failed: %ld\n", i, GetLastError());
/* dwHeaderSize is ignored, pass 0 to prove it */
ret = CommitUrlCacheEntryW(urls[i].url, bufW, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY, urls[i].header_info, 0, urls[i].extension, NULL);
ok(ret, "%d) CommitUrlCacheEntryW failed: %d\n", i, GetLastError());
ok(ret, "%ld) CommitUrlCacheEntryW failed: %ld\n", i, GetLastError());
SetLastError(0xdeadbeef);
size = 0;
ret = GetUrlCacheEntryInfoW(urls[i].url, NULL, &size);
ok(!ret && GetLastError()==ERROR_INSUFFICIENT_BUFFER,
"%d) GetLastError() = %d\n", i, GetLastError());
"%ld) GetLastError() = %ld\n", i, GetLastError());
entry_infoW = HeapAlloc(GetProcessHeap(), 0, size);
ret = GetUrlCacheEntryInfoW(urls[i].url, entry_infoW, &size);
ok(ret, "%d) GetUrlCacheEntryInfoW failed: %d\n", i, GetLastError());
ok(ret, "%ld) GetUrlCacheEntryInfoW failed: %ld\n", i, GetLastError());
ret = GetUrlCacheEntryInfoA(urls[i].encoded_url, NULL, &size);
ok(!ret && GetLastError()==ERROR_INSUFFICIENT_BUFFER,
"%d) GetLastError() = %d\n", i, GetLastError());
"%ld) GetLastError() = %ld\n", i, GetLastError());
entry_infoA = HeapAlloc(GetProcessHeap(), 0, size);
ret = GetUrlCacheEntryInfoA(urls[i].encoded_url, entry_infoA, &size);
ok(ret, "%d) GetUrlCacheEntryInfoA failed: %d\n", i, GetLastError());
ok(ret, "%ld) GetUrlCacheEntryInfoA failed: %ld\n", i, GetLastError());
ok(entry_infoW->dwStructSize == entry_infoA->dwStructSize,
"%d) entry_infoW->dwStructSize = %d, expected %d\n",
"%ld) entry_infoW->dwStructSize = %ld, expected %ld\n",
i, entry_infoW->dwStructSize, entry_infoA->dwStructSize);
ok(!lstrcmpW(urls[i].url, entry_infoW->lpszSourceUrlName),
"%d) entry_infoW->lpszSourceUrlName = %s\n",
"%ld) entry_infoW->lpszSourceUrlName = %s\n",
i, wine_dbgstr_w(entry_infoW->lpszSourceUrlName));
ok(!lstrcmpA(urls[i].encoded_url, entry_infoA->lpszSourceUrlName),
"%d) entry_infoA->lpszSourceUrlName = %s\n",
"%ld) entry_infoA->lpszSourceUrlName = %s\n",
i, entry_infoA->lpszSourceUrlName);
ok(entry_infoW->CacheEntryType == entry_infoA->CacheEntryType,
"%d) entry_infoW->CacheEntryType = %x, expected %x\n",
"%ld) entry_infoW->CacheEntryType = %lx, expected %lx\n",
i, entry_infoW->CacheEntryType, entry_infoA->CacheEntryType);
ok(entry_infoW->dwUseCount == entry_infoA->dwUseCount,
"%d) entry_infoW->dwUseCount = %d, expected %d\n",
"%ld) entry_infoW->dwUseCount = %ld, expected %ld\n",
i, entry_infoW->dwUseCount, entry_infoA->dwUseCount);
ok(entry_infoW->dwHitRate == entry_infoA->dwHitRate,
"%d) entry_infoW->dwHitRate = %d, expected %d\n",
"%ld) entry_infoW->dwHitRate = %ld, expected %ld\n",
i, entry_infoW->dwHitRate, entry_infoA->dwHitRate);
ok(entry_infoW->dwSizeLow == entry_infoA->dwSizeLow,
"%d) entry_infoW->dwSizeLow = %d, expected %d\n",
"%ld) entry_infoW->dwSizeLow = %ld, expected %ld\n",
i, entry_infoW->dwSizeLow, entry_infoA->dwSizeLow);
ok(entry_infoW->dwSizeHigh == entry_infoA->dwSizeHigh,
"%d) entry_infoW->dwSizeHigh = %d, expected %d\n",
"%ld) entry_infoW->dwSizeHigh = %ld, expected %ld\n",
i, entry_infoW->dwSizeHigh, entry_infoA->dwSizeHigh);
ok(!memcmp(&entry_infoW->LastModifiedTime, &entry_infoA->LastModifiedTime, sizeof(FILETIME)),
"%d) entry_infoW->LastModifiedTime is incorrect\n", i);
"%ld) entry_infoW->LastModifiedTime is incorrect\n", i);
ok(!memcmp(&entry_infoW->ExpireTime, &entry_infoA->ExpireTime, sizeof(FILETIME)),
"%d) entry_infoW->ExpireTime is incorrect\n", i);
"%ld) entry_infoW->ExpireTime is incorrect\n", i);
ok(!memcmp(&entry_infoW->LastAccessTime, &entry_infoA->LastAccessTime, sizeof(FILETIME)),
"%d) entry_infoW->LastAccessTime is incorrect\n", i);
"%ld) entry_infoW->LastAccessTime is incorrect\n", i);
ok(!memcmp(&entry_infoW->LastSyncTime, &entry_infoA->LastSyncTime, sizeof(FILETIME)),
"%d) entry_infoW->LastSyncTime is incorrect\n", i);
"%ld) entry_infoW->LastSyncTime is incorrect\n", i);
MultiByteToWideChar(CP_ACP, 0, entry_infoA->lpszLocalFileName, -1, bufW, MAX_PATH);
ok(!lstrcmpW(entry_infoW->lpszLocalFileName, bufW),
"%d) entry_infoW->lpszLocalFileName = %s, expected %s\n",
"%ld) entry_infoW->lpszLocalFileName = %s, expected %s\n",
i, wine_dbgstr_w(entry_infoW->lpszLocalFileName), wine_dbgstr_w(bufW));
if(!urls[i].header_info[0]) {
ok(!entry_infoW->lpHeaderInfo, "entry_infoW->lpHeaderInfo != NULL\n");
}else {
ok(!lstrcmpW((WCHAR*)entry_infoW->lpHeaderInfo, urls[i].header_info),
"%d) entry_infoW->lpHeaderInfo = %s\n",
"%ld) entry_infoW->lpHeaderInfo = %s\n",
i, wine_dbgstr_w((WCHAR*)entry_infoW->lpHeaderInfo));
}
if(!urls[i].extension[0]) {
ok(!entry_infoW->lpszFileExtension || (ie10_cache && !entry_infoW->lpszFileExtension[0]),
"%d) entry_infoW->lpszFileExtension = %s\n",
"%ld) entry_infoW->lpszFileExtension = %s\n",
i, wine_dbgstr_w(entry_infoW->lpszFileExtension));
}else {
MultiByteToWideChar(CP_ACP, 0, entry_infoA->lpszFileExtension, -1, bufW, MAX_PATH);
ok(!lstrcmpW(entry_infoW->lpszFileExtension, bufW) ||
(ie10_cache && !lstrcmpW(entry_infoW->lpszFileExtension, urls[i].extension)),
"%d) entry_infoW->lpszFileExtension = %s, expected %s\n",
"%ld) entry_infoW->lpszFileExtension = %s, expected %s\n",
i, wine_dbgstr_w(entry_infoW->lpszFileExtension), wine_dbgstr_w(bufW));
}
......@@ -990,7 +990,7 @@ static void test_urlcacheW(void)
if(pDeleteUrlCacheEntryA) {
ret = pDeleteUrlCacheEntryA(urls[i].encoded_url);
ok(ret, "%d) DeleteUrlCacheEntryW failed: %d\n", i, GetLastError());
ok(ret, "%ld) DeleteUrlCacheEntryW failed: %ld\n", i, GetLastError());
}
}
}
......@@ -1004,7 +1004,7 @@ static void test_FindCloseUrlCache(void)
r = FindCloseUrlCache(NULL);
err = GetLastError();
ok(0 == r, "expected 0, got %d\n", r);
ok(ERROR_INVALID_HANDLE == err, "expected %d, got %d\n", ERROR_INVALID_HANDLE, err);
ok(ERROR_INVALID_HANDLE == err, "expected %d, got %ld\n", ERROR_INVALID_HANDLE, err);
}
static void test_GetDiskInfoA(void)
......@@ -1018,16 +1018,16 @@ static void test_GetDiskInfoA(void)
if ((p = strchr(path, '\\'))) *++p = 0;
ret = GetDiskInfoA(path, &cluster_size, &free, &total);
ok(ret, "GetDiskInfoA failed %u\n", GetLastError());
ok(ret, "GetDiskInfoA failed %lu\n", GetLastError());
ret = GetDiskInfoA(path, &cluster_size, &free, NULL);
ok(ret, "GetDiskInfoA failed %u\n", GetLastError());
ok(ret, "GetDiskInfoA failed %lu\n", GetLastError());
ret = GetDiskInfoA(path, &cluster_size, NULL, NULL);
ok(ret, "GetDiskInfoA failed %u\n", GetLastError());
ok(ret, "GetDiskInfoA failed %lu\n", GetLastError());
ret = GetDiskInfoA(path, NULL, NULL, NULL);
ok(ret, "GetDiskInfoA failed %u\n", GetLastError());
ok(ret, "GetDiskInfoA failed %lu\n", GetLastError());
SetLastError(0xdeadbeef);
strcpy(p, "\\non\\existing\\path");
......@@ -1038,13 +1038,13 @@ static void test_GetDiskInfoA(void)
"GetDiskInfoA succeeded\n");
ok(error == ERROR_PATH_NOT_FOUND ||
broken(old_ie && error == 0xdeadbeef), /* < IE7 */
"got %u expected ERROR_PATH_NOT_FOUND\n", error);
"got %lu expected ERROR_PATH_NOT_FOUND\n", error);
SetLastError(0xdeadbeef);
ret = GetDiskInfoA(NULL, NULL, NULL, NULL);
error = GetLastError();
ok(!ret, "GetDiskInfoA succeeded\n");
ok(error == ERROR_INVALID_PARAMETER, "got %u expected ERROR_INVALID_PARAMETER\n", error);
ok(error == ERROR_INVALID_PARAMETER, "got %lu expected ERROR_INVALID_PARAMETER\n", error);
}
static BOOL cache_entry_exists(const char *url)
......@@ -1054,7 +1054,7 @@ static BOOL cache_entry_exists(const char *url)
BOOL ret;
ret = GetUrlCacheEntryInfoA(url, (void*)buf, &size);
ok(ret || GetLastError() == ERROR_FILE_NOT_FOUND, "GetUrlCacheEntryInfoA returned %x (%u)\n", ret, GetLastError());
ok(ret || GetLastError() == ERROR_FILE_NOT_FOUND, "GetUrlCacheEntryInfoA returned %x (%lu)\n", ret, GetLastError());
return ret;
}
......@@ -1070,13 +1070,13 @@ static void test_trailing_slash(void)
ret = CreateUrlCacheEntryA(url_with_slash, 0, "html", filename, 0);
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CreateUrlCacheEntry failed with error %ld\n", GetLastError());
create_and_write_file(filename, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA("Visited: http://testing.cache.com/", NULL, filetime_zero, filetime_zero,
NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
ok(ret, "CommitUrlCacheEntry failed with error %ld\n", GetLastError());
ok(cache_entry_exists("Visited: http://testing.cache.com/"), "cache entry does not exist\n");
ok(!cache_entry_exists("Visited: http://testing.cache.com"), "cache entry exists\n");
......@@ -1115,12 +1115,12 @@ static void get_cache_path(DWORD flags, char path[MAX_PATH], char path_win8[MAX_
break;
default:
ok(0, "unexpected flags %#x\n", flags);
ok(0, "unexpected flags %#lx\n", flags);
break;
}
ret = SHGetSpecialFolderPathA(0, path, folder, FALSE);
ok(ret, "SHGetSpecialFolderPath error %u\n", GetLastError());
ok(ret, "SHGetSpecialFolderPath error %lu\n", GetLastError());
strcpy(path_win8, path);
strcat(path_win8, suffix_win8);
......@@ -1168,14 +1168,14 @@ static void test_GetUrlCacheConfigInfo(void)
ret = GetUrlCacheConfigInfoA(td[i].info, NULL, td[i].flags);
ok(ret == td[i].ret, "%d: expected %d, got %d\n", i, td[i].ret, ret);
if (!ret)
ok(GetLastError() == td[i].error, "%d: expected %u, got %u\n", i, td[i].error, GetLastError());
ok(GetLastError() == td[i].error, "%d: expected %lu, got %lu\n", i, td[i].error, GetLastError());
else
{
char path[MAX_PATH], path_win8[MAX_PATH];
get_cache_path(td[i].flags, path, path_win8);
ok(info.dwStructSize == td[i].dwStructSize, "got %u\n", info.dwStructSize);
ok(info.dwStructSize == td[i].dwStructSize, "got %lu\n", info.dwStructSize);
ok(!lstrcmpA(info.CachePath, path) || !lstrcmpA(info.CachePath, path_win8),
"%d: expected %s or %s, got %s\n", i, path, path_win8, info.CachePath);
}
......
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