wininet/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c31fc18016
commit
e146f4c753
|
@ -1,4 +1,3 @@
|
|||
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)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue