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
edeff310
Commit
edeff310
authored
Feb 17, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Null pointer for schema uri should be treated as empty.
parent
21332ccb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
8 deletions
+46
-8
schema.c
dlls/msxml3/schema.c
+10
-8
schema.c
dlls/msxml3/tests/schema.c
+36
-0
No files found.
dlls/msxml3/schema.c
View file @
edeff310
...
...
@@ -63,11 +63,13 @@ static const xmlChar XDR_schema[] = "Schema";
static
const
xmlChar
XDR_nsURI
[]
=
"urn:schemas-microsoft-com:xml-data"
;
static
const
xmlChar
DT_nsURI
[]
=
"urn:schemas-microsoft-com:datatypes"
;
static
xmlChar
const
*
datatypes_src
=
NULL
;
static
int
datatypes_len
=
0
;
static
HGLOBAL
datatypes_handle
=
NULL
;
static
HRSRC
datatypes_rsrc
=
NULL
;
static
xmlSchemaPtr
datatypes_schema
=
NULL
;
static
xmlChar
const
*
datatypes_src
;
static
int
datatypes_len
;
static
HGLOBAL
datatypes_handle
;
static
HRSRC
datatypes_rsrc
;
static
xmlSchemaPtr
datatypes_schema
;
static
const
WCHAR
emptyW
[]
=
{
0
};
/* Supported Types:
* msxml3 - XDR only
...
...
@@ -1057,7 +1059,7 @@ static HRESULT WINAPI schema_cache_Invoke(IXMLDOMSchemaCollection2* iface,
static
HRESULT
WINAPI
schema_cache_add
(
IXMLDOMSchemaCollection2
*
iface
,
BSTR
uri
,
VARIANT
var
)
{
schema_cache
*
This
=
impl_from_IXMLDOMSchemaCollection2
(
iface
);
xmlChar
*
name
=
xmlChar_from_wchar
(
uri
);
xmlChar
*
name
=
uri
?
xmlChar_from_wchar
(
uri
)
:
xmlChar_from_wchar
(
emptyW
);
TRACE
(
"(%p)->(%s, var(vt %x))
\n
"
,
This
,
debugstr_w
(
uri
),
V_VT
(
&
var
));
switch
(
V_VT
(
&
var
))
...
...
@@ -1158,7 +1160,7 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2* iface, BSTR uri
if
(
!
node
)
return
E_POINTER
;
name
=
xmlChar_from_wchar
(
uri
);
name
=
uri
?
xmlChar_from_wchar
(
uri
)
:
xmlChar_from_wchar
(
emptyW
);
entry
=
(
cache_entry
*
)
xmlHashLookup
(
This
->
cache
,
name
);
heap_free
(
name
);
...
...
@@ -1173,7 +1175,7 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2* iface, BSTR uri
static
HRESULT
WINAPI
schema_cache_remove
(
IXMLDOMSchemaCollection2
*
iface
,
BSTR
uri
)
{
schema_cache
*
This
=
impl_from_IXMLDOMSchemaCollection2
(
iface
);
xmlChar
*
name
=
xmlChar_from_wchar
(
uri
);
xmlChar
*
name
=
uri
?
xmlChar_from_wchar
(
uri
)
:
xmlChar_from_wchar
(
emptyW
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
wine_dbgstr_w
(
uri
));
xmlHashRemoveEntry
(
This
->
cache
,
name
,
cache_free
);
...
...
dlls/msxml3/tests/schema.c
View file @
edeff310
...
...
@@ -493,11 +493,14 @@ static void* _create_object(const GUID *clsid, const char *name, const IID *iid,
static
void
test_schema_refs
(
void
)
{
static
const
WCHAR
emptyW
[]
=
{
0
};
IXMLDOMDocument2
*
doc
;
IXMLDOMNode
*
node
;
IXMLDOMSchemaCollection
*
cache
;
VARIANT
v
;
VARIANT_BOOL
b
;
BSTR
str
;
LONG
len
;
doc
=
create_document
(
&
IID_IXMLDOMDocument2
);
if
(
!
doc
)
...
...
@@ -516,6 +519,39 @@ static void test_schema_refs(void)
ok
(
b
==
VARIANT_TRUE
,
"b %04x
\n
"
,
b
);
SysFreeString
(
str
);
node
=
(
void
*
)
0xdeadbeef
;
ole_check
(
IXMLDOMSchemaCollection_get
(
cache
,
NULL
,
&
node
));
ok
(
node
==
NULL
,
"%p
\n
"
,
node
);
/* NULL uri pointer, still adds a document */
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
NULL
,
_variantdoc_
(
doc
)));
len
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
len
));
ok
(
len
==
1
,
"got %d
\n
"
,
len
);
/* read back - empty valid BSTR */
str
=
NULL
;
ole_check
(
IXMLDOMSchemaCollection_get_namespaceURI
(
cache
,
0
,
&
str
));
ok
(
str
&&
*
str
==
0
,
"got %p
\n
"
,
str
);
SysFreeString
(
str
);
node
=
NULL
;
ole_check
(
IXMLDOMSchemaCollection_get
(
cache
,
NULL
,
&
node
));
ok
(
node
!=
NULL
,
"%p
\n
"
,
node
);
IXMLDOMNode_Release
(
node
);
node
=
NULL
;
str
=
SysAllocString
(
emptyW
);
ole_check
(
IXMLDOMSchemaCollection_get
(
cache
,
str
,
&
node
));
ok
(
node
!=
NULL
,
"%p
\n
"
,
node
);
IXMLDOMNode_Release
(
node
);
SysFreeString
(
str
);
/* remove with NULL uri */
ole_check
(
IXMLDOMSchemaCollection_remove
(
cache
,
NULL
));
len
=
-
1
;
ole_check
(
IXMLDOMSchemaCollection_get_length
(
cache
,
&
len
));
ok
(
len
==
0
,
"got %d
\n
"
,
len
);
str
=
SysAllocString
(
xdr_schema_uri
);
ole_check
(
IXMLDOMSchemaCollection_add
(
cache
,
str
,
_variantdoc_
(
doc
)));
...
...
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