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
d9ae2b82
Commit
d9ae2b82
authored
Feb 14, 2014
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
May 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Implement IDirectPlay8LobbiedApplication Initialize.
parent
2cef8dbc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
9 deletions
+76
-9
dpnet_private.h
dlls/dpnet/dpnet_private.h
+7
-2
lobbiedapp.c
dlls/dpnet/lobbiedapp.c
+13
-3
client.c
dlls/dpnet/tests/client.c
+26
-2
peer.c
dlls/dpnet/tests/peer.c
+30
-2
No files found.
dlls/dpnet/dpnet_private.h
View file @
d9ae2b82
...
...
@@ -78,8 +78,13 @@ struct IDirectPlay8AddressImpl
*/
struct
IDirectPlay8LobbiedApplicationImpl
{
IDirectPlay8LobbiedApplication
IDirectPlay8LobbiedApplication_iface
;
LONG
ref
;
IDirectPlay8LobbiedApplication
IDirectPlay8LobbiedApplication_iface
;
LONG
ref
;
PFNDPNMESSAGEHANDLER
msghandler
;
DWORD
flags
;
void
*
usercontext
;
DPNHANDLE
*
connection
;
};
/*****************************************************************************
...
...
dlls/dpnet/lobbiedapp.c
View file @
d9ae2b82
...
...
@@ -89,9 +89,19 @@ static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_Initialize(IDirectPlay8
void
*
const
pvUserContext
,
const
PFNDPNMESSAGEHANDLER
pfn
,
DPNHANDLE
*
const
pdpnhConnection
,
const
DWORD
dwFlags
)
{
IDirectPlay8LobbiedApplicationImpl
*
This
=
impl_from_IDirectPlay8LobbiedApplication
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
DPN_OK
;
IDirectPlay8LobbiedApplicationImpl
*
This
=
impl_from_IDirectPlay8LobbiedApplication
(
iface
);
TRACE
(
"(%p)->(%p %p %p %x)
\n
"
,
This
,
pvUserContext
,
pfn
,
pdpnhConnection
,
dwFlags
);
if
(
!
pfn
)
return
DPNERR_INVALIDPOINTER
;
This
->
msghandler
=
pfn
;
This
->
flags
=
dwFlags
;
This
->
usercontext
=
pvUserContext
;
This
->
connection
=
pdpnhConnection
;
return
DPN_OK
;
}
static
HRESULT
WINAPI
IDirectPlay8LobbiedApplicationImpl_RegisterProgram
(
IDirectPlay8LobbiedApplication
*
iface
,
...
...
dlls/dpnet/tests/client.c
View file @
d9ae2b82
...
...
@@ -21,10 +21,12 @@
#include <stdio.h>
#include <dplay8.h>
#include <dplobby8.h>
#include "wine/test.h"
static
IDirectPlay8Client
*
client
=
NULL
;
static
IDirectPlay8LobbiedApplication
*
lobbied
=
NULL
;
static
const
GUID
appguid
=
{
0xcd0c3d4b
,
0xe15e
,
0x4cf2
,
{
0x9e
,
0xa8
,
0x6e
,
0x1d
,
0x65
,
0x48
,
0xc5
,
0xa5
}
};
static
HRESULT
WINAPI
DirectPlayMessageHandler
(
PVOID
context
,
DWORD
message_id
,
PVOID
buffer
)
...
...
@@ -33,10 +35,17 @@ static HRESULT WINAPI DirectPlayMessageHandler(PVOID context, DWORD message_id,
return
S_OK
;
}
static
HRESULT
WINAPI
DirectPlayLobbyMessageHandler
(
PVOID
context
,
DWORD
message_id
,
PVOID
buffer
)
{
trace
(
"DirectPlayLobbyMessageHandler: 0x%08x
\n
"
,
message_id
);
return
S_OK
;
}
static
BOOL
test_init_dp
(
void
)
{
HRESULT
hr
;
DPN_SP_CAPS
caps
;
DPNHANDLE
lobbyConnection
;
hr
=
CoInitialize
(
0
);
ok
(
hr
==
S_OK
,
"CoInitialize failed with %x
\n
"
,
hr
);
...
...
@@ -56,6 +65,14 @@ static BOOL test_init_dp(void)
hr
=
IDirectPlay8Client_Initialize
(
client
,
NULL
,
DirectPlayMessageHandler
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Client_Initialize failed with %x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_DirectPlay8LobbiedApplication
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectPlay8LobbiedApplication
,
(
void
**
)
&
lobbied
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed with 0x%x
\n
"
,
hr
);
hr
=
IDirectPlay8LobbiedApplication_Initialize
(
lobbied
,
NULL
,
DirectPlayLobbyMessageHandler
,
&
lobbyConnection
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8LobbiedApplication_Initialize failed with %x
\n
"
,
hr
);
return
client
!=
NULL
;
}
...
...
@@ -195,8 +212,15 @@ static void test_cleanup_dp(void)
hr
=
IDirectPlay8Client_Close
(
client
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Client_Close failed with %x
\n
"
,
hr
);
hr
=
IDirectPlay8Client_Release
(
client
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Client_Release failed with %x
\n
"
,
hr
);
if
(
lobbied
)
{
hr
=
IDirectPlay8LobbiedApplication_Close
(
lobbied
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8LobbiedApplication_Close failed with %x
\n
"
,
hr
);
IDirectPlay8LobbiedApplication_Release
(
lobbied
);
}
IDirectPlay8Client_Release
(
client
);
CoUninitialize
();
}
...
...
dlls/dpnet/tests/peer.c
View file @
d9ae2b82
...
...
@@ -20,10 +20,12 @@
#include <stdio.h>
#include <dplay8.h>
#include <dplobby8.h>
#include "wine/test.h"
static
IDirectPlay8Peer
*
peer
=
NULL
;
static
IDirectPlay8LobbiedApplication
*
lobbied
=
NULL
;
static
HRESULT
WINAPI
DirectPlayMessageHandler
(
PVOID
context
,
DWORD
message_id
,
PVOID
buffer
)
{
...
...
@@ -31,10 +33,17 @@ static HRESULT WINAPI DirectPlayMessageHandler(PVOID context, DWORD message_id,
return
S_OK
;
}
static
HRESULT
WINAPI
DirectPlayLobbyMessageHandler
(
PVOID
context
,
DWORD
message_id
,
PVOID
buffer
)
{
trace
(
"DirectPlayLobbyMessageHandler: 0x%08x
\n
"
,
message_id
);
return
S_OK
;
}
static
void
test_init_dp
(
void
)
{
HRESULT
hr
;
DPN_SP_CAPS
caps
;
DPNHANDLE
lobbyConnection
;
hr
=
CoInitialize
(
0
);
ok
(
hr
==
S_OK
,
"CoInitialize failed with %x
\n
"
,
hr
);
...
...
@@ -53,6 +62,18 @@ static void test_init_dp(void)
hr
=
IDirectPlay8Peer_Initialize
(
peer
,
NULL
,
DirectPlayMessageHandler
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Peer_Initialize failed with %x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_DirectPlay8LobbiedApplication
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectPlay8LobbiedApplication
,
(
void
**
)
&
lobbied
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed with 0x%x
\n
"
,
hr
);
hr
=
IDirectPlay8LobbiedApplication_Initialize
(
lobbied
,
NULL
,
NULL
,
&
lobbyConnection
,
0
);
ok
(
hr
==
DPNERR_INVALIDPOINTER
,
"Failed with %x
\n
"
,
hr
);
hr
=
IDirectPlay8LobbiedApplication_Initialize
(
lobbied
,
NULL
,
DirectPlayLobbyMessageHandler
,
&
lobbyConnection
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8LobbiedApplication_Initialize failed with %x
\n
"
,
hr
);
}
static
void
test_enum_service_providers
(
void
)
...
...
@@ -198,8 +219,15 @@ static void test_cleanup_dp(void)
hr
=
IDirectPlay8Peer_Close
(
peer
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Peer_Close failed with %x
\n
"
,
hr
);
hr
=
IDirectPlay8Peer_Release
(
peer
);
ok
(
hr
==
S_OK
,
"IDirectPlay8Peer_Release failed with %x
\n
"
,
hr
);
if
(
lobbied
)
{
hr
=
IDirectPlay8LobbiedApplication_Close
(
lobbied
,
0
);
ok
(
hr
==
S_OK
,
"IDirectPlay8LobbiedApplication_Close failed with %x
\n
"
,
hr
);
IDirectPlay8LobbiedApplication_Release
(
lobbied
);
}
IDirectPlay8Peer_Release
(
peer
);
CoUninitialize
();
}
...
...
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