Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5ad00660
Commit
5ad00660
authored
Jul 04, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsGetReaderPosition.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
13faf34b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
4 deletions
+73
-4
reader.c
dlls/webservices/reader.c
+25
-3
reader.c
dlls/webservices/tests/reader.c
+47
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
No files found.
dlls/webservices/reader.c
View file @
5ad00660
...
...
@@ -432,6 +432,7 @@ struct reader
ULONG
nb_prefixes
;
ULONG
nb_prefixes_allocated
;
WS_XML_READER_INPUT_TYPE
input_type
;
struct
xmlbuf
*
input_buf
;
const
unsigned
char
*
input_data
;
ULONG
input_size
;
ULONG
prop_count
;
...
...
@@ -570,6 +571,7 @@ static HRESULT read_init_state( struct reader *reader )
destroy_nodes
(
reader
->
root
);
reader
->
root
=
NULL
;
reader
->
input_buf
=
NULL
;
clear_prefixes
(
reader
->
prefixes
,
reader
->
nb_prefixes
);
reader
->
nb_prefixes
=
1
;
if
(
!
(
node
=
alloc_node
(
WS_XML_NODE_TYPE_EOF
)))
return
E_OUTOFMEMORY
;
...
...
@@ -3823,9 +3825,10 @@ static WS_CHARSET detect_charset( const unsigned char *data, ULONG size, ULONG *
return
ret
;
}
static
void
set_input_buffer
(
struct
reader
*
reader
,
const
unsigned
char
*
data
,
ULONG
size
)
static
void
set_input_buffer
(
struct
reader
*
reader
,
struct
xmlbuf
*
buf
,
const
unsigned
char
*
data
,
ULONG
size
)
{
reader
->
input_type
=
WS_XML_READER_INPUT_TYPE_BUFFER
;
reader
->
input_buf
=
buf
;
reader
->
input_data
=
data
;
reader
->
input_size
=
size
;
...
...
@@ -3891,7 +3894,8 @@ HRESULT WINAPI WsSetInput( WS_XML_READER *handle, const WS_XML_READER_ENCODING *
case
WS_XML_READER_INPUT_TYPE_BUFFER
:
{
WS_XML_READER_BUFFER_INPUT
*
buf
=
(
WS_XML_READER_BUFFER_INPUT
*
)
input
;
set_input_buffer
(
reader
,
(
const
unsigned
char
*
)
buf
->
encodedData
+
offset
,
buf
->
encodedDataSize
-
offset
);
set_input_buffer
(
reader
,
NULL
,
(
const
unsigned
char
*
)
buf
->
encodedData
+
offset
,
buf
->
encodedDataSize
-
offset
);
break
;
}
default:
...
...
@@ -3937,7 +3941,7 @@ HRESULT WINAPI WsSetInputToBuffer( WS_XML_READER *handle, WS_XML_BUFFER *buffer,
&
charset
,
sizeof
(
charset
)
);
if
(
hr
!=
S_OK
)
return
hr
;
set_input_buffer
(
reader
,
(
const
unsigned
char
*
)
xmlbuf
->
ptr
+
offset
,
xmlbuf
->
size
-
offset
);
set_input_buffer
(
reader
,
xmlbuf
,
(
const
unsigned
char
*
)
xmlbuf
->
ptr
+
offset
,
xmlbuf
->
size
-
offset
);
if
(
!
(
node
=
alloc_node
(
WS_XML_NODE_TYPE_BOF
)))
return
E_OUTOFMEMORY
;
read_insert_bof
(
reader
,
node
);
return
S_OK
;
...
...
@@ -3957,3 +3961,21 @@ HRESULT WINAPI WsXmlStringEquals( const WS_XML_STRING *str1, const WS_XML_STRING
if
(
!
memcmp
(
str1
->
bytes
,
str2
->
bytes
,
str1
->
length
))
return
S_OK
;
return
S_FALSE
;
}
/**************************************************************************
* WsGetReaderPosition [webservices.@]
*/
HRESULT
WINAPI
WsGetReaderPosition
(
WS_XML_READER
*
handle
,
WS_XML_NODE_POSITION
*
pos
,
WS_ERROR
*
error
)
{
struct
reader
*
reader
=
(
struct
reader
*
)
handle
;
TRACE
(
"%p %p %p
\n
"
,
handle
,
pos
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
reader
||
!
pos
)
return
E_INVALIDARG
;
if
(
!
reader
->
input_buf
)
return
WS_E_INVALID_OPERATION
;
pos
->
buffer
=
(
WS_XML_BUFFER
*
)
reader
->
input_buf
;
pos
->
node
=
reader
->
current
;
return
S_OK
;
}
dlls/webservices/tests/reader.c
View file @
5ad00660
...
...
@@ -3449,6 +3449,52 @@ static void test_WsResetError(void)
WsFreeError
(
error
);
}
static
void
test_WsGetReaderPosition
(
void
)
{
WS_HEAP
*
heap
;
WS_XML_READER
*
reader
;
WS_XML_BUFFER
*
buffer
;
WS_XML_NODE_POSITION
pos
;
HRESULT
hr
;
hr
=
WsGetReaderPosition
(
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateHeap
(
1
<<
16
,
0
,
NULL
,
0
,
&
heap
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateReader
(
NULL
,
0
,
&
reader
,
NULL
)
;
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
/* reader must be set to an XML buffer */
hr
=
WsGetReaderPosition
(
reader
,
&
pos
,
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
hr
=
set_input
(
reader
,
"<t/>"
,
sizeof
(
"<t/>"
)
-
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderPosition
(
reader
,
&
pos
,
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateXmlBuffer
(
heap
,
NULL
,
0
,
&
buffer
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsSetInputToBuffer
(
reader
,
buffer
,
NULL
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetReaderPosition
(
reader
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
pos
.
buffer
=
pos
.
node
=
NULL
;
hr
=
WsGetReaderPosition
(
reader
,
&
pos
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
pos
.
buffer
!=
NULL
,
"buffer not set
\n
"
);
ok
(
pos
.
node
!=
NULL
,
"node not set
\n
"
);
WsFreeReader
(
reader
);
WsFreeHeap
(
heap
);
}
START_TEST
(
reader
)
{
test_WsCreateError
();
...
...
@@ -3481,4 +3527,5 @@ START_TEST(reader)
test_WsReadElement
();
test_WsReadValue
();
test_WsResetError
();
test_WsGetReaderPosition
();
}
dlls/webservices/webservices.spec
View file @
5ad00660
...
...
@@ -81,7 +81,7 @@
@ stub WsGetPolicyProperty
@ stdcall WsGetPrefixFromNamespace(ptr ptr long ptr ptr)
@ stdcall WsGetReaderNode(ptr ptr ptr)
@ st
ub WsGetReaderPosition
@ st
dcall WsGetReaderPosition(ptr ptr ptr)
@ stdcall WsGetReaderProperty(ptr long ptr long ptr)
@ stub WsGetSecurityContextProperty
@ stub WsGetSecurityTokenProperty
...
...
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