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
6f3afc1a
Commit
6f3afc1a
authored
Mar 29, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsResetMessage.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4f1c7dc1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
5 deletions
+99
-5
msg.c
dlls/webservices/msg.c
+59
-4
msg.c
dlls/webservices/tests/msg.c
+38
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
webservices.h
include/webservices.h
+1
-0
No files found.
dlls/webservices/msg.c
View file @
6f3afc1a
...
...
@@ -123,15 +123,44 @@ static void free_header( struct header *header )
heap_free
(
header
);
}
static
void
free
_msg
(
struct
msg
*
msg
)
static
void
reset
_msg
(
struct
msg
*
msg
)
{
ULONG
i
;
WsFreeWriter
(
msg
->
writer
);
WsFreeHeap
(
msg
->
heap
);
msg
->
state
=
WS_MESSAGE_STATE_EMPTY
;
msg
->
init
=
0
;
UuidCreate
(
&
msg
->
id
);
msg
->
is_addressed
=
FALSE
;
heap_free
(
msg
->
addr
.
chars
);
msg
->
addr
.
chars
=
NULL
;
msg
->
addr
.
length
=
0
;
heap_free
(
msg
->
action
.
chars
);
for
(
i
=
0
;
i
<
msg
->
header_count
;
i
++
)
free_header
(
msg
->
header
[
i
]
);
msg
->
action
.
chars
=
NULL
;
msg
->
action
.
length
=
0
;
WsResetHeap
(
msg
->
heap
,
NULL
);
msg
->
buf
=
NULL
;
/* allocated on msg->heap */
msg
->
writer_body
=
NULL
;
/* owned by caller */
msg
->
reader_body
=
NULL
;
/* owned by caller */
for
(
i
=
0
;
i
<
msg
->
header_count
;
i
++
)
{
free_header
(
msg
->
header
[
i
]
);
msg
->
header
[
i
]
=
NULL
;
}
msg
->
header_count
=
0
;
memset
(
&
msg
->
ctx_send
,
0
,
sizeof
(
msg
->
ctx_send
)
);
memset
(
&
msg
->
ctx_receive
,
0
,
sizeof
(
msg
->
ctx_receive
)
);
}
static
void
free_msg
(
struct
msg
*
msg
)
{
reset_msg
(
msg
);
WsFreeWriter
(
msg
->
writer
);
WsFreeHeap
(
msg
->
heap
);
heap_free
(
msg
->
header
);
msg
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
...
...
@@ -246,6 +275,32 @@ void WINAPI WsFreeMessage( WS_MESSAGE *handle )
}
/**************************************************************************
* WsResetMessage [webservices.@]
*/
HRESULT
WINAPI
WsResetMessage
(
WS_MESSAGE
*
handle
,
WS_ERROR
*
error
)
{
struct
msg
*
msg
=
(
struct
msg
*
)
handle
;
TRACE
(
"%p %p
\n
"
,
handle
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
msg
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
msg
->
cs
);
if
(
msg
->
magic
!=
MSG_MAGIC
)
{
LeaveCriticalSection
(
&
msg
->
cs
);
return
E_INVALIDARG
;
}
reset_msg
(
msg
);
LeaveCriticalSection
(
&
msg
->
cs
);
return
S_OK
;
}
/**************************************************************************
* WsGetMessageProperty [webservices.@]
*/
HRESULT
WINAPI
WsGetMessageProperty
(
WS_MESSAGE
*
handle
,
WS_MESSAGE_PROPERTY_ID
id
,
void
*
buf
,
...
...
dlls/webservices/tests/msg.c
View file @
6f3afc1a
...
...
@@ -1105,6 +1105,43 @@ static void test_WsReadBody(void)
WsFreeHeap
(
heap
);
}
static
void
test_WsResetMessage
(
void
)
{
WS_MESSAGE
*
msg
;
WS_MESSAGE_STATE
state
;
WS_ENVELOPE_VERSION
env_version
;
WS_ADDRESSING_VERSION
addr_version
;
HRESULT
hr
;
hr
=
WsCreateMessage
(
WS_ENVELOPE_VERSION_SOAP_1_1
,
WS_ADDRESSING_VERSION_0_9
,
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
);
hr
=
WsResetMessage
(
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
state
=
0xdeadbeef
;
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_STATE
,
&
state
,
sizeof
(
state
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
WS_MESSAGE_STATE_EMPTY
,
"got %u
\n
"
,
state
);
env_version
=
0xdeadbeef
;
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_ENVELOPE_VERSION
,
&
env_version
,
sizeof
(
env_version
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
env_version
==
WS_ENVELOPE_VERSION_SOAP_1_1
,
"got %u
\n
"
,
env_version
);
addr_version
=
0xdeadbeef
;
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_ADDRESSING_VERSION
,
&
addr_version
,
sizeof
(
addr_version
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
addr_version
==
WS_ADDRESSING_VERSION_0_9
,
"got %u
\n
"
,
addr_version
);
WsFreeMessage
(
msg
);
}
START_TEST
(
msg
)
{
test_WsCreateMessage
();
...
...
@@ -1123,4 +1160,5 @@ START_TEST(msg)
test_WsReadEnvelopeStart
();
test_WsReadEnvelopeEnd
();
test_WsReadBody
();
test_WsResetMessage
();
}
dlls/webservices/webservices.spec
View file @
6f3afc1a
...
...
@@ -137,7 +137,7 @@
@ stdcall WsResetError(ptr)
@ stdcall WsResetHeap(ptr ptr)
@ stub WsResetListener
@ st
ub WsResetMessage
@ st
dcall WsResetMessage(ptr ptr)
@ stub WsResetMetadata
@ stub WsResetServiceHost
@ stub WsResetServiceProxy
...
...
include/webservices.h
View file @
6f3afc1a
...
...
@@ -1488,6 +1488,7 @@ HRESULT WINAPI WsRemoveHeader(WS_MESSAGE*, WS_HEADER_TYPE, WS_ERROR*);
HRESULT
WINAPI
WsRemoveMappedHeader
(
WS_MESSAGE
*
,
const
WS_XML_STRING
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsRemoveNode
(
const
WS_XML_NODE_POSITION
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetChannel
(
WS_CHANNEL
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetMessage
(
WS_MESSAGE
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetError
(
WS_ERROR
*
);
HRESULT
WINAPI
WsResetHeap
(
WS_HEAP
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetMessage
(
WS_MESSAGE
*
,
WS_ERROR
*
);
...
...
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