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
2060d80d
Commit
2060d80d
authored
Mar 15, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Treat input BSTR as general WCHAR string for ::loadXML().
parent
b1b54ae3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
domdoc.c
dlls/msxml3/domdoc.c
+4
-3
domdoc.c
dlls/msxml3/tests/domdoc.c
+16
-0
No files found.
dlls/msxml3/domdoc.c
View file @
2060d80d
...
...
@@ -1650,19 +1650,20 @@ static HRESULT WINAPI domdoc_abort(
static
BOOL
bstr_to_utf8
(
BSTR
bstr
,
char
**
pstr
,
int
*
plen
)
{
UINT
len
,
blen
=
SysStringLen
(
bstr
)
;
UINT
len
;
LPSTR
str
;
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
bstr
,
blen
,
NULL
,
0
,
NULL
,
NULL
);
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
bstr
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
str
=
heap_alloc
(
len
);
if
(
!
str
)
return
FALSE
;
WideCharToMultiByte
(
CP_UTF8
,
0
,
bstr
,
blen
,
str
,
len
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_UTF8
,
0
,
bstr
,
-
1
,
str
,
len
,
NULL
,
NULL
);
*
plen
=
len
;
*
pstr
=
str
;
return
TRUE
;
}
/* don't rely on data to be in BSTR format, treat it as WCHAR string */
static
HRESULT
WINAPI
domdoc_loadXML
(
IXMLDOMDocument2
*
iface
,
BSTR
bstrXML
,
...
...
dlls/msxml3/tests/domdoc.c
View file @
2060d80d
...
...
@@ -535,6 +535,7 @@ static void test_domdoc( void )
BSTR
str
;
LONG
code
;
LONG
nLength
=
0
;
WCHAR
buff
[
100
];
r
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
LPVOID
*
)
&
doc
);
...
...
@@ -543,6 +544,12 @@ static void test_domdoc( void )
test_disp
((
IUnknown
*
)
doc
);
if
(
0
)
{
/* crashes on native */
r
=
IXMLDOMDocument_loadXML
(
doc
,
(
BSTR
)
0x1
,
NULL
);
}
/* try some stupid things */
r
=
IXMLDOMDocument_loadXML
(
doc
,
NULL
,
NULL
);
ok
(
r
==
S_FALSE
,
"loadXML failed
\n
"
);
...
...
@@ -601,6 +608,15 @@ static void test_domdoc( void )
ok
(
r
==
S_FALSE
,
"should be no document element
\n
"
);
ok
(
element
==
NULL
,
"Element should be NULL
\n
"
);
/* test for BSTR handling, pass broken BSTR */
memcpy
(
&
buff
[
2
],
szComplete1
,
sizeof
(
szComplete1
));
/* just a big length */
*
(
DWORD
*
)
buff
=
0xf0f0
;
b
=
VARIANT_FALSE
;
r
=
IXMLDOMDocument_loadXML
(
doc
,
&
buff
[
2
],
&
b
);
ok
(
r
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
/* try to load something valid */
b
=
VARIANT_FALSE
;
str
=
SysAllocString
(
szComplete1
);
...
...
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