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
4f58e116
Commit
4f58e116
authored
Jun 20, 2011
by
Adam Martinson
Committed by
Alexandre Julliard
Jun 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Add support for VT_BSTR|VT_BYREF in domdoc_save().
parent
5ab513bd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
12 deletions
+35
-12
domdoc.c
dlls/msxml3/domdoc.c
+15
-11
domdoc.c
dlls/msxml3/tests/domdoc.c
+20
-1
No files found.
dlls/msxml3/domdoc.c
View file @
4f58e116
...
...
@@ -2423,16 +2423,11 @@ static HRESULT WINAPI domdoc_save(
xmlNodePtr
xmldecl
;
HRESULT
ret
=
S_OK
;
TRACE
(
"(%p)->(var(vt %d, %s))
\n
"
,
This
,
V_VT
(
&
destination
),
V_VT
(
&
destination
)
==
VT_BSTR
?
debugstr_w
(
V_BSTR
(
&
destination
))
:
NULL
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
destination
));
if
(
V_VT
(
&
destination
)
!=
VT_BSTR
&&
V_VT
(
&
destination
)
!=
VT_UNKNOWN
)
switch
(
V_VT
(
&
destination
)
)
{
FIXME
(
"Unhandled vt %d
\n
"
,
V_VT
(
&
destination
));
return
S_FALSE
;
}
if
(
V_VT
(
&
destination
)
==
VT_UNKNOWN
)
case
VT_UNKNOWN
:
{
IUnknown
*
pUnk
=
V_UNKNOWN
(
&
destination
);
IXMLDOMDocument2
*
document
;
...
...
@@ -2468,11 +2463,14 @@ static HRESULT WINAPI domdoc_save(
}
}
}
else
break
;
case
VT_BSTR
:
case
VT_BSTR
|
VT_BYREF
:
{
/* save with file path */
HANDLE
handle
=
CreateFileW
(
V_BSTR
(
&
destination
),
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
HANDLE
handle
=
CreateFileW
(
(
V_VT
(
&
destination
)
&
VT_BYREF
)
?
*
V_BSTRREF
(
&
destination
)
:
V_BSTR
(
&
destination
)
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
{
WARN
(
"failed to create file
\n
"
);
...
...
@@ -2488,6 +2486,12 @@ static HRESULT WINAPI domdoc_save(
return
E_FAIL
;
}
}
break
;
default:
FIXME
(
"Unhandled VARIANT: %s
\n
"
,
debugstr_variant
(
&
destination
));
return
S_FALSE
;
}
xmldecl
=
xmldoc_unlink_xmldecl
(
get_doc
(
This
));
if
(
xmlSaveDoc
(
ctx
,
get_doc
(
This
))
==
-
1
)
ret
=
S_FALSE
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
4f58e116
...
...
@@ -6859,7 +6859,7 @@ static void test_save(void)
IXMLDOMDocument
*
doc
,
*
doc2
;
IXMLDOMElement
*
root
;
VARIANT
file
,
vDoc
;
BSTR
sOrig
,
sNew
;
BSTR
sOrig
,
sNew
,
filename
;
char
buffer
[
100
];
DWORD
read
=
0
;
HANDLE
hfile
;
...
...
@@ -6909,6 +6909,25 @@ static void test_save(void)
hr
=
IXMLDOMDocument_save
(
doc
,
file
);
EXPECT_HR
(
hr
,
S_OK
);
hfile
=
CreateFileA
(
"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
;
ReadFile
(
hfile
,
buffer
,
sizeof
(
buffer
),
&
read
,
NULL
);
ok
(
read
!=
0
,
"could not read file
\n
"
);
ok
(
buffer
[
0
]
!=
'<'
||
buffer
[
1
]
!=
'?'
,
"File contains processing instruction
\n
"
);
CloseHandle
(
hfile
);
DeleteFile
(
"test.xml"
);
/* save to path VT_BSTR | VT_BYREF */
filename
=
_bstr_
(
"test.xml"
);
V_VT
(
&
file
)
=
VT_BSTR
|
VT_BYREF
;
V_BSTRREF
(
&
file
)
=
&
filename
;
hr
=
IXMLDOMDocument_save
(
doc
,
file
);
EXPECT_HR
(
hr
,
S_OK
);
IXMLDOMDocument_Release
(
doc
);
hfile
=
CreateFileA
(
"test.xml"
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
...
...
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