Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9c9180f6
Commit
9c9180f6
authored
May 30, 2017
by
Owen Rudge
Committed by
Alexandre Julliard
Jun 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsdapi: Create default XML context in WSDCreateDiscoveryPublisher if required.
Signed-off-by:
Owen Rudge
<
orudge@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9bf2f6b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
2 deletions
+61
-2
discovery.c
dlls/wsdapi/discovery.c
+10
-2
discovery.c
dlls/wsdapi/tests/discovery.c
+51
-0
No files found.
dlls/wsdapi/discovery.c
View file @
9c9180f6
...
...
@@ -360,10 +360,18 @@ HRESULT WINAPI WSDCreateDiscoveryPublisher(IWSDXMLContext *pContext, IWSDiscover
obj
->
IWSDiscoveryPublisher_iface
.
lpVtbl
=
&
publisher_vtbl
;
obj
->
ref
=
1
;
obj
->
xmlContext
=
pContext
;
if
(
pContext
!
=
NULL
)
if
(
pContext
=
=
NULL
)
{
if
(
FAILED
(
WSDXMLCreateContext
(
&
obj
->
xmlContext
)))
{
WARN
(
"Unable to create XML context
\n
"
);
return
E_OUTOFMEMORY
;
}
}
else
{
obj
->
xmlContext
=
pContext
;
IWSDXMLContext_AddRef
(
pContext
);
}
...
...
dlls/wsdapi/tests/discovery.c
View file @
9c9180f6
...
...
@@ -162,6 +162,56 @@ static void CreateDiscoveryPublisher_tests(void)
ok
(
ref
==
0
,
"IWSDiscoveryPublisher_Release() has %d references, should have 0
\n
"
,
ref
);
}
static
void
CreateDiscoveryPublisher_XMLContext_tests
(
void
)
{
IWSDiscoveryPublisher
*
publisher
=
NULL
;
IWSDXMLContext
*
xmlContext
,
*
returnedContext
;
HRESULT
rc
;
int
ref
;
/* Test creating an XML context and supplying it to WSDCreateDiscoveryPublisher */
rc
=
WSDXMLCreateContext
(
&
xmlContext
);
ok
(
rc
==
S_OK
,
"WSDXMLCreateContext failed: %08x
\n
"
,
rc
);
rc
=
WSDCreateDiscoveryPublisher
(
xmlContext
,
&
publisher
);
ok
(
rc
==
S_OK
,
"WSDCreateDiscoveryPublisher(xmlContext, &publisher) failed: %08x
\n
"
,
rc
);
ok
(
publisher
!=
NULL
,
"WSDCreateDiscoveryPublisher(xmlContext, &publisher) failed: publisher == NULL
\n
"
);
rc
=
IWSDiscoveryPublisher_GetXMLContext
(
publisher
,
NULL
);
ok
(
rc
==
E_INVALIDARG
,
"GetXMLContext returned unexpected value with NULL argument: %08x
\n
"
,
rc
);
rc
=
IWSDiscoveryPublisher_GetXMLContext
(
publisher
,
&
returnedContext
);
ok
(
rc
==
S_OK
,
"GetXMLContext failed: %08x
\n
"
,
rc
);
ok
(
xmlContext
==
returnedContext
,
"GetXMLContext returned unexpected value: returnedContext == %p
\n
"
,
returnedContext
);
ref
=
IWSDXMLContext_Release
(
returnedContext
);
ok
(
ref
==
2
,
"IWSDXMLContext_Release() has %d references, should have 2
\n
"
,
ref
);
ref
=
IWSDiscoveryPublisher_Release
(
publisher
);
ok
(
ref
==
0
,
"IWSDiscoveryPublisher_Release() has %d references, should have 0
\n
"
,
ref
);
ref
=
IWSDXMLContext_Release
(
returnedContext
);
ok
(
ref
==
0
,
"IWSDXMLContext_Release() has %d references, should have 0
\n
"
,
ref
);
/* Test using a default XML context */
publisher
=
NULL
;
returnedContext
=
NULL
;
rc
=
WSDCreateDiscoveryPublisher
(
NULL
,
&
publisher
);
ok
(
rc
==
S_OK
,
"WSDCreateDiscoveryPublisher(NULL, &publisher) failed: %08x
\n
"
,
rc
);
ok
(
publisher
!=
NULL
,
"WSDCreateDiscoveryPublisher(NULL, &publisher) failed: publisher == NULL
\n
"
);
rc
=
IWSDiscoveryPublisher_GetXMLContext
(
publisher
,
&
returnedContext
);
ok
(
rc
==
S_OK
,
"GetXMLContext failed: %08x
\n
"
,
rc
);
ref
=
IWSDXMLContext_Release
(
returnedContext
);
ok
(
ref
==
1
,
"IWSDXMLContext_Release() has %d references, should have 1
\n
"
,
ref
);
ref
=
IWSDiscoveryPublisher_Release
(
publisher
);
ok
(
ref
==
0
,
"IWSDiscoveryPublisher_Release() has %d references, should have 0
\n
"
,
ref
);
}
static
void
Publish_tests
(
void
)
{
IWSDiscoveryPublisher
*
publisher
=
NULL
;
...
...
@@ -231,6 +281,7 @@ START_TEST(discovery)
CoInitialize
(
NULL
);
CreateDiscoveryPublisher_tests
();
CreateDiscoveryPublisher_XMLContext_tests
();
Publish_tests
();
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