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
9f52fec0
Commit
9f52fec0
authored
May 10, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsReadAttribute.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f541c826
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
1 deletion
+90
-1
reader.c
dlls/webservices/reader.c
+36
-0
reader.c
dlls/webservices/tests/reader.c
+53
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
No files found.
dlls/webservices/reader.c
View file @
9f52fec0
...
@@ -4423,6 +4423,42 @@ HRESULT WINAPI WsReadValue( WS_XML_READER *handle, WS_VALUE_TYPE value_type, voi
...
@@ -4423,6 +4423,42 @@ HRESULT WINAPI WsReadValue( WS_XML_READER *handle, WS_VALUE_TYPE value_type, voi
return
hr
;
return
hr
;
}
}
/**************************************************************************
* WsReadAttribute [webservices.@]
*/
HRESULT
WINAPI
WsReadAttribute
(
WS_XML_READER
*
handle
,
const
WS_ATTRIBUTE_DESCRIPTION
*
desc
,
WS_READ_OPTION
option
,
WS_HEAP
*
heap
,
void
*
value
,
ULONG
size
,
WS_ERROR
*
error
)
{
struct
reader
*
reader
=
(
struct
reader
*
)
handle
;
HRESULT
hr
;
TRACE
(
"%p %p %u %p %p %u %p
\n
"
,
handle
,
desc
,
option
,
heap
,
value
,
size
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
reader
||
!
desc
||
!
value
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
reader
->
cs
);
if
(
reader
->
magic
!=
READER_MAGIC
)
{
LeaveCriticalSection
(
&
reader
->
cs
);
return
E_INVALIDARG
;
}
if
(
!
reader
->
input_type
)
{
LeaveCriticalSection
(
&
reader
->
cs
);
return
WS_E_INVALID_OPERATION
;
}
hr
=
read_type
(
reader
,
WS_ATTRIBUTE_TYPE_MAPPING
,
desc
->
type
,
desc
->
attributeLocalName
,
desc
->
attributeNs
,
desc
->
typeDescription
,
option
,
heap
,
value
,
size
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
static
inline
BOOL
is_utf8
(
const
unsigned
char
*
data
,
ULONG
size
,
ULONG
*
offset
)
static
inline
BOOL
is_utf8
(
const
unsigned
char
*
data
,
ULONG
size
,
ULONG
*
offset
)
{
{
static
const
char
bom
[]
=
{
0xef
,
0xbb
,
0xbf
};
static
const
char
bom
[]
=
{
0xef
,
0xbb
,
0xbf
};
...
...
dlls/webservices/tests/reader.c
View file @
9f52fec0
...
@@ -4351,6 +4351,58 @@ static void test_WsReadQualifiedName(void)
...
@@ -4351,6 +4351,58 @@ static void test_WsReadQualifiedName(void)
WsFreeReader
(
reader
);
WsFreeReader
(
reader
);
}
}
static
void
test_WsReadAttribute
(
void
)
{
WS_XML_STRING
localname
=
{
1
,
(
BYTE
*
)
"a"
},
ns
=
{
0
,
NULL
};
WS_XML_READER
*
reader
;
WS_ATTRIBUTE_DESCRIPTION
desc
;
WS_HEAP
*
heap
;
UINT32
*
val
;
BOOL
found
;
HRESULT
hr
;
hr
=
WsReadAttribute
(
NULL
,
NULL
,
0
,
NULL
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateReader
(
NULL
,
0
,
&
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadAttribute
(
reader
,
NULL
,
0
,
NULL
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
desc
.
attributeLocalName
=
&
localname
;
desc
.
attributeNs
=
&
ns
;
desc
.
type
=
WS_UINT32_TYPE
;
desc
.
typeDescription
=
NULL
;
hr
=
WsReadAttribute
(
reader
,
&
desc
,
0
,
NULL
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadAttribute
(
reader
,
&
desc
,
WS_READ_REQUIRED_POINTER
,
NULL
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateHeap
(
1
<<
8
,
0
,
NULL
,
0
,
&
heap
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadAttribute
(
reader
,
&
desc
,
WS_READ_REQUIRED_POINTER
,
heap
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadAttribute
(
reader
,
&
desc
,
WS_READ_REQUIRED_POINTER
,
heap
,
&
val
,
sizeof
(
val
),
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
prepare_struct_type_test
(
reader
,
"<t a='1'>"
);
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
&
found
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
val
=
NULL
;
hr
=
WsReadAttribute
(
reader
,
&
desc
,
WS_READ_REQUIRED_POINTER
,
heap
,
&
val
,
sizeof
(
val
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
val
!=
NULL
,
"val not set
\n
"
);
ok
(
*
val
==
1
,
"got %u
\n
"
,
*
val
);
WsFreeHeap
(
heap
);
WsFreeReader
(
reader
);
}
START_TEST
(
reader
)
START_TEST
(
reader
)
{
{
test_WsCreateError
();
test_WsCreateError
();
...
@@ -4391,4 +4443,5 @@ START_TEST(reader)
...
@@ -4391,4 +4443,5 @@ START_TEST(reader)
test_WsReadChars
();
test_WsReadChars
();
test_WsReadCharsUtf8
();
test_WsReadCharsUtf8
();
test_WsReadQualifiedName
();
test_WsReadQualifiedName
();
test_WsReadAttribute
();
}
}
dlls/webservices/webservices.spec
View file @
9f52fec0
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
@ stub WsPullBytes
@ stub WsPullBytes
@ stub WsPushBytes
@ stub WsPushBytes
@ stub WsReadArray
@ stub WsReadArray
@ st
ub WsReadAttribute
@ st
dcall WsReadAttribute(ptr ptr long ptr ptr long ptr)
@ stdcall WsReadBody(ptr ptr long ptr ptr long ptr)
@ stdcall WsReadBody(ptr ptr long ptr ptr long ptr)
@ stdcall WsReadBytes(ptr ptr long ptr ptr)
@ stdcall WsReadBytes(ptr ptr long ptr ptr)
@ stdcall WsReadChars(ptr ptr long ptr ptr)
@ stdcall WsReadChars(ptr ptr long ptr ptr)
...
...
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