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
cde8e6c8
Commit
cde8e6c8
authored
Mar 16, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Support VT_BSTR|VT_BYREF as source in load().
parent
59f64b28
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
13 deletions
+71
-13
domdoc.c
dlls/msxml3/domdoc.c
+13
-11
main.c
dlls/msxml3/main.c
+3
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+55
-2
No files found.
dlls/msxml3/domdoc.c
View file @
cde8e6c8
...
...
@@ -2104,7 +2104,7 @@ static HRESULT doread( domdoc *This, LPWSTR filename )
static
HRESULT
WINAPI
domdoc_load
(
IXMLDOMDocument3
*
iface
,
VARIANT
xmlS
ource
,
VARIANT
s
ource
,
VARIANT_BOOL
*
isSuccessful
)
{
domdoc
*
This
=
impl_from_IXMLDOMDocument3
(
iface
);
...
...
@@ -2114,19 +2114,23 @@ static HRESULT WINAPI domdoc_load(
IStream
*
pStream
=
NULL
;
xmlDocPtr
xmldoc
;
TRACE
(
"(%p)->
type %d
\n
"
,
This
,
V_VT
(
&
xmlSource
)
);
TRACE
(
"(%p)->
(%s)
\n
"
,
This
,
debugstr_variant
(
&
source
)
);
*
isSuccessful
=
VARIANT_FALSE
;
assert
(
&
This
->
node
);
switch
(
V_VT
(
&
xmlS
ource
)
)
switch
(
V_VT
(
&
s
ource
)
)
{
case
VT_BSTR
:
filename
=
V_BSTR
(
&
xmlSource
);
filename
=
V_BSTR
(
&
source
);
break
;
case
VT_BSTR
|
VT_BYREF
:
if
(
!
V_BSTRREF
(
&
source
))
return
E_INVALIDARG
;
filename
=
*
V_BSTRREF
(
&
source
);
break
;
case
VT_UNKNOWN
:
hr
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
&
xmlS
ource
),
&
IID_IXMLDOMDocument3
,
(
void
**
)
&
pNewDoc
);
hr
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
&
s
ource
),
&
IID_IXMLDOMDocument3
,
(
void
**
)
&
pNewDoc
);
if
(
hr
==
S_OK
)
{
if
(
pNewDoc
)
...
...
@@ -2141,7 +2145,7 @@ static HRESULT WINAPI domdoc_load(
return
hr
;
}
}
hr
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
&
xmlS
ource
),
&
IID_IStream
,
(
void
**
)
&
pStream
);
hr
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
&
s
ource
),
&
IID_IStream
,
(
void
**
)
&
pStream
);
if
(
hr
==
S_OK
)
{
IPersistStream
*
pDocStream
;
...
...
@@ -2170,14 +2174,12 @@ static HRESULT WINAPI domdoc_load(
else
{
/* ISequentialStream */
FIXME
(
"Unknown type not supported (%d) (%p)(%p)
\n
"
,
hr
,
pNewDoc
,
V_UNKNOWN
(
&
xmlS
ource
)
->
lpVtbl
);
FIXME
(
"Unknown type not supported (%d) (%p)(%p)
\n
"
,
hr
,
pNewDoc
,
V_UNKNOWN
(
&
s
ource
)
->
lpVtbl
);
}
break
;
default:
FIXME
(
"VT type not supported (%d)
\n
"
,
V_VT
(
&
xmlSource
));
}
TRACE
(
"filename (%s)
\n
"
,
debugstr_w
(
filename
));
FIXME
(
"VT type not supported (%d)
\n
"
,
V_VT
(
&
source
));
}
if
(
filename
)
{
...
...
dlls/msxml3/main.c
View file @
cde8e6c8
...
...
@@ -286,6 +286,9 @@ const char *debugstr_variant(const VARIANT *v)
return
wine_dbg_sprintf
(
"{VT_UNKNOWN: %p}"
,
V_UNKNOWN
(
v
));
case
VT_UINT
:
return
wine_dbg_sprintf
(
"{VT_UINT: %u}"
,
V_UINT
(
v
));
case
VT_BSTR
|
VT_BYREF
:
return
wine_dbg_sprintf
(
"{VT_BSTR|VT_BYREF: ptr %p, data %s}"
,
V_BSTRREF
(
v
),
V_BSTRREF
(
v
)
?
debugstr_w
(
*
V_BSTRREF
(
v
))
:
NULL
);
default:
return
wine_dbg_sprintf
(
"{vt %d}"
,
V_VT
(
v
));
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
cde8e6c8
...
...
@@ -5686,7 +5686,7 @@ static void test_save(void)
IXMLDOMDocument_Release
(
doc
);
hfile
=
CreateFile
(
"test.xml"
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
hfile
=
CreateFile
A
(
"test.xml"
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
hfile
!=
INVALID_HANDLE_VALUE
,
"Could not open file: %u
\n
"
,
GetLastError
());
if
(
hfile
==
INVALID_HANDLE_VALUE
)
return
;
...
...
@@ -6097,7 +6097,7 @@ static void test_TransformWithLoadingLocalFile(void)
GetTempPathA
(
MAX_PATH
,
lpPathBuffer
);
strcat
(
lpPathBuffer
,
"customers.xml"
);
file
=
CreateFile
(
lpPathBuffer
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
file
=
CreateFile
A
(
lpPathBuffer
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Could not create file: %u
\n
"
,
GetLastError
());
if
(
file
==
INVALID_HANDLE_VALUE
)
return
;
...
...
@@ -8609,6 +8609,58 @@ static void test_selection(void)
free_bstrs
();
}
static
void
test_load
(
void
)
{
IXMLDOMDocument
*
doc
;
VARIANT_BOOL
b
;
HANDLE
hfile
;
VARIANT
src
;
HRESULT
hr
;
BOOL
ret
;
BSTR
path
;
DWORD
written
;
/* prepare a file */
hfile
=
CreateFileA
(
"test.xml"
,
GENERIC_WRITE
|
GENERIC_READ
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
hfile
!=
INVALID_HANDLE_VALUE
,
"failed to create test file
\n
"
);
if
(
hfile
==
INVALID_HANDLE_VALUE
)
return
;
ret
=
WriteFile
(
hfile
,
szNonUnicodeXML
,
sizeof
(
szNonUnicodeXML
)
-
1
,
&
written
,
NULL
);
ok
(
ret
,
"WriteFile failed
\n
"
);
CloseHandle
(
hfile
);
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
path
=
_bstr_
(
"test.xml"
);
/* load from path: VT_BSTR */
V_VT
(
&
src
)
=
VT_BSTR
;
V_BSTR
(
&
src
)
=
path
;
hr
=
IXMLDOMDocument_load
(
doc
,
src
,
&
b
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
b
==
VARIANT_TRUE
,
"got %d
\n
"
,
b
);
/* load from a path: VT_BSTR|VT_BYREF */
V_VT
(
&
src
)
=
VT_BSTR
|
VT_BYREF
;
V_BSTRREF
(
&
src
)
=
&
path
;
hr
=
IXMLDOMDocument_load
(
doc
,
src
,
&
b
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
b
==
VARIANT_TRUE
,
"got %d
\n
"
,
b
);
/* load from a path: VT_BSTR|VT_BYREF, null ptr */
V_VT
(
&
src
)
=
VT_BSTR
|
VT_BYREF
;
V_BSTRREF
(
&
src
)
=
NULL
;
hr
=
IXMLDOMDocument_load
(
doc
,
src
,
&
b
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
ok
(
b
==
VARIANT_FALSE
,
"got %d
\n
"
,
b
);
IXMLDOMDocument_Release
(
doc
);
DeleteFileA
(
"test.xml"
);
free_bstrs
();
}
START_TEST
(
domdoc
)
{
IXMLDOMDocument
*
doc
;
...
...
@@ -8680,6 +8732,7 @@ START_TEST(domdoc)
test_get_nodeTypeString
();
test_get_attributes
();
test_selection
();
test_load
();
test_xsltemplate
();
...
...
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