Commit 40d30cf3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Fix some test failures on Windows 8.

parent 2321f8b0
......@@ -948,7 +948,8 @@ static HRESULT httprequest_getResponseHeader(httprequest *This, BSTR header, BST
{
struct httpheader *entry;
if (!header || !value) return E_INVALIDARG;
if (!header) return E_INVALIDARG;
if (!value) return E_POINTER;
if (This->raw_respheaders && list_empty(&This->respheaders))
{
......@@ -982,7 +983,7 @@ static HRESULT httprequest_getResponseHeader(httprequest *This, BSTR header, BST
static HRESULT httprequest_getAllResponseHeaders(httprequest *This, BSTR *respheaders)
{
if (!respheaders) return E_INVALIDARG;
if (!respheaders) return E_POINTER;
*respheaders = SysAllocString(This->raw_respheaders);
......@@ -1015,17 +1016,16 @@ static HRESULT httprequest_abort(httprequest *This)
static HRESULT httprequest_get_status(httprequest *This, LONG *status)
{
if (!status) return E_INVALIDARG;
if (This->state != READYSTATE_COMPLETE) return E_FAIL;
if (!status) return E_POINTER;
*status = This->status;
return S_OK;
return This->state == READYSTATE_COMPLETE ? S_OK : E_FAIL;
}
static HRESULT httprequest_get_statusText(httprequest *This, BSTR *status)
{
if (!status) return E_INVALIDARG;
if (!status) return E_POINTER;
if (This->state != READYSTATE_COMPLETE) return E_FAIL;
*status = SysAllocString(This->status_text);
......@@ -1038,7 +1038,7 @@ static HRESULT httprequest_get_responseText(httprequest *This, BSTR *body)
HGLOBAL hglobal;
HRESULT hr;
if (!body) return E_INVALIDARG;
if (!body) return E_POINTER;
if (This->state != READYSTATE_COMPLETE) return E_FAIL;
hr = GetHGlobalFromStream(This->bsc->stream, &hglobal);
......@@ -1184,7 +1184,7 @@ static HRESULT httprequest_get_responseStream(httprequest *This, VARIANT *body)
static HRESULT httprequest_get_readyState(httprequest *This, LONG *state)
{
if (!state) return E_INVALIDARG;
if (!state) return E_POINTER;
*state = This->state;
return S_OK;
......
......@@ -1469,12 +1469,12 @@ static void test_XMLHTTP(void)
/* initial status code */
hr = IXMLHttpRequest_get_status(xhr, NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
status = 0xdeadbeef;
hr = IXMLHttpRequest_get_status(xhr, &status);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "got 0x%08x\n", hr);
ok(status == 0xdeadbeef, "got %d\n", status);
ok(status == READYSTATE_UNINITIALIZED || broken(status == 0xdeadbeef) /* <win8 */, "got %d\n", status);
hr = IXMLHttpRequest_get_statusText(xhr, &str);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
......@@ -1497,7 +1497,7 @@ static void test_XMLHTTP(void)
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "got 0x%08x\n", hr);
hr = IXMLHttpRequest_get_readyState(xhr, NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
state = -1;
hr = IXMLHttpRequest_get_readyState(xhr, &state);
......@@ -1523,7 +1523,7 @@ static void test_XMLHTTP(void)
status = 0xdeadbeef;
hr = IXMLHttpRequest_get_status(xhr, &status);
ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win2k */, "got 0x%08x\n", hr);
ok(status == 0xdeadbeef, "got %d\n", status);
ok(status == READYSTATE_UNINITIALIZED || broken(status == 0xdeadbeef) /* <win8 */, "got %d\n", status);
state = -1;
hr = IXMLHttpRequest_get_readyState(xhr, &state);
......@@ -1564,7 +1564,7 @@ static void test_XMLHTTP(void)
/* response headers */
hr = IXMLHttpRequest_getAllResponseHeaders(xhr, NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
hr = IXMLHttpRequest_getAllResponseHeaders(xhr, &str);
EXPECT_HR(hr, S_OK);
/* status line is stripped already */
......@@ -1579,7 +1579,7 @@ static void test_XMLHTTP(void)
hr = IXMLHttpRequest_getResponseHeader(xhr, NULL, NULL);
EXPECT_HR(hr, E_INVALIDARG);
hr = IXMLHttpRequest_getResponseHeader(xhr, _bstr_("Date"), NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
hr = IXMLHttpRequest_getResponseHeader(xhr, _bstr_("Date"), &str);
EXPECT_HR(hr, S_OK);
ok(*str != ' ', "got leading space in header %s\n", wine_dbgstr_w(str));
......@@ -1592,7 +1592,7 @@ static void test_XMLHTTP(void)
ok(status == 200, "got %d\n", status);
hr = IXMLHttpRequest_get_statusText(xhr, NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
hr = IXMLHttpRequest_get_statusText(xhr, &str);
EXPECT_HR(hr, S_OK);
......@@ -1640,7 +1640,7 @@ static void test_XMLHTTP(void)
EXPECT_HR(hr, S_OK);
hr = IXMLHttpRequest_get_responseText(xhr, NULL);
EXPECT_HR(hr, E_INVALIDARG);
ok(hr == E_POINTER || broken(hr == E_INVALIDARG) /* <win8 */, "got 0x%08x\n", hr);
hr = IXMLHttpRequest_get_responseText(xhr, &bstrResponse);
EXPECT_HR(hr, S_OK);
......
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