Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f0546a19
Commit
f0546a19
authored
Oct 08, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implement ::get_responseBody().
parent
8630368a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
4 deletions
+68
-4
httprequest.c
dlls/msxml3/httprequest.c
+45
-3
domdoc.c
dlls/msxml3/tests/domdoc.c
+23
-1
No files found.
dlls/msxml3/httprequest.c
View file @
f0546a19
...
...
@@ -824,13 +824,55 @@ static HRESULT WINAPI httprequest_get_responseText(IXMLHTTPRequest *iface, BSTR
return
hr
;
}
static
HRESULT
WINAPI
httprequest_get_responseBody
(
IXMLHTTPRequest
*
iface
,
VARIANT
*
pvarB
ody
)
static
HRESULT
WINAPI
httprequest_get_responseBody
(
IXMLHTTPRequest
*
iface
,
VARIANT
*
b
ody
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
HGLOBAL
hglobal
;
HRESULT
hr
;
FIXME
(
"stub %p %p
\n
"
,
This
,
pvarB
ody
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
b
ody
);
return
E_NOTIMPL
;
if
(
!
body
)
return
E_INVALIDARG
;
if
(
This
->
state
!=
READYSTATE_COMPLETE
)
return
E_FAIL
;
hr
=
GetHGlobalFromStream
(
This
->
bsc
->
stream
,
&
hglobal
);
if
(
hr
==
S_OK
)
{
void
*
ptr
=
GlobalLock
(
hglobal
);
DWORD
size
=
GlobalSize
(
hglobal
);
SAFEARRAYBOUND
bound
;
SAFEARRAY
*
array
;
bound
.
lLbound
=
0
;
bound
.
cElements
=
size
;
array
=
SafeArrayCreate
(
VT_UI1
,
1
,
&
bound
);
if
(
array
)
{
void
*
dest
;
V_VT
(
body
)
=
VT_ARRAY
|
VT_UI1
;
V_ARRAY
(
body
)
=
array
;
hr
=
SafeArrayAccessData
(
array
,
&
dest
);
if
(
hr
==
S_OK
)
{
memcpy
(
dest
,
ptr
,
size
);
SafeArrayUnaccessData
(
array
);
}
else
{
VariantClear
(
body
);
}
}
else
hr
=
E_FAIL
;
GlobalUnlock
(
hglobal
);
}
return
hr
;
}
static
HRESULT
WINAPI
httprequest_get_responseStream
(
IXMLHTTPRequest
*
iface
,
VARIANT
*
pvarBody
)
...
...
dlls/msxml3/tests/domdoc.c
View file @
f0546a19
...
...
@@ -3195,7 +3195,8 @@ static void test_XMLHTTP(void)
VARIANT
dummy
;
VARIANT
async
;
VARIANT
varbody
;
LONG
state
,
status
,
ref
;
LONG
state
,
status
,
ref
,
bound
;
void
*
ptr
;
IDispatch
*
event
;
HRESULT
hr
=
CoCreateInstance
(
&
CLSID_XMLHTTPRequest
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLHttpRequest
,
...
...
@@ -3388,6 +3389,27 @@ todo_wine {
SysFreeString
(
bstrResponse
);
}
hr
=
IXMLHttpRequest_get_responseBody
(
pXMLHttpRequest
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
V_VT
(
&
varbody
)
=
VT_EMPTY
;
hr
=
IXMLHttpRequest_get_responseBody
(
pXMLHttpRequest
,
&
varbody
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
varbody
)
==
(
VT_ARRAY
|
VT_UI1
),
"got type %d, expected %d
\n
"
,
V_VT
(
&
varbody
),
VT_ARRAY
|
VT_UI1
);
ok
(
SafeArrayGetDim
(
V_ARRAY
(
&
varbody
))
==
1
,
"got %d, expected one dimension
\n
"
,
SafeArrayGetDim
(
V_ARRAY
(
&
varbody
)));
bound
=
-
1
;
hr
=
SafeArrayGetLBound
(
V_ARRAY
(
&
varbody
),
1
,
&
bound
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
bound
==
0
,
"got %d, expected zero bound
\n
"
,
bound
);
hr
=
SafeArrayAccessData
(
V_ARRAY
(
&
varbody
),
&
ptr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
memcmp
(
ptr
,
xmltestbodyA
,
sizeof
(
xmltestbodyA
)
-
1
)
==
0
,
"got wrond body data
\n
"
);
SafeArrayUnaccessData
(
V_ARRAY
(
&
varbody
));
VariantClear
(
&
varbody
);
SysFreeString
(
url
);
IDispatch_Release
(
event
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment