winhttp: Implement IWinHttpRequest::get_StatusText.
This commit is contained in:
parent
e11828d2d0
commit
39468db2d6
|
@ -2575,8 +2575,28 @@ static HRESULT WINAPI winhttp_request_get_StatusText(
|
||||||
IWinHttpRequest *iface,
|
IWinHttpRequest *iface,
|
||||||
BSTR *status )
|
BSTR *status )
|
||||||
{
|
{
|
||||||
FIXME("\n");
|
struct winhttp_request *request = impl_from_IWinHttpRequest( iface );
|
||||||
return E_NOTIMPL;
|
DWORD err, len = 0, 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 );
|
||||||
|
|
||||||
|
WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_STATUS_TEXT, NULL, NULL, &len, &index );
|
||||||
|
err = GetLastError();
|
||||||
|
if (err != ERROR_INSUFFICIENT_BUFFER) return HRESULT_FROM_WIN32( err );
|
||||||
|
if (!(*status = SysAllocStringLen( NULL, len / sizeof(WCHAR) ))) return E_OUTOFMEMORY;
|
||||||
|
index = 0;
|
||||||
|
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_STATUS_TEXT, NULL, *status, &len, &index ))
|
||||||
|
{
|
||||||
|
SysFreeString( *status );
|
||||||
|
return HRESULT_FROM_WIN32( GetLastError() );
|
||||||
|
}
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI winhttp_request_get_ResponseText(
|
static HRESULT WINAPI winhttp_request_get_ResponseText(
|
||||||
|
|
Loading…
Reference in New Issue