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
25 /* GUID for IDirectPlaySP {0C9F6360-CC61-11cf-ACEC-00AA006886E3} */
26 DEFINE_GUID(IID_IDirectPlaySP
, 0xc9f6360, 0xcc61, 0x11cf, 0xac, 0xec, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
27 typedef struct IDirectPlaySP IDirectPlaySP
, *LPDIRECTPLAYSP
;
30 typedef BOOL (CALLBACK
*LPENUMMRUCALLBACK
)( LPCVOID lpData
,
34 /* For SP. Top 16 bits is dplay, bottom 16 is SP */
35 #define DPSP_MAJORVERSION 0x00060000
36 #define DPSP_DX5VERSION 0x00050000
37 #define DPSP_DX3VERSION 0x00040000
39 #define DPSP_MAJORVERSIONMASK 0xFFFF0000
40 #define DPSP_MINORVERSIONMASK 0x0000FFFF
44 #define DPLAYI_PLAYER_SYSPLAYER 0x00000001
45 #define DPLAYI_PLAYER_NAMESRVR 0x00000002
46 #define DPLAYI_PLAYER_PLAYERINGROUP 0x00000004
47 #define DPLAYI_PLAYER_PLAYERLOCAL 0x00000008
48 #define DPLAYI_GROUP_SYSGROUP 0x00000020
49 #define DPLAYI_GROUP_DPLAYOWNS 0x00000040
50 #define DPLAYI_PLAYER_APPSERVER 0x00000080
51 #define DPLAYI_GROUP_HIDDEN 0x00000400
53 /* Define the COM interface */
54 #define ICOM_INTERFACE IDirectPlaySP
55 #define IDirectPlaySP_METHODS \
56 ICOM_METHOD5(HRESULT,AddMRUEntry, LPCWSTR,lpSection, LPCWSTR,lpKey, LPCVOID,lpData, DWORD,dwDataSize, DWORD,dwMaxEntries ) \
57 ICOM_METHOD6(HRESULT,CreateAddress, REFGUID,guidSP, REFGUID,guidDataType, LPCVOID,lpData, DWORD,dwDataSize, LPVOID,lpAddress,LPDWORD,lpdwAddressSize) \
58 ICOM_METHOD4(HRESULT,EnumAddress, LPDPENUMADDRESSCALLBACK,lpEnumAddressCallback, LPCVOID,lpAddress, DWORD,dwAddressSize, LPVOID,lpContext ) \
59 ICOM_METHOD4(HRESULT,EnumMRUEntries, LPCWSTR,lpSection, LPCWSTR,lpKey, LPENUMMRUCALLBACK,lpEnumMRUCallback, LPVOID,lpContext ) \
60 ICOM_METHOD2(HRESULT,GetPlayerFlags, DPID,idPlayer, LPDWORD,lpdwPlayerFlags ) \
61 ICOM_METHOD4(HRESULT,GetSPPlayerData, DPID,idPlayer, LPVOID*,lplpData, LPDWORD,lpdwDataSize, DWORD,dwFlags ) \
62 ICOM_METHOD3(HRESULT,HandleMessage, LPVOID,lpMessageBody, DWORD,dwMessageBodySize, LPVOID,lpMessageHeader ) \
63 ICOM_METHOD4(HRESULT,SetSPPlayerData, DPID,idPlayer, LPVOID,lpData, DWORD,dwDataSize, DWORD,dwFlags ) \
64 ICOM_METHOD4(HRESULT,CreateCompoundAddress, LPCDPCOMPOUNDADDRESSELEMENT,lpElements, DWORD,dwElementCount, LPVOID,lpAddress, LPDWORD,lpdwAddressSize ) \
65 ICOM_METHOD3(HRESULT,GetSPData, LPVOID*,lplpData, LPDWORD,dwDataSize, DWORD,dwFlags ) \
66 ICOM_METHOD3(HRESULT,SetSPData, LPVOID,lpData, DWORD,dwDataSize, DWORD,dwFlags ) \
67 ICOM_METHOD2(VOID,SendComplete, LPVOID,, DWORD, )
69 #define IDirectPlaySP_IMETHODS \
73 ICOM_DEFINE(IDirectPlaySP
,IUnknown
)
77 /* NOTE: The microsoft provided header file doesn't have these access
80 /*** IUnknown methods ***/
81 #define IDirectPlaySP_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
82 #define IDirectPlaySP_AddRef(p) ICOM_CALL (AddRef,p)
83 #define IDirectPlaySP_Release(p) ICOM_CALL (Release,p)
84 /*** IDirectPlaySP methods ***/
85 #define IDirectPlaySP_AddMRUEntry(p,a,b,c,d,e) ICOM_CALL5(AddMRUEntry,p,a,b,c,d,e)
86 #define IDirectPlaySP_CreateAddress(p,a,b,c,d,e,f) ICOM_CALL6(CreateAddress,p,a,b,c,d,e,f)
87 #define IDirectPlaySP_EnumAddress(p,a,b,c,d) ICOM_CALL4(EnumAddress,p,a,b,c,d)
88 #define IDirectPlaySP_EnumMRUEntries(p,a,b,c,d) ICOM_CALL4(EnumMRUEntries,p,a,b,c,d)
89 #define IDirectPlaySP_GetPlayerFlags(p,a,b) ICOM_CALL2(GetPlayerFlags,p,a,b)
90 #define IDirectPlaySP_GetSPPlayerData(p,a,b,c,d) ICOM_CALL4(GetSPPlayerData,p,a,b,c,d)
91 #define IDirectPlaySP_HandleMessage(p,a,b,c) ICOM_CALL3(HandleMessage,p,a,b,c)
92 #define IDirectPlaySP_SetSPPlayerData(p,a,b,c,d) ICOM_CALL4(SetSPPlayerData,p,a,b,c,d)
93 #define IDirectPlaySP_CreateCompoundAddress(p,a,b,c,d) ICOM_CALL4(CreateCompoundAddress,p,a,b,c,d)
94 #define IDirectPlaySP_GetSPData(p,a,b,c) ICOM_CALL3(GetSPData,p,a,b,c)
95 #define IDirectPlaySP_SetSPData(p,a,b,c) ICOM_CALL3(SetSPData,p,a,b,c)
96 #define IDirectPlaySP_SendComplete(p,a,b) ICOM_CALL2(SendComplete,p,a,b)
98 /* SP Callback stuff */
100 typedef struct tagDPSP_ADDPLAYERTOGROUPDATA
104 IDirectPlaySP
* lpISP
;
105 } DPSP_ADDPLAYERTOGROUPDATA
, *LPDPSP_ADDPLAYERTOGROUPDATA
;
107 typedef struct tagDPSP_CLOSEDATA
109 IDirectPlaySP
* lpISP
;
110 } DPSP_CLOSEDATA
, *LPDPSP_CLOSEDATA
;
112 typedef struct tagDPSP_CREATEGROUPDATA
116 LPVOID lpSPMessageHeader
;
117 IDirectPlaySP
* lpISP
;
118 } DPSP_CREATEGROUPDATA
, *LPDPSP_CREATEGROUPDATA
;
120 typedef struct tagDPSP_CREATEPLAYERDATA
124 LPVOID lpSPMessageHeader
;
125 IDirectPlaySP
* lpISP
;
126 } DPSP_CREATEPLAYERDATA
, *LPDPSP_CREATEPLAYERDATA
;
128 typedef struct tagDPSP_DELETEGROUPDATA
132 IDirectPlaySP
* lpISP
;
133 } DPSP_DELETEGROUPDATA
, *LPDPSP_DELETEGROUPDATA
;
135 typedef struct tagDPSP_DELETEPLAYERDATA
139 IDirectPlaySP
* lpISP
;
140 } DPSP_DELETEPLAYERDATA
, *LPDPSP_DELETEPLAYERDATA
;
142 typedef struct tagDPSP_ENUMSESSIONSDATA
146 IDirectPlaySP
* lpISP
;
148 } DPSP_ENUMSESSIONSDATA
, *LPDPSP_ENUMSESSIONSDATA
;
150 typedef struct _DPSP_GETADDRESSDATA
154 LPDPADDRESS lpAddress
;
155 LPDWORD lpdwAddressSize
;
156 IDirectPlaySP
* lpISP
;
157 } DPSP_GETADDRESSDATA
, *LPDPSP_GETADDRESSDATA
;
159 typedef struct tagDPSP_GETADDRESSCHOICESDATA
161 LPDPADDRESS lpAddress
;
162 LPDWORD lpdwAddressSize
;
163 IDirectPlaySP
* lpISP
;
164 } DPSP_GETADDRESSCHOICESDATA
, *LPDPSP_GETADDRESSCHOICESDATA
;
166 typedef struct tagDPSP_GETCAPSDATA
171 IDirectPlaySP
* lpISP
;
172 } DPSP_GETCAPSDATA
, *LPDPSP_GETCAPSDATA
;
174 typedef struct tagDPSP_OPENDATA
177 LPVOID lpSPMessageHeader
;
178 IDirectPlaySP
* lpISP
;
181 DWORD dwSessionFlags
;
182 } DPSP_OPENDATA
, *LPDPSP_OPENDATA
;
184 typedef struct tagDPSP_REMOVEPLAYERFROMGROUPDATA
188 IDirectPlaySP
* lpISP
;
189 } DPSP_REMOVEPLAYERFROMGROUPDATA
, *LPDPSP_REMOVEPLAYERFROMGROUPDATA
;
191 typedef struct tagDPSP_REPLYDATA
193 LPVOID lpSPMessageHeader
;
197 IDirectPlaySP
* lpISP
;
198 } DPSP_REPLYDATA
, *LPDPSP_REPLYDATA
;
200 typedef struct tagDPSP_SENDDATA
208 IDirectPlaySP
* lpISP
;
209 } DPSP_SENDDATA
, *LPDPSP_SENDDATA
;
211 typedef struct tagDPSP_SENDTOGROUPDATA
218 IDirectPlaySP
* lpISP
;
219 } DPSP_SENDTOGROUPDATA
, *LPDPSP_SENDTOGROUPDATA
;
221 typedef struct tagDPSP_SENDEXDATA
223 IDirectPlaySP
* lpISP
;
227 LPSGBUFFER lpSendBuffers
;
235 } DPSP_SENDEXDATA
, *LPDPSP_SENDEXDATA
;
237 typedef struct tagDPSP_SENDTOGROUPEXDATA
239 IDirectPlaySP
* lpISP
;
243 LPSGBUFFER lpSendBuffers
;
250 } DPSP_SENDTOGROUPEXDATA
, *LPDPSP_SENDTOGROUPEXDATA
;
252 typedef struct tagDPSP_GETMESSAGEQUEUEDATA
254 IDirectPlaySP
* lpISP
;
259 LPDWORD lpdwNumBytes
;
260 } DPSP_GETMESSAGEQUEUEDATA
, *LPDPSP_GETMESSAGEQUEUEDATA
;
262 #define DPCANCELSEND_PRIORITY 0x00000001
263 #define DPCANCELSEND_ALL 0x00000002
265 typedef struct tagDPSP_CANCELDATA
267 IDirectPlaySP
* lpISP
;
269 LPRGLPVOID lprglpvSPMsgID
;
273 } DPSP_CANCELDATA
, *LPDPSP_CANCELDATA
;
275 typedef struct tagDPSP_SHUTDOWNDATA
277 IDirectPlaySP
* lpISP
;
278 } DPSP_SHUTDOWNDATA
, *LPDPSP_SHUTDOWNDATA
;
281 /* Prototypes returned by SPInit */
282 typedef HRESULT (WINAPI
*LPDPSP_CREATEPLAYER
)(LPDPSP_CREATEPLAYERDATA
);
283 typedef HRESULT (WINAPI
*LPDPSP_DELETEPLAYER
)(LPDPSP_DELETEPLAYERDATA
);
284 typedef HRESULT (WINAPI
*LPDPSP_SEND
)(LPDPSP_SENDDATA
);
285 typedef HRESULT (WINAPI
*LPDPSP_ENUMSESSIONS
)(LPDPSP_ENUMSESSIONSDATA
);
286 typedef HRESULT (WINAPI
*LPDPSP_REPLY
)(LPDPSP_REPLYDATA
);
287 typedef HRESULT (WINAPI
*LPDPSP_SHUTDOWN
)(void);
288 typedef HRESULT (WINAPI
*LPDPSP_CREATEGROUP
)(LPDPSP_CREATEGROUPDATA
);
289 typedef HRESULT (WINAPI
*LPDPSP_DELETEGROUP
)(LPDPSP_DELETEGROUPDATA
);
290 typedef HRESULT (WINAPI
*LPDPSP_ADDPLAYERTOGROUP
)(LPDPSP_ADDPLAYERTOGROUPDATA
);
291 typedef HRESULT (WINAPI
*LPDPSP_REMOVEPLAYERFROMGROUP
)(LPDPSP_REMOVEPLAYERFROMGROUPDATA
);
292 typedef HRESULT (WINAPI
*LPDPSP_GETCAPS
)(LPDPSP_GETCAPSDATA
);
293 typedef HRESULT (WINAPI
*LPDPSP_GETADDRESS
)(LPDPSP_GETADDRESSDATA
);
294 typedef HRESULT (WINAPI
*LPDPSP_GETADDRESSCHOICES
)(LPDPSP_GETADDRESSCHOICESDATA
);
295 typedef HRESULT (WINAPI
*LPDPSP_OPEN
)(LPDPSP_OPENDATA
);
296 typedef HRESULT (WINAPI
*LPDPSP_CLOSE
)(void);
297 typedef HRESULT (WINAPI
*LPDPSP_SENDTOGROUP
)(LPDPSP_SENDTOGROUPDATA
);
298 typedef HRESULT (WINAPI
*LPDPSP_SHUTDOWNEX
)(LPDPSP_SHUTDOWNDATA
);
299 typedef HRESULT (WINAPI
*LPDPSP_CLOSEEX
)(LPDPSP_CLOSEDATA
);
300 typedef HRESULT (WINAPI
*LPDPSP_SENDEX
)(LPDPSP_SENDEXDATA
);
301 typedef HRESULT (WINAPI
*LPDPSP_SENDTOGROUPEX
)(LPDPSP_SENDTOGROUPEXDATA
);
302 typedef HRESULT (WINAPI
*LPDPSP_CANCEL
)(LPDPSP_CANCELDATA
);
303 typedef HRESULT (WINAPI
*LPDPSP_GETMESSAGEQUEUE
)(LPDPSP_GETMESSAGEQUEUEDATA
);
306 typedef struct tagDPSP_SPCALLBACKS
311 LPDPSP_ENUMSESSIONS EnumSessions
; /* Must be provided */
312 LPDPSP_REPLY Reply
; /* Must be provided */
313 LPDPSP_SEND Send
; /* Must be provided */
314 LPDPSP_ADDPLAYERTOGROUP AddPlayerToGroup
; /* Optional */
315 LPDPSP_CLOSE Close
; /* Optional */
316 LPDPSP_CREATEGROUP CreateGroup
; /* Optional */
317 LPDPSP_CREATEPLAYER CreatePlayer
; /* Optional */
318 LPDPSP_DELETEGROUP DeleteGroup
; /* Optional */
319 LPDPSP_DELETEPLAYER DeletePlayer
; /* Optional */
320 LPDPSP_GETADDRESS GetAddress
; /* Optional */
321 LPDPSP_GETCAPS GetCaps
; /* Optional */
322 LPDPSP_OPEN Open
; /* Optional */
323 LPDPSP_REMOVEPLAYERFROMGROUP RemovePlayerFromGroup
; /* Optional */
324 LPDPSP_SENDTOGROUP SendToGroup
; /* Optional */
325 LPDPSP_SHUTDOWN Shutdown
; /* Optional */
327 LPDPSP_CLOSEEX CloseEx
; /* Optional */
328 LPDPSP_SHUTDOWNEX ShutdownEx
; /* Optional */
329 LPDPSP_GETADDRESSCHOICES GetAddressChoices
; /* Optional */
331 LPDPSP_SENDEX SendEx
; /* Optional */
332 LPDPSP_SENDTOGROUPEX SendToGroupEx
; /* Optional */
333 LPDPSP_CANCEL Cancel
; /* Optional */
334 LPDPSP_GETMESSAGEQUEUE GetMessageQueue
; /* Optional */
335 } DPSP_SPCALLBACKS
, *LPDPSP_SPCALLBACKS
;
337 typedef struct tagSPINITDATA
339 LPDPSP_SPCALLBACKS lpCB
;
340 IDirectPlaySP
* lpISP
;
345 DWORD dwSPHeaderSize
;
346 LPDPADDRESS lpAddress
;
349 } SPINITDATA
, *LPSPINITDATA
;
351 typedef HRESULT (WINAPI
*LPDPSP_SPINIT
)(LPSPINITDATA
);
353 /* This variable is exported from the DLL at ordinal 6 to be accessed by the
356 extern DWORD gdwDPlaySPRefCount
;