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
b2829c4b
Commit
b2829c4b
authored
Aug 16, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsRemoveHeader.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b89f7d94
Hide whitespace changes
Inline
Side-by-side
Showing
4 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
+62
-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 @
b2829c4b
...
@@ -671,3 +671,35 @@ HRESULT WINAPI WsSetHeader( WS_MESSAGE *handle, WS_HEADER_TYPE type, WS_TYPE val
...
@@ -671,3 +671,35 @@ HRESULT WINAPI WsSetHeader( WS_MESSAGE *handle, WS_HEADER_TYPE type, WS_TYPE val
msg
->
header
[
i
]
=
header
;
msg
->
header
[
i
]
=
header
;
return
write_envelope
(
msg
);
return
write_envelope
(
msg
);
}
}
/**************************************************************************
* WsRemoveHeader [webservices.@]
*/
HRESULT
WINAPI
WsRemoveHeader
(
WS_MESSAGE
*
handle
,
WS_HEADER_TYPE
type
,
WS_ERROR
*
error
)
{
struct
msg
*
msg
=
(
struct
msg
*
)
handle
;
BOOL
removed
=
FALSE
;
ULONG
i
;
TRACE
(
"%p %u %p
\n
"
,
handle
,
type
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
handle
)
return
E_INVALIDARG
;
if
(
msg
->
state
<
WS_MESSAGE_STATE_INITIALIZED
)
return
WS_E_INVALID_OPERATION
;
if
(
type
<
WS_ACTION_HEADER
||
type
>
WS_FAULT_TO_HEADER
)
return
E_INVALIDARG
;
for
(
i
=
0
;
i
<
msg
->
header_count
;
i
++
)
{
if
(
msg
->
header
[
i
]
->
type
==
type
)
{
heap_free
(
msg
->
header
[
i
]
);
memmove
(
&
msg
->
header
[
i
],
&
msg
->
header
[
i
+
1
],
(
msg
->
header_count
-
i
)
*
sizeof
(
struct
header
*
)
);
msg
->
header_count
--
;
removed
=
TRUE
;
break
;
}
}
if
(
removed
)
return
write_envelope
(
msg
);
return
S_OK
;
}
dlls/webservices/tests/msg.c
View file @
b2829c4b
...
@@ -591,6 +591,67 @@ static void test_WsSetHeader(void)
...
@@ -591,6 +591,67 @@ static void test_WsSetHeader(void)
WsFreeWriter
(
writer
);
WsFreeWriter
(
writer
);
}
}
static
void
test_WsRemoveHeader
(
void
)
{
static
const
char
expected
[]
=
"<s:Envelope xmlns:a=
\"
http://www.w3.org/2005/08/addressing
\"
"
"xmlns:s=
\"
http://www.w3.org/2003/05/soap-envelope
\"
><s:Header>"
"<a:MessageID>urn:uuid:00000000-0000-0000-0000-000000000000</a:MessageID>"
"<a:Action s:mustUnderstand=
\"
1
\"
>action</a:Action></s:Header>"
"<s:Body/></s:Envelope>"
;
static
const
char
expected2
[]
=
"<s:Envelope xmlns:a=
\"
http://www.w3.org/2005/08/addressing
\"
"
"xmlns:s=
\"
http://www.w3.org/2003/05/soap-envelope
\"
><s:Header>"
"<a:MessageID>urn:uuid:00000000-0000-0000-0000-000000000000</a:MessageID>"
"</s:Header><s:Body/></s:Envelope>"
;
static
const
WS_XML_STRING
action
=
{
6
,
(
BYTE
*
)
"action"
};
HRESULT
hr
;
WS_MESSAGE
*
msg
;
hr
=
WsSetHeader
(
NULL
,
0
,
0
,
0
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateMessage
(
WS_ADDRESSING_VERSION_1_0
,
WS_ENVELOPE_VERSION_SOAP_1_2
,
NULL
,
0
,
&
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsRemoveHeader
(
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsRemoveHeader
(
msg
,
0
,
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
hr
=
WsRemoveHeader
(
msg
,
WS_ACTION_HEADER
,
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
);
check_output_header
(
msg
,
expected2
,
-
1
,
strstr
(
expected2
,
"urn:uuid:"
)
-
expected2
,
46
,
__LINE__
);
hr
=
WsRemoveHeader
(
msg
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsRemoveHeader
(
msg
,
WS_ACTION_HEADER
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output_header
(
msg
,
expected2
,
-
1
,
strstr
(
expected2
,
"urn:uuid:"
)
-
expected2
,
46
,
__LINE__
);
hr
=
WsSetHeader
(
msg
,
WS_ACTION_HEADER
,
WS_XML_STRING_TYPE
,
WS_WRITE_REQUIRED_VALUE
,
&
action
,
sizeof
(
action
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output_header
(
msg
,
expected
,
-
1
,
strstr
(
expected
,
"urn:uuid:"
)
-
expected
,
46
,
__LINE__
);
hr
=
WsRemoveHeader
(
msg
,
WS_ACTION_HEADER
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output_header
(
msg
,
expected2
,
-
1
,
strstr
(
expected2
,
"urn:uuid:"
)
-
expected2
,
46
,
__LINE__
);
/* again */
hr
=
WsRemoveHeader
(
msg
,
WS_ACTION_HEADER
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output_header
(
msg
,
expected2
,
-
1
,
strstr
(
expected2
,
"urn:uuid:"
)
-
expected2
,
46
,
__LINE__
);
WsFreeMessage
(
msg
);
}
START_TEST
(
msg
)
START_TEST
(
msg
)
{
{
test_WsCreateMessage
();
test_WsCreateMessage
();
...
@@ -601,4 +662,5 @@ START_TEST(msg)
...
@@ -601,4 +662,5 @@ START_TEST(msg)
test_WsWriteEnvelopeEnd
();
test_WsWriteEnvelopeEnd
();
test_WsWriteBody
();
test_WsWriteBody
();
test_WsSetHeader
();
test_WsSetHeader
();
test_WsRemoveHeader
();
}
}
dlls/webservices/webservices.spec
View file @
b2829c4b
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
@ stub WsReceiveMessage
@ stub WsReceiveMessage
@ stub WsRegisterOperationForCancel
@ stub WsRegisterOperationForCancel
@ stub WsRemoveCustomHeader
@ stub WsRemoveCustomHeader
@ st
ub WsRemoveHeader
@ st
dcall WsRemoveHeader(ptr long ptr)
@ stub WsRemoveMappedHeader
@ stub WsRemoveMappedHeader
@ stub WsRemoveNode
@ stub WsRemoveNode
@ stub WsRequestReply
@ stub WsRequestReply
...
...
include/webservices.h
View file @
b2829c4b
...
@@ -1420,6 +1420,7 @@ HRESULT WINAPI WsReadValue(WS_XML_READER*, WS_VALUE_TYPE, void*, ULONG, WS_ERROR
...
@@ -1420,6 +1420,7 @@ HRESULT WINAPI WsReadValue(WS_XML_READER*, WS_VALUE_TYPE, void*, ULONG, WS_ERROR
HRESULT
WINAPI
WsReceiveMessage
(
WS_CHANNEL
*
,
WS_MESSAGE
*
,
const
WS_MESSAGE_DESCRIPTION
**
,
ULONG
,
HRESULT
WINAPI
WsReceiveMessage
(
WS_CHANNEL
*
,
WS_MESSAGE
*
,
const
WS_MESSAGE_DESCRIPTION
**
,
ULONG
,
WS_RECEIVE_OPTION
,
WS_READ_OPTION
,
WS_HEAP
*
,
void
*
,
ULONG
,
ULONG
*
,
WS_RECEIVE_OPTION
,
WS_READ_OPTION
,
WS_HEAP
*
,
void
*
,
ULONG
,
ULONG
*
,
const
WS_ASYNC_CONTEXT
*
,
WS_ERROR
*
);
const
WS_ASYNC_CONTEXT
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsRemoveHeader
(
WS_MESSAGE
*
,
WS_HEADER_TYPE
,
WS_ERROR
*
);
HRESULT
WINAPI
WsRemoveNode
(
const
WS_XML_NODE_POSITION
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsRemoveNode
(
const
WS_XML_NODE_POSITION
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetChannel
(
WS_CHANNEL
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetChannel
(
WS_CHANNEL
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetError
(
WS_ERROR
*
);
HRESULT
WINAPI
WsResetError
(
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