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
85cf92ae
Commit
85cf92ae
authored
Jan 24, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Block ::add() if collection is read-only.
parent
95b9b821
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
schema.c
dlls/msxml3/schema.c
+7
-1
domdoc.c
dlls/msxml3/tests/domdoc.c
+1
-8
No files found.
dlls/msxml3/schema.c
View file @
85cf92ae
...
...
@@ -102,6 +102,7 @@ typedef struct
xmlHashTablePtr
cache
;
VARIANT_BOOL
validateOnLoad
;
int
read_only
;
}
schema_cache
;
typedef
struct
...
...
@@ -966,11 +967,13 @@ static void cache_free(void* data, xmlChar* name /* ignored */)
queried at libxml2 level here. */
HRESULT
cache_from_doc_ns
(
IXMLDOMSchemaCollection2
*
iface
,
xmlnode
*
node
)
{
static
const
xmlChar
query
[]
=
"//*/namespace::*"
;
schema_cache
*
This
=
impl_from_IXMLDOMSchemaCollection2
(
iface
);
static
const
xmlChar
query
[]
=
"//*/namespace::*"
;
xmlXPathObjectPtr
nodeset
;
xmlXPathContextPtr
ctxt
;
This
->
read_only
=
1
;
ctxt
=
xmlXPathNewContext
(
node
->
node
->
doc
);
nodeset
=
xmlXPathEvalExpression
(
query
,
ctxt
);
...
...
@@ -1111,6 +1114,8 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
xmlChar
*
name
=
uri
?
xmlchar_from_wchar
(
uri
)
:
xmlchar_from_wchar
(
emptyW
);
TRACE
(
"(%p)->(%s %s)
\n
"
,
This
,
debugstr_w
(
uri
),
debugstr_variant
(
&
var
));
if
(
This
->
read_only
)
return
E_FAIL
;
switch
(
V_VT
(
&
var
))
{
case
VT_NULL
:
...
...
@@ -1498,6 +1503,7 @@ HRESULT SchemaCache_create(MSXML_VERSION version, IUnknown* outer, void** obj)
This
->
ref
=
1
;
This
->
version
=
version
;
This
->
validateOnLoad
=
VARIANT_TRUE
;
This
->
read_only
=
0
;
init_dispex
(
&
This
->
dispex
,
(
IUnknown
*
)
&
This
->
IXMLDOMSchemaCollection2_iface
,
&
schemacache_dispex
);
*
obj
=
&
This
->
IXMLDOMSchemaCollection2_iface
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
85cf92ae
...
...
@@ -11400,7 +11400,6 @@ static void test_get_namespaces(void)
V_VT
(
&
v
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
v
)
=
(
IDispatch
*
)
doc2
;
hr
=
IXMLDOMSchemaCollection_add
(
collection
,
_bstr_
(
xsd_schema1_uri
),
v
);
todo_wine
EXPECT_HR
(
hr
,
E_FAIL
);
hr
=
IXMLDOMSchemaCollection_get_namespaceURI
(
collection
,
0
,
&
s
);
...
...
@@ -11410,16 +11409,13 @@ todo_wine
hr
=
IXMLDOMSchemaCollection_get_namespaceURI
(
collection
,
1
,
&
s
);
EXPECT_HR
(
hr
,
S_OK
);
todo_wine
ok
(
!
lstrcmpW
(
s
,
_bstr_
(
"http://blahblah.org"
)),
"got %s
\n
"
,
wine_dbgstr_w
(
s
));
SysFreeString
(
s
);
s
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMSchemaCollection_get_namespaceURI
(
collection
,
2
,
&
s
);
todo_wine
{
EXPECT_HR
(
hr
,
E_FAIL
);
ok
(
s
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
s
);
}
/* enumerate */
enumv
=
(
void
*
)
0xdeadbeef
;
...
...
@@ -11513,7 +11509,6 @@ todo_wine
V_VT
(
&
v
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
v
)
=
(
IDispatch
*
)
doc2
;
hr
=
IXMLDOMSchemaCollection_add
(
collection
,
_bstr_
(
xsd_schema1_uri
),
v
);
todo_wine
EXPECT_HR
(
hr
,
E_FAIL
);
IXMLDOMSchemaCollection_Release
(
doc2
);
...
...
@@ -11524,16 +11519,14 @@ todo_wine
hr
=
IXMLDOMSchemaCollection_get_namespaceURI
(
collection
,
1
,
&
s
);
EXPECT_HR
(
hr
,
S_OK
);
todo_wine
ok
(
!
lstrcmpW
(
s
,
_bstr_
(
"http://blahblah.org"
)),
"got %s
\n
"
,
wine_dbgstr_w
(
s
));
SysFreeString
(
s
);
s
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMSchemaCollection_get_namespaceURI
(
collection
,
2
,
&
s
);
todo_wine
{
EXPECT_HR
(
hr
,
E_FAIL
);
ok
(
s
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
s
);
}
/* enumerate */
enumv
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMSchemaCollection_get__newEnum
(
collection
,
(
IUnknown
**
)
&
enumv
);
...
...
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