Hans Leidekker : winhttp: Propagate request errors in request_wait.
Alexandre Julliard
julliard at winehq.org
Mon Nov 25 09:12:29 CST 2019
Module: wine
Branch: stable
Commit: 249ee6f2782055906c89517f6afd50ad1eac1dd4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=249ee6f2782055906c89517f6afd50ad1eac1dd4
Author: Hans Leidekker <hans at codeweavers.com>
Date: Wed Oct 2 16:43:36 2019 +0200
winhttp: Propagate request errors in request_wait.
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 8de2369dcfcc6888772ad7b3fb730a780e92df87)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/winhttp/request.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index 1a03f5c800..e4be2387a7 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -3734,7 +3734,9 @@ static void CALLBACK wait_status_callback( HINTERNET handle, DWORD_PTR context,
request->error = result->dwError;
break;
}
- default: break;
+ default:
+ request->error = ERROR_SUCCESS;
+ break;
}
SetEvent( request->wait );
}
@@ -3947,18 +3949,17 @@ static DWORD request_wait( struct winhttp_request *request, DWORD timeout )
switch (err)
{
case WAIT_OBJECT_0:
- ret = ERROR_SUCCESS;
+ ret = request->error;
break;
case WAIT_TIMEOUT:
ret = ERROR_TIMEOUT;
break;
- case WAIT_FAILED:
default:
ret = GetLastError();
break;
}
EnterCriticalSection( &request->cs );
- if (!ret) request->proc_running = FALSE;
+ if (err == WAIT_OBJECT_0) request->proc_running = FALSE;
return ret;
}
@@ -4482,11 +4483,9 @@ static HRESULT WINAPI winhttp_request_WaitForResponse(
err = ERROR_SUCCESS;
break;
- case ERROR_SUCCESS:
+ default:
if (succeeded) *succeeded = VARIANT_TRUE;
break;
-
- default: break;
}
LeaveCriticalSection( &request->cs );
return HRESULT_FROM_WIN32( err );
More information about the wine-cvs
mailing list