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
ae0b830c
Commit
ae0b830c
authored
Aug 29, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite: Store DTD processing mode in reader.
parent
5cb75c52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
6 deletions
+55
-6
reader.c
dlls/xmllite/reader.c
+23
-4
reader.c
dlls/xmllite/tests/reader.c
+15
-2
xmllite.idl
include/xmllite.idl
+17
-0
No files found.
dlls/xmllite/reader.c
View file @
ae0b830c
...
...
@@ -44,6 +44,7 @@ typedef struct _xmlreader
ISequentialStream
*
stream
;
/* stored as sequential stream, cause currently
optimizations possible with IStream aren't implemented */
XmlReadState
state
;
DtdProcessing
dtdmode
;
UINT
line
,
pos
;
/* reader position in XML stream */
}
xmlreader
;
...
...
@@ -104,7 +105,7 @@ static ULONG WINAPI xmlreader_Release(IXmlReader *iface)
if
(
ref
==
0
)
{
if
(
This
->
input
)
IUnknown_Release
(
This
->
input
);
if
(
This
->
stream
)
I
Unknown
_Release
(
This
->
stream
);
if
(
This
->
stream
)
I
SequentialStream
_Release
(
This
->
stream
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -126,7 +127,7 @@ static HRESULT WINAPI xmlreader_SetInput(IXmlReader* iface, IUnknown *input)
if
(
This
->
stream
)
{
I
Unknown
_Release
(
This
->
stream
);
I
SequentialStream
_Release
(
This
->
stream
);
This
->
stream
=
NULL
;
}
...
...
@@ -167,6 +168,9 @@ static HRESULT WINAPI xmlreader_GetProperty(IXmlReader* iface, UINT property, LO
switch
(
property
)
{
case
XmlReaderProperty_DtdProcessing
:
*
value
=
This
->
dtdmode
;
break
;
case
XmlReaderProperty_ReadState
:
*
value
=
This
->
state
;
break
;
...
...
@@ -180,8 +184,22 @@ static HRESULT WINAPI xmlreader_GetProperty(IXmlReader* iface, UINT property, LO
static
HRESULT
WINAPI
xmlreader_SetProperty
(
IXmlReader
*
iface
,
UINT
property
,
LONG_PTR
value
)
{
FIXME
(
"(%p %u %lu): stub
\n
"
,
iface
,
property
,
value
);
return
E_NOTIMPL
;
xmlreader
*
This
=
impl_from_IXmlReader
(
iface
);
TRACE
(
"(%p %u %lu)
\n
"
,
iface
,
property
,
value
);
switch
(
property
)
{
case
XmlReaderProperty_DtdProcessing
:
if
(
value
<
0
||
value
>
_DtdProcessing_Last
)
return
E_INVALIDARG
;
This
->
dtdmode
=
value
;
break
;
default:
FIXME
(
"Unimplemented property (%u)
\n
"
,
property
);
return
E_NOTIMPL
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
xmlreader_Read
(
IXmlReader
*
iface
,
XmlNodeType
*
node_type
)
...
...
@@ -455,6 +473,7 @@ HRESULT WINAPI CreateXmlReader(REFIID riid, void **pObject, IMalloc *pMalloc)
reader
->
stream
=
NULL
;
reader
->
input
=
NULL
;
reader
->
state
=
XmlReadState_Closed
;
reader
->
dtdmode
=
DtdProcessing_Prohibit
;
reader
->
line
=
reader
->
pos
=
0
;
*
pObject
=
&
reader
->
IXmlReader_iface
;
...
...
dlls/xmllite/tests/reader.c
View file @
ae0b830c
...
...
@@ -350,19 +350,32 @@ static void test_reader_create(void)
HRESULT
hr
;
IXmlReader
*
reader
;
IUnknown
*
input
;
DtdProcessing
dtd
;
/* crashes native */
if
(
0
)
{
pCreateXmlReader
(
&
IID_IXmlReader
,
NULL
,
NULL
);
pCreateXmlReader
(
NULL
,
(
LPVOID
*
)
&
reader
,
NULL
);
pCreateXmlReader
(
NULL
,
(
void
*
*
)
&
reader
,
NULL
);
}
hr
=
pCreateXmlReader
(
&
IID_IXmlReader
,
(
LPVOID
*
)
&
reader
,
NULL
);
hr
=
pCreateXmlReader
(
&
IID_IXmlReader
,
(
void
*
*
)
&
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
test_read_state
(
reader
,
XmlReadState_Closed
,
-
1
,
FALSE
);
dtd
=
2
;
hr
=
IXmlReader_GetProperty
(
reader
,
XmlReaderProperty_DtdProcessing
,
(
LONG_PTR
*
)
&
dtd
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
dtd
==
DtdProcessing_Prohibit
,
"got %d
\n
"
,
dtd
);
dtd
=
2
;
hr
=
IXmlReader_SetProperty
(
reader
,
XmlReaderProperty_DtdProcessing
,
dtd
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
hr
=
IXmlReader_SetProperty
(
reader
,
XmlReaderProperty_DtdProcessing
,
-
1
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
/* Null input pointer, releases previous input */
hr
=
IXmlReader_SetInput
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
...
...
include/xmllite.idl
View file @
ae0b830c
...
...
@@ -88,6 +88,23 @@ cpp_quote(" XmlReadState_EndOfFile = 3,")
cpp_quote
(
" XmlReadState_Closed = 4"
)
cpp_quote
(
"} XmlReadState;"
)
/*
conformance
levels
*/
cpp_quote
(
"typedef enum XmlConformanceLevel"
)
cpp_quote
(
"{"
)
cpp_quote
(
" XmlConformanceLevel_Auto = 0,"
)
cpp_quote
(
" XmlConformanceLevel_Fragment = 1,"
)
cpp_quote
(
" XmlConformanceLevel_Document = 2,"
)
cpp_quote
(
" _XmlConformanceLevel_Last = 2"
)
cpp_quote
(
"} XmlConformanceLevel;"
)
/*
DTD
processing
mode
*/
cpp_quote
(
"typedef enum DtdProcessing"
)
cpp_quote
(
"{"
)
cpp_quote
(
" DtdProcessing_Prohibit = 0,"
)
cpp_quote
(
" DtdProcessing_Parse = DtdProcessing_Prohibit + 1,"
)
cpp_quote
(
" _DtdProcessing_Last = DtdProcessing_Parse"
)
cpp_quote
(
"} DtdProcessing;"
)
/*
IXmlReader
properties
*/
cpp_quote
(
"typedef enum XmlReaderProperty"
)
cpp_quote
(
"{"
)
...
...
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