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
27bb5a0f
Commit
27bb5a0f
authored
Feb 17, 2011
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Feb 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Add IObjectWithSite support to IXMLHttpRequest.
parent
d1442ace
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
0 deletions
+81
-0
httprequest.c
dlls/msxml3/httprequest.c
+76
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+5
-0
No files found.
dlls/msxml3/httprequest.c
View file @
27bb5a0f
...
...
@@ -61,6 +61,7 @@ struct reqheader
typedef
struct
{
IXMLHTTPRequest
IXMLHTTPRequest_iface
;
IObjectWithSite
IObjectWithSite_iface
;
LONG
ref
;
READYSTATE
state
;
...
...
@@ -81,6 +82,9 @@ typedef struct
/* bind callback */
BindStatusCallback
*
bsc
;
LONG
status
;
/* IObjectWithSite*/
IUnknown
*
site
;
}
httprequest
;
static
inline
httprequest
*
impl_from_IXMLHTTPRequest
(
IXMLHTTPRequest
*
iface
)
...
...
@@ -88,6 +92,11 @@ static inline httprequest *impl_from_IXMLHTTPRequest( IXMLHTTPRequest *iface )
return
CONTAINING_RECORD
(
iface
,
httprequest
,
IXMLHTTPRequest_iface
);
}
static
inline
httprequest
*
impl_from_IObjectWithSite
(
IObjectWithSite
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
httprequest
,
IObjectWithSite_iface
);
}
static
void
httprequest_setreadystate
(
httprequest
*
This
,
READYSTATE
state
)
{
READYSTATE
last
=
This
->
state
;
...
...
@@ -503,6 +512,10 @@ static HRESULT WINAPI httprequest_QueryInterface(IXMLHTTPRequest *iface, REFIID
{
*
ppvObject
=
iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IObjectWithSite
,
riid
))
{
*
ppvObject
=
&
This
->
IObjectWithSite_iface
;
}
else
{
TRACE
(
"Unsupported interface %s
\n
"
,
debugstr_guid
(
riid
));
...
...
@@ -534,6 +547,9 @@ static ULONG WINAPI httprequest_Release(IXMLHTTPRequest *iface)
{
struct
reqheader
*
header
,
*
header2
;
if
(
This
->
site
)
IUnknown_Release
(
This
->
site
);
SysFreeString
(
This
->
url
);
SysFreeString
(
This
->
user
);
SysFreeString
(
This
->
password
);
...
...
@@ -992,6 +1008,64 @@ static const struct IXMLHTTPRequestVtbl dimimpl_vtbl =
httprequest_put_onreadystatechange
};
/* IObjectWithSite */
static
HRESULT
WINAPI
httprequest_ObjectWithSite_QueryInterface
(
IObjectWithSite
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
httprequest
*
This
=
impl_from_IObjectWithSite
(
iface
);
return
IXMLHTTPRequest_QueryInterface
(
(
IXMLHTTPRequest
*
)
This
,
riid
,
ppvObject
);
}
static
ULONG
WINAPI
httprequest_ObjectWithSite_AddRef
(
IObjectWithSite
*
iface
)
{
httprequest
*
This
=
impl_from_IObjectWithSite
(
iface
);
return
IXMLHTTPRequest_AddRef
((
IXMLHTTPRequest
*
)
This
);
}
static
ULONG
WINAPI
httprequest_ObjectWithSite_Release
(
IObjectWithSite
*
iface
)
{
httprequest
*
This
=
impl_from_IObjectWithSite
(
iface
);
return
IXMLHTTPRequest_Release
((
IXMLHTTPRequest
*
)
This
);
}
static
HRESULT
WINAPI
httprequest_ObjectWithSite_GetSite
(
IObjectWithSite
*
iface
,
REFIID
iid
,
void
**
ppvSite
)
{
httprequest
*
This
=
impl_from_IObjectWithSite
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
iid
),
ppvSite
);
if
(
!
This
->
site
)
return
E_FAIL
;
return
IUnknown_QueryInterface
(
This
->
site
,
iid
,
ppvSite
);
}
static
HRESULT
WINAPI
httprequest_ObjectWithSite_SetSite
(
IObjectWithSite
*
iface
,
IUnknown
*
punk
)
{
httprequest
*
This
=
impl_from_IObjectWithSite
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
punk
);
if
(
punk
)
IUnknown_AddRef
(
punk
);
if
(
This
->
site
)
IUnknown_Release
(
This
->
site
);
This
->
site
=
punk
;
return
S_OK
;
}
static
const
IObjectWithSiteVtbl
httprequestObjectSite
=
{
httprequest_ObjectWithSite_QueryInterface
,
httprequest_ObjectWithSite_AddRef
,
httprequest_ObjectWithSite_Release
,
httprequest_ObjectWithSite_SetSite
,
httprequest_ObjectWithSite_GetSite
};
HRESULT
XMLHTTPRequest_create
(
IUnknown
*
pUnkOuter
,
void
**
ppObj
)
{
httprequest
*
req
;
...
...
@@ -1004,6 +1078,7 @@ HRESULT XMLHTTPRequest_create(IUnknown *pUnkOuter, void **ppObj)
return
E_OUTOFMEMORY
;
req
->
IXMLHTTPRequest_iface
.
lpVtbl
=
&
dimimpl_vtbl
;
req
->
IObjectWithSite_iface
.
lpVtbl
=
&
httprequestObjectSite
;
req
->
ref
=
1
;
req
->
async
=
FALSE
;
...
...
@@ -1017,6 +1092,7 @@ HRESULT XMLHTTPRequest_create(IUnknown *pUnkOuter, void **ppObj)
req
->
status
=
0
;
req
->
reqheader_size
=
0
;
list_init
(
&
req
->
reqheaders
);
req
->
site
=
NULL
;
*
ppObj
=
&
req
->
IXMLHTTPRequest_iface
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
27bb5a0f
...
...
@@ -3216,6 +3216,7 @@ static void test_XMLHTTP(void)
static
const
CHAR
xmltestbodyA
[]
=
"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?>
\n
<a>TEST</a>
\n
"
;
IXMLHttpRequest
*
pXMLHttpRequest
;
IObjectWithSite
*
pSite
;
BSTR
bstrResponse
,
method
,
url
;
VARIANT
dummy
;
VARIANT
async
;
...
...
@@ -3232,6 +3233,10 @@ static void test_XMLHTTP(void)
return
;
}
hr
=
IXMLHttpRequest_QueryInterface
(
pXMLHttpRequest
,
&
IID_IObjectWithSite
,
(
void
**
)
&
pSite
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IObjectWithSite_Release
(
pSite
);
VariantInit
(
&
dummy
);
V_VT
(
&
dummy
)
=
VT_ERROR
;
V_ERROR
(
&
dummy
)
=
DISP_E_MEMBERNOTFOUND
;
...
...
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