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
b15345d4
Commit
b15345d4
authored
Jul 27, 2008
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Added ISAXXMLReader_parseURL implementation.
parent
6b2e7a18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
25 deletions
+57
-25
saxreader.c
dlls/msxml3/saxreader.c
+57
-25
No files found.
dlls/msxml3/saxreader.c
View file @
b15345d4
...
...
@@ -1098,17 +1098,11 @@ static HRESULT WINAPI isaxxmlreader_putSecureBaseURL(
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxxmlreader_parse
(
ISAXXMLReader
*
iface
,
VARIANT
varInput
)
static
HRESULT
parse_buffer
(
saxreader
*
This
,
xmlChar
*
buffer
)
{
saxreader
*
This
=
impl_from_ISAXXMLReader
(
iface
);
saxlocator
*
locator
;
xmlChar
*
data
=
NULL
;
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
This
);
hr
=
SAXLocator_create
(
This
,
&
locator
);
if
(
FAILED
(
hr
))
return
E_FAIL
;
...
...
@@ -1123,12 +1117,38 @@ static HRESULT WINAPI isaxxmlreader_parse(
locator
->
pParserCtxt
->
sax
=
&
locator
->
saxreader
->
sax
;
locator
->
pParserCtxt
->
userData
=
locator
;
xmlSetupParserForBuffer
(
locator
->
pParserCtxt
,
buffer
,
NULL
);
if
(
xmlParseDocument
(
locator
->
pParserCtxt
))
hr
=
E_FAIL
;
else
hr
=
locator
->
ret
;
if
(
locator
->
pParserCtxt
)
{
locator
->
pParserCtxt
->
sax
=
NULL
;
xmlFreeParserCtxt
(
locator
->
pParserCtxt
);
locator
->
pParserCtxt
=
NULL
;
}
ISAXLocator_Release
((
ISAXLocator
*
)
&
locator
->
lpSAXLocatorVtbl
);
return
S_OK
;
}
static
HRESULT
WINAPI
isaxxmlreader_parse
(
ISAXXMLReader
*
iface
,
VARIANT
varInput
)
{
saxreader
*
This
=
impl_from_ISAXXMLReader
(
iface
);
xmlChar
*
data
=
NULL
;
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
This
);
hr
=
S_OK
;
switch
(
V_VT
(
&
varInput
))
{
case
VT_BSTR
:
data
=
xmlChar_from_wchar
(
V_BSTR
(
&
varInput
));
xmlSetupParserForBuffer
(
locator
->
pParserCtxt
,
data
,
NULL
);
hr
=
parse_buffer
(
This
,
data
);
break
;
case
VT_ARRAY
|
VT_UI1
:
{
void
*
pSAData
;
...
...
@@ -1146,7 +1166,7 @@ static HRESULT WINAPI isaxxmlreader_parse(
if
(
hr
!=
S_OK
)
break
;
memcpy
(
data
,
pSAData
,
dataRead
);
data
[
dataRead
]
=
'\0'
;
xmlSetupParserForBuffer
(
locator
->
pParserCtxt
,
data
,
NULL
);
hr
=
parse_buffer
(
This
,
data
);
SafeArrayUnaccessData
(
V_ARRAY
(
&
varInput
));
break
;
}
...
...
@@ -1185,7 +1205,7 @@ static HRESULT WINAPI isaxxmlreader_parse(
break
;
}
data
[
dataInfo
.
cbSize
.
QuadPart
]
=
'\0'
;
xmlSetupParserForBuffer
(
locator
->
pParserCtxt
,
data
,
NULL
);
hr
=
parse_buffer
(
This
,
data
);
IStream_Release
(
stream
);
break
;
}
...
...
@@ -1196,7 +1216,7 @@ static HRESULT WINAPI isaxxmlreader_parse(
IXMLDOMDocument_get_xml
(
xmlDoc
,
&
bstrData
);
data
=
xmlChar_from_wchar
(
bstrData
);
xmlSetupParserForBuffer
(
locator
->
pParserCtxt
,
data
,
NULL
);
hr
=
parse_buffer
(
This
,
data
);
IXMLDOMDocument_Release
(
xmlDoc
);
hr
=
E_NOTIMPL
;
break
;
...
...
@@ -1207,20 +1227,23 @@ static HRESULT WINAPI isaxxmlreader_parse(
hr
=
E_INVALIDARG
;
}
if
(
hr
==
S_OK
)
{
if
(
xmlParseDocument
(
locator
->
pParserCtxt
))
hr
=
E_FAIL
;
else
hr
=
locator
->
ret
;
}
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
hr
;
}
static
HRESULT
saxreader_onDataAvailable
(
void
*
obj
,
char
*
ptr
,
DWORD
len
)
{
saxreader
*
This
=
obj
;
xmlChar
*
data
;
HRESULT
hr
;
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
+
1
);
memcpy
(
data
,
ptr
,
len
);
data
[
len
]
=
0
;
hr
=
parse_buffer
(
This
,
data
);
if
(
locator
->
pParserCtxt
)
{
locator
->
pParserCtxt
->
sax
=
NULL
;
xmlFreeParserCtxt
(
locator
->
pParserCtxt
);
locator
->
pParserCtxt
=
NULL
;
}
HeapFree
(
GetProcessHeap
(),
0
,
data
);
ISAXLocator_Release
((
ISAXLocator
*
)
&
locator
->
lpSAXLocatorVtbl
);
return
hr
;
}
...
...
@@ -1229,9 +1252,18 @@ static HRESULT WINAPI isaxxmlreader_parseURL(
const
WCHAR
*
url
)
{
saxreader
*
This
=
impl_from_ISAXXMLReader
(
iface
);
bsc_t
*
bsc
;
HRESULT
hr
;
FIXME
(
"(%p)->(%s) stub
\n
"
,
This
,
debugstr_w
(
url
));
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s) stub
\n
"
,
This
,
debugstr_w
(
url
));
hr
=
bind_url
(
url
,
saxreader_onDataAvailable
,
This
,
&
bsc
);
if
(
FAILED
(
hr
))
return
hr
;
detach_bsc
(
bsc
);
return
S_OK
;
}
static
const
struct
ISAXXMLReaderVtbl
isaxreader_vtbl
=
...
...
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