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
6a07cfeb
Commit
6a07cfeb
authored
Jun 28, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Add support for IPersistStreamInit for IXMLDOMDocument.
parent
f2f50885
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
39 deletions
+71
-39
domdoc.c
dlls/msxml3/domdoc.c
+49
-39
domdoc.c
dlls/msxml3/tests/domdoc.c
+22
-0
No files found.
dlls/msxml3/domdoc.c
View file @
6a07cfeb
...
...
@@ -66,7 +66,7 @@ typedef struct _domdoc
{
xmlnode
node
;
const
struct
IXMLDOMDocument2Vtbl
*
lpVtbl
;
const
struct
IPersistStream
Vtbl
*
lpvtblIPersistStream
;
const
struct
IPersistStream
InitVtbl
*
lpvtblIPersistStreamInit
;
const
struct
IObjectWithSiteVtbl
*
lpvtblIObjectWithSite
;
const
struct
IObjectSafetyVtbl
*
lpvtblIObjectSafety
;
const
struct
ISupportErrorInfoVtbl
*
lpvtblISupportErrorInfo
;
...
...
@@ -296,9 +296,9 @@ static inline xmlDocPtr get_doc( domdoc *This )
return
(
xmlDocPtr
)
This
->
node
.
node
;
}
static
inline
domdoc
*
impl_from_IPersistStream
(
IPersistStream
*
iface
)
static
inline
domdoc
*
impl_from_IPersistStream
Init
(
IPersistStreamInit
*
iface
)
{
return
(
domdoc
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
domdoc
,
lpvtblIPersistStream
));
return
(
domdoc
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
domdoc
,
lpvtblIPersistStream
Init
));
}
static
inline
domdoc
*
impl_from_IObjectWithSite
(
IObjectWithSite
*
iface
)
...
...
@@ -319,29 +319,29 @@ static inline domdoc *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface)
/************************************************************************
* xmldoc implementation of IPersistStream.
*/
static
HRESULT
WINAPI
xmldoc_IPersistStream_QueryInterface
(
IPersistStream
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
static
HRESULT
WINAPI
xmldoc_IPersistStream
Init
_QueryInterface
(
IPersistStream
Init
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
domdoc
*
this
=
impl_from_IPersistStream
(
iface
);
domdoc
*
this
=
impl_from_IPersistStream
Init
(
iface
);
return
IXMLDocument_QueryInterface
((
IXMLDocument
*
)
this
,
riid
,
ppvObj
);
}
static
ULONG
WINAPI
xmldoc_IPersistStream_AddRef
(
IPersistStream
*
iface
)
static
ULONG
WINAPI
xmldoc_IPersistStream
Init
_AddRef
(
IPersistStream
Init
*
iface
)
{
domdoc
*
this
=
impl_from_IPersistStream
(
iface
);
domdoc
*
this
=
impl_from_IPersistStream
Init
(
iface
);
return
IXMLDocument_AddRef
((
IXMLDocument
*
)
this
);
}
static
ULONG
WINAPI
xmldoc_IPersistStream_Release
(
IPersistStream
*
iface
)
static
ULONG
WINAPI
xmldoc_IPersistStream
Init
_Release
(
IPersistStream
Init
*
iface
)
{
domdoc
*
this
=
impl_from_IPersistStream
(
iface
);
domdoc
*
this
=
impl_from_IPersistStream
Init
(
iface
);
return
IXMLDocument_Release
((
IXMLDocument
*
)
this
);
}
static
HRESULT
WINAPI
xmldoc_IPersistStream_GetClassID
(
IPersistStream
*
iface
,
CLSID
*
classid
)
static
HRESULT
WINAPI
xmldoc_IPersistStream
Init
_GetClassID
(
IPersistStream
Init
*
iface
,
CLSID
*
classid
)
{
TRACE
(
"(%p,%p): stub!
\n
"
,
iface
,
classid
);
...
...
@@ -353,20 +353,20 @@ static HRESULT WINAPI xmldoc_IPersistStream_GetClassID(
return
S_OK
;
}
static
HRESULT
WINAPI
xmldoc_IPersistStream_IsDirty
(
IPersistStream
*
iface
)
static
HRESULT
WINAPI
xmldoc_IPersistStream
Init
_IsDirty
(
IPersistStream
Init
*
iface
)
{
domdoc
*
This
=
impl_from_IPersistStream
(
iface
);
domdoc
*
This
=
impl_from_IPersistStream
Init
(
iface
);
FIXME
(
"(%p): stub!
\n
"
,
This
);
return
S_FALSE
;
}
static
HRESULT
WINAPI
xmldoc_IPersistStream_Load
(
IPersistStream
*
iface
,
LPSTREAM
pStm
)
static
HRESULT
WINAPI
xmldoc_IPersistStream
Init
_Load
(
IPersistStream
Init
*
iface
,
LPSTREAM
pStm
)
{
domdoc
*
This
=
impl_from_IPersistStream
(
iface
);
domdoc
*
This
=
impl_from_IPersistStream
Init
(
iface
);
HRESULT
hr
;
HGLOBAL
hglobal
;
DWORD
read
,
written
,
len
;
...
...
@@ -416,10 +416,10 @@ static HRESULT WINAPI xmldoc_IPersistStream_Load(
return
attach_xmldoc
(
&
This
->
node
,
xmldoc
);
}
static
HRESULT
WINAPI
xmldoc_IPersistStream_Save
(
IPersistStream
*
iface
,
LPSTREAM
pStm
,
BOOL
fClearDirty
)
static
HRESULT
WINAPI
xmldoc_IPersistStream
Init
_Save
(
IPersistStream
Init
*
iface
,
LPSTREAM
pStm
,
BOOL
fClearDirty
)
{
domdoc
*
This
=
impl_from_IPersistStream
(
iface
);
domdoc
*
This
=
impl_from_IPersistStream
Init
(
iface
);
HRESULT
hr
;
BSTR
xmlString
;
...
...
@@ -441,24 +441,33 @@ static HRESULT WINAPI xmldoc_IPersistStream_Save(
return
hr
;
}
static
HRESULT
WINAPI
xmldoc_IPersistStream_GetSizeMax
(
IPersistStream
*
iface
,
ULARGE_INTEGER
*
pcbSize
)
static
HRESULT
WINAPI
xmldoc_IPersistStream
Init
_GetSizeMax
(
IPersistStream
Init
*
iface
,
ULARGE_INTEGER
*
pcbSize
)
{
domdoc
*
This
=
impl_from_IPersistStream
(
iface
);
domdoc
*
This
=
impl_from_IPersistStream
Init
(
iface
);
TRACE
(
"(%p)->(%p): stub!
\n
"
,
This
,
pcbSize
);
return
E_NOTIMPL
;
}
static
const
IPersistStreamVtbl
xmldoc_IPersistStream_VTable
=
static
HRESULT
WINAPI
xmldoc_IPersistStreamInit_InitNew
(
IPersistStreamInit
*
iface
)
{
xmldoc_IPersistStream_QueryInterface
,
xmldoc_IPersistStream_AddRef
,
xmldoc_IPersistStream_Release
,
xmldoc_IPersistStream_GetClassID
,
xmldoc_IPersistStream_IsDirty
,
xmldoc_IPersistStream_Load
,
xmldoc_IPersistStream_Save
,
xmldoc_IPersistStream_GetSizeMax
,
domdoc
*
This
=
impl_from_IPersistStreamInit
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
S_OK
;
}
static
const
IPersistStreamInitVtbl
xmldoc_IPersistStreamInit_VTable
=
{
xmldoc_IPersistStreamInit_QueryInterface
,
xmldoc_IPersistStreamInit_AddRef
,
xmldoc_IPersistStreamInit_Release
,
xmldoc_IPersistStreamInit_GetClassID
,
xmldoc_IPersistStreamInit_IsDirty
,
xmldoc_IPersistStreamInit_Load
,
xmldoc_IPersistStreamInit_Save
,
xmldoc_IPersistStreamInit_GetSizeMax
,
xmldoc_IPersistStreamInit_InitNew
};
/* ISupportErrorInfo interface */
...
...
@@ -520,9 +529,10 @@ static HRESULT WINAPI domdoc_QueryInterface( IXMLDOMDocument2 *iface, REFIID rii
{
*
ppvObject
=
IXMLDOMNode_from_impl
(
&
This
->
node
);
}
else
if
(
IsEqualGUID
(
&
IID_IPersistStream
,
riid
))
else
if
(
IsEqualGUID
(
&
IID_IPersistStream
,
riid
)
||
IsEqualGUID
(
&
IID_IPersistStreamInit
,
riid
))
{
*
ppvObject
=
&
(
This
->
lpvtblIPersistStream
);
*
ppvObject
=
&
(
This
->
lpvtblIPersistStream
Init
);
}
else
if
(
IsEqualGUID
(
&
IID_IObjectWithSite
,
riid
))
{
...
...
@@ -1575,7 +1585,7 @@ static HRESULT WINAPI domdoc_load(
hr
=
IUnknown_QueryInterface
(
iface
,
&
IID_IPersistStream
,
(
void
**
)
&
pDocStream
);
if
(
hr
==
S_OK
)
{
hr
=
xmldoc_
IPersistStream_Load
(
pDocStream
,
pStream
);
hr
=
IPersistStream_Load
(
pDocStream
,
pStream
);
IStream_Release
(
pStream
);
if
(
hr
==
S_OK
)
{
...
...
@@ -2337,7 +2347,7 @@ HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument2 **docu
return
E_OUTOFMEMORY
;
doc
->
lpVtbl
=
&
domdoc_vtbl
;
doc
->
lpvtblIPersistStream
=
&
xmldoc_IPersistStream
_VTable
;
doc
->
lpvtblIPersistStream
Init
=
&
xmldoc_IPersistStreamInit
_VTable
;
doc
->
lpvtblIObjectWithSite
=
&
domdocObjectSite
;
doc
->
lpvtblIObjectSafety
=
&
domdocObjectSafetyVtbl
;
doc
->
lpvtblISupportErrorInfo
=
&
support_error_vtbl
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
6a07cfeb
...
...
@@ -1242,6 +1242,27 @@ if (0)
free_bstrs
();
}
static
void
test_persiststreaminit
(
void
)
{
IXMLDOMDocument
*
doc
;
IPersistStreamInit
*
streaminit
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
void
**
)
&
doc
);
ok
(
hr
==
S_OK
,
"failed with 0x%08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
hr
=
IXMLDOMDocument_QueryInterface
(
doc
,
&
IID_IPersistStreamInit
,
(
void
**
)
&
streaminit
);
ok
(
hr
==
S_OK
,
"failed with 0x%08x
\n
"
,
hr
);
hr
=
IPersistStreamInit_InitNew
(
streaminit
);
ok
(
hr
==
S_OK
,
"failed with 0x%08x
\n
"
,
hr
);
IXMLDOMDocument_Release
(
doc
);
}
static
void
test_domnode
(
void
)
{
HRESULT
r
;
...
...
@@ -5597,6 +5618,7 @@ START_TEST(domdoc)
IXMLDOMDocument_Release
(
doc
);
test_domdoc
();
test_persiststreaminit
();
test_domnode
();
test_refs
();
test_create
();
...
...
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