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
40c8d6aa
Commit
40c8d6aa
authored
Dec 16, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Store document url in properties so every instance could see it.
parent
d0665616
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
10 deletions
+38
-10
domdoc.c
dlls/msxml3/domdoc.c
+20
-9
domdoc.c
dlls/msxml3/tests/domdoc.c
+18
-1
No files found.
dlls/msxml3/domdoc.c
View file @
40c8d6aa
...
...
@@ -86,6 +86,7 @@ typedef struct {
xmlChar
const
*
selectNsStr
;
LONG
selectNsStr_len
;
BOOL
XPath
;
WCHAR
*
url
;
}
domdoc_properties
;
typedef
struct
ConnectionPoint
ConnectionPoint
;
...
...
@@ -131,8 +132,6 @@ struct domdoc
domdoc_properties
*
properties
;
HRESULT
error
;
WCHAR
*
url
;
/* IObjectWithSite */
IUnknown
*
site
;
...
...
@@ -299,6 +298,9 @@ static domdoc_properties *create_properties(MSXML_VERSION version)
properties
->
version
=
version
;
properties
->
XPath
=
(
version
==
MSXML4
||
version
==
MSXML6
);
/* document url */
properties
->
url
=
NULL
;
return
properties
;
}
...
...
@@ -333,6 +335,16 @@ static domdoc_properties* copy_properties(domdoc_properties const* properties)
list_add_tail
(
&
pcopy
->
selectNsList
,
&
new_ns
->
entry
);
}
if
(
properties
->
url
)
{
int
len
=
strlenW
(
properties
->
url
);
pcopy
->
url
=
CoTaskMemAlloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
pcopy
->
url
,
properties
->
url
,
len
*
sizeof
(
WCHAR
));
pcopy
->
url
[
len
]
=
0
;
}
else
pcopy
->
url
=
NULL
;
}
return
pcopy
;
...
...
@@ -346,6 +358,7 @@ static void free_properties(domdoc_properties* properties)
IXMLDOMSchemaCollection2_Release
(
properties
->
schemaCache
);
clear_selectNsList
(
&
properties
->
selectNsList
);
heap_free
((
xmlChar
*
)
properties
->
selectNsStr
);
CoTaskMemFree
(
properties
->
url
);
heap_free
(
properties
);
}
}
...
...
@@ -948,7 +961,6 @@ static ULONG WINAPI domdoc_Release( IXMLDOMDocument3 *iface )
for
(
eid
=
0
;
eid
<
EVENTID_LAST
;
eid
++
)
if
(
This
->
events
[
eid
])
IDispatch_Release
(
This
->
events
[
eid
]);
CoTaskMemFree
(
This
->
url
);
release_namespaces
(
This
);
heap_free
(
This
);
}
...
...
@@ -2202,15 +2214,15 @@ static HRESULT WINAPI domdoc_load(
{
IMoniker
*
mon
;
CoTaskMemFree
(
This
->
url
);
This
->
url
=
NULL
;
CoTaskMemFree
(
This
->
properties
->
url
);
This
->
properties
->
url
=
NULL
;
hr
=
create_moniker_from_url
(
filename
,
&
mon
);
if
(
SUCCEEDED
(
hr
)
)
{
hr
=
domdoc_load_moniker
(
This
,
mon
);
if
(
hr
==
S_OK
)
IMoniker_GetDisplayName
(
mon
,
NULL
,
NULL
,
&
This
->
url
);
IMoniker_GetDisplayName
(
mon
,
NULL
,
NULL
,
&
This
->
properties
->
url
);
IMoniker_Release
(
mon
);
}
...
...
@@ -2282,9 +2294,9 @@ static HRESULT WINAPI domdoc_get_url(
if
(
!
url
)
return
E_INVALIDARG
;
if
(
This
->
url
)
if
(
This
->
properties
->
url
)
{
*
url
=
SysAllocString
(
This
->
url
);
*
url
=
SysAllocString
(
This
->
properties
->
url
);
if
(
!*
url
)
return
E_OUTOFMEMORY
;
...
...
@@ -3568,7 +3580,6 @@ HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document)
doc
->
safeopt
=
0
;
doc
->
cp_list
=
NULL
;
doc
->
namespaces
=
NULL
;
doc
->
url
=
NULL
;
memset
(
doc
->
events
,
0
,
sizeof
(
doc
->
events
));
/* events connection points */
...
...
dlls/msxml3/tests/domdoc.c
View file @
40c8d6aa
...
...
@@ -9560,8 +9560,9 @@ static void write_to_file(const char *name, const char *data)
static
void
test_load
(
void
)
{
IXMLDOMDocument
*
doc
;
IXMLDOMDocument
*
doc
,
*
doc2
;
IXMLDOMNodeList
*
list
;
IXMLDOMElement
*
elem
;
VARIANT_BOOL
b
;
VARIANT
src
;
HRESULT
hr
;
...
...
@@ -9604,7 +9605,23 @@ static void test_load(void)
bstr1
=
NULL
;
hr
=
IXMLDOMDocument_get_url
(
doc
,
&
bstr1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
elem
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* create another instace for the same document, check url */
hr
=
IXMLDOMElement_get_ownerDocument
(
elem
,
&
doc2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_get_url
(
doc
,
&
bstr2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
bstr1
,
bstr2
),
"got %s
\n
"
,
wine_dbgstr_w
(
bstr2
));
IXMLDOMDocument_Release
(
doc2
);
IXMLDOMElement_Release
(
elem
);
SysFreeString
(
bstr1
);
SysFreeString
(
bstr2
);
/* load from a path: VT_BSTR|VT_BYREF, null ptr */
V_VT
(
&
src
)
=
VT_BSTR
|
VT_BYREF
;
...
...
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