1 #ifndef __WINE_DPLAY_GLOBAL_INCLUDED
2 #define __WINE_DPLAY_GLOBAL_INCLUDED
6 #include "dplayx_queue.h"
8 extern HRESULT
DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback
,
9 LPCVOID lpAddress
, DWORD dwAddressSize
,
12 extern DWORD
DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc
, BOOL bAnsi
);
14 /*****************************************************************************
15 * Predeclare the interface implementation structures
17 typedef struct IDirectPlay2Impl IDirectPlay2AImpl
;
18 typedef struct IDirectPlay2Impl IDirectPlay2Impl
;
19 typedef struct IDirectPlay3Impl IDirectPlay3AImpl
;
20 typedef struct IDirectPlay3Impl IDirectPlay3Impl
;
21 typedef struct IDirectPlay4Impl IDirectPlay4AImpl
;
22 typedef struct IDirectPlay4Impl IDirectPlay4Impl
;
24 typedef struct tagDirectPlayIUnknownData
27 CRITICAL_SECTION DP_lock
;
28 } DirectPlayIUnknownData
;
30 typedef struct tagEnumSessionAsyncCallbackData
32 LPSPINITDATA lpSpData
;
34 DWORD dwEnumSessionFlags
;
36 HANDLE hSuicideRequest
;
37 } EnumSessionAsyncCallbackData
;
39 typedef struct tagDP_MSG_REPLY_STRUCT
45 /* FIXME: Is the message header required as well? */
46 } DP_MSG_REPLY_STRUCT
, *LPDP_MSG_REPLY_STRUCT
;
48 typedef struct tagDP_MSG_REPLY_STRUCT_LIST
50 DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST
) replysExpected
;
51 DP_MSG_REPLY_STRUCT replyExpected
;
52 } DP_MSG_REPLY_STRUCT_LIST
, *LPDP_MSG_REPLY_STRUCT_LIST
;
56 /* Individual player information */
62 ULONG uRef
; /* What is the reference count on this data? */
64 /* View of local data */
66 DWORD dwLocalDataSize
;
68 /* View of remote data */
70 DWORD dwRemoteDataSize
;
72 /* SP data on a per player basis */
73 LPVOID lpSPPlayerData
;
75 DWORD dwFlags
; /* Special remarks about the type of player */
77 typedef struct PlayerData
* lpPlayerData
;
81 DPQ_ENTRY(PlayerList
) players
;
85 typedef struct PlayerList
* lpPlayerList
;
89 /* Internal information */
90 DPID parent
; /* If parent == 0 it's a top level group */
92 ULONG uRef
; /* Reference count */
94 DPQ_HEAD(GroupList
) groups
; /* A group has [0..n] groups */
95 DPQ_HEAD(PlayerList
) players
; /* A group has [0..n] players */
97 DPID idGroupOwner
; /* ID of player who owns the group */
99 DWORD dwFlags
; /* Flags describing anything special about the group */
104 /* View of local data */
106 DWORD dwLocalDataSize
;
108 /* View of remote data */
110 DWORD dwRemoteDataSize
;
112 typedef struct GroupData GroupData
;
113 typedef struct GroupData
* lpGroupData
;
117 DPQ_ENTRY(GroupList
) groups
;
121 typedef struct GroupList
* lpGroupList
;
125 DPQ_ENTRY( DPMSG
) msgs
;
128 typedef struct DPMSG
* LPDPMSG
;
133 DP_SERVICE_PROVIDER
= 1,
134 DP_LOBBY_PROVIDER
= 2
137 /* Contains all data members. FIXME: Rename me */
138 typedef struct tagDirectPlay2Data
140 BOOL bConnectionOpen
;
142 /* For async EnumSessions requests */
143 HANDLE hEnumSessionThread
;
144 HANDLE hKillEnumSessionThreadEvent
;
146 LPVOID lpNameServerData
; /* DPlay interface doesn't know contents */
148 BOOL bHostInterface
; /* Did this interface create the session */
150 lpGroupData lpSysGroup
; /* System group with _everything_ in it */
152 LPDPSESSIONDESC2 lpSessionDesc
;
155 DPQ_HEAD( DPMSG
) receiveMsgs
; /* Msg receive queue */
156 DPQ_HEAD( DPMSG
) sendMsgs
; /* Msg send pending queue */
158 /* Information about the service provider active on this connection */
162 /* Information about the lobby server that's attached to this DP object */
163 SPDATA_INIT dplspData
;
164 BOOL bDPLSPInitialized
;
166 /* Our service provider */
167 HMODULE hServiceProvider
;
169 /* Our DP lobby provider */
170 HMODULE hDPLobbyProvider
;
172 enum SPSTATE connectionInitialized
;
174 /* Expected messages queue */
175 DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST
) replysExpected
;
178 typedef struct tagDirectPlay3Data
182 typedef struct tagDirectPlay4Data
187 #define DP_IMPL_FIELDS \
188 ULONG ulInterfaceRef; \
189 DirectPlayIUnknownData* unk; \
190 DirectPlay2Data* dp2; \
191 DirectPlay3Data* dp3; \
192 DirectPlay4Data* dp4;
194 struct IDirectPlay2Impl
196 ICOM_VFIELD(IDirectPlay2
);
200 struct IDirectPlay3Impl
202 ICOM_VFIELD(IDirectPlay3
);
206 struct IDirectPlay4Impl
208 ICOM_VFIELD(IDirectPlay4
);
212 /* Forward declarations of virtual tables */
213 extern ICOM_VTABLE(IDirectPlay2
) directPlay2AVT
;
214 extern ICOM_VTABLE(IDirectPlay3
) directPlay3AVT
;
215 extern ICOM_VTABLE(IDirectPlay4
) directPlay4AVT
;
217 extern ICOM_VTABLE(IDirectPlay2
) directPlay2WVT
;
218 extern ICOM_VTABLE(IDirectPlay3
) directPlay3WVT
;
219 extern ICOM_VTABLE(IDirectPlay4
) directPlay4WVT
;
222 HRESULT
DP_HandleMessage( IDirectPlay2Impl
* This
, LPCVOID lpMessageBody
,
223 DWORD dwMessageBodySize
, LPCVOID lpMessageHeader
,
224 WORD wCommandId
, WORD wVersion
,
225 LPVOID
* lplpReply
, LPDWORD lpdwMsgSize
);
227 /* DP SP external interfaces into DirectPlay */
228 extern HRESULT
DP_GetSPPlayerData( IDirectPlay2Impl
* lpDP
, DPID idPlayer
, LPVOID
* lplpData
);
229 extern HRESULT
DP_SetSPPlayerData( IDirectPlay2Impl
* lpDP
, DPID idPlayer
, LPVOID lpData
);
231 /* DP external interfaces to call into DPSP interface */
232 extern LPVOID
DPSP_CreateSPPlayerData(void);
234 #endif /* __WINE_DPLAY_GLOBAL_INCLUDED */