wininet: Compile tests with -D__WINESRC__.
This commit is contained in:
parent
f5113d2d56
commit
e857a70ae2
@ -1,6 +1,5 @@
|
|||||||
TESTDLL = wininet.dll
|
TESTDLL = wininet.dll
|
||||||
IMPORTS = wininet crypt32 ws2_32 user32 advapi32
|
IMPORTS = wininet crypt32 ws2_32 user32 advapi32
|
||||||
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
|
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
ftp.c \
|
ftp.c \
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "wininet.h"
|
#include "wininet.h"
|
||||||
#include "winsock.h"
|
#include "winsock2.h"
|
||||||
|
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ static void test_connect(HINTERNET hInternet)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
||||||
if (hFtp) /* some servers accept an empty password */
|
if (hFtp) /* some servers accept an empty password */
|
||||||
{
|
{
|
||||||
ok ( GetLastError() == ERROR_SUCCESS, "ERROR_SUCCESS, got %d\n", GetLastError());
|
ok ( GetLastError() == ERROR_SUCCESS, "ERROR_SUCCESS, got %d\n", GetLastError());
|
||||||
@ -82,13 +82,13 @@ static void test_connect(HINTERNET hInternet)
|
|||||||
"Expected ERROR_INTERNET_LOGIN_FAILURE, got %d\n", GetLastError());
|
"Expected ERROR_INTERNET_LOGIN_FAILURE, got %d\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, NULL, "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
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 ( hFtp == NULL, "Expected InternetConnect to fail\n");
|
||||||
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", "IEUser@",
|
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", "IEUser@",
|
||||||
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
||||||
ok(!hFtp, "Expected InternetConnect to fail\n");
|
ok(!hFtp, "Expected InternetConnect to fail\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
@ -102,19 +102,19 @@ static void test_connect(HINTERNET hInternet)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, NULL, NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, NULL, NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
||||||
if (!hFtp && (GetLastError() == ERROR_INTERNET_LOGIN_FAILURE))
|
if (!hFtp && (GetLastError() == ERROR_INTERNET_LOGIN_FAILURE))
|
||||||
{
|
{
|
||||||
/* We are most likely running on a clean Wine install or a Windows install where the registry key is removed */
|
/* We are most likely running on a clean Wine install or a Windows install where the registry key is removed */
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
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 : %d\n", GetLastError());
|
||||||
ok ( GetLastError() == ERROR_SUCCESS,
|
ok ( GetLastError() == ERROR_SUCCESS,
|
||||||
"ERROR_SUCCESS, got %d\n", GetLastError());
|
"ERROR_SUCCESS, got %d\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", NULL,
|
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", NULL,
|
||||||
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
||||||
if (!hFtp)
|
if (!hFtp)
|
||||||
{
|
{
|
||||||
@ -746,7 +746,7 @@ static void test_command(HINTERNET hFtp, HINTERNET hConnect)
|
|||||||
|
|
||||||
static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
|
static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATA findData;
|
WIN32_FIND_DATAA findData;
|
||||||
HINTERNET hSearch;
|
HINTERNET hSearch;
|
||||||
HINTERNET hSearch2;
|
HINTERNET hSearch2;
|
||||||
HINTERNET hOpenFile;
|
HINTERNET hOpenFile;
|
||||||
@ -943,7 +943,7 @@ static void test_status_callbacks(HINTERNET hInternet)
|
|||||||
cb = pInternetSetStatusCallbackA(hInternet, status_callback);
|
cb = pInternetSetStatusCallbackA(hInternet, status_callback);
|
||||||
ok(cb == NULL, "expected NULL got %p\n", cb);
|
ok(cb == NULL, "expected NULL got %p\n", cb);
|
||||||
|
|
||||||
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL,
|
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL,
|
||||||
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 1);
|
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 1);
|
||||||
if (!hFtp)
|
if (!hFtp)
|
||||||
{
|
{
|
||||||
@ -974,17 +974,17 @@ START_TEST(ftp)
|
|||||||
pInternetSetStatusCallbackA = (void*)GetProcAddress(hWininet, "InternetSetStatusCallbackA");
|
pInternetSetStatusCallbackA = (void*)GetProcAddress(hWininet, "InternetSetStatusCallbackA");
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
hInternet = InternetOpen("winetest", 0, NULL, NULL, 0);
|
hInternet = InternetOpenA("winetest", 0, NULL, NULL, 0);
|
||||||
ok(hInternet != NULL, "InternetOpen failed: %u\n", GetLastError());
|
ok(hInternet != NULL, "InternetOpen failed: %u\n", GetLastError());
|
||||||
|
|
||||||
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
|
||||||
if (!hFtp)
|
if (!hFtp)
|
||||||
{
|
{
|
||||||
InternetCloseHandle(hInternet);
|
InternetCloseHandle(hInternet);
|
||||||
skip("No ftp connection could be made to ftp.winehq.org\n");
|
skip("No ftp connection could be made to ftp.winehq.org\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
hHttp = InternetConnect(hInternet, "www.winehq.org", INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
|
hHttp = InternetConnectA(hInternet, "www.winehq.org", INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
|
||||||
if (!hHttp)
|
if (!hHttp)
|
||||||
{
|
{
|
||||||
InternetCloseHandle(hFtp);
|
InternetCloseHandle(hFtp);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -168,7 +168,7 @@ static void test_InternetQueryOptionA(void)
|
|||||||
len = 0xdeadbeef;
|
len = 0xdeadbeef;
|
||||||
retval = InternetQueryOptionA(NULL, INTERNET_OPTION_PROXY, NULL, &len);
|
retval = InternetQueryOptionA(NULL, INTERNET_OPTION_PROXY, NULL, &len);
|
||||||
ok(!retval && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got wrong error %x(%u)\n", retval, GetLastError());
|
ok(!retval && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got wrong error %x(%u)\n", retval, GetLastError());
|
||||||
ok(len >= sizeof(INTERNET_PROXY_INFO) && len != 0xdeadbeef,"len = %u\n", len);
|
ok(len >= sizeof(INTERNET_PROXY_INFOA) && len != 0xdeadbeef,"len = %u\n", len);
|
||||||
|
|
||||||
hinet = InternetOpenA(useragent,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL, 0);
|
hinet = InternetOpenA(useragent,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL, 0);
|
||||||
ok((hinet != 0x0),"InternetOpen Failed\n");
|
ok((hinet != 0x0),"InternetOpen Failed\n");
|
||||||
@ -362,7 +362,7 @@ static void test_get_cookie(void)
|
|||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = InternetGetCookie("http://www.example.com", NULL, NULL, &len);
|
ret = InternetGetCookieA("http://www.example.com", NULL, NULL, &len);
|
||||||
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS,
|
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS,
|
||||||
"InternetGetCookie should have failed with %s and error %d\n",
|
"InternetGetCookie should have failed with %s and error %d\n",
|
||||||
ret ? "TRUE" : "FALSE", GetLastError());
|
ret ? "TRUE" : "FALSE", GetLastError());
|
||||||
@ -381,33 +381,33 @@ static void test_complicated_cookie(void)
|
|||||||
static const WCHAR testing_example_comW[] =
|
static const WCHAR testing_example_comW[] =
|
||||||
{'h','t','t','p',':','/','/','t','e','s','t','i','n','g','.','e','x','a','m','p','l','e','.','c','o','m',0};
|
{'h','t','t','p',':','/','/','t','e','s','t','i','n','g','.','e','x','a','m','p','l','e','.','c','o','m',0};
|
||||||
|
|
||||||
ret = InternetSetCookie("http://www.example.com/bar",NULL,"A=B; domain=.example.com");
|
ret = InternetSetCookieA("http://www.example.com/bar",NULL,"A=B; domain=.example.com");
|
||||||
ok(ret == TRUE,"InternetSetCookie failed\n");
|
ok(ret == TRUE,"InternetSetCookie failed\n");
|
||||||
ret = InternetSetCookie("http://www.example.com/bar",NULL,"C=D; domain=.example.com; path=/");
|
ret = InternetSetCookieA("http://www.example.com/bar",NULL,"C=D; domain=.example.com; path=/");
|
||||||
ok(ret == TRUE,"InternetSetCookie failed\n");
|
ok(ret == TRUE,"InternetSetCookie failed\n");
|
||||||
|
|
||||||
/* Technically illegal! domain should require 2 dots, but native wininet accepts it */
|
/* Technically illegal! domain should require 2 dots, but native wininet accepts it */
|
||||||
ret = InternetSetCookie("http://www.example.com",NULL,"E=F; domain=example.com");
|
ret = InternetSetCookieA("http://www.example.com",NULL,"E=F; domain=example.com");
|
||||||
ok(ret == TRUE,"InternetSetCookie failed\n");
|
ok(ret == TRUE,"InternetSetCookie failed\n");
|
||||||
ret = InternetSetCookie("http://www.example.com",NULL,"G=H; domain=.example.com; path=/foo");
|
ret = InternetSetCookieA("http://www.example.com",NULL,"G=H; domain=.example.com; path=/foo");
|
||||||
ok(ret == TRUE,"InternetSetCookie failed\n");
|
ok(ret == TRUE,"InternetSetCookie failed\n");
|
||||||
ret = InternetSetCookie("http://www.example.com/bar.html",NULL,"I=J; domain=.example.com");
|
ret = InternetSetCookieA("http://www.example.com/bar.html",NULL,"I=J; domain=.example.com");
|
||||||
ok(ret == TRUE,"InternetSetCookie failed\n");
|
ok(ret == TRUE,"InternetSetCookie failed\n");
|
||||||
ret = InternetSetCookie("http://www.example.com/bar/",NULL,"K=L; domain=.example.com");
|
ret = InternetSetCookieA("http://www.example.com/bar/",NULL,"K=L; domain=.example.com");
|
||||||
ok(ret == TRUE,"InternetSetCookie failed\n");
|
ok(ret == TRUE,"InternetSetCookie failed\n");
|
||||||
ret = InternetSetCookie("http://www.example.com/bar/",NULL,"M=N; domain=.example.com; path=/foo/");
|
ret = InternetSetCookieA("http://www.example.com/bar/",NULL,"M=N; domain=.example.com; path=/foo/");
|
||||||
ok(ret == TRUE,"InternetSetCookie failed\n");
|
ok(ret == TRUE,"InternetSetCookie failed\n");
|
||||||
ret = InternetSetCookie("http://www.example.com/bar/",NULL,"O=P; secure; path=/bar");
|
ret = InternetSetCookieA("http://www.example.com/bar/",NULL,"O=P; secure; path=/bar");
|
||||||
ok(ret == TRUE,"InternetSetCookie failed\n");
|
ok(ret == TRUE,"InternetSetCookie failed\n");
|
||||||
|
|
||||||
len = 1024;
|
len = 1024;
|
||||||
ret = InternetGetCookie("http://testing.example.com", NULL, NULL, &len);
|
ret = InternetGetCookieA("http://testing.example.com", NULL, NULL, &len);
|
||||||
ok(ret == TRUE,"InternetGetCookie failed\n");
|
ok(ret == TRUE,"InternetGetCookie failed\n");
|
||||||
ok(len == 19, "len = %u\n", len);
|
ok(len == 19, "len = %u\n", len);
|
||||||
|
|
||||||
len = 1024;
|
len = 1024;
|
||||||
memset(buffer, 0xac, sizeof(buffer));
|
memset(buffer, 0xac, sizeof(buffer));
|
||||||
ret = InternetGetCookie("http://testing.example.com", NULL, buffer, &len);
|
ret = InternetGetCookieA("http://testing.example.com", NULL, buffer, &len);
|
||||||
ok(ret == TRUE,"InternetGetCookie failed\n");
|
ok(ret == TRUE,"InternetGetCookie failed\n");
|
||||||
ok(len == 19, "len = %u\n", len);
|
ok(len == 19, "len = %u\n", len);
|
||||||
ok(strlen(buffer) == 18, "strlen(buffer) = %u\n", lstrlenA(buffer));
|
ok(strlen(buffer) == 18, "strlen(buffer) = %u\n", lstrlenA(buffer));
|
||||||
@ -422,7 +422,7 @@ static void test_complicated_cookie(void)
|
|||||||
|
|
||||||
len = 10;
|
len = 10;
|
||||||
memset(buffer, 0xac, sizeof(buffer));
|
memset(buffer, 0xac, sizeof(buffer));
|
||||||
ret = InternetGetCookie("http://testing.example.com", NULL, buffer, &len);
|
ret = InternetGetCookieA("http://testing.example.com", NULL, buffer, &len);
|
||||||
ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
||||||
"InternetGetCookie returned: %x(%u), expected ERROR_INSUFFICIENT_BUFFER\n", ret, GetLastError());
|
"InternetGetCookie returned: %x(%u), expected ERROR_INSUFFICIENT_BUFFER\n", ret, GetLastError());
|
||||||
ok(len == 19, "len = %u\n", len);
|
ok(len == 19, "len = %u\n", len);
|
||||||
@ -447,7 +447,7 @@ static void test_complicated_cookie(void)
|
|||||||
ok(len == 38, "len = %u\n", len);
|
ok(len == 38, "len = %u\n", len);
|
||||||
|
|
||||||
len = 1024;
|
len = 1024;
|
||||||
ret = InternetGetCookie("http://testing.example.com/foobar", NULL, buffer, &len);
|
ret = InternetGetCookieA("http://testing.example.com/foobar", NULL, buffer, &len);
|
||||||
ok(ret == TRUE,"InternetGetCookie failed\n");
|
ok(ret == TRUE,"InternetGetCookie failed\n");
|
||||||
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
||||||
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
||||||
@ -459,7 +459,7 @@ static void test_complicated_cookie(void)
|
|||||||
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
||||||
|
|
||||||
len = 1024;
|
len = 1024;
|
||||||
ret = InternetGetCookie("http://testing.example.com/foobar/", NULL, buffer, &len);
|
ret = InternetGetCookieA("http://testing.example.com/foobar/", NULL, buffer, &len);
|
||||||
ok(ret == TRUE,"InternetGetCookie failed\n");
|
ok(ret == TRUE,"InternetGetCookie failed\n");
|
||||||
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
||||||
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
||||||
@ -471,7 +471,7 @@ static void test_complicated_cookie(void)
|
|||||||
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
||||||
|
|
||||||
len = 1024;
|
len = 1024;
|
||||||
ret = InternetGetCookie("http://testing.example.com/foo/bar", NULL, buffer, &len);
|
ret = InternetGetCookieA("http://testing.example.com/foo/bar", NULL, buffer, &len);
|
||||||
ok(ret == TRUE,"InternetGetCookie failed\n");
|
ok(ret == TRUE,"InternetGetCookie failed\n");
|
||||||
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
||||||
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
||||||
@ -483,7 +483,7 @@ static void test_complicated_cookie(void)
|
|||||||
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
||||||
|
|
||||||
len = 1024;
|
len = 1024;
|
||||||
ret = InternetGetCookie("http://testing.example.com/barfoo", NULL, buffer, &len);
|
ret = InternetGetCookieA("http://testing.example.com/barfoo", NULL, buffer, &len);
|
||||||
ok(ret == TRUE,"InternetGetCookie failed\n");
|
ok(ret == TRUE,"InternetGetCookie failed\n");
|
||||||
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
||||||
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
||||||
@ -495,7 +495,7 @@ static void test_complicated_cookie(void)
|
|||||||
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
||||||
|
|
||||||
len = 1024;
|
len = 1024;
|
||||||
ret = InternetGetCookie("http://testing.example.com/barfoo/", NULL, buffer, &len);
|
ret = InternetGetCookieA("http://testing.example.com/barfoo/", NULL, buffer, &len);
|
||||||
ok(ret == TRUE,"InternetGetCookie failed\n");
|
ok(ret == TRUE,"InternetGetCookie failed\n");
|
||||||
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
||||||
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
ok(strstr(buffer,"C=D")!=NULL,"C=D missing\n");
|
||||||
@ -507,7 +507,7 @@ static void test_complicated_cookie(void)
|
|||||||
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
ok(strstr(buffer,"O=P")==NULL,"O=P present\n");
|
||||||
|
|
||||||
len = 1024;
|
len = 1024;
|
||||||
ret = InternetGetCookie("http://testing.example.com/bar/foo", NULL, buffer, &len);
|
ret = InternetGetCookieA("http://testing.example.com/bar/foo", NULL, buffer, &len);
|
||||||
ok(ret == TRUE,"InternetGetCookie failed\n");
|
ok(ret == TRUE,"InternetGetCookie failed\n");
|
||||||
ok(len == 24, "len = %u\n", 24);
|
ok(len == 24, "len = %u\n", 24);
|
||||||
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
ok(strstr(buffer,"A=B")!=NULL,"A=B missing\n");
|
||||||
@ -521,40 +521,40 @@ static void test_complicated_cookie(void)
|
|||||||
|
|
||||||
/* Cookie name argument is not implemented */
|
/* Cookie name argument is not implemented */
|
||||||
len = 1024;
|
len = 1024;
|
||||||
ret = InternetGetCookie("http://testing.example.com/bar/foo", "A", buffer, &len);
|
ret = InternetGetCookieA("http://testing.example.com/bar/foo", "A", buffer, &len);
|
||||||
ok(ret == TRUE,"InternetGetCookie failed\n");
|
ok(ret == TRUE,"InternetGetCookie failed\n");
|
||||||
ok(len == 24, "len = %u\n", 24);
|
ok(len == 24, "len = %u\n", 24);
|
||||||
|
|
||||||
/* test persistent cookies */
|
/* test persistent cookies */
|
||||||
ret = InternetSetCookie("http://testing.example.com", NULL, "A=B; expires=Fri, 01-Jan-2038 00:00:00 GMT");
|
ret = InternetSetCookieA("http://testing.example.com", NULL, "A=B; expires=Fri, 01-Jan-2038 00:00:00 GMT");
|
||||||
ok(ret, "InternetSetCookie failed with error %d\n", GetLastError());
|
ok(ret, "InternetSetCookie failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
len = sizeof(user);
|
len = sizeof(user);
|
||||||
ret = GetUserName(user, &len);
|
ret = GetUserNameA(user, &len);
|
||||||
ok(ret, "GetUserName failed with error %d\n", GetLastError());
|
ok(ret, "GetUserName failed with error %d\n", GetLastError());
|
||||||
for(; len>0; len--)
|
for(; len>0; len--)
|
||||||
user[len-1] = tolower(user[len-1]);
|
user[len-1] = tolower(user[len-1]);
|
||||||
|
|
||||||
sprintf(buffer, "Cookie:%s@testing.example.com/", user);
|
sprintf(buffer, "Cookie:%s@testing.example.com/", user);
|
||||||
ret = GetUrlCacheEntryInfo(buffer, NULL, &len);
|
ret = GetUrlCacheEntryInfoA(buffer, NULL, &len);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo succeeded\n");
|
ok(!ret, "GetUrlCacheEntryInfo succeeded\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %d\n", GetLastError());
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %d\n", GetLastError());
|
||||||
|
|
||||||
/* remove persistent cookie */
|
/* remove persistent cookie */
|
||||||
ret = InternetSetCookie("http://testing.example.com", NULL, "A=B");
|
ret = InternetSetCookieA("http://testing.example.com", NULL, "A=B");
|
||||||
ok(ret, "InternetSetCookie failed with error %d\n", GetLastError());
|
ok(ret, "InternetSetCookie failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
ret = GetUrlCacheEntryInfo(buffer, NULL, &len);
|
ret = GetUrlCacheEntryInfoA(buffer, NULL, &len);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo succeeded\n");
|
ok(!ret, "GetUrlCacheEntryInfo succeeded\n");
|
||||||
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() = %d\n", GetLastError());
|
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() = %d\n", GetLastError());
|
||||||
|
|
||||||
/* try setting cookie for different domain */
|
/* try setting cookie for different domain */
|
||||||
ret = InternetSetCookie("http://www.aaa.example.com/bar",NULL,"E=F; domain=different.com");
|
ret = InternetSetCookieA("http://www.aaa.example.com/bar",NULL,"E=F; domain=different.com");
|
||||||
ok(!ret, "InternetSetCookie succeeded\n");
|
ok(!ret, "InternetSetCookie succeeded\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %d\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %d\n", GetLastError());
|
||||||
ret = InternetSetCookie("http://www.aaa.example.com.pl/bar",NULL,"E=F; domain=example.com.pl");
|
ret = InternetSetCookieA("http://www.aaa.example.com.pl/bar",NULL,"E=F; domain=example.com.pl");
|
||||||
ok(ret, "InternetSetCookie failed with error: %d\n", GetLastError());
|
ok(ret, "InternetSetCookie failed with error: %d\n", GetLastError());
|
||||||
ret = InternetSetCookie("http://www.aaa.example.com.pl/bar",NULL,"E=F; domain=com.pl");
|
ret = InternetSetCookieA("http://www.aaa.example.com.pl/bar",NULL,"E=F; domain=com.pl");
|
||||||
todo_wine ok(!ret, "InternetSetCookie succeeded\n");
|
todo_wine ok(!ret, "InternetSetCookie succeeded\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1025,11 +1025,11 @@ static void test_InternetSetOption(void)
|
|||||||
DWORD size;
|
DWORD size;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
ses = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
|
ses = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
|
||||||
ok(ses != 0, "InternetOpen failed: 0x%08x\n", GetLastError());
|
ok(ses != 0, "InternetOpen failed: 0x%08x\n", GetLastError());
|
||||||
con = InternetConnect(ses, "www.winehq.org", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
|
con = InternetConnectA(ses, "www.winehq.org", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
|
||||||
ok(con != 0, "InternetConnect failed: 0x%08x\n", GetLastError());
|
ok(con != 0, "InternetConnect failed: 0x%08x\n", GetLastError());
|
||||||
req = HttpOpenRequest(con, "GET", "/", NULL, NULL, NULL, 0, 0);
|
req = HttpOpenRequestA(con, "GET", "/", NULL, NULL, NULL, 0, 0);
|
||||||
ok(req != 0, "HttpOpenRequest failed: 0x%08x\n", GetLastError());
|
ok(req != 0, "HttpOpenRequest failed: 0x%08x\n", GetLastError());
|
||||||
|
|
||||||
/* INTERNET_OPTION_POLICY tests */
|
/* INTERNET_OPTION_POLICY tests */
|
||||||
@ -1054,31 +1054,31 @@ static void test_InternetSetOption(void)
|
|||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ulArg = 11;
|
ulArg = 11;
|
||||||
ret = InternetSetOption(NULL, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
|
ret = InternetSetOptionA(NULL, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
|
||||||
ok(ret == FALSE, "InternetQueryOption should've failed\n");
|
ok(ret == FALSE, "InternetQueryOption should've failed\n");
|
||||||
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError());
|
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ulArg = 11;
|
ulArg = 11;
|
||||||
ret = InternetSetOption(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, 20);
|
ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, 20);
|
||||||
ok(ret == FALSE, "InternetQueryOption should've failed\n");
|
ok(ret == FALSE, "InternetQueryOption should've failed\n");
|
||||||
ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %d\n", GetLastError());
|
ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %d\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ulArg = 11;
|
ulArg = 11;
|
||||||
ret = InternetSetOption(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
|
ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
|
||||||
ok(ret == TRUE, "InternetQueryOption should've succeeded\n");
|
ok(ret == TRUE, "InternetQueryOption should've succeeded\n");
|
||||||
ok(GetLastError() == 0xdeadbeef, "GetLastError() = %d\n", GetLastError());
|
ok(GetLastError() == 0xdeadbeef, "GetLastError() = %d\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ulArg = 4;
|
ulArg = 4;
|
||||||
ret = InternetSetOption(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
|
ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
|
||||||
ok(ret == FALSE, "InternetQueryOption should've failed\n");
|
ok(ret == FALSE, "InternetQueryOption should've failed\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ulArg = 16;
|
ulArg = 16;
|
||||||
ret = InternetSetOption(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
|
ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG));
|
||||||
ok(ret == FALSE, "InternetQueryOption should've failed\n");
|
ok(ret == FALSE, "InternetQueryOption should've failed\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError());
|
||||||
|
|
||||||
@ -1348,11 +1348,11 @@ static void test_InternetErrorDlg(void)
|
|||||||
res = InternetErrorDlg(NULL, NULL, 12055, flags, NULL);
|
res = InternetErrorDlg(NULL, NULL, 12055, flags, NULL);
|
||||||
ok(res == ERROR_INVALID_HANDLE, "Got %d\n", res);
|
ok(res == ERROR_INVALID_HANDLE, "Got %d\n", res);
|
||||||
|
|
||||||
ses = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
|
ses = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
|
||||||
ok(ses != 0, "InternetOpen failed: 0x%08x\n", GetLastError());
|
ok(ses != 0, "InternetOpen failed: 0x%08x\n", GetLastError());
|
||||||
con = InternetConnect(ses, "www.winehq.org", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
|
con = InternetConnectA(ses, "www.winehq.org", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
|
||||||
ok(con != 0, "InternetConnect failed: 0x%08x\n", GetLastError());
|
ok(con != 0, "InternetConnect failed: 0x%08x\n", GetLastError());
|
||||||
req = HttpOpenRequest(con, "GET", "/", NULL, NULL, NULL, 0, 0);
|
req = HttpOpenRequestA(con, "GET", "/", NULL, NULL, NULL, 0, 0);
|
||||||
ok(req != 0, "HttpOpenRequest failed: 0x%08x\n", GetLastError());
|
ok(req != 0, "HttpOpenRequest failed: 0x%08x\n", GetLastError());
|
||||||
|
|
||||||
/* NULL hwnd and FLAGS_ERROR_UI_FLAGS_NO_UI not set */
|
/* NULL hwnd and FLAGS_ERROR_UI_FLAGS_NO_UI not set */
|
||||||
|
@ -517,7 +517,7 @@ static void InternetCrackUrl_test(void)
|
|||||||
ret, GLE);
|
ret, GLE);
|
||||||
|
|
||||||
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
|
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
|
||||||
ret = InternetCrackUrl("about://host/blank", 0,0,&urlComponents);
|
ret = InternetCrackUrlA("about://host/blank", 0,0,&urlComponents);
|
||||||
ok(ret, "InternetCrackUrl failed with %d\n", GetLastError());
|
ok(ret, "InternetCrackUrl failed with %d\n", GetLastError());
|
||||||
ok(!strcmp(urlComponents.lpszScheme, "about"), "lpszScheme was \"%s\" instead of \"about\"\n", urlComponents.lpszScheme);
|
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.lpszHostName, "host"), "lpszHostName was \"%s\" instead of \"host\"\n", urlComponents.lpszHostName);
|
||||||
@ -526,7 +526,7 @@ static void InternetCrackUrl_test(void)
|
|||||||
/* try a NULL lpszUrl */
|
/* try a NULL lpszUrl */
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
|
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
|
||||||
ret = InternetCrackUrl(NULL, 0, 0, &urlComponents);
|
ret = InternetCrackUrlA(NULL, 0, 0, &urlComponents);
|
||||||
GLE = GetLastError();
|
GLE = GetLastError();
|
||||||
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
|
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 %d\n", GLE);
|
||||||
@ -536,7 +536,7 @@ static void InternetCrackUrl_test(void)
|
|||||||
*/
|
*/
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
|
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
|
||||||
ret = InternetCrackUrl("", 0, 0, &urlComponents);
|
ret = InternetCrackUrlA("", 0, 0, &urlComponents);
|
||||||
GLE = GetLastError();
|
GLE = GetLastError();
|
||||||
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
|
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
|
||||||
ok(GLE != 0xdeadbeef && GLE != ERROR_SUCCESS, "Expected GLE to represent a failure\n");
|
ok(GLE != 0xdeadbeef && GLE != ERROR_SUCCESS, "Expected GLE to represent a failure\n");
|
||||||
@ -746,7 +746,7 @@ static void InternetCrackUrlW_test(void)
|
|||||||
ok( urlpart[0] == 0, "urlpart should be empty\n");
|
ok( urlpart[0] == 0, "urlpart should be empty\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fill_url_components(LPURL_COMPONENTS lpUrlComponents)
|
static void fill_url_components(URL_COMPONENTSA *lpUrlComponents)
|
||||||
{
|
{
|
||||||
static CHAR http[] = "http",
|
static CHAR http[] = "http",
|
||||||
winehq[] = "www.winehq.org",
|
winehq[] = "www.winehq.org",
|
||||||
@ -755,7 +755,7 @@ static void fill_url_components(LPURL_COMPONENTS lpUrlComponents)
|
|||||||
site_about[] = "/site/about",
|
site_about[] = "/site/about",
|
||||||
empty[] = "";
|
empty[] = "";
|
||||||
|
|
||||||
lpUrlComponents->dwStructSize = sizeof(URL_COMPONENTS);
|
lpUrlComponents->dwStructSize = sizeof(URL_COMPONENTSA);
|
||||||
lpUrlComponents->lpszScheme = http;
|
lpUrlComponents->lpszScheme = http;
|
||||||
lpUrlComponents->dwSchemeLength = strlen(lpUrlComponents->lpszScheme);
|
lpUrlComponents->dwSchemeLength = strlen(lpUrlComponents->lpszScheme);
|
||||||
lpUrlComponents->nScheme = INTERNET_SCHEME_HTTP;
|
lpUrlComponents->nScheme = INTERNET_SCHEME_HTTP;
|
||||||
@ -774,7 +774,7 @@ static void fill_url_components(LPURL_COMPONENTS lpUrlComponents)
|
|||||||
|
|
||||||
static void InternetCreateUrlA_test(void)
|
static void InternetCreateUrlA_test(void)
|
||||||
{
|
{
|
||||||
URL_COMPONENTS urlComp;
|
URL_COMPONENTSA urlComp;
|
||||||
LPSTR szUrl;
|
LPSTR szUrl;
|
||||||
DWORD len = -1;
|
DWORD len = -1;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
@ -802,7 +802,7 @@ static void InternetCreateUrlA_test(void)
|
|||||||
ok(len == -1, "Expected len -1, got %d\n", len);
|
ok(len == -1, "Expected len -1, got %d\n", len);
|
||||||
|
|
||||||
/* test zero'ed lpUrlComponents */
|
/* test zero'ed lpUrlComponents */
|
||||||
ZeroMemory(&urlComp, sizeof(URL_COMPONENTS));
|
ZeroMemory(&urlComp, sizeof(urlComp));
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = InternetCreateUrlA(&urlComp, 0, NULL, &len);
|
ret = InternetCreateUrlA(&urlComp, 0, NULL, &len);
|
||||||
ok(!ret, "Expected failure\n");
|
ok(!ret, "Expected failure\n");
|
||||||
@ -992,7 +992,7 @@ static void InternetCreateUrlA_test(void)
|
|||||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||||
|
|
||||||
memset(&urlComp, 0, sizeof(urlComp));
|
memset(&urlComp, 0, sizeof(urlComp));
|
||||||
urlComp.dwStructSize = sizeof(URL_COMPONENTS);
|
urlComp.dwStructSize = sizeof(urlComp);
|
||||||
urlComp.lpszScheme = http;
|
urlComp.lpszScheme = http;
|
||||||
urlComp.dwSchemeLength = 0;
|
urlComp.dwSchemeLength = 0;
|
||||||
urlComp.nScheme = INTERNET_SCHEME_HTTP;
|
urlComp.nScheme = INTERNET_SCHEME_HTTP;
|
||||||
@ -1017,7 +1017,7 @@ static void InternetCreateUrlA_test(void)
|
|||||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||||
|
|
||||||
memset(&urlComp, 0, sizeof(urlComp));
|
memset(&urlComp, 0, sizeof(urlComp));
|
||||||
urlComp.dwStructSize = sizeof(URL_COMPONENTS);
|
urlComp.dwStructSize = sizeof(urlComp);
|
||||||
urlComp.lpszScheme = https;
|
urlComp.lpszScheme = https;
|
||||||
urlComp.dwSchemeLength = 0;
|
urlComp.dwSchemeLength = 0;
|
||||||
urlComp.nScheme = INTERNET_SCHEME_HTTP;
|
urlComp.nScheme = INTERNET_SCHEME_HTTP;
|
||||||
@ -1042,7 +1042,7 @@ static void InternetCreateUrlA_test(void)
|
|||||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||||
|
|
||||||
memset(&urlComp, 0, sizeof(urlComp));
|
memset(&urlComp, 0, sizeof(urlComp));
|
||||||
urlComp.dwStructSize = sizeof(URL_COMPONENTS);
|
urlComp.dwStructSize = sizeof(urlComp);
|
||||||
urlComp.lpszScheme = about;
|
urlComp.lpszScheme = about;
|
||||||
urlComp.dwSchemeLength = 5;
|
urlComp.dwSchemeLength = 5;
|
||||||
urlComp.lpszUrlPath = blank;
|
urlComp.lpszUrlPath = blank;
|
||||||
@ -1058,7 +1058,7 @@ static void InternetCreateUrlA_test(void)
|
|||||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||||
|
|
||||||
memset(&urlComp, 0, sizeof(urlComp));
|
memset(&urlComp, 0, sizeof(urlComp));
|
||||||
urlComp.dwStructSize = sizeof(URL_COMPONENTS);
|
urlComp.dwStructSize = sizeof(urlComp);
|
||||||
urlComp.lpszScheme = about;
|
urlComp.lpszScheme = about;
|
||||||
urlComp.lpszHostName = host;
|
urlComp.lpszHostName = host;
|
||||||
urlComp.lpszUrlPath = blank;
|
urlComp.lpszUrlPath = blank;
|
||||||
@ -1073,7 +1073,7 @@ static void InternetCreateUrlA_test(void)
|
|||||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||||
|
|
||||||
memset(&urlComp, 0, sizeof(urlComp));
|
memset(&urlComp, 0, sizeof(urlComp));
|
||||||
urlComp.dwStructSize = sizeof(URL_COMPONENTS);
|
urlComp.dwStructSize = sizeof(urlComp);
|
||||||
urlComp.nPort = 8080;
|
urlComp.nPort = 8080;
|
||||||
urlComp.lpszScheme = about;
|
urlComp.lpszScheme = about;
|
||||||
len = strlen(CREATE_URL11);
|
len = strlen(CREATE_URL11);
|
||||||
@ -1086,7 +1086,7 @@ static void InternetCreateUrlA_test(void)
|
|||||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||||
|
|
||||||
memset(&urlComp, 0, sizeof(urlComp));
|
memset(&urlComp, 0, sizeof(urlComp));
|
||||||
urlComp.dwStructSize = sizeof(URL_COMPONENTS);
|
urlComp.dwStructSize = sizeof(urlComp);
|
||||||
urlComp.lpszScheme = http;
|
urlComp.lpszScheme = http;
|
||||||
urlComp.dwSchemeLength = 0;
|
urlComp.dwSchemeLength = 0;
|
||||||
urlComp.nScheme = INTERNET_SCHEME_HTTP;
|
urlComp.nScheme = INTERNET_SCHEME_HTTP;
|
||||||
@ -1103,7 +1103,7 @@ static void InternetCreateUrlA_test(void)
|
|||||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||||
|
|
||||||
memset(&urlComp, 0, sizeof(urlComp));
|
memset(&urlComp, 0, sizeof(urlComp));
|
||||||
urlComp.dwStructSize = sizeof(URL_COMPONENTS);
|
urlComp.dwStructSize = sizeof(urlComp);
|
||||||
urlComp.lpszScheme = http;
|
urlComp.lpszScheme = http;
|
||||||
urlComp.dwSchemeLength = strlen(urlComp.lpszScheme);
|
urlComp.dwSchemeLength = strlen(urlComp.lpszScheme);
|
||||||
urlComp.lpszHostName = localhost;
|
urlComp.lpszHostName = localhost;
|
||||||
|
@ -44,7 +44,7 @@ static char filenameA[MAX_PATH + 1];
|
|||||||
static char filenameA1[MAX_PATH + 1];
|
static char filenameA1[MAX_PATH + 1];
|
||||||
static BOOL old_ie = FALSE;
|
static BOOL old_ie = FALSE;
|
||||||
|
|
||||||
static void check_cache_entry_infoA(const char *returnedfrom, LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo)
|
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 %d\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->lpszSourceUrlName, test_url), "%s: lpszSourceUrlName should be %s instead of %s\n", returnedfrom, test_url, lpCacheEntryInfo->lpszSourceUrlName);
|
||||||
@ -59,16 +59,16 @@ static void test_find_url_cache_entriesA(void)
|
|||||||
BOOL found = FALSE;
|
BOOL found = FALSE;
|
||||||
DWORD cbCacheEntryInfo;
|
DWORD cbCacheEntryInfo;
|
||||||
DWORD cbCacheEntryInfoSaved;
|
DWORD cbCacheEntryInfoSaved;
|
||||||
LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo;
|
INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo;
|
||||||
|
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
hEnumHandle = FindFirstUrlCacheEntry(NULL, NULL, &cbCacheEntryInfo);
|
hEnumHandle = FindFirstUrlCacheEntryA(NULL, NULL, &cbCacheEntryInfo);
|
||||||
ok(!hEnumHandle, "FindFirstUrlCacheEntry should have failed\n");
|
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 %d\n", GetLastError());
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo * sizeof(char));
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo * sizeof(char));
|
||||||
cbCacheEntryInfoSaved = cbCacheEntryInfo;
|
cbCacheEntryInfoSaved = cbCacheEntryInfo;
|
||||||
hEnumHandle = FindFirstUrlCacheEntry(NULL, lpCacheEntryInfo, &cbCacheEntryInfo);
|
hEnumHandle = FindFirstUrlCacheEntryA(NULL, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(hEnumHandle != NULL, "FindFirstUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(hEnumHandle != NULL, "FindFirstUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
@ -80,14 +80,14 @@ static void test_find_url_cache_entriesA(void)
|
|||||||
}
|
}
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
cbCacheEntryInfo = cbCacheEntryInfoSaved;
|
cbCacheEntryInfo = cbCacheEntryInfoSaved;
|
||||||
ret = FindNextUrlCacheEntry(hEnumHandle, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = FindNextUrlCacheEntryA(hEnumHandle, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
||||||
{
|
{
|
||||||
lpCacheEntryInfo = HeapReAlloc(GetProcessHeap(), 0, lpCacheEntryInfo, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapReAlloc(GetProcessHeap(), 0, lpCacheEntryInfo, cbCacheEntryInfo);
|
||||||
cbCacheEntryInfoSaved = cbCacheEntryInfo;
|
cbCacheEntryInfoSaved = cbCacheEntryInfo;
|
||||||
ret = FindNextUrlCacheEntry(hEnumHandle, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = FindNextUrlCacheEntryA(hEnumHandle, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ret)
|
if (!ret)
|
||||||
@ -104,27 +104,27 @@ static void test_GetUrlCacheEntryInfoExA(void)
|
|||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
DWORD cbCacheEntryInfo, cbRedirectUrl;
|
DWORD cbCacheEntryInfo, cbRedirectUrl;
|
||||||
LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo;
|
INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo;
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfoEx(NULL, NULL, NULL, NULL, NULL, NULL, 0);
|
ret = GetUrlCacheEntryInfoExA(NULL, NULL, NULL, NULL, NULL, NULL, 0);
|
||||||
ok(!ret, "GetUrlCacheEntryInfoEx with NULL URL and NULL args should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfoEx with NULL URL and NULL args should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
cbCacheEntryInfo = sizeof(INTERNET_CACHE_ENTRY_INFO);
|
cbCacheEntryInfo = sizeof(INTERNET_CACHE_ENTRY_INFOA);
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfoEx("", NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
|
ret = GetUrlCacheEntryInfoExA("", NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
|
||||||
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
|
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
|
||||||
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
ret = GetUrlCacheEntryInfoEx(test_url, NULL, NULL, NULL, NULL, NULL, 0);
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfoEx(test_url, NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
|
ret = GetUrlCacheEntryInfoExA(test_url, NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
|
||||||
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
|
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
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 %d\n", GetLastError());
|
||||||
@ -132,7 +132,7 @@ static void test_GetUrlCacheEntryInfoExA(void)
|
|||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfoEx(test_url, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
|
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
|
||||||
ok(!ret, "GetUrlCacheEntryInfoEx succeeded\n");
|
ok(!ret, "GetUrlCacheEntryInfoEx succeeded\n");
|
||||||
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
|
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 %d\n", GetLastError());
|
||||||
@ -141,7 +141,7 @@ static void test_GetUrlCacheEntryInfoExA(void)
|
|||||||
ret = GetUrlCacheEntryInfoExW(test_urlW, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
ret = GetUrlCacheEntryInfoEx(test_url, lpCacheEntryInfo, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
if (ret) check_cache_entry_infoA("GetUrlCacheEntryInfoEx", lpCacheEntryInfo);
|
if (ret) check_cache_entry_infoA("GetUrlCacheEntryInfoEx", lpCacheEntryInfo);
|
||||||
@ -151,12 +151,12 @@ static void test_GetUrlCacheEntryInfoExA(void)
|
|||||||
ok(ret, "SetUrlCacheEntryInfoA failed with error %d\n", GetLastError());
|
ok(ret, "SetUrlCacheEntryInfoA failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfoEx(test_url, NULL, NULL, NULL, NULL, NULL, 0x200 /*GET_INSTALLED_ENTRY*/);
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
cbCacheEntryInfo = 100000;
|
cbCacheEntryInfo = 100000;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfoEx(test_url, NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
|
ret = GetUrlCacheEntryInfoExA(test_url, NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
|
||||||
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
@ -164,12 +164,12 @@ static void test_GetUrlCacheEntryInfoExA(void)
|
|||||||
|
|
||||||
/* Querying the redirect URL fails with ERROR_INVALID_PARAMETER */
|
/* Querying the redirect URL fails with ERROR_INVALID_PARAMETER */
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfoEx(test_url, NULL, NULL, NULL, &cbRedirectUrl, NULL, 0);
|
ret = GetUrlCacheEntryInfoExA(test_url, NULL, NULL, NULL, &cbRedirectUrl, NULL, 0);
|
||||||
ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfoEx(test_url, NULL, &cbCacheEntryInfo, NULL, &cbRedirectUrl, NULL, 0);
|
ret = GetUrlCacheEntryInfoExA(test_url, NULL, &cbCacheEntryInfo, NULL, &cbRedirectUrl, NULL, 0);
|
||||||
ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
@ -182,7 +182,7 @@ static void test_RetrieveUrlCacheEntryA(void)
|
|||||||
|
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = RetrieveUrlCacheEntryFile(NULL, NULL, &cbCacheEntryInfo, 0);
|
ret = RetrieveUrlCacheEntryFileA(NULL, NULL, &cbCacheEntryInfo, 0);
|
||||||
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
@ -190,14 +190,14 @@ static void test_RetrieveUrlCacheEntryA(void)
|
|||||||
{
|
{
|
||||||
/* Crashes on Win9x, NT4 and W2K */
|
/* Crashes on Win9x, NT4 and W2K */
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = RetrieveUrlCacheEntryFile(test_url, NULL, NULL, 0);
|
ret = RetrieveUrlCacheEntryFileA(test_url, NULL, NULL, 0);
|
||||||
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
|
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 %d\n", GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
cbCacheEntryInfo = 100000;
|
cbCacheEntryInfo = 100000;
|
||||||
ret = RetrieveUrlCacheEntryFile(NULL, NULL, &cbCacheEntryInfo, 0);
|
ret = RetrieveUrlCacheEntryFileA(NULL, NULL, &cbCacheEntryInfo, 0);
|
||||||
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
|
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 %d\n", GetLastError());
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ static void test_IsUrlCacheEntryExpiredA(void)
|
|||||||
BOOL ret;
|
BOOL ret;
|
||||||
FILETIME ft;
|
FILETIME ft;
|
||||||
DWORD size;
|
DWORD size;
|
||||||
LPINTERNET_CACHE_ENTRY_INFO info;
|
INTERNET_CACHE_ENTRY_INFOA *info;
|
||||||
ULARGE_INTEGER exp_time;
|
ULARGE_INTEGER exp_time;
|
||||||
|
|
||||||
/* The function returns TRUE when the output time is NULL or the tested URL
|
/* The function returns TRUE when the output time is NULL or the tested URL
|
||||||
@ -249,12 +249,12 @@ static void test_IsUrlCacheEntryExpiredA(void)
|
|||||||
ft.dwLowDateTime, ft.dwHighDateTime);
|
ft.dwLowDateTime, ft.dwHighDateTime);
|
||||||
|
|
||||||
/* Set the expire time to a point in the past.. */
|
/* Set the expire time to a point in the past.. */
|
||||||
ret = GetUrlCacheEntryInfo(test_url, NULL, &size);
|
ret = GetUrlCacheEntryInfoA(test_url, NULL, &size);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
||||||
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
||||||
info = HeapAlloc(GetProcessHeap(), 0, size);
|
info = HeapAlloc(GetProcessHeap(), 0, size);
|
||||||
ret = GetUrlCacheEntryInfo(test_url, info, &size);
|
ret = GetUrlCacheEntryInfoA(test_url, info, &size);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
||||||
GetSystemTimeAsFileTime(&info->ExpireTime);
|
GetSystemTimeAsFileTime(&info->ExpireTime);
|
||||||
exp_time.u.LowPart = info->ExpireTime.dwLowDateTime;
|
exp_time.u.LowPart = info->ExpireTime.dwLowDateTime;
|
||||||
@ -262,7 +262,7 @@ static void test_IsUrlCacheEntryExpiredA(void)
|
|||||||
exp_time.QuadPart -= 10 * 60 * (ULONGLONG)10000000;
|
exp_time.QuadPart -= 10 * 60 * (ULONGLONG)10000000;
|
||||||
info->ExpireTime.dwLowDateTime = exp_time.u.LowPart;
|
info->ExpireTime.dwLowDateTime = exp_time.u.LowPart;
|
||||||
info->ExpireTime.dwHighDateTime = exp_time.u.HighPart;
|
info->ExpireTime.dwHighDateTime = exp_time.u.HighPart;
|
||||||
ret = SetUrlCacheEntryInfo(test_url, info, CACHE_ENTRY_EXPTIME_FC);
|
ret = SetUrlCacheEntryInfoA(test_url, info, CACHE_ENTRY_EXPTIME_FC);
|
||||||
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
||||||
ft.dwLowDateTime = 0xdeadbeef;
|
ft.dwLowDateTime = 0xdeadbeef;
|
||||||
ft.dwHighDateTime = 0xbaadf00d;
|
ft.dwHighDateTime = 0xbaadf00d;
|
||||||
@ -277,7 +277,7 @@ static void test_IsUrlCacheEntryExpiredA(void)
|
|||||||
exp_time.QuadPart += 20 * 60 * (ULONGLONG)10000000;
|
exp_time.QuadPart += 20 * 60 * (ULONGLONG)10000000;
|
||||||
info->ExpireTime.dwLowDateTime = exp_time.u.LowPart;
|
info->ExpireTime.dwLowDateTime = exp_time.u.LowPart;
|
||||||
info->ExpireTime.dwHighDateTime = exp_time.u.HighPart;
|
info->ExpireTime.dwHighDateTime = exp_time.u.HighPart;
|
||||||
ret = SetUrlCacheEntryInfo(test_url, info, CACHE_ENTRY_EXPTIME_FC);
|
ret = SetUrlCacheEntryInfoA(test_url, info, CACHE_ENTRY_EXPTIME_FC);
|
||||||
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
||||||
ft.dwLowDateTime = 0xdeadbeef;
|
ft.dwLowDateTime = 0xdeadbeef;
|
||||||
ft.dwHighDateTime = 0xbaadf00d;
|
ft.dwHighDateTime = 0xbaadf00d;
|
||||||
@ -290,7 +290,7 @@ static void test_IsUrlCacheEntryExpiredA(void)
|
|||||||
ft.dwLowDateTime, ft.dwHighDateTime);
|
ft.dwLowDateTime, ft.dwHighDateTime);
|
||||||
/* Set the modified time... */
|
/* Set the modified time... */
|
||||||
GetSystemTimeAsFileTime(&info->LastModifiedTime);
|
GetSystemTimeAsFileTime(&info->LastModifiedTime);
|
||||||
ret = SetUrlCacheEntryInfo(test_url, info, CACHE_ENTRY_MODTIME_FC);
|
ret = SetUrlCacheEntryInfoA(test_url, info, CACHE_ENTRY_MODTIME_FC);
|
||||||
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
||||||
/* and the entry should still be unexpired.. */
|
/* and the entry should still be unexpired.. */
|
||||||
ret = IsUrlCacheEntryExpiredA(test_url, 0, &ft);
|
ret = IsUrlCacheEntryExpiredA(test_url, 0, &ft);
|
||||||
@ -365,16 +365,16 @@ static void test_urlcacheA(void)
|
|||||||
BOOL ret;
|
BOOL ret;
|
||||||
HANDLE hFile;
|
HANDLE hFile;
|
||||||
BYTE zero_byte = 0;
|
BYTE zero_byte = 0;
|
||||||
LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo;
|
INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo;
|
||||||
LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo2;
|
INTERNET_CACHE_ENTRY_INFOA *lpCacheEntryInfo2;
|
||||||
DWORD cbCacheEntryInfo;
|
DWORD cbCacheEntryInfo;
|
||||||
static const FILETIME filetime_zero;
|
static const FILETIME filetime_zero;
|
||||||
FILETIME now;
|
FILETIME now;
|
||||||
|
|
||||||
ret = CreateUrlCacheEntry(test_url, 0, "html", filenameA, 0);
|
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
|
||||||
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
ret = CreateUrlCacheEntry(test_url, 0, "html", filenameA1, 0);
|
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA1, 0);
|
||||||
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
check_file_exists(filenameA1);
|
check_file_exists(filenameA1);
|
||||||
DeleteFileA(filenameA1);
|
DeleteFileA(filenameA1);
|
||||||
@ -383,15 +383,15 @@ static void test_urlcacheA(void)
|
|||||||
|
|
||||||
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
|
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
|
||||||
|
|
||||||
ret = CommitUrlCacheEntry(test_url1, NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
|
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 %d\n", GetLastError());
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
ret = GetUrlCacheEntryInfo(test_url1, NULL, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url1, NULL, &cbCacheEntryInfo);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
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 %d\n", GetLastError());
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
ret = GetUrlCacheEntryInfo(test_url1, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url1, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
ok(!memcmp(&lpCacheEntryInfo->ExpireTime, &filetime_zero, sizeof(FILETIME)),
|
ok(!memcmp(&lpCacheEntryInfo->ExpireTime, &filetime_zero, sizeof(FILETIME)),
|
||||||
"expected zero ExpireTime\n");
|
"expected zero ExpireTime\n");
|
||||||
@ -409,16 +409,16 @@ static void test_urlcacheA(void)
|
|||||||
|
|
||||||
/* A subsequent commit with a different time/type doesn't change most of the entry */
|
/* A subsequent commit with a different time/type doesn't change most of the entry */
|
||||||
GetSystemTimeAsFileTime(&now);
|
GetSystemTimeAsFileTime(&now);
|
||||||
ret = CommitUrlCacheEntry(test_url1, NULL, now, now, NORMAL_CACHE_ENTRY,
|
ret = CommitUrlCacheEntryA(test_url1, NULL, now, now, NORMAL_CACHE_ENTRY,
|
||||||
(LPBYTE)ok_header, strlen(ok_header), NULL, NULL);
|
(LPBYTE)ok_header, strlen(ok_header), NULL, NULL);
|
||||||
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
ret = GetUrlCacheEntryInfo(test_url1, NULL, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url1, NULL, &cbCacheEntryInfo);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
||||||
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
||||||
lpCacheEntryInfo2 = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo2 = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
ret = GetUrlCacheEntryInfo(test_url1, lpCacheEntryInfo2, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url1, lpCacheEntryInfo2, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
/* but it does change the time.. */
|
/* but it does change the time.. */
|
||||||
ok(memcmp(&lpCacheEntryInfo2->ExpireTime, &filetime_zero, sizeof(FILETIME)),
|
ok(memcmp(&lpCacheEntryInfo2->ExpireTime, &filetime_zero, sizeof(FILETIME)),
|
||||||
@ -447,18 +447,18 @@ static void test_urlcacheA(void)
|
|||||||
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
|
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
|
||||||
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo2);
|
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo2);
|
||||||
|
|
||||||
ret = CommitUrlCacheEntry(test_url, filenameA, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = RetrieveUrlCacheEntryFile(test_url, NULL, &cbCacheEntryInfo, 0);
|
ret = RetrieveUrlCacheEntryFileA(test_url, NULL, &cbCacheEntryInfo, 0);
|
||||||
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
|
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
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 %d\n", GetLastError());
|
||||||
|
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
ret = RetrieveUrlCacheEntryFile(test_url, lpCacheEntryInfo, &cbCacheEntryInfo, 0);
|
ret = RetrieveUrlCacheEntryFileA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo, 0);
|
||||||
ok(ret, "RetrieveUrlCacheEntryFile failed with error %d\n", GetLastError());
|
ok(ret, "RetrieveUrlCacheEntryFile failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
if (ret) check_cache_entry_infoA("RetrieveUrlCacheEntryFile", lpCacheEntryInfo);
|
if (ret) check_cache_entry_infoA("RetrieveUrlCacheEntryFile", lpCacheEntryInfo);
|
||||||
@ -467,7 +467,7 @@ static void test_urlcacheA(void)
|
|||||||
|
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = RetrieveUrlCacheEntryFile(test_url1, NULL, &cbCacheEntryInfo, 0);
|
ret = RetrieveUrlCacheEntryFileA(test_url1, NULL, &cbCacheEntryInfo, 0);
|
||||||
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
|
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_DATA,
|
ok(GetLastError() == ERROR_INVALID_DATA,
|
||||||
"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 %d\n", GetLastError());
|
||||||
@ -494,14 +494,14 @@ static void test_urlcacheA(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = DeleteFile(filenameA);
|
ret = DeleteFileA(filenameA);
|
||||||
ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "local file should no longer exist\n");
|
ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "local file should no longer exist\n");
|
||||||
|
|
||||||
/* Creating two entries with the same URL */
|
/* Creating two entries with the same URL */
|
||||||
ret = CreateUrlCacheEntry(test_url, 0, "html", filenameA, 0);
|
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
|
||||||
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
ret = CreateUrlCacheEntry(test_url, 0, "html", filenameA1, 0);
|
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA1, 0);
|
||||||
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
ok(lstrcmpiA(filenameA, filenameA1), "expected a different file name\n");
|
ok(lstrcmpiA(filenameA, filenameA1), "expected a different file name\n");
|
||||||
@ -511,13 +511,13 @@ static void test_urlcacheA(void)
|
|||||||
check_file_exists(filenameA);
|
check_file_exists(filenameA);
|
||||||
check_file_exists(filenameA1);
|
check_file_exists(filenameA1);
|
||||||
|
|
||||||
ret = CommitUrlCacheEntry(test_url, filenameA, filetime_zero,
|
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero,
|
||||||
filetime_zero, NORMAL_CACHE_ENTRY, (LPBYTE)ok_header,
|
filetime_zero, NORMAL_CACHE_ENTRY, (LPBYTE)ok_header,
|
||||||
strlen(ok_header), "html", NULL);
|
strlen(ok_header), "html", NULL);
|
||||||
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
check_file_exists(filenameA);
|
check_file_exists(filenameA);
|
||||||
check_file_exists(filenameA1);
|
check_file_exists(filenameA1);
|
||||||
ret = CommitUrlCacheEntry(test_url, filenameA1, filetime_zero,
|
ret = CommitUrlCacheEntryA(test_url, filenameA1, filetime_zero,
|
||||||
filetime_zero, COOKIE_CACHE_ENTRY, NULL, 0, "html", NULL);
|
filetime_zero, COOKIE_CACHE_ENTRY, NULL, 0, "html", NULL);
|
||||||
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
/* By committing the same URL a second time, the prior entry is
|
/* By committing the same URL a second time, the prior entry is
|
||||||
@ -525,12 +525,12 @@ static void test_urlcacheA(void)
|
|||||||
*/
|
*/
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfo(test_url, NULL, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url, NULL, &cbCacheEntryInfo);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
||||||
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
ret = GetUrlCacheEntryInfo(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
/* with the previous entry type retained.. */
|
/* with the previous entry type retained.. */
|
||||||
ok(lpCacheEntryInfo->CacheEntryType & NORMAL_CACHE_ENTRY,
|
ok(lpCacheEntryInfo->CacheEntryType & NORMAL_CACHE_ENTRY,
|
||||||
@ -558,21 +558,21 @@ static void test_urlcacheA(void)
|
|||||||
/* Check whether a retrieved cache entry can be deleted before it's
|
/* Check whether a retrieved cache entry can be deleted before it's
|
||||||
* unlocked:
|
* unlocked:
|
||||||
*/
|
*/
|
||||||
ret = CreateUrlCacheEntry(test_url, 0, "html", filenameA, 0);
|
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
|
||||||
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
ret = CommitUrlCacheEntry(test_url, filenameA, filetime_zero, filetime_zero,
|
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero,
|
||||||
NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
|
NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);
|
||||||
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = RetrieveUrlCacheEntryFile(test_url, NULL, &cbCacheEntryInfo, 0);
|
ret = RetrieveUrlCacheEntryFileA(test_url, NULL, &cbCacheEntryInfo, 0);
|
||||||
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
|
ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
||||||
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
||||||
|
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
ret = RetrieveUrlCacheEntryFile(test_url, lpCacheEntryInfo,
|
ret = RetrieveUrlCacheEntryFileA(test_url, lpCacheEntryInfo,
|
||||||
&cbCacheEntryInfo, 0);
|
&cbCacheEntryInfo, 0);
|
||||||
ok(ret, "RetrieveUrlCacheEntryFile failed with error %d\n", GetLastError());
|
ok(ret, "RetrieveUrlCacheEntryFile failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
@ -589,7 +589,7 @@ static void test_urlcacheA(void)
|
|||||||
|
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
memset(lpCacheEntryInfo, 0, cbCacheEntryInfo);
|
memset(lpCacheEntryInfo, 0, cbCacheEntryInfo);
|
||||||
ret = GetUrlCacheEntryInfo(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
ok(lpCacheEntryInfo->CacheEntryType & 0x400000,
|
ok(lpCacheEntryInfo->CacheEntryType & 0x400000,
|
||||||
"CacheEntryType hasn't PENDING_DELETE_CACHE_ENTRY set, (flags %08x)\n",
|
"CacheEntryType hasn't PENDING_DELETE_CACHE_ENTRY set, (flags %08x)\n",
|
||||||
@ -620,13 +620,13 @@ static void test_urlcacheA(void)
|
|||||||
/* Test whether preventing a file from being deleted causes
|
/* Test whether preventing a file from being deleted causes
|
||||||
* DeleteUrlCacheEntryA to fail.
|
* DeleteUrlCacheEntryA to fail.
|
||||||
*/
|
*/
|
||||||
ret = CreateUrlCacheEntry(test_url, 0, "html", filenameA, 0);
|
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
|
||||||
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
|
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
|
||||||
check_file_exists(filenameA);
|
check_file_exists(filenameA);
|
||||||
|
|
||||||
ret = CommitUrlCacheEntry(test_url, filenameA, filetime_zero,
|
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero,
|
||||||
filetime_zero, NORMAL_CACHE_ENTRY, (LPBYTE)ok_header,
|
filetime_zero, NORMAL_CACHE_ENTRY, (LPBYTE)ok_header,
|
||||||
strlen(ok_header), "html", NULL);
|
strlen(ok_header), "html", NULL);
|
||||||
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
@ -658,35 +658,35 @@ static void test_urlcacheA(void)
|
|||||||
* must have been set already.
|
* must have been set already.
|
||||||
*/
|
*/
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = CommitUrlCacheEntry(test_url, NULL, filetime_zero, filetime_zero,
|
ret = CommitUrlCacheEntryA(test_url, NULL, filetime_zero, filetime_zero,
|
||||||
STICKY_CACHE_ENTRY, (LPBYTE)ok_header, strlen(ok_header), "html",
|
STICKY_CACHE_ENTRY, (LPBYTE)ok_header, strlen(ok_header), "html",
|
||||||
NULL);
|
NULL);
|
||||||
ok(!ret, "expected failure\n");
|
ok(!ret, "expected failure\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = CommitUrlCacheEntry(test_url, NULL, filetime_zero, filetime_zero,
|
ret = CommitUrlCacheEntryA(test_url, NULL, filetime_zero, filetime_zero,
|
||||||
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
|
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
|
||||||
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
|
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
|
||||||
ok(!ret, "expected failure\n");
|
ok(!ret, "expected failure\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
|
|
||||||
ret = CreateUrlCacheEntry(test_url, 0, "html", filenameA, 0);
|
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
|
||||||
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
|
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
|
||||||
ret = CommitUrlCacheEntry(test_url, filenameA, filetime_zero, filetime_zero,
|
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero,
|
||||||
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
|
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
|
||||||
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
|
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
|
||||||
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfo(test_url, NULL, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url, NULL, &cbCacheEntryInfo);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
||||||
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
ret = GetUrlCacheEntryInfo(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
ok(lpCacheEntryInfo->CacheEntryType & (NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY),
|
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 %d (0x%08x)\n",
|
||||||
@ -703,21 +703,21 @@ static void test_urlcacheA(void)
|
|||||||
check_file_not_exists(filenameA);
|
check_file_not_exists(filenameA);
|
||||||
}
|
}
|
||||||
/* Test once again, setting the exempt delta via SetUrlCacheEntryInfo */
|
/* Test once again, setting the exempt delta via SetUrlCacheEntryInfo */
|
||||||
ret = CreateUrlCacheEntry(test_url, 0, "html", filenameA, 0);
|
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA, 0);
|
||||||
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
|
create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte));
|
||||||
ret = CommitUrlCacheEntry(test_url, filenameA, filetime_zero, filetime_zero,
|
ret = CommitUrlCacheEntryA(test_url, filenameA, filetime_zero, filetime_zero,
|
||||||
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
|
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
|
||||||
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
|
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
|
||||||
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetUrlCacheEntryInfo(test_url, NULL, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url, NULL, &cbCacheEntryInfo);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
||||||
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
ret = GetUrlCacheEntryInfo(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
ok(lpCacheEntryInfo->CacheEntryType & (NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY),
|
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 %d (0x%08x)\n",
|
||||||
@ -729,7 +729,7 @@ static void test_urlcacheA(void)
|
|||||||
ret = SetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo,
|
ret = SetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo,
|
||||||
CACHE_ENTRY_EXEMPT_DELTA_FC);
|
CACHE_ENTRY_EXEMPT_DELTA_FC);
|
||||||
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
||||||
ret = GetUrlCacheEntryInfo(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
ok(!U(*lpCacheEntryInfo).dwExemptDelta, "expected dwExemptDelta 0, got %d\n",
|
ok(!U(*lpCacheEntryInfo).dwExemptDelta, "expected dwExemptDelta 0, got %d\n",
|
||||||
U(*lpCacheEntryInfo).dwExemptDelta);
|
U(*lpCacheEntryInfo).dwExemptDelta);
|
||||||
@ -746,16 +746,16 @@ static void test_urlcacheA(void)
|
|||||||
CACHE_ENTRY_EXEMPT_DELTA_FC);
|
CACHE_ENTRY_EXEMPT_DELTA_FC);
|
||||||
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError());
|
||||||
|
|
||||||
ret = CreateUrlCacheEntry(test_url, 0, "html", filenameA1, 0);
|
ret = CreateUrlCacheEntryA(test_url, 0, "html", filenameA1, 0);
|
||||||
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
create_and_write_file(filenameA1, &zero_byte, sizeof(zero_byte));
|
create_and_write_file(filenameA1, &zero_byte, sizeof(zero_byte));
|
||||||
|
|
||||||
ret = CommitUrlCacheEntry(test_url, filenameA1, filetime_zero, filetime_zero,
|
ret = CommitUrlCacheEntryA(test_url, filenameA1, filetime_zero, filetime_zero,
|
||||||
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
|
NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY,
|
||||||
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
|
(LPBYTE)ok_header, strlen(ok_header), "html", NULL);
|
||||||
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
ret = GetUrlCacheEntryInfo(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_url, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
ok(U(*lpCacheEntryInfo).dwExemptDelta == 8600,
|
ok(U(*lpCacheEntryInfo).dwExemptDelta == 8600,
|
||||||
"expected dwExemptDelta 8600, got %d\n",
|
"expected dwExemptDelta 8600, got %d\n",
|
||||||
@ -777,24 +777,24 @@ static void test_urlcacheA(void)
|
|||||||
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError());
|
||||||
|
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
ret = GetUrlCacheEntryInfo(test_hash_collisions1, NULL, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_hash_collisions1, NULL, &cbCacheEntryInfo);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
||||||
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
ret = GetUrlCacheEntryInfo(test_hash_collisions1, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_hash_collisions1, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_hash_collisions1),
|
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_hash_collisions1),
|
||||||
"got incorrect entry: %s\n", lpCacheEntryInfo->lpszSourceUrlName);
|
"got incorrect entry: %s\n", lpCacheEntryInfo->lpszSourceUrlName);
|
||||||
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
|
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
|
||||||
|
|
||||||
cbCacheEntryInfo = 0;
|
cbCacheEntryInfo = 0;
|
||||||
ret = GetUrlCacheEntryInfo(test_hash_collisions2, NULL, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_hash_collisions2, NULL, &cbCacheEntryInfo);
|
||||||
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
ok(!ret, "GetUrlCacheEntryInfo should have failed\n");
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
|
||||||
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
"expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
|
||||||
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo);
|
||||||
ret = GetUrlCacheEntryInfo(test_hash_collisions2, lpCacheEntryInfo, &cbCacheEntryInfo);
|
ret = GetUrlCacheEntryInfoA(test_hash_collisions2, lpCacheEntryInfo, &cbCacheEntryInfo);
|
||||||
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError());
|
||||||
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_hash_collisions2),
|
ok(!strcmp(lpCacheEntryInfo->lpszSourceUrlName, test_hash_collisions2),
|
||||||
"got incorrect entry: %s\n", lpCacheEntryInfo->lpszSourceUrlName);
|
"got incorrect entry: %s\n", lpCacheEntryInfo->lpszSourceUrlName);
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* between the A and W versions, we just define a set of macros so the
|
* between the A and W versions, we just define a set of macros so the
|
||||||
* generated tests work anyway.
|
* generated tests work anyway.
|
||||||
*/
|
*/
|
||||||
#ifndef GOPHER_ABSTRACT_ATTRIBUTE_TYPE
|
#ifndef __WINESRC__
|
||||||
#define GOPHER_ABSTRACT_ATTRIBUTE_TYPEA GOPHER_ABSTRACT_ATTRIBUTE_TYPE
|
#define GOPHER_ABSTRACT_ATTRIBUTE_TYPEA GOPHER_ABSTRACT_ATTRIBUTE_TYPE
|
||||||
#define GOPHER_ABSTRACT_ATTRIBUTE_TYPEW GOPHER_ABSTRACT_ATTRIBUTE_TYPE
|
#define GOPHER_ABSTRACT_ATTRIBUTE_TYPEW GOPHER_ABSTRACT_ATTRIBUTE_TYPE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user