From 354f97dff82618c996074ad217088b5ac26b7fc9 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 19 Jan 2011 15:11:11 +0000 Subject: [PATCH] wininet: Add tests for querying INTERNET_OPTION_MAX_CONNS_PER_SERVER and INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER and fix typo in the implementation. --- dlls/wininet/internet.c | 2 +- dlls/wininet/tests/internet.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 002f4e47203..df8901af652 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -2305,7 +2305,7 @@ DWORD INET_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD * if (*size < sizeof(ULONG)) return ERROR_INSUFFICIENT_BUFFER; - *(ULONG*)size = 4; + *(ULONG*)buffer = 4; *size = sizeof(ULONG); return ERROR_SUCCESS; diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index d0668309e64..e179dca8c3f 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -164,7 +164,7 @@ static void test_InternetCanonicalizeUrlA(void) static void test_InternetQueryOptionA(void) { HINTERNET hinet,hurl; - DWORD len; + DWORD len, val; DWORD err; static const char useragent[] = {"Wininet Test"}; char *buffer; @@ -248,6 +248,19 @@ static void test_InternetQueryOptionA(void) ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%d\n",err); InternetCloseHandle(hinet); + + len = sizeof(val); + retval = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, &len); + ok(retval == TRUE,"Got wrong return value %d\n", retval); + ok(len == sizeof(val), "got %d\n", len); + ok(val == 2, "got %d\n", val); + + len = sizeof(val); + retval = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER, &val, &len); + ok(retval == TRUE,"Got wrong return value %d\n", retval); + ok(len == sizeof(val), "got %d\n", len); + ok(val == 4, "got %d\n", val); + } static void test_get_cookie(void)