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
be767562
Commit
be767562
authored
Apr 22, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsOpenChannel and WsCloseChannel.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a04361f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
2 deletions
+89
-2
channel.c
dlls/webservices/channel.c
+44
-0
channel.c
dlls/webservices/tests/channel.c
+40
-0
webservices.spec
dlls/webservices/webservices.spec
+2
-2
webservices_private.h
dlls/webservices/webservices_private.h
+3
-0
No files found.
dlls/webservices/channel.c
View file @
be767562
...
...
@@ -162,3 +162,47 @@ HRESULT WINAPI WsSetChannelProperty( WS_CHANNEL *handle, WS_CHANNEL_PROPERTY_ID
return
prop_set
(
channel
->
prop
,
channel
->
prop_count
,
id
,
value
,
size
);
}
HRESULT
open_channel
(
struct
channel
*
channel
,
const
WS_ENDPOINT_ADDRESS
*
endpoint
)
{
channel
->
state
=
WS_CHANNEL_STATE_OPEN
;
return
S_OK
;
}
/**************************************************************************
* WsOpenChannel [webservices.@]
*/
HRESULT
WINAPI
WsOpenChannel
(
WS_CHANNEL
*
handle
,
const
WS_ENDPOINT_ADDRESS
*
endpoint
,
const
WS_ASYNC_CONTEXT
*
ctx
,
WS_ERROR
*
error
)
{
struct
channel
*
channel
=
(
struct
channel
*
)
handle
;
TRACE
(
"%p %p %p %p
\n
"
,
handle
,
endpoint
,
ctx
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
ctx
)
FIXME
(
"ignoring ctx parameter
\n
"
);
if
(
!
endpoint
)
return
E_INVALIDARG
;
if
(
channel
->
state
!=
WS_CHANNEL_STATE_CREATED
)
return
WS_E_INVALID_OPERATION
;
return
open_channel
(
channel
,
endpoint
);
}
HRESULT
close_channel
(
struct
channel
*
channel
)
{
channel
->
state
=
WS_CHANNEL_STATE_CLOSED
;
return
S_OK
;
}
/**************************************************************************
* WsCloseChannel [webservices.@]
*/
HRESULT
WINAPI
WsCloseChannel
(
WS_CHANNEL
*
handle
,
const
WS_ASYNC_CONTEXT
*
ctx
,
WS_ERROR
*
error
)
{
struct
channel
*
channel
=
(
struct
channel
*
)
handle
;
TRACE
(
"%p %p %p
\n
"
,
handle
,
ctx
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
ctx
)
FIXME
(
"ignoring ctx parameter
\n
"
);
return
close_channel
(
channel
);
}
dlls/webservices/tests/channel.c
View file @
be767562
...
...
@@ -57,7 +57,47 @@ static void test_WsCreateChannel(void)
WsFreeChannel
(
channel
);
}
static
void
test_WsOpenChannel
(
void
)
{
WCHAR
url
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'h'
,
'o'
,
's'
,
't'
};
HRESULT
hr
;
WS_CHANNEL
*
channel
;
WS_ENDPOINT_ADDRESS
addr
;
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
&
channel
,
NULL
)
;
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsCloseChannel
(
channel
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
WsFreeChannel
(
channel
);
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
&
channel
,
NULL
)
;
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsOpenChannel
(
channel
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
addr
.
url
.
length
=
sizeof
(
url
)
/
sizeof
(
url
[
0
]);
addr
.
url
.
chars
=
url
;
addr
.
headers
=
NULL
;
addr
.
extensions
=
NULL
;
addr
.
identity
=
NULL
;
hr
=
WsOpenChannel
(
channel
,
&
addr
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsOpenChannel
(
channel
,
&
addr
,
NULL
,
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
hr
=
WsCloseChannel
(
channel
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsCloseChannel
(
channel
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
WsFreeChannel
(
channel
);
}
START_TEST
(
channel
)
{
test_WsCreateChannel
();
test_WsOpenChannel
();
}
dlls/webservices/webservices.spec
View file @
be767562
...
...
@@ -13,7 +13,7 @@
@ stub WsAsyncExecute
@ stub WsCall
@ stub WsCheckMustUnderstandHeaders
@ st
ub WsCloseChannel
@ st
dcall WsCloseChannel(ptr ptr ptr)
@ stub WsCloseListener
@ stub WsCloseServiceHost
@ stub WsCloseServiceProxy
...
...
@@ -95,7 +95,7 @@
@ stub WsMatchPolicyAlternative
@ stdcall WsMoveReader(ptr long ptr ptr)
@ stub WsMoveWriter
@ st
ub WsOpenChannel
@ st
dcall WsOpenChannel(ptr ptr ptr ptr)
@ stub WsOpenListener
@ stub WsOpenServiceHost
@ stub WsOpenServiceProxy
...
...
dlls/webservices/webservices_private.h
View file @
be767562
...
...
@@ -74,6 +74,7 @@ struct channel
{
WS_CHANNEL_TYPE
type
;
WS_CHANNEL_BINDING
binding
;
WS_CHANNEL_STATE
state
;
ULONG
prop_count
;
struct
prop
prop
[
9
];
};
...
...
@@ -81,6 +82,8 @@ struct channel
HRESULT
create_channel
(
WS_CHANNEL_TYPE
,
WS_CHANNEL_BINDING
,
const
WS_CHANNEL_PROPERTY
*
,
ULONG
,
struct
channel
**
)
DECLSPEC_HIDDEN
;
void
free_channel
(
struct
channel
*
)
DECLSPEC_HIDDEN
;
HRESULT
open_channel
(
struct
channel
*
,
const
WS_ENDPOINT_ADDRESS
*
)
DECLSPEC_HIDDEN
;
HRESULT
close_channel
(
struct
channel
*
)
DECLSPEC_HIDDEN
;
static
inline
void
*
heap_alloc
(
SIZE_T
size
)
{
...
...
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