1 #ifndef __WINE_DIRECT_PLAY_SP_H
2 #define __WINE_DIRECT_PLAY_SP_H
7 /* GUID for IDirectPlaySP {0C9F6360-CC61-11cf-ACEC-00AA006886E3} */
8 DEFINE_GUID(IID_IDirectPlaySP, 0xc9f6360, 0xcc61, 0x11cf, 0xac, 0xec, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
9 typedef struct IDirectPlaySP IDirectPlaySP, *LPDIRECTPLAYSP;
12 typedef BOOL (CALLBACK* LPENUMMRUCALLBACK)( LPCVOID lpData,
16 /* For SP. Top 16 bits is dplay, bottom 16 is SP */
17 #define DPSP_MAJORVERSION 0x00060000
18 #define DPSP_DX5VERSION 0x00050000
19 #define DPSP_DX3VERSION 0x00040000
21 #define DPSP_MAJORVERSIONMASK 0xFFFF0000
22 #define DPSP_MINORVERSIONMASK 0x0000FFFF
26 #define DPLAYI_PLAYER_SYSPLAYER 0x00000001
27 #define DPLAYI_PLAYER_NAMESRVR 0x00000002
28 #define DPLAYI_PLAYER_PLAYERINGROUP 0x00000004
29 #define DPLAYI_PLAYER_PLAYERLOCAL 0x00000008
30 #define DPLAYI_GROUP_SYSGROUP 0x00000020
31 #define DPLAYI_GROUP_DPLAYOWNS 0x00000040
32 #define DPLAYI_PLAYER_APPSERVER 0x00000080
33 #define DPLAYI_GROUP_HIDDEN 0x00000400
35 /* Define the COM interface */
36 #define ICOM_INTERFACE IDirectPlaySP
37 #define IDirectPlaySP_METHODS \
38 ICOM_METHOD5(HRESULT,AddMRUEntry, LPCWSTR,lpSection, LPCWSTR,lpKey, LPCVOID,lpData, DWORD,dwDataSize, DWORD,dwMaxEntries ) \
39 ICOM_METHOD6(HRESULT,CreateAddress, REFGUID,guidSP, REFGUID,guidDataType, LPCVOID,lpData, DWORD,dwDataSize, LPVOID,lpAddress,LPDWORD,lpdwAddressSize) \
40 ICOM_METHOD4(HRESULT,EnumAddress, LPDPENUMADDRESSCALLBACK,lpEnumAddressCallback, LPCVOID,lpAddress, DWORD,dwAddressSize, LPVOID,lpContext ) \
41 ICOM_METHOD4(HRESULT,EnumMRUEntries, LPCWSTR,lpSection, LPCWSTR,lpKey, LPENUMMRUCALLBACK,lpEnumMRUCallback, LPVOID,lpContext ) \
42 ICOM_METHOD2(HRESULT,GetPlayerFlags, DPID,idPlayer, LPDWORD,lpdwPlayerFlags ) \
43 ICOM_METHOD4(HRESULT,GetSPPlayerData, DPID,idPlayer, LPVOID*,lplpData, LPDWORD,lpdwDataSize, DWORD,dwFlags ) \
44 ICOM_METHOD3(HRESULT,HandleMessage, LPVOID,lpMessageBody, DWORD,dwMessageBodySize, LPVOID,lpMessageHeader ) \
45 ICOM_METHOD4(HRESULT,SetSPPlayerData, DPID,idPlayer, LPVOID,lpData, DWORD,dwDataSize, DWORD,dwFlags ) \
46 ICOM_METHOD4(HRESULT,CreateCompoundAddress, LPCDPCOMPOUNDADDRESSELEMENT,lpElements, DWORD,dwElementCount, LPVOID,lpAddress, LPDWORD,lpdwAddressSize ) \
47 ICOM_METHOD3(HRESULT,GetSPData, LPVOID*,lplpData, LPDWORD,dwDataSize, DWORD,dwFlags ) \
48 ICOM_METHOD3(HRESULT,SetSPData, LPVOID,lpData, DWORD,dwDataSize, DWORD,dwFlags ) \
49 ICOM_METHOD2(VOID,SendComplete, LPVOID,, DWORD, )
51 #define IDirectPlaySP_IMETHODS \
55 ICOM_DEFINE(IDirectPlaySP,IUnknown)
59 /* NOTE: The microsoft provided header file doesn't have these access
62 /*** IUnknown methods ***/
63 #define IDirectPlaySP_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
64 #define IDirectPlaySP_AddRef(p) ICOM_CALL (AddRef,p)
65 #define IDirectPlaySP_Release(p) ICOM_CALL (Release,p)
66 /*** IDirectPlaySP methods ***/
67 #define IDirectPlaySP_AddMRUEntry(p,a,b,c,d,e) ICOM_CALL5(AddMRUEntry,p,a,b,c,d,e)
68 #define IDirectPlaySP_CreateAddress(p,a,b,c,d,e,f) ICOM_CALL6(CreateAddress,p,a,b,c,d,e,f)
69 #define IDirectPlaySP_EnumAddress(p,a,b,c,d) ICOM_CALL4(EnumAddress,p,a,b,c,d)
70 #define IDirectPlaySP_EnumMRUEntries(p,a,b,c,d) ICOM_CALL4(EnumMRUEntries,p,a,b,c,d)
71 #define IDirectPlaySP_GetPlayerFlags(p,a,b) ICOM_CALL2(GetPlayerFlags,p,a,b)
72 #define IDirectPlaySP_GetSPPlayerData(p,a,b,c,d) ICOM_CALL4(GetSPPlayerData,p,a,b,c,d)
73 #define IDirectPlaySP_HandleMessage(p,a,b,c) ICOM_CALL3(HandleMessage,p,a,b,c)
74 #define IDirectPlaySP_SetSPPlayerData(p,a,b,c,d) ICOM_CALL4(SetSPPlayerData,p,a,b,c,d)
75 #define IDirectPlaySP_CreateCompoundAddress(p,a,b,c,d) ICOM_CALL4(CreateCompoundAddress,p,a,b,c,d)
76 #define IDirectPlaySP_GetSPData(p,a,b,c) ICOM_CALL3(GetSPData,p,a,b,c)
77 #define IDirectPlaySP_SetSPData(p,a,b,c) ICOM_CALL3(SetSPData,p,a,b,c)
78 #define IDirectPlaySP_SendComplete(p,a,b) ICOM_CALL2(SendComplete,p,a,b)
80 /* SP Callback stuff */
82 typedef struct tagDPSP_ADDPLAYERTOGROUPDATA
87 } DPSP_ADDPLAYERTOGROUPDATA, *LPDPSP_ADDPLAYERTOGROUPDATA;
89 typedef struct tagDPSP_CLOSEDATA
92 } DPSP_CLOSEDATA, *LPDPSP_CLOSEDATA;
94 typedef struct tagDPSP_CREATEGROUPDATA
98 LPVOID lpSPMessageHeader;
100 } DPSP_CREATEGROUPDATA, *LPDPSP_CREATEGROUPDATA;
102 typedef struct tagDPSP_CREATEPLAYERDATA
106 LPVOID lpSPMessageHeader;
107 IDirectPlaySP* lpISP;
108 } DPSP_CREATEPLAYERDATA, *LPDPSP_CREATEPLAYERDATA;
110 typedef struct tagDPSP_DELETEGROUPDATA
114 IDirectPlaySP* lpISP;
115 } DPSP_DELETEGROUPDATA, *LPDPSP_DELETEGROUPDATA;
117 typedef struct tagDPSP_DELETEPLAYERDATA
121 IDirectPlaySP* lpISP;
122 } DPSP_DELETEPLAYERDATA, *LPDPSP_DELETEPLAYERDATA;
124 typedef struct tagDPSP_ENUMSESSIONSDATA
128 IDirectPlaySP* lpISP;
130 } DPSP_ENUMSESSIONSDATA, *LPDPSP_ENUMSESSIONSDATA;
132 typedef struct _DPSP_GETADDRESSDATA
136 LPDPADDRESS lpAddress;
137 LPDWORD lpdwAddressSize;
138 IDirectPlaySP* lpISP;
139 } DPSP_GETADDRESSDATA, *LPDPSP_GETADDRESSDATA;
141 typedef struct tagDPSP_GETADDRESSCHOICESDATA
143 LPDPADDRESS lpAddress;
144 LPDWORD lpdwAddressSize;
145 IDirectPlaySP* lpISP;
146 } DPSP_GETADDRESSCHOICESDATA, *LPDPSP_GETADDRESSCHOICESDATA;
148 typedef struct tagDPSP_GETCAPSDATA
153 IDirectPlaySP* lpISP;
154 } DPSP_GETCAPSDATA, *LPDPSP_GETCAPSDATA;
156 typedef struct tagDPSP_OPENDATA
159 LPVOID lpSPMessageHeader;
160 IDirectPlaySP* lpISP;
163 DWORD dwSessionFlags;
164 } DPSP_OPENDATA, *LPDPSP_OPENDATA;
166 typedef struct tagDPSP_REMOVEPLAYERFROMGROUPDATA
170 IDirectPlaySP* lpISP;
171 } DPSP_REMOVEPLAYERFROMGROUPDATA, *LPDPSP_REMOVEPLAYERFROMGROUPDATA;
173 typedef struct tagDPSP_REPLYDATA
175 LPVOID lpSPMessageHeader;
179 IDirectPlaySP* lpISP;
180 } DPSP_REPLYDATA, *LPDPSP_REPLYDATA;
182 typedef struct tagDPSP_SENDDATA
190 IDirectPlaySP* lpISP;
191 } DPSP_SENDDATA, *LPDPSP_SENDDATA;
193 typedef struct tagDPSP_SENDTOGROUPDATA
200 IDirectPlaySP* lpISP;
201 } DPSP_SENDTOGROUPDATA, *LPDPSP_SENDTOGROUPDATA;
203 typedef struct tagDPSP_SENDEXDATA
205 IDirectPlaySP* lpISP;
209 LPSGBUFFER lpSendBuffers;
217 } DPSP_SENDEXDATA, *LPDPSP_SENDEXDATA;
219 typedef struct tagDPSP_SENDTOGROUPEXDATA
221 IDirectPlaySP* lpISP;
225 LPSGBUFFER lpSendBuffers;
232 } DPSP_SENDTOGROUPEXDATA, *LPDPSP_SENDTOGROUPEXDATA;
234 typedef struct tagDPSP_GETMESSAGEQUEUEDATA
236 IDirectPlaySP* lpISP;
241 LPDWORD lpdwNumBytes;
242 } DPSP_GETMESSAGEQUEUEDATA, *LPDPSP_GETMESSAGEQUEUEDATA;
244 #define DPCANCELSEND_PRIORITY 0x00000001
245 #define DPCANCELSEND_ALL 0x00000002
247 typedef struct tagDPSP_CANCELDATA
249 IDirectPlaySP* lpISP;
251 LPRGLPVOID lprglpvSPMsgID;
255 } DPSP_CANCELDATA, *LPDPSP_CANCELDATA;
257 typedef struct tagDPSP_SHUTDOWNDATA
259 IDirectPlaySP* lpISP;
260 } DPSP_SHUTDOWNDATA, *LPDPSP_SHUTDOWNDATA;
263 /* Prototypes returned by SPInit */
264 typedef HRESULT (WINAPI *LPDPSP_CREATEPLAYER)(LPDPSP_CREATEPLAYERDATA);
265 typedef HRESULT (WINAPI *LPDPSP_DELETEPLAYER)(LPDPSP_DELETEPLAYERDATA);
266 typedef HRESULT (WINAPI *LPDPSP_SEND)(LPDPSP_SENDDATA);
267 typedef HRESULT (WINAPI *LPDPSP_ENUMSESSIONS)(LPDPSP_ENUMSESSIONSDATA);
268 typedef HRESULT (WINAPI *LPDPSP_REPLY)(LPDPSP_REPLYDATA);
269 typedef HRESULT (WINAPI *LPDPSP_SHUTDOWN)(void);
270 typedef HRESULT (WINAPI *LPDPSP_CREATEGROUP)(LPDPSP_CREATEGROUPDATA);
271 typedef HRESULT (WINAPI *LPDPSP_DELETEGROUP)(LPDPSP_DELETEGROUPDATA);
272 typedef HRESULT (WINAPI *LPDPSP_ADDPLAYERTOGROUP)(LPDPSP_ADDPLAYERTOGROUPDATA);
273 typedef HRESULT (WINAPI *LPDPSP_REMOVEPLAYERFROMGROUP)(LPDPSP_REMOVEPLAYERFROMGROUPDATA);
274 typedef HRESULT (WINAPI *LPDPSP_GETCAPS)(LPDPSP_GETCAPSDATA);
275 typedef HRESULT (WINAPI *LPDPSP_GETADDRESS)(LPDPSP_GETADDRESSDATA);
276 typedef HRESULT (WINAPI *LPDPSP_GETADDRESSCHOICES)(LPDPSP_GETADDRESSCHOICESDATA);
277 typedef HRESULT (WINAPI *LPDPSP_OPEN)(LPDPSP_OPENDATA);
278 typedef HRESULT (WINAPI *LPDPSP_CLOSE)(void);
279 typedef HRESULT (WINAPI *LPDPSP_SENDTOGROUP)(LPDPSP_SENDTOGROUPDATA);
280 typedef HRESULT (WINAPI *LPDPSP_SHUTDOWNEX)(LPDPSP_SHUTDOWNDATA);
281 typedef HRESULT (WINAPI *LPDPSP_CLOSEEX)(LPDPSP_CLOSEDATA);
282 typedef HRESULT (WINAPI *LPDPSP_SENDEX)(LPDPSP_SENDEXDATA);
283 typedef HRESULT (WINAPI *LPDPSP_SENDTOGROUPEX)(LPDPSP_SENDTOGROUPEXDATA);
284 typedef HRESULT (WINAPI *LPDPSP_CANCEL)(LPDPSP_CANCELDATA);
285 typedef HRESULT (WINAPI *LPDPSP_GETMESSAGEQUEUE)(LPDPSP_GETMESSAGEQUEUEDATA);
288 typedef struct tagDPSP_SPCALLBACKS
293 LPDPSP_ENUMSESSIONS EnumSessions; /* Must be provided */
294 LPDPSP_REPLY Reply; /* Must be provided */
295 LPDPSP_SEND Send; /* Must be provided */
296 LPDPSP_ADDPLAYERTOGROUP AddPlayerToGroup; /* Optional */
297 LPDPSP_CLOSE Close; /* Optional */
298 LPDPSP_CREATEGROUP CreateGroup; /* Optional */
299 LPDPSP_CREATEPLAYER CreatePlayer; /* Optional */
300 LPDPSP_DELETEGROUP DeleteGroup; /* Optional */
301 LPDPSP_DELETEPLAYER DeletePlayer; /* Optional */
302 LPDPSP_GETADDRESS GetAddress; /* Optional */
303 LPDPSP_GETCAPS GetCaps; /* Optional */
304 LPDPSP_OPEN Open; /* Optional */
305 LPDPSP_REMOVEPLAYERFROMGROUP RemovePlayerFromGroup; /* Optional */
306 LPDPSP_SENDTOGROUP SendToGroup; /* Optional */
307 LPDPSP_SHUTDOWN Shutdown; /* Optional */
309 LPDPSP_CLOSEEX CloseEx; /* Optional */
310 LPDPSP_SHUTDOWNEX ShutdownEx; /* Optional */
311 LPDPSP_GETADDRESSCHOICES GetAddressChoices; /* Optional */
313 LPDPSP_SENDEX SendEx; /* Optional */
314 LPDPSP_SENDTOGROUPEX SendToGroupEx; /* Optional */
315 LPDPSP_CANCEL Cancel; /* Optional */
316 LPDPSP_GETMESSAGEQUEUE GetMessageQueue; /* Optional */
317 } DPSP_SPCALLBACKS, *LPDPSP_SPCALLBACKS;
319 typedef struct tagSPINITDATA
321 LPDPSP_SPCALLBACKS lpCB;
322 IDirectPlaySP* lpISP;
327 DWORD dwSPHeaderSize;
328 LPDPADDRESS lpAddress;
331 } SPINITDATA, *LPSPINITDATA;
333 typedef HRESULT (WINAPI *LPDPSP_SPINIT)(LPSPINITDATA);
335 /* This variable is exported from the DLL at ordinal 6 to be accessed by the
338 extern DWORD gdwDPlaySPRefCount;