Module: wine Branch: master Commit: dd35601b0773e3ff1bb206edfd2eef2a004724b9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=dd35601b0773e3ff1bb206edfd...
Author: Piotr Caban piotr@codeweavers.com Date: Fri May 3 15:19:11 2013 +0200
wininet: Handle NULL req->netconn in INTERNET_DIAGNOSTIC_SOCKET_INFO query.
---
dlls/wininet/http.c | 2 +- dlls/wininet/tests/http.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 94b63c8..e160d04 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -1997,7 +1997,7 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe info->Flags |= IDSI_FLAG_KEEP_ALIVE; if (req->proxy) info->Flags |= IDSI_FLAG_PROXY; - if (req->netconn->secure) + if (req->netconn && req->netconn->secure) info->Flags |= IDSI_FLAG_SECURE;
return ERROR_SUCCESS; diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 5f0bf43..bfa215b 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -3249,6 +3249,7 @@ static void test_HttpQueryInfo(int port)
static void test_options(int port) { + INTERNET_DIAGNOSTIC_SOCKET_INFO idsi; HINTERNET ses, con, req; DWORD size, error; DWORD_PTR ctx; @@ -3349,6 +3350,10 @@ static void test_options(int port) ok(ret, "InternetQueryOption failed %u\n", GetLastError()); ok(ctx == 3, "expected 3 got %lu\n", ctx);
+ size = sizeof(idsi); + ret = InternetQueryOption(req, INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO, &idsi, &size); + ok(ret, "InternetQueryOption failed %u\n", GetLastError()); + /* INTERNET_OPTION_PROXY */ SetLastError(0xdeadbeef); ret = InternetQueryOptionA(ses, INTERNET_OPTION_PROXY, NULL, NULL);