Fixed callback parameters (bogus hWave); added acm conversion for
[wine.git] / dlls / dplayx / dplay_global.h
blob94208c20f1e574f84f9b513ea2040e9d65fbccec
1 #ifndef __WINE_DPLAY_GLOBAL_INCLUDED
2 #define __WINE_DPLAY_GLOBAL_INCLUDED
4 #include "dplaysp.h"
5 #include "lobbysp.h"
6 #include "dplayx_queue.h"
8 extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
9 LPCVOID lpAddress, DWORD dwAddressSize,
10 LPVOID lpContext );
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
26 ULONG ulObjRef;
27 CRITICAL_SECTION DP_lock;
28 } DirectPlayIUnknownData;
30 typedef struct tagEnumSessionAsyncCallbackData
32 LPSPINITDATA lpSpData;
33 GUID requestGuid;
34 DWORD dwEnumSessionFlags;
35 DWORD dwTimeout;
36 HANDLE hSuicideRequest;
37 } EnumSessionAsyncCallbackData;
39 typedef struct tagDP_MSG_REPLY_STRUCT
41 HANDLE hReceipt;
42 WORD wExpectedReply;
43 LPVOID lpReplyMsg;
44 DWORD dwMsgBodySize;
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;
54 struct PlayerData
56 /* Individual player information */
57 DPID dpid;
59 DPNAME name;
60 HANDLE hEvent;
62 ULONG uRef; /* What is the reference count on this data? */
64 /* View of local data */
65 LPVOID lpLocalData;
66 DWORD dwLocalDataSize;
68 /* View of remote data */
69 LPVOID lpRemoteData;
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;
79 struct PlayerList
81 DPQ_ENTRY(PlayerList) players;
83 lpPlayerData lpPData;
85 typedef struct PlayerList* lpPlayerList;
87 struct GroupData
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 */
101 DPID dpid;
102 DPNAME name;
104 /* View of local data */
105 LPVOID lpLocalData;
106 DWORD dwLocalDataSize;
108 /* View of remote data */
109 LPVOID lpRemoteData;
110 DWORD dwRemoteDataSize;
112 typedef struct GroupData GroupData;
113 typedef struct GroupData* lpGroupData;
115 struct GroupList
117 DPQ_ENTRY(GroupList) groups;
119 lpGroupData lpGData;
121 typedef struct GroupList* lpGroupList;
123 struct DPMSG
125 DPQ_ENTRY( DPMSG ) msgs;
126 DPMSG_GENERIC* msg;
128 typedef struct DPMSG* LPDPMSG;
130 enum SPSTATE
132 NO_PROVIDER = 0,
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;
154 /* I/O Msg queues */
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 */
159 SPINITDATA spData;
160 BOOL bSPInitialized;
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;
176 } DirectPlay2Data;
178 typedef struct tagDirectPlay3Data
180 BOOL dummy;
181 } DirectPlay3Data;
182 typedef struct tagDirectPlay4Data
184 BOOL dummy;
185 } DirectPlay4Data;
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);
197 DP_IMPL_FIELDS
200 struct IDirectPlay3Impl
202 ICOM_VFIELD(IDirectPlay3);
203 DP_IMPL_FIELDS
206 struct IDirectPlay4Impl
208 ICOM_VFIELD(IDirectPlay4);
209 DP_IMPL_FIELDS
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 */