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
afb17f29
Commit
afb17f29
authored
Nov 29, 2008
by
Michael Karcher
Committed by
Alexandre Julliard
Dec 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: attach_xmldoc may fail.
The upcoming new implementation of attach_xmldoc needs HeapAlloc. Prepare for the failure case.
parent
8b293040
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
domdoc.c
dlls/msxml3/domdoc.c
+15
-12
No files found.
dlls/msxml3/domdoc.c
View file @
afb17f29
...
@@ -209,7 +209,7 @@ HRESULT xmldoc_remove_orphan(xmlDocPtr doc, xmlNodePtr node)
...
@@ -209,7 +209,7 @@ HRESULT xmldoc_remove_orphan(xmlDocPtr doc, xmlNodePtr node)
return
S_FALSE
;
return
S_FALSE
;
}
}
static
void
attach_xmldoc
(
IXMLDOMNode
*
node
,
xmlDocPtr
xml
)
static
HRESULT
attach_xmldoc
(
IXMLDOMNode
*
node
,
xmlDocPtr
xml
)
{
{
xmlnode
*
This
=
impl_from_IXMLDOMNode
(
node
);
xmlnode
*
This
=
impl_from_IXMLDOMNode
(
node
);
...
@@ -220,7 +220,7 @@ static void attach_xmldoc( IXMLDOMNode *node, xmlDocPtr xml )
...
@@ -220,7 +220,7 @@ static void attach_xmldoc( IXMLDOMNode *node, xmlDocPtr xml )
if
(
This
->
node
)
if
(
This
->
node
)
xmldoc_add_ref
(
This
->
node
->
doc
);
xmldoc_add_ref
(
This
->
node
->
doc
);
return
;
return
S_OK
;
}
}
static
inline
domdoc
*
impl_from_IXMLDOMDocument2
(
IXMLDOMDocument2
*
iface
)
static
inline
domdoc
*
impl_from_IXMLDOMDocument2
(
IXMLDOMDocument2
*
iface
)
...
@@ -345,9 +345,8 @@ static HRESULT WINAPI xmldoc_IPersistStream_Load(
...
@@ -345,9 +345,8 @@ static HRESULT WINAPI xmldoc_IPersistStream_Load(
}
}
xmldoc
->
_private
=
create_priv
();
xmldoc
->
_private
=
create_priv
();
attach_xmldoc
(
This
->
node
,
xmldoc
);
return
S_OK
;
return
attach_xmldoc
(
This
->
node
,
xmldoc
)
;
}
}
static
HRESULT
WINAPI
xmldoc_IPersistStream_Save
(
static
HRESULT
WINAPI
xmldoc_IPersistStream_Save
(
...
@@ -1324,7 +1323,7 @@ static HRESULT domdoc_onDataAvailable(void *obj, char *ptr, DWORD len)
...
@@ -1324,7 +1323,7 @@ static HRESULT domdoc_onDataAvailable(void *obj, char *ptr, DWORD len)
xmldoc
=
doparse
(
ptr
,
len
);
xmldoc
=
doparse
(
ptr
,
len
);
if
(
xmldoc
)
{
if
(
xmldoc
)
{
xmldoc
->
_private
=
create_priv
();
xmldoc
->
_private
=
create_priv
();
attach_xmldoc
(
This
->
node
,
xmldoc
);
return
attach_xmldoc
(
This
->
node
,
xmldoc
);
}
}
return
S_OK
;
return
S_OK
;
...
@@ -1377,11 +1376,12 @@ static HRESULT WINAPI domdoc_load(
...
@@ -1377,11 +1376,12 @@ static HRESULT WINAPI domdoc_load(
{
{
domdoc
*
newDoc
=
impl_from_IXMLDOMDocument2
(
pNewDoc
);
domdoc
*
newDoc
=
impl_from_IXMLDOMDocument2
(
pNewDoc
);
xmldoc
=
xmlCopyDoc
(
get_doc
(
newDoc
),
1
);
xmldoc
=
xmlCopyDoc
(
get_doc
(
newDoc
),
1
);
attach_xmldoc
(
This
->
node
,
xmldoc
);
hr
=
attach_xmldoc
(
This
->
node
,
xmldoc
);
*
isSuccessful
=
VARIANT_TRUE
;
if
(
SUCCEEDED
(
hr
))
*
isSuccessful
=
VARIANT_TRUE
;
return
S_OK
;
return
hr
;
}
}
}
}
hr
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
&
xmlSource
),
&
IID_IStream
,
(
void
**
)
&
pStream
);
hr
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
&
xmlSource
),
&
IID_IStream
,
(
void
**
)
&
pStream
);
...
@@ -1438,8 +1438,9 @@ static HRESULT WINAPI domdoc_load(
...
@@ -1438,8 +1438,9 @@ static HRESULT WINAPI domdoc_load(
if
(
!
filename
||
FAILED
(
hr
))
{
if
(
!
filename
||
FAILED
(
hr
))
{
xmldoc
=
xmlNewDoc
(
NULL
);
xmldoc
=
xmlNewDoc
(
NULL
);
xmldoc
->
_private
=
create_priv
();
xmldoc
->
_private
=
create_priv
();
attach_xmldoc
(
This
->
node
,
xmldoc
);
hr
=
attach_xmldoc
(
This
->
node
,
xmldoc
);
hr
=
S_FALSE
;
if
(
SUCCEEDED
(
hr
))
hr
=
S_FALSE
;
}
}
TRACE
(
"ret (%d)
\n
"
,
hr
);
TRACE
(
"ret (%d)
\n
"
,
hr
);
...
@@ -1541,7 +1542,7 @@ static HRESULT WINAPI domdoc_loadXML(
...
@@ -1541,7 +1542,7 @@ static HRESULT WINAPI domdoc_loadXML(
xmlDocPtr
xmldoc
=
NULL
;
xmlDocPtr
xmldoc
=
NULL
;
char
*
str
;
char
*
str
;
int
len
;
int
len
;
HRESULT
hr
=
S_FALSE
;
HRESULT
hr
=
S_FALSE
,
hr2
;
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_w
(
bstrXML
),
isSuccessful
);
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_w
(
bstrXML
),
isSuccessful
);
...
@@ -1568,7 +1569,9 @@ static HRESULT WINAPI domdoc_loadXML(
...
@@ -1568,7 +1569,9 @@ static HRESULT WINAPI domdoc_loadXML(
xmldoc
=
xmlNewDoc
(
NULL
);
xmldoc
=
xmlNewDoc
(
NULL
);
xmldoc
->
_private
=
create_priv
();
xmldoc
->
_private
=
create_priv
();
attach_xmldoc
(
This
->
node
,
xmldoc
);
hr2
=
attach_xmldoc
(
This
->
node
,
xmldoc
);
if
(
FAILED
(
hr2
)
)
hr
=
hr2
;
return
hr
;
return
hr
;
}
}
...
...
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