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
3c784214
Commit
3c784214
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: Implement WsResetServiceProxy.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e1e36be4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
1 deletion
+86
-1
proxy.c
dlls/webservices/proxy.c
+40
-0
proxy.c
dlls/webservices/tests/proxy.c
+44
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
webservices.h
include/webservices.h
+1
-0
No files found.
dlls/webservices/proxy.c
View file @
3c784214
...
...
@@ -70,9 +70,17 @@ static struct proxy *alloc_proxy(void)
return
ret
;
}
static
void
reset_proxy
(
struct
proxy
*
proxy
)
{
WsResetChannel
(
proxy
->
channel
,
NULL
);
proxy
->
state
=
WS_SERVICE_PROXY_STATE_CREATED
;
}
static
void
free_proxy
(
struct
proxy
*
proxy
)
{
reset_proxy
(
proxy
);
WsFreeChannel
(
proxy
->
channel
);
proxy
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
proxy
->
cs
);
heap_free
(
proxy
);
...
...
@@ -192,6 +200,38 @@ HRESULT WINAPI WsCreateServiceProxyFromTemplate( WS_CHANNEL_TYPE channel_type,
}
/**************************************************************************
* WsResetServiceProxy [webservices.@]
*/
HRESULT
WINAPI
WsResetServiceProxy
(
WS_SERVICE_PROXY
*
handle
,
WS_ERROR
*
error
)
{
struct
proxy
*
proxy
=
(
struct
proxy
*
)
handle
;
TRACE
(
"%p %p
\n
"
,
handle
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
proxy
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
proxy
->
cs
);
if
(
proxy
->
magic
!=
PROXY_MAGIC
)
{
LeaveCriticalSection
(
&
proxy
->
cs
);
return
E_INVALIDARG
;
}
if
(
proxy
->
state
!=
WS_SERVICE_PROXY_STATE_CREATED
&&
proxy
->
state
!=
WS_SERVICE_PROXY_STATE_CLOSED
)
{
LeaveCriticalSection
(
&
proxy
->
cs
);
return
WS_E_INVALID_OPERATION
;
}
reset_proxy
(
proxy
);
LeaveCriticalSection
(
&
proxy
->
cs
);
return
S_OK
;
}
/**************************************************************************
* WsFreeServiceProxy [webservices.@]
*/
void
WINAPI
WsFreeServiceProxy
(
WS_SERVICE_PROXY
*
handle
)
...
...
dlls/webservices/tests/proxy.c
View file @
3c784214
...
...
@@ -185,6 +185,49 @@ static void test_WsOpenServiceProxy(void)
WsFreeServiceProxy
(
proxy
);
}
static
void
test_WsResetServiceProxy
(
void
)
{
WCHAR
url
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'h'
,
'o'
,
's'
,
't'
,
'/'
};
HRESULT
hr
;
WS_SERVICE_PROXY
*
proxy
;
WS_ENDPOINT_ADDRESS
addr
;
WS_SERVICE_PROXY_STATE
state
;
hr
=
WsCreateServiceProxy
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
NULL
,
0
,
NULL
,
0
,
&
proxy
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsResetServiceProxy
(
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
;
hr
=
WsOpenServiceProxy
(
proxy
,
&
addr
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsResetServiceProxy
(
proxy
,
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
hr
=
WsCloseServiceProxy
(
proxy
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsResetServiceProxy
(
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
);
WsFreeServiceProxy
(
proxy
);
}
static
HRESULT
create_channel
(
int
port
,
WS_CHANNEL
**
ret
)
{
static
const
WCHAR
fmt
[]
=
...
...
@@ -680,6 +723,7 @@ START_TEST(proxy)
test_WsCreateServiceProxy
();
test_WsCreateServiceProxyFromTemplate
();
test_WsOpenServiceProxy
();
test_WsResetServiceProxy
();
info
.
port
=
7533
;
info
.
event
=
CreateEventW
(
NULL
,
0
,
0
,
NULL
);
...
...
dlls/webservices/webservices.spec
View file @
3c784214
...
...
@@ -140,7 +140,7 @@
@ stdcall WsResetMessage(ptr ptr)
@ stub WsResetMetadata
@ stub WsResetServiceHost
@ st
ub WsResetServiceProxy
@ st
dcall WsResetServiceProxy(ptr ptr)
@ stub WsRevokeSecurityContext
@ stub WsSendFaultMessageForError
@ stdcall WsSendMessage(ptr ptr ptr long ptr long ptr ptr)
...
...
include/webservices.h
View file @
3c784214
...
...
@@ -1631,6 +1631,7 @@ HRESULT WINAPI WsResetError(WS_ERROR*);
HRESULT
WINAPI
WsResetHeap
(
WS_HEAP
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetListener
(
WS_LISTENER
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetMessage
(
WS_MESSAGE
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetServiceProxy
(
WS_SERVICE_PROXY
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsRequestReply
(
WS_CHANNEL
*
,
WS_MESSAGE
*
,
const
WS_MESSAGE_DESCRIPTION
*
,
WS_WRITE_OPTION
,
const
void
*
,
ULONG
,
WS_MESSAGE
*
,
const
WS_MESSAGE_DESCRIPTION
*
,
WS_READ_OPTION
,
WS_HEAP
*
,
void
*
,
ULONG
,
const
WS_ASYNC_CONTEXT
*
,
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