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
e1e36be4
Commit
e1e36be4
authored
Apr 05, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Keep track of service proxy state.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
29d4c503
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
23 deletions
+43
-23
proxy.c
dlls/webservices/proxy.c
+21
-9
proxy.c
dlls/webservices/tests/proxy.c
+22
-14
No files found.
dlls/webservices/proxy.c
View file @
e1e36be4
...
...
@@ -43,11 +43,12 @@ static const struct prop_desc proxy_props[] =
struct
proxy
{
ULONG
magic
;
CRITICAL_SECTION
cs
;
WS_CHANNEL
*
channel
;
ULONG
prop_count
;
struct
prop
prop
[
sizeof
(
proxy_props
)
/
sizeof
(
proxy_props
[
0
])];
ULONG
magic
;
CRITICAL_SECTION
cs
;
WS_SERVICE_PROXY_STATE
state
;
WS_CHANNEL
*
channel
;
ULONG
prop_count
;
struct
prop
prop
[
sizeof
(
proxy_props
)
/
sizeof
(
proxy_props
[
0
])];
};
#define PROXY_MAGIC (('P' << 24) | ('R' << 16) | ('O' << 8) | 'X')
...
...
@@ -222,7 +223,7 @@ HRESULT WINAPI WsGetServiceProxyProperty( WS_SERVICE_PROXY *handle, WS_PROXY_PRO
void
*
buf
,
ULONG
size
,
WS_ERROR
*
error
)
{
struct
proxy
*
proxy
=
(
struct
proxy
*
)
handle
;
HRESULT
hr
;
HRESULT
hr
=
S_OK
;
TRACE
(
"%p %u %p %u %p
\n
"
,
handle
,
id
,
buf
,
size
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
...
...
@@ -237,7 +238,16 @@ HRESULT WINAPI WsGetServiceProxyProperty( WS_SERVICE_PROXY *handle, WS_PROXY_PRO
return
E_INVALIDARG
;
}
hr
=
prop_get
(
proxy
->
prop
,
proxy
->
prop_count
,
id
,
buf
,
size
);
switch
(
id
)
{
case
WS_PROXY_PROPERTY_STATE
:
if
(
!
buf
||
size
!=
sizeof
(
proxy
->
state
))
hr
=
E_INVALIDARG
;
else
*
(
WS_SERVICE_PROXY_STATE
*
)
buf
=
proxy
->
state
;
break
;
default:
hr
=
prop_get
(
proxy
->
prop
,
proxy
->
prop_count
,
id
,
buf
,
size
);
}
LeaveCriticalSection
(
&
proxy
->
cs
);
return
hr
;
...
...
@@ -266,7 +276,8 @@ HRESULT WINAPI WsOpenServiceProxy( WS_SERVICE_PROXY *handle, const WS_ENDPOINT_A
return
E_INVALIDARG
;
}
hr
=
WsOpenChannel
(
proxy
->
channel
,
endpoint
,
NULL
,
NULL
);
if
((
hr
=
WsOpenChannel
(
proxy
->
channel
,
endpoint
,
NULL
,
NULL
))
==
S_OK
)
proxy
->
state
=
WS_SERVICE_PROXY_STATE_OPEN
;
LeaveCriticalSection
(
&
proxy
->
cs
);
return
hr
;
...
...
@@ -294,7 +305,8 @@ HRESULT WINAPI WsCloseServiceProxy( WS_SERVICE_PROXY *handle, const WS_ASYNC_CON
return
E_INVALIDARG
;
}
hr
=
WsCloseChannel
(
proxy
->
channel
,
NULL
,
NULL
);
if
((
hr
=
WsCloseChannel
(
proxy
->
channel
,
NULL
,
NULL
))
==
S_OK
)
proxy
->
state
=
WS_SERVICE_PROXY_STATE_CLOSED
;
LeaveCriticalSection
(
&
proxy
->
cs
);
return
hr
;
...
...
dlls/webservices/tests/proxy.c
View file @
e1e36be4
...
...
@@ -95,7 +95,7 @@ static void test_WsCreateServiceProxy(void)
HRESULT
hr
;
WS_SERVICE_PROXY
*
proxy
;
WS_SERVICE_PROXY_STATE
state
;
ULONG
size
,
value
;
ULONG
value
;
hr
=
WsCreateServiceProxy
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
NULL
,
0
,
NULL
,
0
,
NULL
,
NULL
);
...
...
@@ -109,13 +109,11 @@ static void test_WsCreateServiceProxy(void)
/* write-only property */
value
=
0xdeadbeef
;
size
=
sizeof
(
value
);
hr
=
WsGetServiceProxyProperty
(
proxy
,
WS_PROXY_PROPERTY_CALL_TIMEOUT
,
&
value
,
size
,
NULL
);
hr
=
WsGetServiceProxyProperty
(
proxy
,
WS_PROXY_PROPERTY_CALL_TIMEOUT
,
&
value
,
sizeof
(
value
),
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
state
=
0xdeadbeef
;
size
=
sizeof
(
state
);
hr
=
WsGetServiceProxyProperty
(
proxy
,
WS_PROXY_PROPERTY_STATE
,
&
state
,
size
,
NULL
);
hr
=
WsGetServiceProxyProperty
(
proxy
,
WS_PROXY_PROPERTY_STATE
,
&
state
,
sizeof
(
state
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
WS_SERVICE_PROXY_STATE_CREATED
,
"got %u
\n
"
,
state
);
...
...
@@ -151,6 +149,7 @@ static void test_WsOpenServiceProxy(void)
WCHAR
url
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'h'
,
'o'
,
's'
,
't'
,
'/'
};
HRESULT
hr
;
WS_SERVICE_PROXY
*
proxy
;
WS_SERVICE_PROXY_STATE
state
;
WS_HTTP_POLICY_DESCRIPTION
policy
;
WS_ENDPOINT_ADDRESS
addr
;
...
...
@@ -159,17 +158,30 @@ static void test_WsOpenServiceProxy(void)
NULL
,
0
,
&
policy
,
sizeof
(
policy
),
&
proxy
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
state
=
0xdeadbeef
;
hr
=
WsGetServiceProxyProperty
(
proxy
,
WS_PROXY_PROPERTY_STATE
,
&
state
,
sizeof
(
state
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
WS_SERVICE_PROXY_STATE_CREATED
,
"got %u
\n
"
,
state
);
memset
(
&
addr
,
0
,
sizeof
(
addr
)
);
addr
.
url
.
length
=
sizeof
(
url
)
/
sizeof
(
url
[
0
]);
addr
.
url
.
chars
=
url
;
addr
.
headers
=
NULL
;
addr
.
extensions
=
NULL
;
addr
.
identity
=
NULL
;
hr
=
WsOpenServiceProxy
(
proxy
,
&
addr
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
state
=
0xdeadbeef
;
hr
=
WsGetServiceProxyProperty
(
proxy
,
WS_PROXY_PROPERTY_STATE
,
&
state
,
sizeof
(
state
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
WS_SERVICE_PROXY_STATE_OPEN
,
"got %u
\n
"
,
state
);
hr
=
WsCloseServiceProxy
(
proxy
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
state
=
0xdeadbeef
;
hr
=
WsGetServiceProxyProperty
(
proxy
,
WS_PROXY_PROPERTY_STATE
,
&
state
,
sizeof
(
state
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
WS_SERVICE_PROXY_STATE_CLOSED
,
"got %u
\n
"
,
state
);
WsFreeServiceProxy
(
proxy
);
}
...
...
@@ -197,11 +209,9 @@ static HRESULT create_channel( int port, WS_CHANNEL **ret )
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
prop
,
2
,
NULL
,
&
channel
,
NULL
);
if
(
hr
!=
S_OK
)
return
hr
;
memset
(
&
addr
,
0
,
sizeof
(
addr
)
);
addr
.
url
.
length
=
wsprintfW
(
buf
,
fmt
,
port
);
addr
.
url
.
chars
=
buf
;
addr
.
headers
=
NULL
;
addr
.
extensions
=
NULL
;
addr
.
identity
=
NULL
;
hr
=
WsOpenChannel
(
channel
,
&
addr
,
NULL
,
NULL
);
if
(
hr
==
S_OK
)
*
ret
=
channel
;
else
WsFreeChannel
(
channel
);
...
...
@@ -335,11 +345,9 @@ static HRESULT create_proxy( int port, WS_SERVICE_PROXY **ret )
0
,
prop
,
sizeof
(
prop
)
/
sizeof
(
prop
[
0
]),
&
proxy
,
NULL
);
if
(
hr
!=
S_OK
)
return
hr
;
memset
(
&
addr
,
0
,
sizeof
(
addr
)
);
addr
.
url
.
length
=
wsprintfW
(
url
,
fmt
,
port
);
addr
.
url
.
chars
=
url
;
addr
.
headers
=
NULL
;
addr
.
extensions
=
NULL
;
addr
.
identity
=
NULL
;
hr
=
WsOpenServiceProxy
(
proxy
,
&
addr
,
NULL
,
NULL
);
if
(
hr
==
S_OK
)
*
ret
=
proxy
;
else
WsFreeServiceProxy
(
proxy
);
...
...
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