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
65293d8e
Commit
65293d8e
authored
Aug 10, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a node object and use it to hold libxml2 pointers.
parent
2255e6fe
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
37 deletions
+77
-37
Makefile.in
dlls/msxml3/Makefile.in
+1
-0
domdoc.c
dlls/msxml3/domdoc.c
+42
-15
element.c
dlls/msxml3/element.c
+18
-19
msxml_private.h
dlls/msxml3/msxml_private.h
+15
-2
node.c
dlls/msxml3/node.c
+0
-0
nodemap.c
dlls/msxml3/nodemap.c
+1
-1
No files found.
dlls/msxml3/Makefile.in
View file @
65293d8e
...
@@ -13,6 +13,7 @@ C_SRCS = \
...
@@ -13,6 +13,7 @@ C_SRCS = \
element.c
\
element.c
\
factory.c
\
factory.c
\
main.c
\
main.c
\
node.c
\
nodemap.c
nodemap.c
@MAKE_DLL_RULES@
@MAKE_DLL_RULES@
...
...
dlls/msxml3/domdoc.c
View file @
65293d8e
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "winuser.h"
#include "winuser.h"
#include "winnls.h"
#include "ole2.h"
#include "ole2.h"
#include "ocidl.h"
#include "ocidl.h"
#include "msxml.h"
#include "msxml.h"
...
@@ -44,7 +45,7 @@ typedef struct _domdoc
...
@@ -44,7 +45,7 @@ typedef struct _domdoc
const
struct
IXMLDOMDocumentVtbl
*
lpVtbl
;
const
struct
IXMLDOMDocumentVtbl
*
lpVtbl
;
LONG
ref
;
LONG
ref
;
VARIANT_BOOL
async
;
VARIANT_BOOL
async
;
xmlDocPtr
xmldoc
;
IXMLDOMNode
*
node
;
}
domdoc
;
}
domdoc
;
static
inline
domdoc
*
impl_from_IXMLDOMDocument
(
IXMLDOMDocument
*
iface
)
static
inline
domdoc
*
impl_from_IXMLDOMDocument
(
IXMLDOMDocument
*
iface
)
...
@@ -94,7 +95,7 @@ static ULONG WINAPI domdoc_Release(
...
@@ -94,7 +95,7 @@ static ULONG WINAPI domdoc_Release(
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
if
(
ref
==
0
)
{
{
xmlFreeDoc
(
This
->
xmldoc
);
IXMLDOMElement_Release
(
This
->
node
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
...
@@ -500,10 +501,27 @@ static HRESULT WINAPI domdoc_get_documentElement(
...
@@ -500,10 +501,27 @@ static HRESULT WINAPI domdoc_get_documentElement(
IXMLDOMElement
**
DOMElement
)
IXMLDOMElement
**
DOMElement
)
{
{
domdoc
*
This
=
impl_from_IXMLDOMDocument
(
iface
);
domdoc
*
This
=
impl_from_IXMLDOMDocument
(
iface
);
xmlDocPtr
xmldoc
=
NULL
;
xmlNodePtr
root
=
NULL
;
TRACE
(
"%p
\n
"
,
This
);
*
DOMElement
=
NULL
;
if
(
!
This
->
node
)
return
S_FALSE
;
xmldoc
=
xmldoc_from_xmlnode
(
This
->
node
);
if
(
!
xmldoc
)
return
S_FALSE
;
root
=
xmlDocGetRootElement
(
xmldoc
);
if
(
!
root
)
return
S_FALSE
;
FIXME
(
"%p
\n
"
,
This
);
*
DOMElement
=
create_element
(
root
);
return
DOMElement_create
(
DOMElement
,
This
->
xmldoc
)
;
return
S_OK
;
}
}
...
@@ -669,9 +687,15 @@ static HRESULT WINAPI domdoc_load(
...
@@ -669,9 +687,15 @@ static HRESULT WINAPI domdoc_load(
{
{
domdoc
*
This
=
impl_from_IXMLDOMDocument
(
iface
);
domdoc
*
This
=
impl_from_IXMLDOMDocument
(
iface
);
LPWSTR
filename
=
NULL
;
LPWSTR
filename
=
NULL
;
xmlDocPtr
x
d
;
xmlDocPtr
x
mldoc
;
TRACE
(
"%p
\n
"
,
This
);
TRACE
(
"type %d
\n
"
,
V_VT
(
&
xmlSource
)
);
if
(
This
->
node
)
{
IXMLDOMNode_Release
(
This
->
node
);
This
->
node
=
NULL
;
}
switch
(
V_VT
(
&
xmlSource
)
)
switch
(
V_VT
(
&
xmlSource
)
)
{
{
...
@@ -680,17 +704,20 @@ static HRESULT WINAPI domdoc_load(
...
@@ -680,17 +704,20 @@ static HRESULT WINAPI domdoc_load(
}
}
if
(
!
filename
)
if
(
!
filename
)
return
E_FAIL
;
return
S_FALSE
;
x
d
=
doread
(
filename
);
x
mldoc
=
doread
(
filename
);
if
(
!
x
d
)
if
(
!
x
mldoc
)
return
E_FAIL
;
return
S_FALSE
;
/* free the old document before overwriting it */
This
->
node
=
create_domdoc_node
(
xmldoc
);
if
(
This
->
xmldoc
)
if
(
!
This
->
node
)
xmlFreeDoc
(
This
->
xmldoc
);
{
This
->
xmldoc
=
xd
;
*
isSuccessful
=
VARIANT_FALSE
;
return
S_FALSE
;
}
*
isSuccessful
=
VARIANT_TRUE
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -942,7 +969,7 @@ HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
...
@@ -942,7 +969,7 @@ HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
doc
->
lpVtbl
=
&
domdoc_vtbl
;
doc
->
lpVtbl
=
&
domdoc_vtbl
;
doc
->
ref
=
1
;
doc
->
ref
=
1
;
doc
->
async
=
0
;
doc
->
async
=
0
;
doc
->
xmldoc
=
NULL
;
doc
->
node
=
NULL
;
*
ppObj
=
&
doc
->
lpVtbl
;
*
ppObj
=
&
doc
->
lpVtbl
;
...
...
dlls/msxml3/element.c
View file @
65293d8e
...
@@ -44,7 +44,7 @@ typedef struct _domelem
...
@@ -44,7 +44,7 @@ typedef struct _domelem
{
{
const
struct
IXMLDOMElementVtbl
*
lpVtbl
;
const
struct
IXMLDOMElementVtbl
*
lpVtbl
;
LONG
ref
;
LONG
ref
;
xmlDocPtr
xmldoc
;
IXMLDOMNode
*
node
;
}
domelem
;
}
domelem
;
static
inline
domelem
*
impl_from_IXMLDOMElement
(
IXMLDOMElement
*
iface
)
static
inline
domelem
*
impl_from_IXMLDOMElement
(
IXMLDOMElement
*
iface
)
...
@@ -90,6 +90,7 @@ static ULONG WINAPI domelem_Release(
...
@@ -90,6 +90,7 @@ static ULONG WINAPI domelem_Release(
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
if
(
ref
==
0
)
{
{
IXMLDOMNode_Release
(
This
->
node
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
...
@@ -216,14 +217,8 @@ static HRESULT WINAPI domelem_get_attributes(
...
@@ -216,14 +217,8 @@ static HRESULT WINAPI domelem_get_attributes(
IXMLDOMElement
*
iface
,
IXMLDOMElement
*
iface
,
IXMLDOMNamedNodeMap
**
attributeMap
)
IXMLDOMNamedNodeMap
**
attributeMap
)
{
{
domelem
*
This
=
impl_from_IXMLDOMElement
(
iface
);
FIXME
(
"
\n
"
);
xmlNodePtr
root
;
return
E_NOTIMPL
;
root
=
xmlDocGetRootElement
(
This
->
xmldoc
);
if
(
!
root
)
return
E_FAIL
;
return
NodeMap_create
(
attributeMap
,
This
->
xmldoc
,
root
);
}
}
static
HRESULT
WINAPI
domelem_insertBefore
(
static
HRESULT
WINAPI
domelem_insertBefore
(
...
@@ -558,21 +553,25 @@ static const struct IXMLDOMElementVtbl domelem_vtbl =
...
@@ -558,21 +553,25 @@ static const struct IXMLDOMElementVtbl domelem_vtbl =
domelem_normalize
,
domelem_normalize
,
};
};
HRESULT
DOMElement_create
(
IXMLDOMElement
**
DOMElement
,
xmlDocPtr
xmldoc
)
IXMLDOMElement
*
create_element
(
xmlNodePtr
element
)
{
{
domelem
*
elem
;
domelem
*
This
;
elem
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
elem
);
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
This
);
if
(
!
elem
)
if
(
!
This
)
return
E_OUTOFMEMORY
;
return
NULL
;
elem
->
lpVtbl
=
&
domelem_vtbl
;
This
->
lpVtbl
=
&
domelem_vtbl
;
elem
->
xmldoc
=
xmldoc
;
This
->
node
=
create_element_node
(
element
)
;
elem
->
ref
=
1
;
This
->
ref
=
1
;
*
DOMElement
=
(
IXMLDOMElement
*
)
&
elem
->
lpVtbl
;
if
(
!
This
->
node
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
NULL
;
}
return
S_OK
;
return
(
IXMLDOMElement
*
)
&
This
->
lpVtbl
;
}
}
#endif
#endif
dlls/msxml3/msxml_private.h
View file @
65293d8e
...
@@ -27,8 +27,21 @@
...
@@ -27,8 +27,21 @@
#include <libxml/parser.h>
#include <libxml/parser.h>
extern
HRESULT
DOMElement_create
(
IXMLDOMElement
**
DOMElement
,
xmlDocPtr
xmldoc
);
/* constructors */
extern
HRESULT
NodeMap_create
(
IXMLDOMNamedNodeMap
**
DomNamedNodeMap
,
xmlDocPtr
xmldoc
,
xmlNodePtr
node
);
extern
IXMLDOMNode
*
create_domdoc_node
(
xmlDocPtr
node
);
extern
IUnknown
*
create_domdoc
(
void
);
extern
IXMLDOMNode
*
create_attribute_node
(
xmlAttrPtr
attr
);
extern
IUnknown
*
create_xmldoc
(
void
);
extern
IXMLDOMElement
*
create_element
(
xmlNodePtr
element
);
extern
IXMLDOMNode
*
create_element_node
(
xmlNodePtr
element
);
/* data accessors */
extern
xmlDocPtr
xmldoc_from_xmlnode
(
IXMLDOMNode
*
iface
);
extern
xmlNodePtr
xmlelement_from_xmlnode
(
IXMLDOMNode
*
iface
);
/* helpers */
extern
xmlChar
*
xmlChar_from_wchar
(
LPWSTR
str
);
extern
BSTR
bstr_from_xmlChar
(
const
xmlChar
*
buf
);
#endif
#endif
...
...
dlls/msxml3/node.c
0 → 100644
View file @
65293d8e
This diff is collapsed.
Click to expand it.
dlls/msxml3/nodemap.c
View file @
65293d8e
...
@@ -133,7 +133,7 @@ static HRESULT WINAPI xmlnodemap_Invoke(
...
@@ -133,7 +133,7 @@ static HRESULT WINAPI xmlnodemap_Invoke(
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
xmlChar
*
xmlChar_from_wchar
(
LPWSTR
str
)
xmlChar
*
xmlChar_from_wchar
(
LPWSTR
str
)
{
{
DWORD
len
;
DWORD
len
;
xmlChar
*
xmlstr
;
xmlChar
*
xmlstr
;
...
...
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