Hans Leidekker : winhttp: Implement IWinHttpRequest::get_Status.
Alexandre Julliard
julliard at winehq.org
Thu Jul 21 10:50:50 CDT 2011
Module: wine
Branch: master
Commit: e11828d2d0bde81ad8f29f41cd1dad2f3b8cb8ec
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e11828d2d0bde81ad8f29f41cd1dad2f3b8cb8ec
Author: Hans Leidekker <hans at codeweavers.com>
Date: Thu Jul 21 11:51:47 2011 +0200
winhttp: Implement IWinHttpRequest::get_Status.
---
dlls/winhttp/request.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index 69c004c..97fe255 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -2551,8 +2551,24 @@ static HRESULT WINAPI winhttp_request_get_Status(
IWinHttpRequest *iface,
LONG *status )
{
- FIXME("\n");
- return E_NOTIMPL;
+ struct winhttp_request *request = impl_from_IWinHttpRequest( iface );
+ DWORD err, flags, status_code, len = sizeof(status_code), index = 0;
+
+ TRACE("%p, %p\n", request, status);
+
+ if (request->state < REQUEST_STATE_SENT)
+ {
+ return HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND );
+ }
+ if ((err = request_wait_for_response( request, INFINITE, NULL ))) return HRESULT_FROM_WIN32( err );
+
+ flags = WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER;
+ if (!WinHttpQueryHeaders( request->hrequest, flags, NULL, &status_code, &len, &index ))
+ {
+ return HRESULT_FROM_WIN32( GetLastError() );
+ }
+ *status = status_code;
+ return S_OK;
}
static HRESULT WINAPI winhttp_request_get_StatusText(
More information about the wine-cvs
mailing list