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
40e276f7
Commit
40e276f7
authored
Sep 05, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opcservices: Keep target uri and mode for relationships.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2ff3f689
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
9 deletions
+35
-9
package.c
dlls/opcservices/package.c
+22
-6
opcservices.c
dlls/opcservices/tests/opcservices.c
+13
-3
No files found.
dlls/opcservices/package.c
View file @
40e276f7
...
...
@@ -66,6 +66,8 @@ struct opc_relationship
LONG
refcount
;
WCHAR
*
id
;
IUri
*
target
;
OPC_URI_TARGET_MODE
target_mode
;
};
struct
opc_relationship_set
...
...
@@ -397,6 +399,7 @@ static ULONG WINAPI opc_relationship_Release(IOpcRelationship *iface)
if
(
!
refcount
)
{
CoTaskMemFree
(
relationship
->
id
);
IUri_Release
(
relationship
->
target
);
heap_free
(
relationship
);
}
...
...
@@ -429,16 +432,25 @@ static HRESULT WINAPI opc_relationship_GetSourceUri(IOpcRelationship *iface, IOp
static
HRESULT
WINAPI
opc_relationship_GetTargetUri
(
IOpcRelationship
*
iface
,
IUri
**
target
)
{
FIXME
(
"iface %p, target %p stub!
\n
"
,
iface
,
target
);
struct
opc_relationship
*
relationship
=
impl_from_IOpcRelationship
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"iface %p, target %p.
\n
"
,
iface
,
target
);
*
target
=
relationship
->
target
;
IUri_AddRef
(
*
target
);
return
S_OK
;
}
static
HRESULT
WINAPI
opc_relationship_GetTargetMode
(
IOpcRelationship
*
iface
,
OPC_URI_TARGET_MODE
*
target_mode
)
{
FIXME
(
"iface %p, target_mode %p stub!
\n
"
,
iface
,
target_mod
e
);
struct
opc_relationship
*
relationship
=
impl_from_IOpcRelationship
(
ifac
e
);
return
E_NOTIMPL
;
TRACE
(
"iface %p, target_mode %p.
\n
"
,
iface
,
target_mode
);
*
target_mode
=
relationship
->
target_mode
;
return
S_OK
;
}
static
const
IOpcRelationshipVtbl
opc_relationship_vtbl
=
...
...
@@ -453,7 +465,8 @@ static const IOpcRelationshipVtbl opc_relationship_vtbl =
opc_relationship_GetTargetMode
,
};
static
HRESULT
opc_relationship_create
(
struct
opc_relationship_set
*
set
,
const
WCHAR
*
id
,
IOpcRelationship
**
out
)
static
HRESULT
opc_relationship_create
(
struct
opc_relationship_set
*
set
,
const
WCHAR
*
id
,
IUri
*
target_uri
,
OPC_URI_TARGET_MODE
target_mode
,
IOpcRelationship
**
out
)
{
struct
opc_relationship
*
relationship
;
...
...
@@ -488,6 +501,9 @@ static HRESULT opc_relationship_create(struct opc_relationship_set *set, const W
return
E_OUTOFMEMORY
;
}
relationship
->
target
=
target_uri
;
IUri_AddRef
(
relationship
->
target
);
set
->
relationships
[
set
->
count
++
]
=
relationship
;
IOpcRelationship_AddRef
(
&
relationship
->
IOpcRelationship_iface
);
...
...
@@ -561,7 +577,7 @@ static HRESULT WINAPI opc_relationship_set_CreateRelationship(IOpcRelationshipSe
if
(
!
type
||
!
target_uri
)
return
E_POINTER
;
return
opc_relationship_create
(
relationship_set
,
id
,
relationship
);
return
opc_relationship_create
(
relationship_set
,
id
,
target_uri
,
target_mode
,
relationship
);
}
static
HRESULT
WINAPI
opc_relationship_set_DeleteRelationship
(
IOpcRelationshipSet
*
iface
,
const
WCHAR
*
id
)
...
...
dlls/opcservices/tests/opcservices.c
View file @
40e276f7
...
...
@@ -205,16 +205,17 @@ static void test_file_stream(void)
DeleteFileW
(
pathW
);
}
static
void
test_relationship
_id
(
void
)
static
void
test_relationship
(
void
)
{
static
const
WCHAR
absoluteW
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'h'
,
'o'
,
's'
,
't'
,
'/'
,
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
static
const
WCHAR
targetW
[]
=
{
't'
,
'a'
,
'r'
,
'g'
,
'e'
,
't'
,
0
};
static
const
WCHAR
typeW
[]
=
{
't'
,
'y'
,
'p'
,
'e'
,
0
};
IUri
*
target_uri
,
*
target_uri2
;
IUri
*
target_uri
,
*
target_uri2
,
*
uri
;
IOpcRelationshipSet
*
rels
;
IOpcRelationship
*
rel
;
IOpcFactory
*
factory
;
IOpcPackage
*
package
;
DWORD
mode
;
HRESULT
hr
;
WCHAR
*
id
;
...
...
@@ -257,6 +258,15 @@ todo_wine
ok
(
lstrlenW
(
id
)
==
9
&&
*
id
==
'R'
,
"Unexpected relationship id %s.
\n
"
,
wine_dbgstr_w
(
id
));
CoTaskMemFree
(
id
);
hr
=
IOpcRelationship_GetTargetUri
(
rel
,
&
uri
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get target uri, hr %#x.
\n
"
,
hr
);
ok
(
uri
==
target_uri
,
"Unexpected uri.
\n
"
);
IUri_Release
(
uri
);
hr
=
IOpcRelationship_GetTargetMode
(
rel
,
&
mode
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get target mode, hr %#x.
\n
"
,
hr
);
ok
(
mode
==
OPC_URI_TARGET_MODE_INTERNAL
,
"Unexpected mode %d.
\n
"
,
mode
);
IOpcRelationship_Release
(
rel
);
IOpcRelationshipSet_Release
(
rels
);
...
...
@@ -283,7 +293,7 @@ START_TEST(opcservices)
test_package
();
test_file_stream
();
test_relationship
_id
();
test_relationship
();
IOpcFactory_Release
(
factory
);
...
...
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