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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_DIRECT_PLAY_SP_H
20 #define __WINE_DIRECT_PLAY_SP_H
30 /* GUID for IDirectPlaySP {0C9F6360-CC61-11cf-ACEC-00AA006886E3} */
31 DEFINE_GUID(IID_IDirectPlaySP
, 0xc9f6360, 0xcc61, 0x11cf, 0xac, 0xec, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
32 typedef struct IDirectPlaySP IDirectPlaySP
, *LPDIRECTPLAYSP
;
35 typedef BOOL (CALLBACK
*LPENUMMRUCALLBACK
)( LPCVOID lpData
,
39 /* For SP. Top 16 bits is dplay, bottom 16 is SP */
40 #define DPSP_MAJORVERSION 0x00060000
41 #define DPSP_DX5VERSION 0x00050000
42 #define DPSP_DX3VERSION 0x00040000
44 #define DPSP_MAJORVERSIONMASK 0xFFFF0000
45 #define DPSP_MINORVERSIONMASK 0x0000FFFF
49 #define DPLAYI_PLAYER_SYSPLAYER 0x00000001
50 #define DPLAYI_PLAYER_NAMESRVR 0x00000002
51 #define DPLAYI_PLAYER_PLAYERINGROUP 0x00000004
52 #define DPLAYI_PLAYER_PLAYERLOCAL 0x00000008
53 #define DPLAYI_GROUP_SYSGROUP 0x00000020
54 #define DPLAYI_GROUP_DPLAYOWNS 0x00000040
55 #define DPLAYI_PLAYER_APPSERVER 0x00000080
56 #define DPLAYI_GROUP_HIDDEN 0x00000400
58 /* Define the COM interface */
59 #define INTERFACE IDirectPlaySP
60 #define IDirectPlaySP_METHODS \
62 STDMETHOD(AddMRUEntry)(THIS_ LPCWSTR lpSection, LPCWSTR lpKey, LPCVOID lpData, DWORD dwDataSize, DWORD dwMaxEntries ) PURE; \
63 STDMETHOD(CreateAddress)(THIS_ REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize, LPVOID lpAddress,LPDWORD lpdwAddressSize) PURE; \
64 STDMETHOD(EnumAddress)(THIS_ LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext ) PURE; \
65 STDMETHOD(EnumMRUEntries)(THIS_ LPCWSTR lpSection, LPCWSTR lpKey, LPENUMMRUCALLBACK lpEnumMRUCallback, LPVOID lpContext ) PURE; \
66 STDMETHOD(GetPlayerFlags)(THIS_ DPID idPlayer, LPDWORD lpdwPlayerFlags ) PURE; \
67 STDMETHOD(GetSPPlayerData)(THIS_ DPID idPlayer, LPVOID *lplpData, LPDWORD lpdwDataSize, DWORD dwFlags ) PURE; \
68 STDMETHOD(HandleMessage)(THIS_ LPVOID lpMessageBody, DWORD dwMessageBodySize, LPVOID lpMessageHeader ) PURE; \
69 STDMETHOD(SetSPPlayerData)(THIS_ DPID idPlayer, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) PURE; \
70 STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount, LPVOID lpAddress, LPDWORD lpdwAddressSize ) PURE; \
71 STDMETHOD(GetSPData)(THIS_ LPVOID *lplpData, LPDWORD dwDataSize, DWORD dwFlags ) PURE; \
72 STDMETHOD(SetSPData)(THIS_ LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) PURE; \
73 STDMETHOD_(VOID,SendComplete)(THIS_ LPVOID , DWORD ) PURE;
74 DECLARE_INTERFACE_(IDirectPlaySP
,IUnknown
) { IDirectPlaySP_METHODS
};
78 /* NOTE: The microsoft provided header file doesn't have these access
81 #if !defined (__cplusplus) || defined(CINTERFACE)
82 /*** IUnknown methods ***/
83 #define IDirectPlaySP_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
84 #define IDirectPlaySP_AddRef(p) (p)->lpVtbl->AddRef(p)
85 #define IDirectPlaySP_Release(p) (p)->lpVtbl->Release(p)
86 /*** IDirectPlaySP methods ***/
87 #define IDirectPlaySP_AddMRUEntry(p,a,b,c,d,e) (p)->lpVtbl->AddMRUEntry(p,a,b,c,d,e)
88 #define IDirectPlaySP_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f)
89 #define IDirectPlaySP_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d)
90 #define IDirectPlaySP_EnumMRUEntries(p,a,b,c,d) (p)->lpVtbl->EnumMRUEntries(p,a,b,c,d)
91 #define IDirectPlaySP_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b)
92 #define IDirectPlaySP_GetSPPlayerData(p,a,b,c,d) (p)->lpVtbl->GetSPPlayerData(p,a,b,c,d)
93 #define IDirectPlaySP_HandleMessage(p,a,b,c) (p)->lpVtbl->HandleMessage(p,a,b,c)
94 #define IDirectPlaySP_SetSPPlayerData(p,a,b,c,d) (p)->lpVtbl->SetSPPlayerData(p,a,b,c,d)
95 #define IDirectPlaySP_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
96 #define IDirectPlaySP_GetSPData(p,a,b,c) (p)->lpVtbl->GetSPData(p,a,b,c)
97 #define IDirectPlaySP_SetSPData(p,a,b,c) (p)->lpVtbl->SetSPData(p,a,b,c)
98 #define IDirectPlaySP_SendComplete(p,a,b) (p)->lpVtbl->SendComplete(p,a,b)
101 /* SP Callback stuff */
103 typedef struct tagDPSP_ADDPLAYERTOGROUPDATA
107 IDirectPlaySP
* lpISP
;
108 } DPSP_ADDPLAYERTOGROUPDATA
, *LPDPSP_ADDPLAYERTOGROUPDATA
;
110 typedef struct tagDPSP_CLOSEDATA
112 IDirectPlaySP
* lpISP
;
113 } DPSP_CLOSEDATA
, *LPDPSP_CLOSEDATA
;
115 typedef struct tagDPSP_CREATEGROUPDATA
119 LPVOID lpSPMessageHeader
;
120 IDirectPlaySP
* lpISP
;
121 } DPSP_CREATEGROUPDATA
, *LPDPSP_CREATEGROUPDATA
;
123 typedef struct tagDPSP_CREATEPLAYERDATA
127 LPVOID lpSPMessageHeader
;
128 IDirectPlaySP
* lpISP
;
129 } DPSP_CREATEPLAYERDATA
, *LPDPSP_CREATEPLAYERDATA
;
131 typedef struct tagDPSP_DELETEGROUPDATA
135 IDirectPlaySP
* lpISP
;
136 } DPSP_DELETEGROUPDATA
, *LPDPSP_DELETEGROUPDATA
;
138 typedef struct tagDPSP_DELETEPLAYERDATA
142 IDirectPlaySP
* lpISP
;
143 } DPSP_DELETEPLAYERDATA
, *LPDPSP_DELETEPLAYERDATA
;
145 typedef struct tagDPSP_ENUMSESSIONSDATA
149 IDirectPlaySP
* lpISP
;
151 } DPSP_ENUMSESSIONSDATA
, *LPDPSP_ENUMSESSIONSDATA
;
153 typedef struct _DPSP_GETADDRESSDATA
157 LPDPADDRESS lpAddress
;
158 LPDWORD lpdwAddressSize
;
159 IDirectPlaySP
* lpISP
;
160 } DPSP_GETADDRESSDATA
, *LPDPSP_GETADDRESSDATA
;
162 typedef struct tagDPSP_GETADDRESSCHOICESDATA
164 LPDPADDRESS lpAddress
;
165 LPDWORD lpdwAddressSize
;
166 IDirectPlaySP
* lpISP
;
167 } DPSP_GETADDRESSCHOICESDATA
, *LPDPSP_GETADDRESSCHOICESDATA
;
169 typedef struct tagDPSP_GETCAPSDATA
174 IDirectPlaySP
* lpISP
;
175 } DPSP_GETCAPSDATA
, *LPDPSP_GETCAPSDATA
;
177 typedef struct tagDPSP_OPENDATA
180 LPVOID lpSPMessageHeader
;
181 IDirectPlaySP
* lpISP
;
184 DWORD dwSessionFlags
;
185 } DPSP_OPENDATA
, *LPDPSP_OPENDATA
;
187 typedef struct tagDPSP_REMOVEPLAYERFROMGROUPDATA
191 IDirectPlaySP
* lpISP
;
192 } DPSP_REMOVEPLAYERFROMGROUPDATA
, *LPDPSP_REMOVEPLAYERFROMGROUPDATA
;
194 typedef struct tagDPSP_REPLYDATA
196 LPVOID lpSPMessageHeader
;
200 IDirectPlaySP
* lpISP
;
201 } DPSP_REPLYDATA
, *LPDPSP_REPLYDATA
;
203 typedef struct tagDPSP_SENDDATA
211 IDirectPlaySP
* lpISP
;
212 } DPSP_SENDDATA
, *LPDPSP_SENDDATA
;
214 typedef struct tagDPSP_SENDTOGROUPDATA
221 IDirectPlaySP
* lpISP
;
222 } DPSP_SENDTOGROUPDATA
, *LPDPSP_SENDTOGROUPDATA
;
224 typedef struct tagDPSP_SENDEXDATA
226 IDirectPlaySP
* lpISP
;
230 LPSGBUFFER lpSendBuffers
;
238 } DPSP_SENDEXDATA
, *LPDPSP_SENDEXDATA
;
240 typedef struct tagDPSP_SENDTOGROUPEXDATA
242 IDirectPlaySP
* lpISP
;
246 LPSGBUFFER lpSendBuffers
;
253 } DPSP_SENDTOGROUPEXDATA
, *LPDPSP_SENDTOGROUPEXDATA
;
255 typedef struct tagDPSP_GETMESSAGEQUEUEDATA
257 IDirectPlaySP
* lpISP
;
262 LPDWORD lpdwNumBytes
;
263 } DPSP_GETMESSAGEQUEUEDATA
, *LPDPSP_GETMESSAGEQUEUEDATA
;
265 #define DPCANCELSEND_PRIORITY 0x00000001
266 #define DPCANCELSEND_ALL 0x00000002
268 typedef struct tagDPSP_CANCELDATA
270 IDirectPlaySP
* lpISP
;
272 LPRGLPVOID lprglpvSPMsgID
;
276 } DPSP_CANCELDATA
, *LPDPSP_CANCELDATA
;
278 typedef struct tagDPSP_SHUTDOWNDATA
280 IDirectPlaySP
* lpISP
;
281 } DPSP_SHUTDOWNDATA
, *LPDPSP_SHUTDOWNDATA
;
284 /* Prototypes returned by SPInit */
285 typedef HRESULT (WINAPI
*LPDPSP_CREATEPLAYER
)(LPDPSP_CREATEPLAYERDATA
);
286 typedef HRESULT (WINAPI
*LPDPSP_DELETEPLAYER
)(LPDPSP_DELETEPLAYERDATA
);
287 typedef HRESULT (WINAPI
*LPDPSP_SEND
)(LPDPSP_SENDDATA
);
288 typedef HRESULT (WINAPI
*LPDPSP_ENUMSESSIONS
)(LPDPSP_ENUMSESSIONSDATA
);
289 typedef HRESULT (WINAPI
*LPDPSP_REPLY
)(LPDPSP_REPLYDATA
);
290 typedef HRESULT (WINAPI
*LPDPSP_SHUTDOWN
)(void);
291 typedef HRESULT (WINAPI
*LPDPSP_CREATEGROUP
)(LPDPSP_CREATEGROUPDATA
);
292 typedef HRESULT (WINAPI
*LPDPSP_DELETEGROUP
)(LPDPSP_DELETEGROUPDATA
);
293 typedef HRESULT (WINAPI
*LPDPSP_ADDPLAYERTOGROUP
)(LPDPSP_ADDPLAYERTOGROUPDATA
);
294 typedef HRESULT (WINAPI
*LPDPSP_REMOVEPLAYERFROMGROUP
)(LPDPSP_REMOVEPLAYERFROMGROUPDATA
);
295 typedef HRESULT (WINAPI
*LPDPSP_GETCAPS
)(LPDPSP_GETCAPSDATA
);
296 typedef HRESULT (WINAPI
*LPDPSP_GETADDRESS
)(LPDPSP_GETADDRESSDATA
);
297 typedef HRESULT (WINAPI
*LPDPSP_GETADDRESSCHOICES
)(LPDPSP_GETADDRESSCHOICESDATA
);
298 typedef HRESULT (WINAPI
*LPDPSP_OPEN
)(LPDPSP_OPENDATA
);
299 typedef HRESULT (WINAPI
*LPDPSP_CLOSE
)(void);
300 typedef HRESULT (WINAPI
*LPDPSP_SENDTOGROUP
)(LPDPSP_SENDTOGROUPDATA
);
301 typedef HRESULT (WINAPI
*LPDPSP_SHUTDOWNEX
)(LPDPSP_SHUTDOWNDATA
);
302 typedef HRESULT (WINAPI
*LPDPSP_CLOSEEX
)(LPDPSP_CLOSEDATA
);
303 typedef HRESULT (WINAPI
*LPDPSP_SENDEX
)(LPDPSP_SENDEXDATA
);
304 typedef HRESULT (WINAPI
*LPDPSP_SENDTOGROUPEX
)(LPDPSP_SENDTOGROUPEXDATA
);
305 typedef HRESULT (WINAPI
*LPDPSP_CANCEL
)(LPDPSP_CANCELDATA
);
306 typedef HRESULT (WINAPI
*LPDPSP_GETMESSAGEQUEUE
)(LPDPSP_GETMESSAGEQUEUEDATA
);
309 typedef struct tagDPSP_SPCALLBACKS
314 LPDPSP_ENUMSESSIONS EnumSessions
; /* Must be provided */
315 LPDPSP_REPLY Reply
; /* Must be provided */
316 LPDPSP_SEND Send
; /* Must be provided */
317 LPDPSP_ADDPLAYERTOGROUP AddPlayerToGroup
; /* Optional */
318 LPDPSP_CLOSE Close
; /* Optional */
319 LPDPSP_CREATEGROUP CreateGroup
; /* Optional */
320 LPDPSP_CREATEPLAYER CreatePlayer
; /* Optional */
321 LPDPSP_DELETEGROUP DeleteGroup
; /* Optional */
322 LPDPSP_DELETEPLAYER DeletePlayer
; /* Optional */
323 LPDPSP_GETADDRESS GetAddress
; /* Optional */
324 LPDPSP_GETCAPS GetCaps
; /* Optional */
325 LPDPSP_OPEN Open
; /* Optional */
326 LPDPSP_REMOVEPLAYERFROMGROUP RemovePlayerFromGroup
; /* Optional */
327 LPDPSP_SENDTOGROUP SendToGroup
; /* Optional */
328 LPDPSP_SHUTDOWN Shutdown
; /* Optional */
330 LPDPSP_CLOSEEX CloseEx
; /* Optional */
331 LPDPSP_SHUTDOWNEX ShutdownEx
; /* Optional */
332 LPDPSP_GETADDRESSCHOICES GetAddressChoices
; /* Optional */
334 LPDPSP_SENDEX SendEx
; /* Optional */
335 LPDPSP_SENDTOGROUPEX SendToGroupEx
; /* Optional */
336 LPDPSP_CANCEL Cancel
; /* Optional */
337 LPDPSP_GETMESSAGEQUEUE GetMessageQueue
; /* Optional */
338 } DPSP_SPCALLBACKS
, *LPDPSP_SPCALLBACKS
;
340 typedef struct tagSPINITDATA
342 LPDPSP_SPCALLBACKS lpCB
;
343 IDirectPlaySP
* lpISP
;
348 DWORD dwSPHeaderSize
;
349 LPDPADDRESS lpAddress
;
352 } SPINITDATA
, *LPSPINITDATA
;
354 typedef HRESULT (WINAPI
*LPDPSP_SPINIT
)(LPSPINITDATA
);
356 /* This variable is exported from the DLL at ordinal 6 to be accessed by the
359 extern DWORD gdwDPlaySPRefCount
;