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
;
40 /* Individual player information */
46 ULONG uRef
; /* What is the reference count on this data? */
48 /* View of local data */
50 DWORD dwLocalDataSize
;
52 /* View of remote data */
54 DWORD dwRemoteDataSize
;
56 DWORD dwFlags
; /* Special remarks about the type of player */
58 typedef struct PlayerData
* lpPlayerData
;
62 DPQ_ENTRY(PlayerList
) players
;
66 typedef struct PlayerList
* lpPlayerList
;
70 /* Internal information */
71 DPID parent
; /* If parent == 0 it's a top level group */
73 ULONG uRef
; /* Reference count */
75 DPQ_HEAD(GroupList
) groups
; /* A group has [0..n] groups */
76 DPQ_HEAD(PlayerList
) players
; /* A group has [0..n] players */
78 DPID idGroupOwner
; /* ID of player who owns the group */
80 DWORD dwFlags
; /* Flags describing anything special about the group */
85 /* View of local data */
87 DWORD dwLocalDataSize
;
89 /* View of remote data */
91 DWORD dwRemoteDataSize
;
93 typedef struct GroupData GroupData
;
94 typedef struct GroupData
* lpGroupData
;
98 DPQ_ENTRY(GroupList
) groups
;
102 typedef struct GroupList
* lpGroupList
;
106 DPQ_ENTRY( DPMSG
) msgs
;
109 typedef struct DPMSG
* LPDPMSG
;
111 /* Contains all dp1 and dp2 data members */
112 typedef struct tagDirectPlay2Data
114 BOOL bConnectionOpen
;
116 /* For async EnumSessions requests */
117 HANDLE hEnumSessionThread
;
118 HANDLE hKillEnumSessionThreadEvent
;
120 LPVOID lpNameServerData
; /* DPlay interface doesn't know contents */
122 BOOL bHostInterface
; /* Did this interface create the session */
124 lpGroupData lpSysGroup
; /* System group with _everything_ in it */
126 LPDPSESSIONDESC2 lpSessionDesc
;
129 DPQ_HEAD( DPMSG
) receiveMsgs
; /* Msg receive queue */
130 DPQ_HEAD( DPMSG
) sendMsgs
; /* Msg send pending queue */
132 /* Information about the service provider active on this connection */
135 /* Our service provider */
136 HMODULE hServiceProvider
;
138 BOOL bConnectionInitialized
;
141 /* proof of concept for message reception */
143 LPVOID lpMsgReceived
;
146 typedef struct tagDirectPlay3Data
150 typedef struct tagDirectPlay4Data
155 #define DP_IMPL_FIELDS \
156 ULONG ulInterfaceRef; \
157 DirectPlayIUnknownData* unk; \
158 DirectPlay2Data* dp2; \
159 DirectPlay3Data* dp3; \
160 DirectPlay4Data* dp4;
162 struct IDirectPlay2Impl
164 ICOM_VFIELD(IDirectPlay2
);
168 struct IDirectPlay3Impl
170 ICOM_VFIELD(IDirectPlay3
);
174 struct IDirectPlay4Impl
176 ICOM_VFIELD(IDirectPlay4
);
180 /* Forward declarations of virtual tables */
181 extern ICOM_VTABLE(IDirectPlay2
) directPlay2AVT
;
182 extern ICOM_VTABLE(IDirectPlay3
) directPlay3AVT
;
183 extern ICOM_VTABLE(IDirectPlay4
) directPlay4AVT
;
185 extern ICOM_VTABLE(IDirectPlay2
) directPlay2WVT
;
186 extern ICOM_VTABLE(IDirectPlay3
) directPlay3WVT
;
187 extern ICOM_VTABLE(IDirectPlay4
) directPlay4WVT
;
190 HRESULT
DP_HandleMessage( IDirectPlay2Impl
* This
, LPCVOID lpMessageBody
,
191 DWORD dwMessageBodySize
, LPCVOID lpMessageHeader
,
192 WORD wCommandId
, WORD wVersion
,
193 LPVOID
* lplpReply
, LPDWORD lpdwMsgSize
);
196 #endif /* __WINE_DPLAY_GLOBAL_INCLUDED */