Commit c0400560 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Moved querying INTERNET_OPTION_REQUEST_FLAGS implementation to HTTPREQ_QueryOption.

parent d2d225f6
......@@ -2158,6 +2158,16 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
*size = sizeof(DWORD);
*(DWORD *)buffer = req->connect_timeout;
return ERROR_SUCCESS;
case INTERNET_OPTION_REQUEST_FLAGS:
TRACE("INTERNET_OPTION_REQUEST_FLAGS\n");
if (*size < sizeof(DWORD))
return ERROR_INSUFFICIENT_BUFFER;
*(DWORD*)buffer = 4;
*size = sizeof(DWORD);
return ERROR_SUCCESS;
}
return INET_QueryOption(hdr, option, buffer, size, unicode);
......
......@@ -1214,7 +1214,7 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
HINTERNET rc = NULL;
DWORD res = ERROR_SUCCESS;
TRACE("(%p, %s, %i, %s, %s, %i, %i, %lx)\n", hInternet, debugstr_w(lpszServerName),
TRACE("(%p, %s, %i, %s, %s, %i, %x, %lx)\n", hInternet, debugstr_w(lpszServerName),
nServerPort, debugstr_w(lpszUserName), debugstr_w(lpszPassword),
dwService, dwFlags, dwContext);
......@@ -2319,17 +2319,6 @@ static DWORD query_global_option(DWORD option, void *buffer, DWORD *size, BOOL u
/* FIXME: This function currently handles more options than it should. Options requiring
* proper handles should be moved to proper functions */
switch(option) {
case INTERNET_OPTION_REQUEST_FLAGS:
TRACE("INTERNET_OPTION_REQUEST_FLAGS\n");
if (*size < sizeof(ULONG))
return ERROR_INSUFFICIENT_BUFFER;
*(ULONG*)buffer = 4;
*size = sizeof(ULONG);
return ERROR_SUCCESS;
case INTERNET_OPTION_HTTP_VERSION:
if (*size < sizeof(HTTP_VERSION_INFO))
return ERROR_INSUFFICIENT_BUFFER;
......@@ -2471,7 +2460,9 @@ static DWORD query_global_option(DWORD option, void *buffer, DWORD *size, BOOL u
return res;
}
case INTERNET_OPTION_REQUEST_FLAGS:
case INTERNET_OPTION_USER_AGENT:
*size = 0;
return ERROR_INTERNET_INCORRECT_HANDLE_TYPE;
case INTERNET_OPTION_POLICY:
return ERROR_INVALID_PARAMETER;
......@@ -2509,6 +2500,11 @@ DWORD INET_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *
*size = sizeof(DWORD_PTR);
return ERROR_SUCCESS;
case INTERNET_OPTION_REQUEST_FLAGS:
WARN("INTERNET_OPTION_REQUEST_FLAGS\n");
*size = sizeof(DWORD);
return ERROR_INTERNET_INCORRECT_HANDLE_TYPE;
case INTERNET_OPTION_MAX_CONNS_PER_SERVER:
case INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER:
WARN("Called on global option %u\n", option);
......
......@@ -212,6 +212,22 @@ static void test_InternetQueryOptionA(void)
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %d\n",err);
SetLastError(0xdeadbeef);
len = sizeof(DWORD);
retval = InternetQueryOptionA(hurl,INTERNET_OPTION_REQUEST_FLAGS,NULL,&len);
err = GetLastError();
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %d\n",err);
ok(len == sizeof(DWORD), "len = %d\n", len);
SetLastError(0xdeadbeef);
len = sizeof(DWORD);
retval = InternetQueryOptionA(NULL,INTERNET_OPTION_REQUEST_FLAGS,NULL,&len);
err = GetLastError();
ok(retval == 0,"Got wrong return value %d\n",retval);
ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %d\n",err);
ok(!len, "len = %d\n", len);
InternetCloseHandle(hurl);
InternetCloseHandle(hinet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment