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
b80c71ab
Commit
b80c71ab
authored
May 07, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Make ::put_data() use passed BSTR as general WCHAR buffer.
parent
cb53b7a8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
28 deletions
+126
-28
cdata.c
dlls/msxml3/cdata.c
+2
-8
comment.c
dlls/msxml3/comment.c
+2
-7
pi.c
dlls/msxml3/pi.c
+2
-6
domdoc.c
dlls/msxml3/tests/domdoc.c
+118
-0
text.c
dlls/msxml3/text.c
+2
-7
No files found.
dlls/msxml3/cdata.c
View file @
b80c71ab
...
@@ -552,14 +552,8 @@ static HRESULT WINAPI domcdata_put_data(
...
@@ -552,14 +552,8 @@ static HRESULT WINAPI domcdata_put_data(
BSTR
data
)
BSTR
data
)
{
{
domcdata
*
This
=
impl_from_IXMLDOMCDATASection
(
iface
);
domcdata
*
This
=
impl_from_IXMLDOMCDATASection
(
iface
);
VARIANT
val
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
));
return
node_set_content
(
&
This
->
node
,
data
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
)
);
V_VT
(
&
val
)
=
VT_BSTR
;
V_BSTR
(
&
val
)
=
data
;
return
IXMLDOMCDATASection_put_nodeValue
(
iface
,
val
);
}
}
static
HRESULT
WINAPI
domcdata_get_length
(
static
HRESULT
WINAPI
domcdata_get_length
(
...
...
dlls/msxml3/comment.c
View file @
b80c71ab
...
@@ -554,13 +554,8 @@ static HRESULT WINAPI domcomment_put_data(
...
@@ -554,13 +554,8 @@ static HRESULT WINAPI domcomment_put_data(
BSTR
data
)
BSTR
data
)
{
{
domcomment
*
This
=
impl_from_IXMLDOMComment
(
iface
);
domcomment
*
This
=
impl_from_IXMLDOMComment
(
iface
);
VARIANT
val
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
));
return
node_set_content
(
&
This
->
node
,
data
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
)
);
V_VT
(
&
val
)
=
VT_BSTR
;
V_BSTR
(
&
val
)
=
data
;
return
node_put_value
(
&
This
->
node
,
&
val
);
}
}
static
HRESULT
WINAPI
domcomment_get_length
(
static
HRESULT
WINAPI
domcomment_get_length
(
...
...
dlls/msxml3/pi.c
View file @
b80c71ab
...
@@ -602,13 +602,12 @@ static HRESULT WINAPI dom_pi_put_data(
...
@@ -602,13 +602,12 @@ static HRESULT WINAPI dom_pi_put_data(
BSTR
data
)
BSTR
data
)
{
{
dom_pi
*
This
=
impl_from_IXMLDOMProcessingInstruction
(
iface
);
dom_pi
*
This
=
impl_from_IXMLDOMProcessingInstruction
(
iface
);
VARIANT
val
;
BSTR
target
;
BSTR
target
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
)
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
)
);
/*
C
annot set data to a PI node whose target is 'xml' */
/*
c
annot set data to a PI node whose target is 'xml' */
hr
=
IXMLDOMProcessingInstruction_get_nodeName
(
iface
,
&
target
);
hr
=
IXMLDOMProcessingInstruction_get_nodeName
(
iface
,
&
target
);
if
(
hr
==
S_OK
)
if
(
hr
==
S_OK
)
{
{
...
@@ -622,10 +621,7 @@ static HRESULT WINAPI dom_pi_put_data(
...
@@ -622,10 +621,7 @@ static HRESULT WINAPI dom_pi_put_data(
SysFreeString
(
target
);
SysFreeString
(
target
);
}
}
V_VT
(
&
val
)
=
VT_BSTR
;
return
node_set_content
(
&
This
->
node
,
data
);
V_BSTR
(
&
val
)
=
data
;
return
IXMLDOMProcessingInstruction_put_nodeValue
(
iface
,
val
);
}
}
static
const
struct
IXMLDOMProcessingInstructionVtbl
dom_pi_vtbl
=
static
const
struct
IXMLDOMProcessingInstructionVtbl
dom_pi_vtbl
=
...
...
dlls/msxml3/tests/domdoc.c
View file @
b80c71ab
...
@@ -11675,6 +11675,123 @@ todo_wine
...
@@ -11675,6 +11675,123 @@ todo_wine
free_bstrs
();
free_bstrs
();
}
}
static
DOMNodeType
put_data_types
[]
=
{
NODE_TEXT
,
NODE_CDATA_SECTION
,
NODE_PROCESSING_INSTRUCTION
,
NODE_COMMENT
,
NODE_INVALID
};
static
void
test_put_data
(
void
)
{
static
const
WCHAR
test_data
[]
=
{
't'
,
'e'
,
's'
,
't'
,
' '
,
'n'
,
'o'
,
'd'
,
'e'
,
' '
,
'd'
,
'a'
,
't'
,
'a'
,
0
};
WCHAR
buff
[
100
],
*
data
;
IXMLDOMDocument
*
doc
;
DOMNodeType
*
type
;
BSTR
get_data
;
HRESULT
hr
;
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
if
(
!
doc
)
return
;
memcpy
(
&
buff
[
2
],
test_data
,
sizeof
(
test_data
));
/* just a big length */
*
(
DWORD
*
)
buff
=
0xf0f0
;
data
=
&
buff
[
2
];
type
=
put_data_types
;
while
(
*
type
!=
NODE_INVALID
)
{
IXMLDOMNode
*
node
;
VARIANT
v
;
V_VT
(
&
v
)
=
VT_I2
;
V_I2
(
&
v
)
=
*
type
;
hr
=
IXMLDOMDocument_createNode
(
doc
,
v
,
_bstr_
(
"name"
),
NULL
,
&
node
);
EXPECT_HR
(
hr
,
S_OK
);
/* put_data() is interface-specific */
switch
(
*
type
)
{
case
NODE_TEXT
:
{
IXMLDOMText
*
text
;
hr
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMText
,
(
void
**
)
&
text
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMText_put_data
(
text
,
data
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMText_get_data
(
text
,
&
get_data
);
EXPECT_HR
(
hr
,
S_OK
);
IXMLDOMText_Release
(
text
);
break
;
}
case
NODE_CDATA_SECTION
:
{
IXMLDOMCDATASection
*
cdata
;
hr
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMCDATASection
,
(
void
**
)
&
cdata
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMCDATASection_put_data
(
cdata
,
data
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMCDATASection_get_data
(
cdata
,
&
get_data
);
EXPECT_HR
(
hr
,
S_OK
);
IXMLDOMCDATASection_Release
(
cdata
);
break
;
}
case
NODE_PROCESSING_INSTRUCTION
:
{
IXMLDOMProcessingInstruction
*
pi
;
hr
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMProcessingInstruction
,
(
void
**
)
&
pi
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMProcessingInstruction_put_data
(
pi
,
data
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMProcessingInstruction_get_data
(
pi
,
&
get_data
);
EXPECT_HR
(
hr
,
S_OK
);
IXMLDOMProcessingInstruction_Release
(
pi
);
break
;
}
case
NODE_COMMENT
:
{
IXMLDOMComment
*
comment
;
hr
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMComment
,
(
void
**
)
&
comment
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMComment_put_data
(
comment
,
data
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMComment_get_data
(
comment
,
&
get_data
);
EXPECT_HR
(
hr
,
S_OK
);
IXMLDOMComment_Release
(
comment
);
break
;
}
default:
break
;
}
/* compare */
ok
(
!
lstrcmpW
(
data
,
get_data
),
"%d: got wrong data %s, expected %s
\n
"
,
*
type
,
wine_dbgstr_w
(
get_data
),
wine_dbgstr_w
(
data
));
SysFreeString
(
get_data
);
IXMLDOMNode_Release
(
node
);
type
++
;
}
IXMLDOMDocument_Release
(
doc
);
free_bstrs
();
}
START_TEST
(
domdoc
)
START_TEST
(
domdoc
)
{
{
IXMLDOMDocument
*
doc
;
IXMLDOMDocument
*
doc
;
...
@@ -11752,6 +11869,7 @@ START_TEST(domdoc)
...
@@ -11752,6 +11869,7 @@ START_TEST(domdoc)
test_supporterrorinfo
();
test_supporterrorinfo
();
test_nodeValue
();
test_nodeValue
();
test_get_namespaces
();
test_get_namespaces
();
test_put_data
();
test_xsltemplate
();
test_xsltemplate
();
...
...
dlls/msxml3/text.c
View file @
b80c71ab
...
@@ -608,13 +608,8 @@ static HRESULT WINAPI domtext_put_data(
...
@@ -608,13 +608,8 @@ static HRESULT WINAPI domtext_put_data(
BSTR
data
)
BSTR
data
)
{
{
domtext
*
This
=
impl_from_IXMLDOMText
(
iface
);
domtext
*
This
=
impl_from_IXMLDOMText
(
iface
);
VARIANT
val
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
));
return
node_set_content
(
&
This
->
node
,
data
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
)
);
V_VT
(
&
val
)
=
VT_BSTR
;
V_BSTR
(
&
val
)
=
data
;
return
node_put_value
(
&
This
->
node
,
&
val
);
}
}
static
HRESULT
WINAPI
domtext_get_length
(
static
HRESULT
WINAPI
domtext_get_length
(
...
...
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