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
af07789c
Commit
af07789c
authored
Sep 29, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3/httpreq: Added ISupportErrorInfo stub.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a0cdab26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
8 deletions
+115
-8
httprequest.c
dlls/msxml3/httprequest.c
+52
-2
httpreq.c
dlls/msxml3/tests/httpreq.c
+63
-6
No files found.
dlls/msxml3/httprequest.c
View file @
af07789c
...
@@ -73,6 +73,7 @@ typedef struct
...
@@ -73,6 +73,7 @@ typedef struct
IXMLHTTPRequest
IXMLHTTPRequest_iface
;
IXMLHTTPRequest
IXMLHTTPRequest_iface
;
IObjectWithSite
IObjectWithSite_iface
;
IObjectWithSite
IObjectWithSite_iface
;
IObjectSafety
IObjectSafety_iface
;
IObjectSafety
IObjectSafety_iface
;
ISupportErrorInfo
ISupportErrorInfo_iface
;
LONG
ref
;
LONG
ref
;
READYSTATE
state
;
READYSTATE
state
;
...
@@ -131,6 +132,11 @@ static inline httprequest *impl_from_IObjectSafety(IObjectSafety *iface)
...
@@ -131,6 +132,11 @@ static inline httprequest *impl_from_IObjectSafety(IObjectSafety *iface)
return
CONTAINING_RECORD
(
iface
,
httprequest
,
IObjectSafety_iface
);
return
CONTAINING_RECORD
(
iface
,
httprequest
,
IObjectSafety_iface
);
}
}
static
inline
httprequest
*
impl_from_ISupportErrorInfo
(
ISupportErrorInfo
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
httprequest
,
ISupportErrorInfo_iface
);
}
static
inline
serverhttp
*
impl_from_IServerXMLHTTPRequest
(
IServerXMLHTTPRequest
*
iface
)
static
inline
serverhttp
*
impl_from_IServerXMLHTTPRequest
(
IServerXMLHTTPRequest
*
iface
)
{
{
return
CONTAINING_RECORD
(
iface
,
serverhttp
,
IServerXMLHTTPRequest_iface
);
return
CONTAINING_RECORD
(
iface
,
serverhttp
,
IServerXMLHTTPRequest_iface
);
...
@@ -1329,6 +1335,10 @@ static HRESULT WINAPI XMLHTTPRequest_QueryInterface(IXMLHTTPRequest *iface, REFI
...
@@ -1329,6 +1335,10 @@ static HRESULT WINAPI XMLHTTPRequest_QueryInterface(IXMLHTTPRequest *iface, REFI
{
{
*
ppvObject
=
&
This
->
IObjectSafety_iface
;
*
ppvObject
=
&
This
->
IObjectSafety_iface
;
}
}
else
if
(
IsEqualGUID
(
&
IID_ISupportErrorInfo
,
riid
))
{
*
ppvObject
=
&
This
->
ISupportErrorInfo_iface
;
}
else
else
{
{
TRACE
(
"Unsupported interface %s
\n
"
,
debugstr_guid
(
riid
));
TRACE
(
"Unsupported interface %s
\n
"
,
debugstr_guid
(
riid
));
...
@@ -1336,7 +1346,7 @@ static HRESULT WINAPI XMLHTTPRequest_QueryInterface(IXMLHTTPRequest *iface, REFI
...
@@ -1336,7 +1346,7 @@ static HRESULT WINAPI XMLHTTPRequest_QueryInterface(IXMLHTTPRequest *iface, REFI
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
I
XMLHTTPRequest_AddRef
(
iface
);
I
Unknown_AddRef
((
IUnknown
*
)
*
ppvObject
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -1709,6 +1719,41 @@ static const IObjectSafetyVtbl ObjectSafetyVtbl = {
...
@@ -1709,6 +1719,41 @@ static const IObjectSafetyVtbl ObjectSafetyVtbl = {
httprequest_Safety_SetInterfaceSafetyOptions
httprequest_Safety_SetInterfaceSafetyOptions
};
};
static
HRESULT
WINAPI
SupportErrorInfo_QueryInterface
(
ISupportErrorInfo
*
iface
,
REFIID
riid
,
void
**
obj
)
{
httprequest
*
This
=
impl_from_ISupportErrorInfo
(
iface
);
return
IXMLHTTPRequest_QueryInterface
(
&
This
->
IXMLHTTPRequest_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
SupportErrorInfo_AddRef
(
ISupportErrorInfo
*
iface
)
{
httprequest
*
This
=
impl_from_ISupportErrorInfo
(
iface
);
return
IXMLHTTPRequest_AddRef
(
&
This
->
IXMLHTTPRequest_iface
);
}
static
ULONG
WINAPI
SupportErrorInfo_Release
(
ISupportErrorInfo
*
iface
)
{
httprequest
*
This
=
impl_from_ISupportErrorInfo
(
iface
);
return
IXMLHTTPRequest_Release
(
&
This
->
IXMLHTTPRequest_iface
);
}
static
HRESULT
WINAPI
SupportErrorInfo_InterfaceSupportsErrorInfo
(
ISupportErrorInfo
*
iface
,
REFIID
riid
)
{
httprequest
*
This
=
impl_from_ISupportErrorInfo
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_guid
(
riid
));
return
E_NOTIMPL
;
}
static
const
ISupportErrorInfoVtbl
SupportErrorInfoVtbl
=
{
SupportErrorInfo_QueryInterface
,
SupportErrorInfo_AddRef
,
SupportErrorInfo_Release
,
SupportErrorInfo_InterfaceSupportsErrorInfo
,
};
/* IServerXMLHTTPRequest */
/* IServerXMLHTTPRequest */
static
HRESULT
WINAPI
ServerXMLHTTPRequest_QueryInterface
(
IServerXMLHTTPRequest
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
ServerXMLHTTPRequest_QueryInterface
(
IServerXMLHTTPRequest
*
iface
,
REFIID
riid
,
void
**
obj
)
{
{
...
@@ -1723,6 +1768,10 @@ static HRESULT WINAPI ServerXMLHTTPRequest_QueryInterface(IServerXMLHTTPRequest
...
@@ -1723,6 +1768,10 @@ static HRESULT WINAPI ServerXMLHTTPRequest_QueryInterface(IServerXMLHTTPRequest
{
{
*
obj
=
iface
;
*
obj
=
iface
;
}
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_ISupportErrorInfo
))
{
*
obj
=
&
This
->
req
.
ISupportErrorInfo_iface
;
}
else
else
{
{
TRACE
(
"Unsupported interface %s
\n
"
,
debugstr_guid
(
riid
));
TRACE
(
"Unsupported interface %s
\n
"
,
debugstr_guid
(
riid
));
...
@@ -1730,7 +1779,7 @@ static HRESULT WINAPI ServerXMLHTTPRequest_QueryInterface(IServerXMLHTTPRequest
...
@@ -1730,7 +1779,7 @@ static HRESULT WINAPI ServerXMLHTTPRequest_QueryInterface(IServerXMLHTTPRequest
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
I
ServerXMLHTTPRequest_AddRef
(
iface
);
I
Unknown_AddRef
(
(
IUnknown
*
)
*
obj
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -1987,6 +2036,7 @@ static void init_httprequest(httprequest *req)
...
@@ -1987,6 +2036,7 @@ static void init_httprequest(httprequest *req)
req
->
IXMLHTTPRequest_iface
.
lpVtbl
=
&
XMLHTTPRequestVtbl
;
req
->
IXMLHTTPRequest_iface
.
lpVtbl
=
&
XMLHTTPRequestVtbl
;
req
->
IObjectWithSite_iface
.
lpVtbl
=
&
ObjectWithSiteVtbl
;
req
->
IObjectWithSite_iface
.
lpVtbl
=
&
ObjectWithSiteVtbl
;
req
->
IObjectSafety_iface
.
lpVtbl
=
&
ObjectSafetyVtbl
;
req
->
IObjectSafety_iface
.
lpVtbl
=
&
ObjectSafetyVtbl
;
req
->
ISupportErrorInfo_iface
.
lpVtbl
=
&
SupportErrorInfoVtbl
;
req
->
ref
=
1
;
req
->
ref
=
1
;
req
->
async
=
FALSE
;
req
->
async
=
FALSE
;
...
...
dlls/msxml3/tests/httpreq.c
View file @
af07789c
...
@@ -1339,6 +1339,16 @@ static IXMLHttpRequest *create_xhr(void)
...
@@ -1339,6 +1339,16 @@ static IXMLHttpRequest *create_xhr(void)
return
SUCCEEDED
(
hr
)
?
ret
:
NULL
;
return
SUCCEEDED
(
hr
)
?
ret
:
NULL
;
}
}
static
IServerXMLHTTPRequest
*
create_server_xhr
(
void
)
{
IServerXMLHTTPRequest
*
ret
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_ServerXMLHTTP30
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IServerXMLHTTPRequest
,
(
void
**
)
&
ret
);
return
SUCCEEDED
(
hr
)
?
ret
:
NULL
;
}
static
void
set_safety_opt
(
IUnknown
*
unk
,
DWORD
mask
,
DWORD
opts
)
static
void
set_safety_opt
(
IUnknown
*
unk
,
DWORD
mask
,
DWORD
opts
)
{
{
IObjectSafety
*
obj_safety
;
IObjectSafety
*
obj_safety
;
...
@@ -1777,20 +1787,67 @@ static void test_safe_httpreq(void)
...
@@ -1777,20 +1787,67 @@ static void test_safe_httpreq(void)
free_bstrs
();
free_bstrs
();
}
}
static
void
test_supporterrorinfo
(
void
)
{
HRESULT
hr
;
IXMLHttpRequest
*
xhr
;
IServerXMLHTTPRequest
*
server_xhr
;
ISupportErrorInfo
*
errorinfo
,
*
errorinfo2
;
xhr
=
create_xhr
();
EXPECT_REF
(
xhr
,
1
);
hr
=
IXMLHttpRequest_QueryInterface
(
xhr
,
&
IID_ISupportErrorInfo
,
(
void
**
)
&
errorinfo
);
ok
(
hr
==
S_OK
,
"Failed to get ISupportErrorInfo, hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
xhr
,
2
);
hr
=
IXMLHttpRequest_QueryInterface
(
xhr
,
&
IID_ISupportErrorInfo
,
(
void
**
)
&
errorinfo2
);
ok
(
hr
==
S_OK
,
"Failed to get ISupportErrorInfo, hr %#x.
\n
"
,
hr
);
ok
(
errorinfo
==
errorinfo2
,
"Unexpected error info instance.
\n
"
);
EXPECT_REF
(
xhr
,
3
);
ISupportErrorInfo_Release
(
errorinfo2
);
ISupportErrorInfo_Release
(
errorinfo
);
IXMLHttpRequest_Release
(
xhr
);
/* ServerXMLHTTP */
server_xhr
=
create_server_xhr
();
EXPECT_REF
(
server_xhr
,
1
);
hr
=
IServerXMLHTTPRequest_QueryInterface
(
server_xhr
,
&
IID_ISupportErrorInfo
,
(
void
**
)
&
errorinfo
);
ok
(
hr
==
S_OK
,
"Failed to get ISupportErrorInfo, hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
server_xhr
,
2
);
hr
=
IServerXMLHTTPRequest_QueryInterface
(
server_xhr
,
&
IID_ISupportErrorInfo
,
(
void
**
)
&
errorinfo2
);
ok
(
hr
==
S_OK
,
"Failed to get ISupportErrorInfo, hr %#x.
\n
"
,
hr
);
ok
(
errorinfo
==
errorinfo2
,
"Unexpected error info instance.
\n
"
);
EXPECT_REF
(
server_xhr
,
3
);
ISupportErrorInfo_Release
(
errorinfo2
);
ISupportErrorInfo_Release
(
errorinfo
);
IServerXMLHTTPRequest_Release
(
server_xhr
);
}
START_TEST
(
httpreq
)
START_TEST
(
httpreq
)
{
{
IXMLHttpRequest
*
xhr
;
IXMLHttpRequest
*
xhr
;
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
if
((
xhr
=
create_xhr
()))
{
if
(
!
(
xhr
=
create_xhr
()))
IXMLHttpRequest_Release
(
xhr
);
{
test_XMLHTTP
();
test_safe_httpreq
();
}
else
{
win_skip
(
"IXMLHTTPRequest is not available
\n
"
);
win_skip
(
"IXMLHTTPRequest is not available
\n
"
);
CoUninitialize
();
return
;
}
}
IXMLHttpRequest_Release
(
xhr
);
test_XMLHTTP
();
test_safe_httpreq
();
test_supporterrorinfo
();
CoUninitialize
();
CoUninitialize
();
}
}
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