Commit 2934ce5c authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winhttp: Return default value for WINHTTP_OPTION_WORKER_THREAD_COUNT.

parent 9759ed14
......@@ -1224,6 +1224,15 @@ static BOOL query_option( struct object_header *hdr, DWORD option, void *buffer,
switch (option)
{
case WINHTTP_OPTION_WORKER_THREAD_COUNT:
{
FIXME( "WINHTTP_OPTION_WORKER_THREAD_COUNT semi-stub.\n" );
if (!validate_buffer( buffer, buflen, sizeof(DWORD) )) return FALSE;
*(DWORD *)buffer = 0;
*buflen = sizeof(DWORD);
return TRUE;
}
case WINHTTP_OPTION_CONTEXT_VALUE:
{
if (!validate_buffer( buffer, buflen, sizeof(DWORD_PTR) )) return FALSE;
......
......@@ -97,6 +97,15 @@ static void test_WinHttpQueryOption(void)
feature = 0xdeadbeef;
size = sizeof(feature) + 1;
SetLastError(0xdeadbeef);
ret = WinHttpQueryOption(session, WINHTTP_OPTION_WORKER_THREAD_COUNT, &feature, &size);
ok(ret, "failed to query option %lu\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS, "got %lu\n", GetLastError());
ok(size == sizeof(feature), "WinHttpQueryOption should set the size: %lu\n", size);
ok(feature == 0, "got unexpected WINHTTP_OPTION_WORKER_THREAD_COUNT %#lx\n", feature);
feature = 0xdeadbeef;
size = sizeof(feature) + 1;
SetLastError(0xdeadbeef);
ret = WinHttpQueryOption(session, WINHTTP_OPTION_REDIRECT_POLICY, &feature, &size);
ok(ret, "failed to query option %lu\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */,
......@@ -168,6 +177,24 @@ static void test_WinHttpQueryOption(void)
feature = 0xdeadbeef;
size = sizeof(feature);
SetLastError(0xdeadbeef);
ret = WinHttpQueryOption(connection, WINHTTP_OPTION_WORKER_THREAD_COUNT, &feature, &size);
ok(ret, "query WINHTTP_OPTION_WORKER_THREAD_COUNT failed for a request\n");
ok(GetLastError() == ERROR_SUCCESS, "got unexpected error %lu\n", GetLastError());
ok(size == sizeof(feature), "WinHttpQueryOption should set the size: %lu\n", size);
ok(feature == 0, "got unexpected WINHTTP_OPTION_WORKER_THREAD_COUNT %#lx\n", feature);
feature = 0xdeadbeef;
size = sizeof(feature);
SetLastError(0xdeadbeef);
ret = WinHttpQueryOption(request, WINHTTP_OPTION_WORKER_THREAD_COUNT, &feature, &size);
ok(ret, "query WINHTTP_OPTION_WORKER_THREAD_COUNT failed for a request\n");
ok(GetLastError() == ERROR_SUCCESS, "got unexpected error %lu\n", GetLastError());
ok(size == sizeof(feature), "WinHttpQueryOption should set the size: %lu\n", size);
ok(feature == 0, "got unexpected WINHTTP_OPTION_WORKER_THREAD_COUNT %#lx\n", feature);
feature = 0xdeadbeef;
size = sizeof(feature);
SetLastError(0xdeadbeef);
ret = WinHttpQueryOption(request, WINHTTP_OPTION_DISABLE_FEATURE, &feature, &size);
ok(!ret, "should fail to query disable feature for a request\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
......
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