Commit 8e37ed55 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Don't pass handle to INTERNET_REQUEST_COMPLETE unless the request is…

wininet: Don't pass handle to INTERNET_REQUEST_COMPLETE unless the request is opened via InternetPoenUrl.
parent c0293df4
...@@ -2660,7 +2660,7 @@ static void HTTP_ReceiveRequestData(http_request_t *req, BOOL first_notif) ...@@ -2660,7 +2660,7 @@ static void HTTP_ReceiveRequestData(http_request_t *req, BOOL first_notif)
} }
if(res == ERROR_SUCCESS) if(res == ERROR_SUCCESS)
send_request_complete(req, (DWORD_PTR)req->hdr.hInternet, avail); send_request_complete(req, req->session->hdr.dwInternalFlags & INET_OPENURL ? (DWORD_PTR)req->hdr.hInternet : 1, avail);
else else
send_request_complete(req, 0, res); send_request_complete(req, 0, res);
} }
...@@ -4805,10 +4805,15 @@ lend: ...@@ -4805,10 +4805,15 @@ lend:
if (request->session->appInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (request->session->appInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
if (res == ERROR_SUCCESS && request->contentLength && request->bytesWritten == request->bytesToWrite) if (res == ERROR_SUCCESS) {
HTTP_ReceiveRequestData(request, TRUE); if(request->contentLength && request->bytesWritten == request->bytesToWrite)
else HTTP_ReceiveRequestData(request, TRUE);
send_request_complete(request, res == ERROR_SUCCESS ? (DWORD_PTR)request->hdr.hInternet : 0, res); else
send_request_complete(request,
request->session->hdr.dwInternalFlags & INET_OPENURL ? (DWORD_PTR)request->hdr.hInternet : 1, 0);
}else {
send_request_complete(request, 0, res);
}
} }
TRACE("<--\n"); TRACE("<--\n");
...@@ -4902,7 +4907,7 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *request, DWORD dwFlags, DWORD_ ...@@ -4902,7 +4907,7 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *request, DWORD dwFlags, DWORD_
if (res == ERROR_SUCCESS && request->contentLength) if (res == ERROR_SUCCESS && request->contentLength)
HTTP_ReceiveRequestData(request, TRUE); HTTP_ReceiveRequestData(request, TRUE);
else else
send_request_complete(request, res == ERROR_SUCCESS ? (DWORD_PTR)request->hdr.hInternet : 0, res); send_request_complete(request, res == ERROR_SUCCESS, res);
return res; return res;
} }
......
...@@ -287,6 +287,7 @@ static VOID WINAPI callback( ...@@ -287,6 +287,7 @@ static VOID WINAPI callback(
ok(dwStatusInformationLength == sizeof(INTERNET_ASYNC_RESULT), ok(dwStatusInformationLength == sizeof(INTERNET_ASYNC_RESULT),
"info length should be sizeof(INTERNET_ASYNC_RESULT) instead of %d\n", "info length should be sizeof(INTERNET_ASYNC_RESULT) instead of %d\n",
dwStatusInformationLength); dwStatusInformationLength);
ok(iar->dwResult == 1 || iar->dwResult == 0, "iar->dwResult = %ld\n", iar->dwResult);
trace("%04x:Callback %p 0x%lx INTERNET_STATUS_REQUEST_COMPLETE {%ld,%d} %d\n", trace("%04x:Callback %p 0x%lx INTERNET_STATUS_REQUEST_COMPLETE {%ld,%d} %d\n",
GetCurrentThreadId(), hInternet, dwContext, GetCurrentThreadId(), hInternet, dwContext,
iar->dwResult,iar->dwError,dwStatusInformationLength); iar->dwResult,iar->dwError,dwStatusInformationLength);
......
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