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
82fe81c4
Commit
82fe81c4
authored
May 19, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Move methods implementation to separate functions, so it can be reused.
parent
9a4d8c30
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
327 additions
and
270 deletions
+327
-270
httprequest.c
dlls/msxml3/httprequest.c
+327
-270
No files found.
dlls/msxml3/httprequest.c
View file @
82fe81c4
...
...
@@ -735,169 +735,16 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
return
hr
;
}
static
HRESULT
WINAPI
httprequest_QueryInterface
(
IXMLHTTPRequest
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
if
(
IsEqualGUID
(
riid
,
&
IID_IXMLHTTPRequest
)
||
IsEqualGUID
(
riid
,
&
IID_IDispatch
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
)
{
*
ppvObject
=
iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IObjectWithSite
,
riid
))
{
*
ppvObject
=
&
This
->
IObjectWithSite_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IObjectSafety
,
riid
))
{
*
ppvObject
=
&
This
->
IObjectSafety_iface
;
}
else
{
TRACE
(
"Unsupported interface %s
\n
"
,
debugstr_guid
(
riid
));
*
ppvObject
=
NULL
;
return
E_NOINTERFACE
;
}
IXMLHTTPRequest_AddRef
(
iface
);
return
S_OK
;
}
static
ULONG
WINAPI
httprequest_AddRef
(
IXMLHTTPRequest
*
iface
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
httprequest_Release
(
IXMLHTTPRequest
*
iface
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
struct
httpheader
*
header
,
*
header2
;
if
(
This
->
site
)
IUnknown_Release
(
This
->
site
);
SysFreeString
(
This
->
custom
);
SysFreeString
(
This
->
siteurl
);
SysFreeString
(
This
->
url
);
SysFreeString
(
This
->
user
);
SysFreeString
(
This
->
password
);
/* request headers */
LIST_FOR_EACH_ENTRY_SAFE
(
header
,
header2
,
&
This
->
reqheaders
,
struct
httpheader
,
entry
)
{
list_remove
(
&
header
->
entry
);
SysFreeString
(
header
->
header
);
SysFreeString
(
header
->
value
);
heap_free
(
header
);
}
/* response headers */
free_response_headers
(
This
);
SysFreeString
(
This
->
status_text
);
/* detach callback object */
BindStatusCallback_Detach
(
This
->
bsc
);
if
(
This
->
sink
)
IDispatch_Release
(
This
->
sink
);
heap_free
(
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
httprequest_GetTypeInfoCount
(
IXMLHTTPRequest
*
iface
,
UINT
*
pctinfo
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pctinfo
);
*
pctinfo
=
1
;
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_GetTypeInfo
(
IXMLHTTPRequest
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%u %u %p)
\n
"
,
This
,
iTInfo
,
lcid
,
ppTInfo
);
return
get_typeinfo
(
IXMLHTTPRequest_tid
,
ppTInfo
);
}
static
HRESULT
WINAPI
httprequest_GetIDsOfNames
(
IXMLHTTPRequest
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
TRACE
(
"(%p)->(%s %p %u %u %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
rgszNames
,
cNames
,
lcid
,
rgDispId
);
if
(
!
rgszNames
||
cNames
==
0
||
!
rgDispId
)
return
E_INVALIDARG
;
hr
=
get_typeinfo
(
IXMLHTTPRequest_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_GetIDsOfNames
(
typeinfo
,
rgszNames
,
cNames
,
rgDispId
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
httprequest_Invoke
(
IXMLHTTPRequest
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
TRACE
(
"(%p)->(%d %s %d %d %p %p %p %p)
\n
"
,
This
,
dispIdMember
,
debugstr_guid
(
riid
),
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
hr
=
get_typeinfo
(
IXMLHTTPRequest_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_Invoke
(
typeinfo
,
&
This
->
IXMLHTTPRequest_iface
,
dispIdMember
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
httprequest_open
(
IXMLHTTPRequest
*
iface
,
BSTR
method
,
BSTR
url
,
static
HRESULT
httprequest_open
(
httprequest
*
This
,
BSTR
method
,
BSTR
url
,
VARIANT
async
,
VARIANT
user
,
VARIANT
password
)
{
static
const
WCHAR
MethodGetW
[]
=
{
'G'
,
'E'
,
'T'
,
0
};
static
const
WCHAR
MethodPutW
[]
=
{
'P'
,
'U'
,
'T'
,
0
};
static
const
WCHAR
MethodPostW
[]
=
{
'P'
,
'O'
,
'S'
,
'T'
,
0
};
static
const
WCHAR
MethodDeleteW
[]
=
{
'D'
,
'E'
,
'L'
,
'E'
,
'T'
,
'E'
,
0
};
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
VARIANT
str
,
is_async
;
HRESULT
hr
;
TRACE
(
"(%p)->(%s %s %s)
\n
"
,
This
,
debugstr_w
(
method
),
debugstr_w
(
url
),
debugstr_variant
(
&
async
));
if
(
!
method
||
!
url
)
return
E_INVALIDARG
;
/* free previously set data */
...
...
@@ -966,13 +813,10 @@ static HRESULT WINAPI httprequest_open(IXMLHTTPRequest *iface, BSTR method, BSTR
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_setRequestHeader
(
IXMLHTTPRequest
*
iface
,
BSTR
header
,
BSTR
value
)
static
HRESULT
httprequest_setRequestHeader
(
httprequest
*
This
,
BSTR
header
,
BSTR
value
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
struct
httpheader
*
entry
;
TRACE
(
"(%p)->(%s %s)
\n
"
,
This
,
debugstr_w
(
header
),
debugstr_w
(
value
));
if
(
!
header
||
!*
header
)
return
E_INVALIDARG
;
if
(
This
->
state
!=
READYSTATE_LOADING
)
return
E_FAIL
;
if
(
!
value
)
return
E_INVALIDARG
;
...
...
@@ -1010,13 +854,10 @@ static HRESULT WINAPI httprequest_setRequestHeader(IXMLHTTPRequest *iface, BSTR
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_getResponseHeader
(
IXMLHTTPRequest
*
iface
,
BSTR
header
,
BSTR
*
value
)
static
HRESULT
httprequest_getResponseHeader
(
httprequest
*
This
,
BSTR
header
,
BSTR
*
value
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
struct
httpheader
*
entry
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
header
),
value
);
if
(
!
header
||
!
value
)
return
E_INVALIDARG
;
if
(
This
->
raw_respheaders
&&
list_empty
(
&
This
->
respheaders
))
...
...
@@ -1049,12 +890,8 @@ static HRESULT WINAPI httprequest_getResponseHeader(IXMLHTTPRequest *iface, BSTR
return
S_FALSE
;
}
static
HRESULT
WINAPI
httprequest_getAllResponseHeaders
(
IXMLHTTPRequest
*
iface
,
BSTR
*
respheaders
)
static
HRESULT
httprequest_getAllResponseHeaders
(
httprequest
*
This
,
BSTR
*
respheaders
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
respheaders
);
if
(
!
respheaders
)
return
E_INVALIDARG
;
*
respheaders
=
SysAllocString
(
This
->
raw_respheaders
);
...
...
@@ -1062,14 +899,11 @@ static HRESULT WINAPI httprequest_getAllResponseHeaders(IXMLHTTPRequest *iface,
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_send
(
IXMLHTTPRequest
*
iface
,
VARIANT
body
)
static
HRESULT
httprequest_send
(
httprequest
*
This
,
VARIANT
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
BindStatusCallback
*
bsc
=
NULL
;
HRESULT
hr
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
body
));
if
(
This
->
state
!=
READYSTATE_LOADING
)
return
E_FAIL
;
hr
=
BindStatusCallback_create
(
This
,
&
bsc
,
&
body
);
...
...
@@ -1081,12 +915,8 @@ static HRESULT WINAPI httprequest_send(IXMLHTTPRequest *iface, VARIANT body)
return
hr
;
}
static
HRESULT
WINAPI
httprequest_abort
(
IXMLHTTPRequest
*
iface
)
static
HRESULT
httprequest_abort
(
httprequest
*
This
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
BindStatusCallback_Detach
(
This
->
bsc
);
This
->
bsc
=
NULL
;
...
...
@@ -1095,12 +925,8 @@ static HRESULT WINAPI httprequest_abort(IXMLHTTPRequest *iface)
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_get_status
(
IXMLHTTPRequest
*
iface
,
LONG
*
status
)
static
HRESULT
httprequest_get_status
(
httprequest
*
This
,
LONG
*
status
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
status
);
if
(
!
status
)
return
E_INVALIDARG
;
if
(
This
->
state
!=
READYSTATE_COMPLETE
)
return
E_FAIL
;
...
...
@@ -1109,12 +935,8 @@ static HRESULT WINAPI httprequest_get_status(IXMLHTTPRequest *iface, LONG *statu
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_get_statusText
(
IXMLHTTPRequest
*
iface
,
BSTR
*
status
)
static
HRESULT
httprequest_get_statusText
(
httprequest
*
This
,
BSTR
*
status
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
status
);
if
(
!
status
)
return
E_INVALIDARG
;
if
(
This
->
state
!=
READYSTATE_COMPLETE
)
return
E_FAIL
;
...
...
@@ -1123,44 +945,11 @@ static HRESULT WINAPI httprequest_get_statusText(IXMLHTTPRequest *iface, BSTR *s
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_get_responseXML
(
IXMLHTTPRequest
*
iface
,
IDispatch
**
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
IXMLDOMDocument3
*
doc
;
HRESULT
hr
;
BSTR
str
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
body
);
if
(
!
body
)
return
E_INVALIDARG
;
if
(
This
->
state
!=
READYSTATE_COMPLETE
)
return
E_FAIL
;
hr
=
DOMDocument_create
(
MSXML_DEFAULT
,
NULL
,
(
void
**
)
&
doc
);
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
IXMLHTTPRequest_get_responseText
(
iface
,
&
str
);
if
(
hr
==
S_OK
)
{
VARIANT_BOOL
ok
;
hr
=
IXMLDOMDocument3_loadXML
(
doc
,
str
,
&
ok
);
SysFreeString
(
str
);
}
IXMLDOMDocument3_QueryInterface
(
doc
,
&
IID_IDispatch
,
(
void
**
)
body
);
IXMLDOMDocument3_Release
(
doc
);
return
hr
;
}
static
HRESULT
WINAPI
httprequest_get_responseText
(
IXMLHTTPRequest
*
iface
,
BSTR
*
body
)
static
HRESULT
httprequest_get_responseText
(
httprequest
*
This
,
BSTR
*
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
HGLOBAL
hglobal
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
body
);
if
(
!
body
)
return
E_INVALIDARG
;
if
(
This
->
state
!=
READYSTATE_COMPLETE
)
return
E_FAIL
;
...
...
@@ -1206,13 +995,37 @@ static HRESULT WINAPI httprequest_get_responseText(IXMLHTTPRequest *iface, BSTR
return
hr
;
}
static
HRESULT
WINAPI
httprequest_get_responseBody
(
IXMLHTTPRequest
*
iface
,
VARIANT
*
body
)
static
HRESULT
httprequest_get_responseXML
(
httprequest
*
This
,
IDispatch
*
*
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
HGLOBAL
hglobal
;
IXMLDOMDocument3
*
doc
;
HRESULT
hr
;
BSTR
str
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
body
);
if
(
!
body
)
return
E_INVALIDARG
;
if
(
This
->
state
!=
READYSTATE_COMPLETE
)
return
E_FAIL
;
hr
=
DOMDocument_create
(
MSXML_DEFAULT
,
NULL
,
(
void
**
)
&
doc
);
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
httprequest_get_responseText
(
This
,
&
str
);
if
(
hr
==
S_OK
)
{
VARIANT_BOOL
ok
;
hr
=
IXMLDOMDocument3_loadXML
(
doc
,
str
,
&
ok
);
SysFreeString
(
str
);
}
IXMLDOMDocument3_QueryInterface
(
doc
,
&
IID_IDispatch
,
(
void
**
)
body
);
IXMLDOMDocument3_Release
(
doc
);
return
hr
;
}
static
HRESULT
httprequest_get_responseBody
(
httprequest
*
This
,
VARIANT
*
body
)
{
HGLOBAL
hglobal
;
HRESULT
hr
;
if
(
!
body
)
return
E_INVALIDARG
;
V_VT
(
body
)
=
VT_EMPTY
;
...
...
@@ -1259,15 +1072,12 @@ static HRESULT WINAPI httprequest_get_responseBody(IXMLHTTPRequest *iface, VARIA
return
hr
;
}
static
HRESULT
WINAPI
httprequest_get_responseStream
(
IXMLHTTPRequest
*
iface
,
VARIANT
*
body
)
static
HRESULT
httprequest_get_responseStream
(
httprequest
*
This
,
VARIANT
*
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
LARGE_INTEGER
move
;
IStream
*
stream
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
body
);
if
(
!
body
)
return
E_INVALIDARG
;
V_VT
(
body
)
=
VT_EMPTY
;
...
...
@@ -1284,53 +1094,297 @@ static HRESULT WINAPI httprequest_get_responseStream(IXMLHTTPRequest *iface, VAR
return
hr
;
}
static
HRESULT
WINAPI
httprequest_get_readyState
(
IXMLHTTPRequest
*
iface
,
LONG
*
state
)
static
HRESULT
httprequest_get_readyState
(
httprequest
*
This
,
LONG
*
state
)
{
if
(
!
state
)
return
E_INVALIDARG
;
*
state
=
This
->
state
;
return
S_OK
;
}
static
HRESULT
httprequest_put_onreadystatechange
(
httprequest
*
This
,
IDispatch
*
sink
)
{
if
(
This
->
sink
)
IDispatch_Release
(
This
->
sink
);
if
((
This
->
sink
=
sink
))
IDispatch_AddRef
(
This
->
sink
);
return
S_OK
;
}
static
void
httprequest_release
(
httprequest
*
This
)
{
struct
httpheader
*
header
,
*
header2
;
if
(
This
->
site
)
IUnknown_Release
(
This
->
site
);
SysFreeString
(
This
->
custom
);
SysFreeString
(
This
->
siteurl
);
SysFreeString
(
This
->
url
);
SysFreeString
(
This
->
user
);
SysFreeString
(
This
->
password
);
/* request headers */
LIST_FOR_EACH_ENTRY_SAFE
(
header
,
header2
,
&
This
->
reqheaders
,
struct
httpheader
,
entry
)
{
list_remove
(
&
header
->
entry
);
SysFreeString
(
header
->
header
);
SysFreeString
(
header
->
value
);
heap_free
(
header
);
}
/* response headers */
free_response_headers
(
This
);
SysFreeString
(
This
->
status_text
);
/* detach callback object */
BindStatusCallback_Detach
(
This
->
bsc
);
if
(
This
->
sink
)
IDispatch_Release
(
This
->
sink
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_QueryInterface
(
IXMLHTTPRequest
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
state
);
if
(
IsEqualGUID
(
riid
,
&
IID_IXMLHTTPRequest
)
||
IsEqualGUID
(
riid
,
&
IID_IDispatch
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
)
{
*
ppvObject
=
iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IObjectWithSite
,
riid
))
{
*
ppvObject
=
&
This
->
IObjectWithSite_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IObjectSafety
,
riid
))
{
*
ppvObject
=
&
This
->
IObjectSafety_iface
;
}
else
{
TRACE
(
"Unsupported interface %s
\n
"
,
debugstr_guid
(
riid
));
*
ppvObject
=
NULL
;
return
E_NOINTERFACE
;
}
if
(
!
state
)
return
E_INVALIDARG
;
IXMLHTTPRequest_AddRef
(
iface
)
;
*
state
=
This
->
state
;
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_put_onreadystatechange
(
IXMLHTTPRequest
*
iface
,
IDispatch
*
sink
)
static
ULONG
WINAPI
XMLHTTPRequest_AddRef
(
IXMLHTTPRequest
*
iface
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
ref
);
return
ref
;
}
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
sink
);
static
ULONG
WINAPI
XMLHTTPRequest_Release
(
IXMLHTTPRequest
*
iface
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
This
->
sink
)
IDispatch_Release
(
This
->
sink
);
if
((
This
->
sink
=
sink
))
IDispatch_AddRef
(
This
->
sink
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
httprequest_release
(
This
);
heap_free
(
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
XMLHTTPRequest_GetTypeInfoCount
(
IXMLHTTPRequest
*
iface
,
UINT
*
pctinfo
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pctinfo
);
*
pctinfo
=
1
;
return
S_OK
;
}
static
HRESULT
WINAPI
XMLHTTPRequest_GetTypeInfo
(
IXMLHTTPRequest
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%u %u %p)
\n
"
,
This
,
iTInfo
,
lcid
,
ppTInfo
);
return
get_typeinfo
(
IXMLHTTPRequest_tid
,
ppTInfo
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_GetIDsOfNames
(
IXMLHTTPRequest
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
TRACE
(
"(%p)->(%s %p %u %u %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
rgszNames
,
cNames
,
lcid
,
rgDispId
);
if
(
!
rgszNames
||
cNames
==
0
||
!
rgDispId
)
return
E_INVALIDARG
;
hr
=
get_typeinfo
(
IXMLHTTPRequest_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_GetIDsOfNames
(
typeinfo
,
rgszNames
,
cNames
,
rgDispId
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
XMLHTTPRequest_Invoke
(
IXMLHTTPRequest
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
TRACE
(
"(%p)->(%d %s %d %d %p %p %p %p)
\n
"
,
This
,
dispIdMember
,
debugstr_guid
(
riid
),
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
hr
=
get_typeinfo
(
IXMLHTTPRequest_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_Invoke
(
typeinfo
,
&
This
->
IXMLHTTPRequest_iface
,
dispIdMember
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
XMLHTTPRequest_open
(
IXMLHTTPRequest
*
iface
,
BSTR
method
,
BSTR
url
,
VARIANT
async
,
VARIANT
user
,
VARIANT
password
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%s %s %s)
\n
"
,
This
,
debugstr_w
(
method
),
debugstr_w
(
url
),
debugstr_variant
(
&
async
));
return
httprequest_open
(
This
,
method
,
url
,
async
,
user
,
password
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_setRequestHeader
(
IXMLHTTPRequest
*
iface
,
BSTR
header
,
BSTR
value
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%s %s)
\n
"
,
This
,
debugstr_w
(
header
),
debugstr_w
(
value
));
return
httprequest_setRequestHeader
(
This
,
header
,
value
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_getResponseHeader
(
IXMLHTTPRequest
*
iface
,
BSTR
header
,
BSTR
*
value
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
header
),
value
);
return
httprequest_getResponseHeader
(
This
,
header
,
value
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_getAllResponseHeaders
(
IXMLHTTPRequest
*
iface
,
BSTR
*
respheaders
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
respheaders
);
return
httprequest_getAllResponseHeaders
(
This
,
respheaders
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_send
(
IXMLHTTPRequest
*
iface
,
VARIANT
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
body
));
return
httprequest_send
(
This
,
body
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_abort
(
IXMLHTTPRequest
*
iface
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
httprequest_abort
(
This
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_get_status
(
IXMLHTTPRequest
*
iface
,
LONG
*
status
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
status
);
return
httprequest_get_status
(
This
,
status
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_get_statusText
(
IXMLHTTPRequest
*
iface
,
BSTR
*
status
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
status
);
return
httprequest_get_statusText
(
This
,
status
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_get_responseXML
(
IXMLHTTPRequest
*
iface
,
IDispatch
**
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
body
);
return
httprequest_get_responseXML
(
This
,
body
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_get_responseText
(
IXMLHTTPRequest
*
iface
,
BSTR
*
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
body
);
return
httprequest_get_responseText
(
This
,
body
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_get_responseBody
(
IXMLHTTPRequest
*
iface
,
VARIANT
*
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
body
);
return
httprequest_get_responseBody
(
This
,
body
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_get_responseStream
(
IXMLHTTPRequest
*
iface
,
VARIANT
*
body
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
body
);
return
httprequest_get_responseStream
(
This
,
body
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_get_readyState
(
IXMLHTTPRequest
*
iface
,
LONG
*
state
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
state
);
return
httprequest_get_readyState
(
This
,
state
);
}
static
HRESULT
WINAPI
XMLHTTPRequest_put_onreadystatechange
(
IXMLHTTPRequest
*
iface
,
IDispatch
*
sink
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
sink
);
return
httprequest_put_onreadystatechange
(
This
,
sink
);
}
static
const
struct
IXMLHTTPRequestVtbl
XMLHTTPRequestVtbl
=
{
httpr
equest_QueryInterface
,
httpr
equest_AddRef
,
httpr
equest_Release
,
httpr
equest_GetTypeInfoCount
,
httpr
equest_GetTypeInfo
,
httpr
equest_GetIDsOfNames
,
httpr
equest_Invoke
,
httpr
equest_open
,
httpr
equest_setRequestHeader
,
httpr
equest_getResponseHeader
,
httpr
equest_getAllResponseHeaders
,
httpr
equest_send
,
httpr
equest_abort
,
httpr
equest_get_status
,
httpr
equest_get_statusText
,
httpr
equest_get_responseXML
,
httpr
equest_get_responseText
,
httpr
equest_get_responseBody
,
httpr
equest_get_responseStream
,
httpr
equest_get_readyState
,
httpr
equest_put_onreadystatechange
XMLHTTPR
equest_QueryInterface
,
XMLHTTPR
equest_AddRef
,
XMLHTTPR
equest_Release
,
XMLHTTPR
equest_GetTypeInfoCount
,
XMLHTTPR
equest_GetTypeInfo
,
XMLHTTPR
equest_GetIDsOfNames
,
XMLHTTPR
equest_Invoke
,
XMLHTTPR
equest_open
,
XMLHTTPR
equest_setRequestHeader
,
XMLHTTPR
equest_getResponseHeader
,
XMLHTTPR
equest_getAllResponseHeaders
,
XMLHTTPR
equest_send
,
XMLHTTPR
equest_abort
,
XMLHTTPR
equest_get_status
,
XMLHTTPR
equest_get_statusText
,
XMLHTTPR
equest_get_responseXML
,
XMLHTTPR
equest_get_responseText
,
XMLHTTPR
equest_get_responseBody
,
XMLHTTPR
equest_get_responseStream
,
XMLHTTPR
equest_get_readyState
,
XMLHTTPR
equest_put_onreadystatechange
};
/* IObjectWithSite */
...
...
@@ -1470,17 +1524,8 @@ static const IObjectSafetyVtbl ObjectSafetyVtbl = {
httprequest_Safety_SetInterfaceSafetyOptions
};
HRESULT
XMLHTTPRequest_create
(
IUnknown
*
pUnkOuter
,
void
**
ppObj
)
static
void
init_httprequest
(
httprequest
*
req
)
{
httprequest
*
req
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p,%p)
\n
"
,
pUnkOuter
,
ppObj
);
req
=
heap_alloc
(
sizeof
(
*
req
)
);
if
(
!
req
)
return
E_OUTOFMEMORY
;
req
->
IXMLHTTPRequest_iface
.
lpVtbl
=
&
XMLHTTPRequestVtbl
;
req
->
IObjectWithSite_iface
.
lpVtbl
=
&
ObjectWithSiteVtbl
;
req
->
IObjectSafety_iface
.
lpVtbl
=
&
ObjectSafetyVtbl
;
...
...
@@ -1506,12 +1551,24 @@ HRESULT XMLHTTPRequest_create(IUnknown *pUnkOuter, void **ppObj)
req
->
site
=
NULL
;
req
->
safeopt
=
0
;
}
*
ppObj
=
&
req
->
IXMLHTTPRequest_iface
;
HRESULT
XMLHTTPRequest_create
(
IUnknown
*
outer
,
void
**
obj
)
{
httprequest
*
req
;
TRACE
(
"
returning iface %p
\n
"
,
*
ppO
bj
);
TRACE
(
"
(%p, %p)
\n
"
,
outer
,
o
bj
);
return
hr
;
req
=
heap_alloc
(
sizeof
(
*
req
)
);
if
(
!
req
)
return
E_OUTOFMEMORY
;
init_httprequest
(
req
);
*
obj
=
&
req
->
IXMLHTTPRequest_iface
;
TRACE
(
"returning iface %p
\n
"
,
*
obj
);
return
S_OK
;
}
#else
...
...
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