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
fb96151b
Commit
fb96151b
authored
Mar 10, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Move string conversion helper to header.
parent
68cc66d8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
75 deletions
+73
-75
domdoc.c
dlls/msxml3/domdoc.c
+3
-4
element.c
dlls/msxml3/element.c
+6
-6
msxml_private.h
dlls/msxml3/msxml_private.h
+48
-37
node.c
dlls/msxml3/node.c
+4
-4
nodemap.c
dlls/msxml3/nodemap.c
+4
-16
schema.c
dlls/msxml3/schema.c
+3
-3
xmlelem.c
dlls/msxml3/xmlelem.c
+5
-5
No files found.
dlls/msxml3/domdoc.c
View file @
fb96151b
...
...
@@ -1984,9 +1984,9 @@ static HRESULT WINAPI domdoc_createNode(
break
;
}
xml_name
=
xml
C
har_from_wchar
(
name
);
xml_name
=
xml
c
har_from_wchar
(
name
);
/* prevent empty href to be allocated */
href
=
namespaceURI
?
xml
C
har_from_wchar
(
namespaceURI
)
:
NULL
;
href
=
namespaceURI
?
xml
c
har_from_wchar
(
namespaceURI
)
:
NULL
;
switch
(
node_type
)
{
...
...
@@ -2853,8 +2853,7 @@ static HRESULT WINAPI domdoc_setProperty(
pNsList
=
&
(
This
->
properties
->
selectNsList
);
clear_selectNsList
(
pNsList
);
heap_free
(
nsStr
);
nsStr
=
xmlChar_from_wchar
(
bstr
);
nsStr
=
xmlchar_from_wchar
(
bstr
);
TRACE
(
"Setting SelectionNamespaces property to: %s
\n
"
,
nsStr
);
...
...
dlls/msxml3/element.c
View file @
fb96151b
...
...
@@ -1056,7 +1056,7 @@ static HRESULT WINAPI domelem_getAttribute(
V_BSTR
(
value
)
=
NULL
;
V_VT
(
value
)
=
VT_NULL
;
xml_name
=
xml
C
har_from_wchar
(
name
);
xml_name
=
xml
c
har_from_wchar
(
name
);
if
(
!
xmlValidateNameValue
(
xml_name
))
hr
=
E_FAIL
;
...
...
@@ -1099,8 +1099,8 @@ static HRESULT WINAPI domelem_setAttribute(
return
hr
;
}
xml_name
=
xml
C
har_from_wchar
(
name
);
xml_value
=
xml
C
har_from_wchar
(
V_BSTR
(
&
var
)
);
xml_name
=
xml
c
har_from_wchar
(
name
);
xml_value
=
xml
c
har_from_wchar
(
V_BSTR
(
&
var
)
);
if
(
!
xmlSetNsProp
(
element
,
NULL
,
xml_name
,
xml_value
))
hr
=
E_FAIL
;
...
...
@@ -1153,7 +1153,7 @@ static HRESULT WINAPI domelem_getAttributeNode(
if
(
!
element
)
return
E_FAIL
;
xml_name
=
xml
C
har_from_wchar
(
p
);
xml_name
=
xml
c
har_from_wchar
(
p
);
if
(
!
xmlValidateNameValue
(
xml_name
))
{
...
...
@@ -1228,8 +1228,8 @@ static HRESULT WINAPI domelem_setAttributeNode(
SysFreeString
(
prefix
);
}
name
=
xml
C
har_from_wchar
(
nameW
);
value
=
xml
C
har_from_wchar
(
V_BSTR
(
&
valueW
));
name
=
xml
c
har_from_wchar
(
nameW
);
value
=
xml
c
har_from_wchar
(
V_BSTR
(
&
valueW
));
if
(
!
name
||
!
value
)
{
...
...
dlls/msxml3/msxml_private.h
View file @
fb96151b
...
...
@@ -157,6 +157,43 @@ extern HINSTANCE MSXML_hInstance;
void
init_dispex
(
DispatchEx
*
,
IUnknown
*
,
dispex_static_data_t
*
);
BOOL
dispex_query_interface
(
DispatchEx
*
,
REFIID
,
void
**
);
/* memory allocation functions */
static
inline
void
*
heap_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
void
*
heap_alloc_zero
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
}
static
inline
void
*
heap_realloc
(
void
*
mem
,
size_t
len
)
{
return
HeapReAlloc
(
GetProcessHeap
(),
0
,
mem
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
static
inline
LPWSTR
heap_strdupW
(
LPCWSTR
str
)
{
LPWSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
size
;
size
=
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
heap_alloc
(
size
);
memcpy
(
ret
,
str
,
size
);
}
return
ret
;
}
#ifdef HAVE_LIBXML2
extern
void
schemasInit
(
void
);
...
...
@@ -354,6 +391,17 @@ static inline HRESULT return_null_bstr(BSTR *p)
return
S_FALSE
;
}
static
inline
xmlChar
*
xmlchar_from_wchar
(
LPCWSTR
str
)
{
xmlChar
*
xmlstr
;
DWORD
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
xmlstr
=
heap_alloc
(
len
);
if
(
xmlstr
)
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
(
LPSTR
)
xmlstr
,
len
,
NULL
,
NULL
);
return
xmlstr
;
}
#endif
extern
IXMLDOMParseError
*
create_parseError
(
LONG
code
,
BSTR
url
,
BSTR
reason
,
BSTR
srcText
,
...
...
@@ -396,43 +444,6 @@ void detach_bsc(bsc_t*);
const
char
*
debugstr_variant
(
const
VARIANT
*
);
/* memory allocation functions */
static
inline
void
*
heap_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
void
*
heap_alloc_zero
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
}
static
inline
void
*
heap_realloc
(
void
*
mem
,
size_t
len
)
{
return
HeapReAlloc
(
GetProcessHeap
(),
0
,
mem
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
static
inline
LPWSTR
heap_strdupW
(
LPCWSTR
str
)
{
LPWSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
size
;
size
=
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
heap_alloc
(
size
);
memcpy
(
ret
,
str
,
size
);
}
return
ret
;
}
/* Error Codes - not defined anywhere in the public headers */
#define E_XML_ELEMENT_UNDECLARED 0xC00CE00D
#define E_XML_ELEMENT_ID_NOT_FOUND 0xC00CE00E
...
...
dlls/msxml3/node.c
View file @
fb96151b
...
...
@@ -162,7 +162,7 @@ HRESULT node_set_content(xmlnode *This, LPCWSTR value)
xmlChar
*
str
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
value
));
str
=
xml
C
har_from_wchar
(
value
);
str
=
xml
c
har_from_wchar
(
value
);
if
(
!
str
)
return
E_OUTOFMEMORY
;
...
...
@@ -176,7 +176,7 @@ static HRESULT node_set_content_escaped(xmlnode *This, LPCWSTR value)
xmlChar
*
str
,
*
escaped
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
value
));
str
=
xml
C
har_from_wchar
(
value
);
str
=
xml
c
har_from_wchar
(
value
);
if
(
!
str
)
return
E_OUTOFMEMORY
;
...
...
@@ -641,7 +641,7 @@ HRESULT node_put_text(xmlnode *This, BSTR text)
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
text
));
str
=
xml
C
har_from_wchar
(
text
);
str
=
xml
c
har_from_wchar
(
text
);
/* Escape the string. */
str2
=
xmlEncodeEntitiesReentrant
(
This
->
node
->
doc
,
str
);
...
...
@@ -1029,7 +1029,7 @@ HRESULT node_select_nodes(const xmlnode *This, BSTR query, IXMLDOMNodeList **nod
if
(
!
query
||
!
nodes
)
return
E_INVALIDARG
;
str
=
xml
C
har_from_wchar
(
query
);
str
=
xml
c
har_from_wchar
(
query
);
hr
=
queryresult_create
(
This
->
node
,
str
,
nodes
);
heap_free
(
str
);
...
...
dlls/msxml3/nodemap.c
View file @
fb96151b
...
...
@@ -189,18 +189,6 @@ static HRESULT WINAPI xmlnodemap_Invoke(
return
hr
;
}
xmlChar
*
xmlChar_from_wchar
(
LPCWSTR
str
)
{
DWORD
len
;
xmlChar
*
xmlstr
;
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
xmlstr
=
heap_alloc
(
len
);
if
(
xmlstr
)
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
(
LPSTR
)
xmlstr
,
len
,
NULL
,
NULL
);
return
xmlstr
;
}
static
HRESULT
WINAPI
xmlnodemap_getNamedItem
(
IXMLDOMNamedNodeMap
*
iface
,
BSTR
name
,
...
...
@@ -334,13 +322,13 @@ static HRESULT WINAPI xmlnodemap_getQualifiedItem(
if
(
namespaceURI
&&
*
namespaceURI
)
{
href
=
xml
C
har_from_wchar
(
namespaceURI
);
href
=
xml
c
har_from_wchar
(
namespaceURI
);
if
(
!
href
)
return
E_OUTOFMEMORY
;
}
else
href
=
NULL
;
name
=
xml
C
har_from_wchar
(
baseName
);
name
=
xml
c
har_from_wchar
(
baseName
);
if
(
!
name
)
{
heap_free
(
href
);
...
...
@@ -380,13 +368,13 @@ static HRESULT WINAPI xmlnodemap_removeQualifiedItem(
if
(
namespaceURI
&&
*
namespaceURI
)
{
href
=
xml
C
har_from_wchar
(
namespaceURI
);
href
=
xml
c
har_from_wchar
(
namespaceURI
);
if
(
!
href
)
return
E_OUTOFMEMORY
;
}
else
href
=
NULL
;
name
=
xml
C
har_from_wchar
(
baseName
);
name
=
xml
c
har_from_wchar
(
baseName
);
if
(
!
name
)
{
heap_free
(
href
);
...
...
dlls/msxml3/schema.c
View file @
fb96151b
...
...
@@ -1061,7 +1061,7 @@ static HRESULT WINAPI schema_cache_Invoke(IXMLDOMSchemaCollection2* iface,
static
HRESULT
WINAPI
schema_cache_add
(
IXMLDOMSchemaCollection2
*
iface
,
BSTR
uri
,
VARIANT
var
)
{
schema_cache
*
This
=
impl_from_IXMLDOMSchemaCollection2
(
iface
);
xmlChar
*
name
=
uri
?
xml
Char_from_wchar
(
uri
)
:
xmlC
har_from_wchar
(
emptyW
);
xmlChar
*
name
=
uri
?
xml
char_from_wchar
(
uri
)
:
xmlc
har_from_wchar
(
emptyW
);
TRACE
(
"(%p)->(%s %s)
\n
"
,
This
,
debugstr_w
(
uri
),
debugstr_variant
(
&
var
));
switch
(
V_VT
(
&
var
))
...
...
@@ -1162,7 +1162,7 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2* iface, BSTR uri
if
(
!
node
)
return
E_POINTER
;
name
=
uri
?
xml
Char_from_wchar
(
uri
)
:
xmlC
har_from_wchar
(
emptyW
);
name
=
uri
?
xml
char_from_wchar
(
uri
)
:
xmlc
har_from_wchar
(
emptyW
);
entry
=
(
cache_entry
*
)
xmlHashLookup
(
This
->
cache
,
name
);
heap_free
(
name
);
...
...
@@ -1177,7 +1177,7 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2* iface, BSTR uri
static
HRESULT
WINAPI
schema_cache_remove
(
IXMLDOMSchemaCollection2
*
iface
,
BSTR
uri
)
{
schema_cache
*
This
=
impl_from_IXMLDOMSchemaCollection2
(
iface
);
xmlChar
*
name
=
uri
?
xml
Char_from_wchar
(
uri
)
:
xmlC
har_from_wchar
(
emptyW
);
xmlChar
*
name
=
uri
?
xml
char_from_wchar
(
uri
)
:
xmlc
har_from_wchar
(
emptyW
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
wine_dbgstr_w
(
uri
));
xmlHashRemoveEntry
(
This
->
cache
,
name
,
cache_free
);
...
...
dlls/msxml3/xmlelem.c
View file @
fb96151b
...
...
@@ -237,8 +237,8 @@ static HRESULT WINAPI xmlelem_setAttribute(IXMLElement *iface, BSTR strPropertyN
if
(
!
strPropertyName
||
V_VT
(
&
PropertyValue
)
!=
VT_BSTR
)
return
E_INVALIDARG
;
name
=
xml
C
har_from_wchar
(
strPropertyName
);
value
=
xml
C
har_from_wchar
(
V_BSTR
(
&
PropertyValue
));
name
=
xml
c
har_from_wchar
(
strPropertyName
);
value
=
xml
c
har_from_wchar
(
V_BSTR
(
&
PropertyValue
));
attr
=
xmlSetProp
(
This
->
node
,
name
,
value
);
heap_free
(
name
);
...
...
@@ -276,7 +276,7 @@ static HRESULT WINAPI xmlelem_getAttribute(IXMLElement *iface, BSTR name,
xmlAttrPtr
attr
;
xmlChar
*
xml_name
;
xml_name
=
xml
C
har_from_wchar
(
name
);
xml_name
=
xml
c
har_from_wchar
(
name
);
attr
=
This
->
node
->
properties
;
while
(
attr
)
{
...
...
@@ -321,7 +321,7 @@ static HRESULT WINAPI xmlelem_removeAttribute(IXMLElement *iface, BSTR strProper
if
(
!
strPropertyName
)
return
E_INVALIDARG
;
name
=
xml
C
har_from_wchar
(
strPropertyName
);
name
=
xml
c
har_from_wchar
(
strPropertyName
);
attr
=
xmlHasProp
(
This
->
node
,
name
);
if
(
!
attr
)
goto
done
;
...
...
@@ -414,7 +414,7 @@ static HRESULT WINAPI xmlelem_put_text(IXMLElement *iface, BSTR p)
if
(
This
->
node
->
type
==
XML_ELEMENT_NODE
)
return
E_NOTIMPL
;
content
=
xml
C
har_from_wchar
(
p
);
content
=
xml
c
har_from_wchar
(
p
);
xmlNodeSetContent
(
This
->
node
,
content
);
heap_free
(
content
);
...
...
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