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
7e310f87
Commit
7e310f87
authored
Sep 06, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opcservices: Implement GetRelationship().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c2d8323f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
3 deletions
+44
-3
package.c
dlls/opcservices/package.c
+23
-2
opcservices.c
dlls/opcservices/tests/opcservices.c
+20
-1
opcbase.idl
include/opcbase.idl
+1
-0
No files found.
dlls/opcservices/package.c
View file @
7e310f87
...
...
@@ -583,9 +583,30 @@ static ULONG WINAPI opc_relationship_set_Release(IOpcRelationshipSet *iface)
static
HRESULT
WINAPI
opc_relationship_set_GetRelationship
(
IOpcRelationshipSet
*
iface
,
const
WCHAR
*
id
,
IOpcRelationship
**
relationship
)
{
FIXME
(
"iface %p, id %s, relationship %p stub!
\n
"
,
iface
,
debugstr_w
(
id
),
relationship
);
struct
opc_relationship_set
*
relationship_set
=
impl_from_IOpcRelationshipSet
(
iface
);
size_t
i
;
return
E_NOTIMPL
;
TRACE
(
"iface %p, id %s, relationship %p.
\n
"
,
iface
,
debugstr_w
(
id
),
relationship
);
if
(
!
relationship
)
return
E_POINTER
;
*
relationship
=
NULL
;
if
(
!
id
)
return
E_POINTER
;
for
(
i
=
0
;
i
<
relationship_set
->
count
;
i
++
)
{
if
(
!
strcmpW
(
id
,
relationship_set
->
relationships
[
i
]
->
id
))
{
*
relationship
=
&
relationship_set
->
relationships
[
i
]
->
IOpcRelationship_iface
;
IOpcRelationship_AddRef
(
*
relationship
);
break
;
}
}
return
*
relationship
?
S_OK
:
OPC_E_NO_SUCH_RELATIONSHIP
;
}
static
HRESULT
WINAPI
opc_relationship_set_CreateRelationship
(
IOpcRelationshipSet
*
iface
,
const
WCHAR
*
id
,
...
...
dlls/opcservices/tests/opcservices.c
View file @
7e310f87
...
...
@@ -232,8 +232,8 @@ static void test_relationship(void)
static
const
WCHAR
typeW
[]
=
{
't'
,
'y'
,
'p'
,
'e'
,
0
};
static
const
WCHAR
rootW
[]
=
{
'/'
,
0
};
IUri
*
target_uri
,
*
target_uri2
,
*
uri
;
IOpcRelationship
*
rel
,
*
rel2
,
*
rel3
;
IOpcUri
*
source_uri
,
*
source_uri2
;
IOpcRelationship
*
rel
,
*
rel2
;
IOpcRelationshipSet
*
rels
;
IOpcFactory
*
factory
;
IOpcPackage
*
package
;
...
...
@@ -283,6 +283,25 @@ todo_wine
hr
=
IOpcRelationship_GetId
(
rel
,
&
id
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get id, hr %#x.
\n
"
,
hr
);
ok
(
lstrlenW
(
id
)
==
9
&&
*
id
==
'R'
,
"Unexpected relationship id %s.
\n
"
,
wine_dbgstr_w
(
id
));
hr
=
IOpcRelationshipSet_GetRelationship
(
rels
,
id
,
&
rel3
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get relationship, hr %#x.
\n
"
,
hr
);
IOpcRelationship_Release
(
rel3
);
hr
=
IOpcRelationshipSet_GetRelationship
(
rels
,
id
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
rel3
=
(
void
*
)
0xdeadbeef
;
hr
=
IOpcRelationshipSet_GetRelationship
(
rels
,
NULL
,
&
rel3
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rel3
==
NULL
,
"Expected null pointer.
\n
"
);
*
id
=
'r'
;
rel3
=
(
void
*
)
0xdeadbeef
;
hr
=
IOpcRelationshipSet_GetRelationship
(
rels
,
id
,
&
rel3
);
ok
(
hr
==
OPC_E_NO_SUCH_RELATIONSHIP
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rel3
==
NULL
,
"Expected null pointer.
\n
"
);
CoTaskMemFree
(
id
);
hr
=
IOpcRelationship_GetTargetUri
(
rel
,
&
uri
);
...
...
include/opcbase.idl
View file @
7e310f87
...
...
@@ -42,3 +42,4 @@ typedef [v1_enum] enum
}
OPC_URI_TARGET_MODE
;
cpp_quote
(
"#define OPC_E_INVALID_RELATIONSHIP_TARGET MAKE_HRESULT(SEVERITY_ERROR, FACILITY_OPC, 0x12)"
)
cpp_quote
(
"#define OPC_E_NO_SUCH_RELATIONSHIP MAKE_HRESULT(SEVERITY_ERROR, FACILITY_OPC, 0x48)"
)
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