dinput/tests: Avoid assigning values twice (PVS-Studio).
[wine/multimedia.git] / dlls / dplayx / dplay_global.h
blob7def46bc2dda587f3e01ebd954333242fcf5b8ed
1 /*
2 * Copyright 2000 Peter Hunnisett
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_DPLAY_GLOBAL_INCLUDED
20 #define __WINE_DPLAY_GLOBAL_INCLUDED
22 #include <stdarg.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "wine/dplaysp.h"
27 #include "lobbysp.h"
28 #include "dplayx_queue.h"
30 extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
31 LPCVOID lpAddress, DWORD dwAddressSize,
32 LPVOID lpContext ) DECLSPEC_HIDDEN;
34 typedef struct tagEnumSessionAsyncCallbackData
36 LPSPINITDATA lpSpData;
37 GUID requestGuid;
38 DWORD dwEnumSessionFlags;
39 DWORD dwTimeout;
40 HANDLE hSuicideRequest;
41 } EnumSessionAsyncCallbackData;
43 typedef struct tagDP_MSG_REPLY_STRUCT
45 HANDLE hReceipt;
46 WORD wExpectedReply;
47 LPVOID lpReplyMsg;
48 DWORD dwMsgBodySize;
49 /* FIXME: Is the message header required as well? */
50 } DP_MSG_REPLY_STRUCT, *LPDP_MSG_REPLY_STRUCT;
52 typedef struct tagDP_MSG_REPLY_STRUCT_LIST
54 DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST) repliesExpected;
55 DP_MSG_REPLY_STRUCT replyExpected;
56 } DP_MSG_REPLY_STRUCT_LIST, *LPDP_MSG_REPLY_STRUCT_LIST;
58 struct PlayerData
60 /* Individual player information */
61 DPID dpid;
63 DPNAME name;
64 HANDLE hEvent;
66 ULONG uRef; /* What is the reference count on this data? */
68 /* View of local data */
69 LPVOID lpLocalData;
70 DWORD dwLocalDataSize;
72 /* View of remote data */
73 LPVOID lpRemoteData;
74 DWORD dwRemoteDataSize;
76 /* SP data on a per player basis */
77 LPVOID lpSPPlayerData;
79 DWORD dwFlags; /* Special remarks about the type of player */
81 typedef struct PlayerData* lpPlayerData;
83 struct PlayerList
85 DPQ_ENTRY(PlayerList) players;
87 lpPlayerData lpPData;
89 typedef struct PlayerList* lpPlayerList;
91 struct GroupData
93 /* Internal information */
94 DPID parent; /* If parent == 0 it's a top level group */
96 ULONG uRef; /* Reference count */
98 DPQ_HEAD(GroupList) groups; /* A group has [0..n] groups */
99 DPQ_HEAD(PlayerList) players; /* A group has [0..n] players */
101 DPID idGroupOwner; /* ID of player who owns the group */
103 DWORD dwFlags; /* Flags describing anything special about the group */
105 DPID dpid;
106 DPNAME name;
108 /* View of local data */
109 LPVOID lpLocalData;
110 DWORD dwLocalDataSize;
112 /* View of remote data */
113 LPVOID lpRemoteData;
114 DWORD dwRemoteDataSize;
116 typedef struct GroupData GroupData;
117 typedef struct GroupData* lpGroupData;
119 struct GroupList
121 DPQ_ENTRY(GroupList) groups;
123 lpGroupData lpGData;
125 typedef struct GroupList* lpGroupList;
127 struct DPMSG
129 DPQ_ENTRY( DPMSG ) msgs;
130 DPMSG_GENERIC* msg;
132 typedef struct DPMSG* LPDPMSG;
134 enum SPSTATE
136 NO_PROVIDER = 0,
137 DP_SERVICE_PROVIDER = 1,
138 DP_LOBBY_PROVIDER = 2
141 /* Contains all data members. FIXME: Rename me */
142 typedef struct tagDirectPlay2Data
144 BOOL bConnectionOpen;
146 /* For async EnumSessions requests */
147 HANDLE hEnumSessionThread;
148 HANDLE hKillEnumSessionThreadEvent;
149 DWORD dwEnumSessionLock;
151 LPVOID lpNameServerData; /* DPlay interface doesn't know contents */
153 BOOL bHostInterface; /* Did this interface create the session */
155 lpGroupData lpSysGroup; /* System group with _everything_ in it */
157 LPDPSESSIONDESC2 lpSessionDesc;
159 /* I/O Msg queues */
160 DPQ_HEAD( DPMSG ) receiveMsgs; /* Msg receive queue */
161 DPQ_HEAD( DPMSG ) sendMsgs; /* Msg send pending queue */
163 /* Information about the service provider active on this connection */
164 SPINITDATA spData;
165 BOOL bSPInitialized;
167 /* Information about the lobby server that's attached to this DP object */
168 SPDATA_INIT dplspData;
169 BOOL bDPLSPInitialized;
171 /* Our service provider */
172 HMODULE hServiceProvider;
174 /* Our DP lobby provider */
175 HMODULE hDPLobbyProvider;
177 enum SPSTATE connectionInitialized;
179 /* Expected messages queue */
180 DPQ_HEAD( tagDP_MSG_REPLY_STRUCT_LIST ) repliesExpected;
181 } DirectPlay2Data;
183 typedef struct IDirectPlayImpl
185 IDirectPlay IDirectPlay_iface;
186 IDirectPlay2A IDirectPlay2A_iface;
187 IDirectPlay2 IDirectPlay2_iface;
188 IDirectPlay3A IDirectPlay3A_iface;
189 IDirectPlay3 IDirectPlay3_iface;
190 IDirectPlay4A IDirectPlay4A_iface;
191 IDirectPlay4 IDirectPlay4_iface;
192 LONG numIfaces; /* "in use interfaces" refcount */
193 LONG ref, ref2A, ref2, ref3A, ref3, ref4A, ref4;
194 CRITICAL_SECTION lock;
195 DirectPlay2Data *dp2;
196 } IDirectPlayImpl;
198 HRESULT DP_HandleMessage( IDirectPlayImpl *This, const void *lpMessageBody,
199 DWORD dwMessageBodySize, const void *lpMessageHeader, WORD wCommandId, WORD wVersion,
200 void **lplpReply, DWORD *lpdwMsgSize ) DECLSPEC_HIDDEN;
202 /* DP SP external interfaces into DirectPlay */
203 extern HRESULT DP_GetSPPlayerData( IDirectPlayImpl *lpDP, DPID idPlayer, void **lplpData ) DECLSPEC_HIDDEN;
204 extern HRESULT DP_SetSPPlayerData( IDirectPlayImpl *lpDP, DPID idPlayer, void *lpData ) DECLSPEC_HIDDEN;
206 /* DP external interfaces to call into DPSP interface */
207 extern LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN;
209 extern HRESULT dplay_create( REFIID riid, void **ppv ) DECLSPEC_HIDDEN;
210 extern HRESULT dplobby_create( REFIID riid, void **ppv ) DECLSPEC_HIDDEN;
211 extern HRESULT dplaysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp ) DECLSPEC_HIDDEN;
212 extern HRESULT dplobbysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp ) DECLSPEC_HIDDEN;
214 #endif /* __WINE_DPLAY_GLOBAL_INCLUDED */