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
e36a185f
Commit
e36a185f
authored
Jul 08, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsAddressMessage.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d91a7d2e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
1 deletion
+96
-1
msg.c
dlls/webservices/msg.c
+32
-0
msg.c
dlls/webservices/tests/msg.c
+63
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
No files found.
dlls/webservices/msg.c
View file @
e36a185f
...
...
@@ -49,6 +49,7 @@ struct msg
WS_ENVELOPE_VERSION
version_env
;
WS_ADDRESSING_VERSION
version_addr
;
BOOL
is_addressed
;
WS_STRING
addr
;
ULONG
prop_count
;
struct
prop
prop
[
sizeof
(
msg_props
)
/
sizeof
(
msg_props
[
0
])];
};
...
...
@@ -68,6 +69,8 @@ static struct msg *alloc_msg(void)
static
void
free_msg
(
struct
msg
*
msg
)
{
if
(
!
msg
)
return
;
heap_free
(
msg
->
addr
.
chars
);
heap_free
(
msg
);
}
...
...
@@ -246,3 +249,32 @@ HRESULT WINAPI WsSetMessageProperty( WS_MESSAGE *handle, WS_MESSAGE_PROPERTY_ID
}
return
prop_set
(
msg
->
prop
,
msg
->
prop_count
,
id
,
value
,
size
);
}
/**************************************************************************
* WsAddressMessage [webservices.@]
*/
HRESULT
WINAPI
WsAddressMessage
(
WS_MESSAGE
*
handle
,
const
WS_ENDPOINT_ADDRESS
*
addr
,
WS_ERROR
*
error
)
{
struct
msg
*
msg
=
(
struct
msg
*
)
handle
;
TRACE
(
"%p %p %p
\n
"
,
handle
,
addr
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
addr
&&
(
addr
->
headers
||
addr
->
extensions
||
addr
->
identity
))
{
FIXME
(
"headers, extensions or identity not supported
\n
"
);
return
E_NOTIMPL
;
}
if
(
!
handle
)
return
E_INVALIDARG
;
if
(
msg
->
state
<
WS_MESSAGE_STATE_INITIALIZED
||
msg
->
is_addressed
)
return
WS_E_INVALID_OPERATION
;
if
(
addr
&&
addr
->
url
.
length
)
{
if
(
!
(
msg
->
addr
.
chars
=
heap_alloc
(
addr
->
url
.
length
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
memcpy
(
msg
->
addr
.
chars
,
addr
->
url
.
chars
,
addr
->
url
.
length
*
sizeof
(
WCHAR
)
);
msg
->
addr
.
length
=
addr
->
url
.
length
;
}
msg
->
is_addressed
=
TRUE
;
return
S_OK
;
}
dlls/webservices/tests/msg.c
View file @
e36a185f
...
...
@@ -209,9 +209,72 @@ static void test_WsInitializeMessage(void)
WsFreeMessage
(
msg
);
}
static
void
test_WsAddressMessage
(
void
)
{
static
WCHAR
localhost
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'h'
,
'o'
,
's'
,
't'
,
'/'
,
0
};
HRESULT
hr
;
WS_MESSAGE
*
msg
;
WS_ENDPOINT_ADDRESS
endpoint
;
BOOL
addressed
;
hr
=
WsAddressMessage
(
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateMessage
(
WS_ADDRESSING_VERSION_0_9
,
WS_ENVELOPE_VERSION_SOAP_1_1
,
NULL
,
0
,
&
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_IS_ADDRESSED
,
&
addressed
,
sizeof
(
addressed
),
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
hr
=
WsAddressMessage
(
msg
,
NULL
,
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
hr
=
WsInitializeMessage
(
msg
,
WS_REQUEST_MESSAGE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
addressed
=
-
1
;
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_IS_ADDRESSED
,
&
addressed
,
sizeof
(
addressed
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
addressed
,
"unexpected value %d
\n
"
,
addressed
);
hr
=
WsAddressMessage
(
msg
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
addressed
=
-
1
;
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_IS_ADDRESSED
,
&
addressed
,
sizeof
(
addressed
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
addressed
==
TRUE
,
"unexpected value %d
\n
"
,
addressed
);
WsFreeMessage
(
msg
);
hr
=
WsCreateMessage
(
WS_ADDRESSING_VERSION_0_9
,
WS_ENVELOPE_VERSION_SOAP_1_1
,
NULL
,
0
,
&
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsInitializeMessage
(
msg
,
WS_REQUEST_MESSAGE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
memset
(
&
endpoint
,
0
,
sizeof
(
endpoint
)
);
endpoint
.
url
.
chars
=
localhost
;
endpoint
.
url
.
length
=
sizeof
(
localhost
)
/
sizeof
(
localhost
[
0
]);
hr
=
WsAddressMessage
(
msg
,
&
endpoint
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
addressed
=
-
1
;
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_IS_ADDRESSED
,
&
addressed
,
sizeof
(
addressed
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
addressed
==
TRUE
,
"unexpected value %d
\n
"
,
addressed
);
WsFreeMessage
(
msg
);
}
START_TEST
(
msg
)
{
test_WsCreateMessage
();
test_WsCreateMessageForChannel
();
test_WsInitializeMessage
();
test_WsAddressMessage
();
}
dlls/webservices/webservices.spec
View file @
e36a185f
...
...
@@ -8,7 +8,7 @@
@ stub WsAddCustomHeader
@ stub WsAddErrorString
@ stub WsAddMappedHeader
@ st
ub WsAddressMessage
@ st
dcall WsAddressMessage(ptr ptr ptr)
@ stdcall WsAlloc(ptr long ptr ptr)
@ stub WsAsyncExecute
@ stdcall WsCall(ptr ptr ptr 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