dpnet: Close resets back to an uninitialized state.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7fb80b9029
commit
eef69511f5
|
@ -253,9 +253,12 @@ static HRESULT WINAPI IDirectPlay8ClientImpl_GetServerAddress(IDirectPlay8Client
|
||||||
|
|
||||||
static HRESULT WINAPI IDirectPlay8ClientImpl_Close(IDirectPlay8Client *iface, const DWORD dwFlags)
|
static HRESULT WINAPI IDirectPlay8ClientImpl_Close(IDirectPlay8Client *iface, const DWORD dwFlags)
|
||||||
{
|
{
|
||||||
IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
|
IDirectPlay8ClientImpl *This = impl_from_IDirectPlay8Client(iface);
|
||||||
FIXME("(%p):(%x): Stub\n", This, dwFlags);
|
FIXME("(%p):(%x): Stub\n", This, dwFlags);
|
||||||
return DPN_OK;
|
|
||||||
|
This->msghandler = NULL;
|
||||||
|
|
||||||
|
return DPN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDirectPlay8ClientImpl_ReturnBuffer(IDirectPlay8Client *iface,
|
static HRESULT WINAPI IDirectPlay8ClientImpl_ReturnBuffer(IDirectPlay8Client *iface,
|
||||||
|
|
|
@ -319,6 +319,33 @@ static void test_cleanup_dp(void)
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_close(void)
|
||||||
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
static IDirectPlay8Client* client2;
|
||||||
|
DPN_SP_CAPS caps;
|
||||||
|
|
||||||
|
hr = CoCreateInstance(&CLSID_DirectPlay8Client, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlay8Client, (void **)&client2);
|
||||||
|
ok(hr == S_OK, "got 0x%x\n", hr);
|
||||||
|
|
||||||
|
memset(&caps, 0, sizeof(DPN_SP_CAPS));
|
||||||
|
caps.dwSize = sizeof(DPN_SP_CAPS);
|
||||||
|
|
||||||
|
hr = IDirectPlay8Client_Initialize(client2, NULL, DirectPlayMessageHandler, 0);
|
||||||
|
ok(hr == S_OK, "got %x\n", hr);
|
||||||
|
|
||||||
|
hr = IDirectPlay8Client_GetSPCaps(client2, &CLSID_DP8SP_TCPIP, &caps, 0);
|
||||||
|
ok(hr == DPN_OK, "got %x\n", hr);
|
||||||
|
|
||||||
|
hr = IDirectPlay8Client_Close(client2, 0);
|
||||||
|
ok(hr == DPN_OK, "got %x\n", hr);
|
||||||
|
|
||||||
|
hr = IDirectPlay8Client_GetSPCaps(client2, &CLSID_DP8SP_TCPIP, &caps, 0);
|
||||||
|
ok(hr == DPNERR_UNINITIALIZED, "got %x\n", hr);
|
||||||
|
|
||||||
|
IDirectPlay8Client_Release(client2);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(client)
|
START_TEST(client)
|
||||||
{
|
{
|
||||||
if(!test_init_dp())
|
if(!test_init_dp())
|
||||||
|
@ -329,5 +356,6 @@ START_TEST(client)
|
||||||
test_get_sp_caps();
|
test_get_sp_caps();
|
||||||
test_player_info();
|
test_player_info();
|
||||||
test_lobbyclient();
|
test_lobbyclient();
|
||||||
|
test_close();
|
||||||
test_cleanup_dp();
|
test_cleanup_dp();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue