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
b296b08a
Commit
b296b08a
authored
Nov 26, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Move document loading from stream to a separate function.
parent
79084be3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
+30
-19
domdoc.c
dlls/msxml3/domdoc.c
+30
-19
No files found.
dlls/msxml3/domdoc.c
View file @
b296b08a
...
...
@@ -718,46 +718,45 @@ static HRESULT WINAPI PersistStreamInit_IsDirty(
return
S_FALSE
;
}
static
HRESULT
WINAPI
PersistStreamInit_Load
(
IPersistStreamInit
*
iface
,
LPSTREAM
pStm
)
static
HRESULT
domdoc_load_from_stream
(
domdoc
*
doc
,
ISequentialStream
*
stream
)
{
domdoc
*
This
=
impl_from_IPersistStreamInit
(
iface
);
HRESULT
hr
;
HGLOBAL
hglobal
;
DWORD
read
,
written
,
len
;
xmlDocPtr
xmldoc
=
NULL
;
HGLOBAL
hglobal
;
BYTE
buf
[
4096
];
HRESULT
hr
;
char
*
ptr
;
xmlDocPtr
xmldoc
=
NULL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pStm
);
if
(
!
pStm
)
return
E_INVALIDARG
;
if
(
doc
->
stream
)
{
IStream_Release
(
doc
->
stream
);
doc
->
stream
=
NULL
;
}
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
This
->
stream
);
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
doc
->
stream
);
if
(
FAILED
(
hr
))
return
hr
;
do
{
IS
tream_Read
(
pSt
m
,
buf
,
sizeof
(
buf
),
&
read
);
hr
=
IStream_Write
(
This
->
stream
,
buf
,
read
,
&
written
);
IS
equentialStream_Read
(
strea
m
,
buf
,
sizeof
(
buf
),
&
read
);
hr
=
IStream_Write
(
doc
->
stream
,
buf
,
read
,
&
written
);
}
while
(
SUCCEEDED
(
hr
)
&&
written
!=
0
&&
read
!=
0
);
if
(
FAILED
(
hr
))
{
ERR
(
"
Failed to copy stream
\n
"
);
ERR
(
"
failed to copy stream 0x%08x
\n
"
,
hr
);
return
hr
;
}
hr
=
GetHGlobalFromStream
(
This
->
stream
,
&
hglobal
);
hr
=
GetHGlobalFromStream
(
doc
->
stream
,
&
hglobal
);
if
(
FAILED
(
hr
))
return
hr
;
len
=
GlobalSize
(
hglobal
);
ptr
=
GlobalLock
(
hglobal
);
if
(
len
!=
0
)
xmldoc
=
doparse
(
This
,
ptr
,
len
,
XML_CHAR_ENCODING_NONE
);
if
(
len
)
xmldoc
=
doparse
(
doc
,
ptr
,
len
,
XML_CHAR_ENCODING_NONE
);
GlobalUnlock
(
hglobal
);
if
(
!
xmldoc
)
...
...
@@ -768,7 +767,19 @@ static HRESULT WINAPI PersistStreamInit_Load(
xmldoc
->
_private
=
create_priv
();
return
attach_xmldoc
(
This
,
xmldoc
);
return
attach_xmldoc
(
doc
,
xmldoc
);
}
static
HRESULT
WINAPI
PersistStreamInit_Load
(
IPersistStreamInit
*
iface
,
IStream
*
stream
)
{
domdoc
*
This
=
impl_from_IPersistStreamInit
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
stream
);
if
(
!
stream
)
return
E_INVALIDARG
;
return
domdoc_load_from_stream
(
This
,
(
ISequentialStream
*
)
stream
);
}
static
HRESULT
WINAPI
PersistStreamInit_Save
(
...
...
@@ -2140,7 +2151,7 @@ static HRESULT WINAPI domdoc_load(
else
{
/* ISequentialStream */
FIXME
(
"Unknown type not supported (
%d
) (%p)(%p)
\n
"
,
hr
,
pNewDoc
,
V_UNKNOWN
(
&
source
)
->
lpVtbl
);
FIXME
(
"Unknown type not supported (
0x%08x
) (%p)(%p)
\n
"
,
hr
,
pNewDoc
,
V_UNKNOWN
(
&
source
)
->
lpVtbl
);
}
break
;
default:
...
...
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