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
65aa7242
Commit
65aa7242
authored
Sep 20, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opcservices: Improve parameter validation in CreateRelationship().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6878cbf5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
package.c
dlls/opcservices/package.c
+10
-0
opcservices.c
dlls/opcservices/tests/opcservices.c
+6
-3
No files found.
dlls/opcservices/package.c
View file @
65aa7242
...
@@ -1301,13 +1301,23 @@ static HRESULT WINAPI opc_relationship_set_CreateRelationship(IOpcRelationshipSe
...
@@ -1301,13 +1301,23 @@ static HRESULT WINAPI opc_relationship_set_CreateRelationship(IOpcRelationshipSe
const
WCHAR
*
type
,
IUri
*
target_uri
,
OPC_URI_TARGET_MODE
target_mode
,
IOpcRelationship
**
relationship
)
const
WCHAR
*
type
,
IUri
*
target_uri
,
OPC_URI_TARGET_MODE
target_mode
,
IOpcRelationship
**
relationship
)
{
{
struct
opc_relationship_set
*
relationship_set
=
impl_from_IOpcRelationshipSet
(
iface
);
struct
opc_relationship_set
*
relationship_set
=
impl_from_IOpcRelationshipSet
(
iface
);
DWORD
length
;
TRACE
(
"iface %p, id %s, type %s, target_uri %p, target_mode %d, relationship %p.
\n
"
,
iface
,
debugstr_w
(
id
),
TRACE
(
"iface %p, id %s, type %s, target_uri %p, target_mode %d, relationship %p.
\n
"
,
iface
,
debugstr_w
(
id
),
debugstr_w
(
type
),
target_uri
,
target_mode
,
relationship
);
debugstr_w
(
type
),
target_uri
,
target_mode
,
relationship
);
if
(
!
relationship
)
return
E_POINTER
;
*
relationship
=
NULL
;
if
(
!
type
||
!
target_uri
)
if
(
!
type
||
!
target_uri
)
return
E_POINTER
;
return
E_POINTER
;
if
(
IUri_GetPropertyLength
(
target_uri
,
Uri_PROPERTY_SCHEME_NAME
,
&
length
,
0
)
==
S_OK
&&
length
!=
0
&&
target_mode
==
OPC_URI_TARGET_MODE_INTERNAL
)
return
OPC_E_INVALID_RELATIONSHIP_TARGET
;
return
opc_relationship_create
(
relationship_set
,
id
,
type
,
target_uri
,
target_mode
,
relationship
);
return
opc_relationship_create
(
relationship_set
,
id
,
type
,
target_uri
,
target_mode
,
relationship
);
}
}
...
...
dlls/opcservices/tests/opcservices.c
View file @
65aa7242
...
@@ -362,21 +362,24 @@ static void test_relationship(void)
...
@@ -362,21 +362,24 @@ static void test_relationship(void)
hr
=
IOpcPackage_GetRelationshipSet
(
package
,
&
rels
);
hr
=
IOpcPackage_GetRelationshipSet
(
package
,
&
rels
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get part set, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get part set, hr %#x.
\n
"
,
hr
);
rel
=
(
void
*
)
0xdeadbeef
;
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
NULL
,
NULL
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
NULL
,
NULL
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rel
==
NULL
,
"Unexpected instance %p.
\n
"
,
rel
);
rel
=
(
void
*
)
0xdeadbeef
;
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
typeW
,
NULL
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
typeW
,
NULL
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rel
==
NULL
,
"Unexpected instance %p.
\n
"
,
rel
);
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
NULL
,
target_uri
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
NULL
,
target_uri
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Absolute target uri with internal mode */
/* Absolute target uri with internal mode */
rel
=
(
void
*
)
0xdeadbeef
;
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
typeW
,
target_uri2
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
typeW
,
target_uri2
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
todo_wine
ok
(
hr
==
OPC_E_INVALID_RELATIONSHIP_TARGET
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
OPC_E_INVALID_RELATIONSHIP_TARGET
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
ok
(
rel
==
NULL
,
"Unexpected instance %p.
\n
"
,
rel
);
IOpcRelationship_Release
(
rel
);
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
typeW
,
target_uri
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
hr
=
IOpcRelationshipSet_CreateRelationship
(
rels
,
NULL
,
typeW
,
target_uri
,
OPC_URI_TARGET_MODE_INTERNAL
,
&
rel
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create relationship, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create relationship, hr %#x.
\n
"
,
hr
);
...
...
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