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
a15fe5a7
Commit
a15fe5a7
authored
Aug 21, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3/mxnamespace: Implemented getURI().
parent
42f65e13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
2 deletions
+93
-2
mxnamespace.c
dlls/msxml3/mxnamespace.c
+48
-2
domdoc.c
dlls/msxml3/tests/domdoc.c
+45
-0
No files found.
dlls/msxml3/mxnamespace.c
View file @
a15fe5a7
...
...
@@ -101,6 +101,8 @@ static HRESULT declare_prefix(struct nscontext *ctxt, const WCHAR *prefix, const
/* returned stored pointer, caller needs to copy it */
static
HRESULT
get_declared_prefix_idx
(
const
struct
nscontext
*
ctxt
,
LONG
index
,
BSTR
*
prefix
)
{
*
prefix
=
NULL
;
if
(
index
>=
ctxt
->
count
||
index
<
0
)
return
E_FAIL
;
if
(
index
>
0
)
index
=
ctxt
->
count
-
index
;
...
...
@@ -109,6 +111,21 @@ static HRESULT get_declared_prefix_idx(const struct nscontext *ctxt, LONG index,
return
S_OK
;
}
static
HRESULT
get_uri_from_prefix
(
const
struct
nscontext
*
ctxt
,
const
WCHAR
*
prefix
,
BSTR
*
uri
)
{
int
i
;
for
(
i
=
0
;
i
<
ctxt
->
count
;
i
++
)
if
(
!
strcmpW
(
ctxt
->
ns
[
i
].
prefix
,
prefix
))
{
*
uri
=
ctxt
->
ns
[
i
].
uri
;
return
S_OK
;
}
*
uri
=
NULL
;
return
S_FALSE
;
}
static
struct
nscontext
*
alloc_ns_context
(
void
)
{
struct
nscontext
*
ctxt
;
...
...
@@ -257,8 +274,37 @@ static HRESULT WINAPI namespacemanager_getURI(IMXNamespaceManager *iface,
const
WCHAR
*
prefix
,
IXMLDOMNode
*
node
,
WCHAR
*
uri
,
int
*
uri_len
)
{
namespacemanager
*
This
=
impl_from_IMXNamespaceManager
(
iface
);
FIXME
(
"(%p)->(%s %p %p %p): stub
\n
"
,
This
,
debugstr_w
(
prefix
),
node
,
uri
,
uri_len
);
return
E_NOTIMPL
;
struct
nscontext
*
ctxt
;
HRESULT
hr
;
BSTR
urib
;
TRACE
(
"(%p)->(%s %p %p %p)
\n
"
,
This
,
debugstr_w
(
prefix
),
node
,
uri
,
uri_len
);
if
(
!
prefix
)
return
E_INVALIDARG
;
if
(
!
uri_len
)
return
E_POINTER
;
if
(
node
)
{
FIXME
(
"namespaces from DOM node not supported
\n
"
);
return
E_NOTIMPL
;
}
ctxt
=
LIST_ENTRY
(
list_head
(
&
This
->
ctxts
),
struct
nscontext
,
entry
);
hr
=
get_uri_from_prefix
(
ctxt
,
prefix
,
&
urib
);
if
(
hr
==
S_OK
)
{
if
(
uri
)
{
if
(
*
uri_len
<
(
INT
)
SysStringLen
(
urib
))
return
E_XML_BUFFERTOOSMALL
;
strcpyW
(
uri
,
urib
);
}
}
else
if
(
uri
)
*
uri
=
0
;
*
uri_len
=
SysStringLen
(
urib
);
return
hr
;
}
static
const
struct
IMXNamespaceManagerVtbl
MXNamespaceManagerVtbl
=
...
...
dlls/msxml3/tests/domdoc.c
View file @
a15fe5a7
...
...
@@ -10117,6 +10117,7 @@ static void test_load(void)
static
void
test_nsnamespacemanager
(
void
)
{
static
const
char
xmluriA
[]
=
"http://www.w3.org/XML/1998/namespace"
;
IMXNamespaceManager
*
nsmgr
;
IVBMXNamespaceManager
*
mgr2
;
IDispatch
*
disp
;
...
...
@@ -10184,6 +10185,50 @@ todo_wine {
ok
(
len
==
3
,
"got %d
\n
"
,
len
);
ok
(
!
lstrcmpW
(
buffW
,
_bstr_
(
"xml"
)),
"got prefix %s
\n
"
,
wine_dbgstr_w
(
buffW
));
/* getURI */
hr
=
IMXNamespaceManager_getURI
(
nsmgr
,
NULL
,
NULL
,
NULL
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
len
=
-
1
;
hr
=
IMXNamespaceManager_getURI
(
nsmgr
,
NULL
,
NULL
,
NULL
,
&
len
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
ok
(
len
==
-
1
,
"got %d
\n
"
,
len
);
hr
=
IMXNamespaceManager_getURI
(
nsmgr
,
_bstr_
(
"xml"
),
NULL
,
NULL
,
NULL
);
EXPECT_HR
(
hr
,
E_POINTER
);
len
=
-
1
;
hr
=
IMXNamespaceManager_getURI
(
nsmgr
,
_bstr_
(
"xml"
),
NULL
,
NULL
,
&
len
);
EXPECT_HR
(
hr
,
S_OK
);
/* length of "xml" uri is constant */
ok
(
len
==
strlen
(
xmluriA
),
"got %d
\n
"
,
len
);
len
=
100
;
hr
=
IMXNamespaceManager_getURI
(
nsmgr
,
_bstr_
(
"xml"
),
NULL
,
buffW
,
&
len
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
len
==
strlen
(
xmluriA
),
"got %d
\n
"
,
len
);
ok
(
!
lstrcmpW
(
buffW
,
_bstr_
(
xmluriA
)),
"got prefix %s
\n
"
,
wine_dbgstr_w
(
buffW
));
len
=
strlen
(
xmluriA
)
-
1
;
buffW
[
0
]
=
0x1
;
hr
=
IMXNamespaceManager_getURI
(
nsmgr
,
_bstr_
(
"xml"
),
NULL
,
buffW
,
&
len
);
EXPECT_HR
(
hr
,
E_XML_BUFFERTOOSMALL
);
ok
(
len
==
strlen
(
xmluriA
)
-
1
,
"got %d
\n
"
,
len
);
ok
(
buffW
[
0
]
==
0x1
,
"got %x
\n
"
,
buffW
[
0
]);
/* prefix xml1 not defined */
len
=
-
1
;
hr
=
IMXNamespaceManager_getURI
(
nsmgr
,
_bstr_
(
"xml1"
),
NULL
,
NULL
,
&
len
);
EXPECT_HR
(
hr
,
S_FALSE
);
ok
(
len
==
0
,
"got %d
\n
"
,
len
);
len
=
100
;
buffW
[
0
]
=
0x1
;
hr
=
IMXNamespaceManager_getURI
(
nsmgr
,
_bstr_
(
"xml1"
),
NULL
,
buffW
,
&
len
);
EXPECT_HR
(
hr
,
S_FALSE
);
ok
(
buffW
[
0
]
==
0
,
"got %x
\n
"
,
buffW
[
0
]);
ok
(
len
==
0
,
"got %d
\n
"
,
len
);
IMXNamespaceManager_Release
(
nsmgr
);
free_bstrs
();
...
...
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