1 #ifndef __WINE_DPLAY_GLOBAL_INCLUDED
2 #define __WINE_DPLAY_GLOBAL_INCLUDED
5 #include "dplayx_queue.h"
7 extern HRESULT
DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback
,
8 LPCVOID lpAddress
, DWORD dwAddressSize
,
11 extern DWORD
DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc
, BOOL bAnsi
);
13 /*****************************************************************************
14 * Predeclare the interface implementation structures
16 typedef struct IDirectPlay2Impl IDirectPlay2AImpl
;
17 typedef struct IDirectPlay2Impl IDirectPlay2Impl
;
18 typedef struct IDirectPlay3Impl IDirectPlay3AImpl
;
19 typedef struct IDirectPlay3Impl IDirectPlay3Impl
;
20 typedef struct IDirectPlay4Impl IDirectPlay4AImpl
;
21 typedef struct IDirectPlay4Impl IDirectPlay4Impl
;
23 typedef struct tagDirectPlayIUnknownData
26 CRITICAL_SECTION DP_lock
;
27 } DirectPlayIUnknownData
;
29 typedef struct tagEnumSessionAsyncCallbackData
31 LPSPINITDATA lpSpData
;
33 DWORD dwEnumSessionFlags
;
35 HANDLE hSuicideRequest
;
36 } EnumSessionAsyncCallbackData
;
38 typedef struct tagDP_MSG_REPLY_STRUCT
44 /* FIXME: Is the message header required as well? */
45 } DP_MSG_REPLY_STRUCT
, *LPDP_MSG_REPLY_STRUCT
;
47 typedef struct tagDP_MSG_REPLY_STRUCT_LIST
49 DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST
) replysExpected
;
50 DP_MSG_REPLY_STRUCT replyExpected
;
51 } DP_MSG_REPLY_STRUCT_LIST
, *LPDP_MSG_REPLY_STRUCT_LIST
;
55 /* Individual player information */
61 ULONG uRef
; /* What is the reference count on this data? */
63 /* View of local data */
65 DWORD dwLocalDataSize
;
67 /* View of remote data */
69 DWORD dwRemoteDataSize
;
71 /* SP data on a per player basis */
72 LPVOID lpSPPlayerData
;
74 DWORD dwFlags
; /* Special remarks about the type of player */
76 typedef struct PlayerData
* lpPlayerData
;
80 DPQ_ENTRY(PlayerList
) players
;
84 typedef struct PlayerList
* lpPlayerList
;
88 /* Internal information */
89 DPID parent
; /* If parent == 0 it's a top level group */
91 ULONG uRef
; /* Reference count */
93 DPQ_HEAD(GroupList
) groups
; /* A group has [0..n] groups */
94 DPQ_HEAD(PlayerList
) players
; /* A group has [0..n] players */
96 DPID idGroupOwner
; /* ID of player who owns the group */
98 DWORD dwFlags
; /* Flags describing anything special about the group */
103 /* View of local data */
105 DWORD dwLocalDataSize
;
107 /* View of remote data */
109 DWORD dwRemoteDataSize
;
111 typedef struct GroupData GroupData
;
112 typedef struct GroupData
* lpGroupData
;
116 DPQ_ENTRY(GroupList
) groups
;
120 typedef struct GroupList
* lpGroupList
;
124 DPQ_ENTRY( DPMSG
) msgs
;
127 typedef struct DPMSG
* LPDPMSG
;
129 /* Contains all dp1 and dp2 data members */
130 typedef struct tagDirectPlay2Data
132 BOOL bConnectionOpen
;
134 /* For async EnumSessions requests */
135 HANDLE hEnumSessionThread
;
136 HANDLE hKillEnumSessionThreadEvent
;
138 LPVOID lpNameServerData
; /* DPlay interface doesn't know contents */
140 BOOL bHostInterface
; /* Did this interface create the session */
142 lpGroupData lpSysGroup
; /* System group with _everything_ in it */
144 LPDPSESSIONDESC2 lpSessionDesc
;
147 DPQ_HEAD( DPMSG
) receiveMsgs
; /* Msg receive queue */
148 DPQ_HEAD( DPMSG
) sendMsgs
; /* Msg send pending queue */
150 /* Information about the service provider active on this connection */
153 /* Our service provider */
154 HMODULE hServiceProvider
;
156 BOOL bConnectionInitialized
;
158 /* Expected messages queue */
159 DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST
) replysExpected
;
162 typedef struct tagDirectPlay3Data
166 typedef struct tagDirectPlay4Data
171 #define DP_IMPL_FIELDS \
172 ULONG ulInterfaceRef; \
173 DirectPlayIUnknownData* unk; \
174 DirectPlay2Data* dp2; \
175 DirectPlay3Data* dp3; \
176 DirectPlay4Data* dp4;
178 struct IDirectPlay2Impl
180 ICOM_VFIELD(IDirectPlay2
);
184 struct IDirectPlay3Impl
186 ICOM_VFIELD(IDirectPlay3
);
190 struct IDirectPlay4Impl
192 ICOM_VFIELD(IDirectPlay4
);
196 /* Forward declarations of virtual tables */
197 extern ICOM_VTABLE(IDirectPlay2
) directPlay2AVT
;
198 extern ICOM_VTABLE(IDirectPlay3
) directPlay3AVT
;
199 extern ICOM_VTABLE(IDirectPlay4
) directPlay4AVT
;
201 extern ICOM_VTABLE(IDirectPlay2
) directPlay2WVT
;
202 extern ICOM_VTABLE(IDirectPlay3
) directPlay3WVT
;
203 extern ICOM_VTABLE(IDirectPlay4
) directPlay4WVT
;
206 HRESULT
DP_HandleMessage( IDirectPlay2Impl
* This
, LPCVOID lpMessageBody
,
207 DWORD dwMessageBodySize
, LPCVOID lpMessageHeader
,
208 WORD wCommandId
, WORD wVersion
,
209 LPVOID
* lplpReply
, LPDWORD lpdwMsgSize
);
211 /* DP SP external interfaces into DirectPlay */
212 extern HRESULT
DP_GetSPPlayerData( IDirectPlay2Impl
* lpDP
, DPID idPlayer
, LPVOID
* lplpData
);
213 extern HRESULT
DP_SetSPPlayerData( IDirectPlay2Impl
* lpDP
, DPID idPlayer
, LPVOID lpData
);
215 /* DP external interfaces to call into DPSP interface */
216 extern LPVOID
DPSP_CreateSPPlayerData(void);
218 #endif /* __WINE_DPLAY_GLOBAL_INCLUDED */