Added some stubs needed for IE 5.5 setup.
[wine] / dlls / dplayx / dplaysp.h
1 #ifndef __WINE_DIRECT_PLAY_SP_H
2 #define __WINE_DIRECT_PLAY_SP_H
3
4 #include "dplay.h"
5 #include "dplobby.h"
6
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;
10
11
12 typedef BOOL (CALLBACK* LPENUMMRUCALLBACK)( LPCVOID lpData,
13                                             DWORD  dwDataSize,
14                                             LPVOID lpContext );
15
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
20
21 #define DPSP_MAJORVERSIONMASK 0xFFFF0000
22 #define DPSP_MINORVERSIONMASK 0x0000FFFF
23
24
25 /* Some flags */
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
34
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, )
50
51 #define IDirectPlaySP_IMETHODS \
52    IUnknown_IMETHODS \
53    IDirectPlaySP_METHODS
54
55 ICOM_DEFINE(IDirectPlaySP,IUnknown)
56 #undef ICOM_INTERFACE
57
58
59 /* NOTE: The microsoft provided header file doesn't have these access 
60  * functions
61  */
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)
79
80 /* SP Callback stuff */
81
82 typedef struct tagDPSP_ADDPLAYERTOGROUPDATA
83 {
84   DPID           idPlayer;
85   DPID           idGroup;
86   IDirectPlaySP* lpISP;
87 } DPSP_ADDPLAYERTOGROUPDATA, *LPDPSP_ADDPLAYERTOGROUPDATA;
88
89 typedef struct tagDPSP_CLOSEDATA
90 {
91   IDirectPlaySP* lpISP;
92 } DPSP_CLOSEDATA, *LPDPSP_CLOSEDATA;
93
94 typedef struct tagDPSP_CREATEGROUPDATA
95 {
96   DPID           idGroup;
97   DWORD          dwFlags;
98   LPVOID         lpSPMessageHeader;
99   IDirectPlaySP* lpISP;
100 } DPSP_CREATEGROUPDATA, *LPDPSP_CREATEGROUPDATA;
101
102 typedef struct tagDPSP_CREATEPLAYERDATA
103 {
104   DPID           idPlayer;
105   DWORD          dwFlags;
106   LPVOID         lpSPMessageHeader;
107   IDirectPlaySP* lpISP;
108 } DPSP_CREATEPLAYERDATA, *LPDPSP_CREATEPLAYERDATA;
109
110 typedef struct tagDPSP_DELETEGROUPDATA
111 {
112   DPID           idGroup;
113   DWORD          dwFlags;
114   IDirectPlaySP* lpISP;
115 } DPSP_DELETEGROUPDATA, *LPDPSP_DELETEGROUPDATA;
116
117 typedef struct tagDPSP_DELETEPLAYERDATA
118 {
119   DPID           idPlayer;
120   DWORD          dwFlags;
121   IDirectPlaySP* lpISP;
122 } DPSP_DELETEPLAYERDATA, *LPDPSP_DELETEPLAYERDATA;
123
124 typedef struct tagDPSP_ENUMSESSIONSDATA
125 {
126   LPVOID         lpMessage;
127   DWORD          dwMessageSize;
128   IDirectPlaySP* lpISP;
129   BOOL           bReturnStatus;
130 } DPSP_ENUMSESSIONSDATA, *LPDPSP_ENUMSESSIONSDATA;
131
132 typedef struct _DPSP_GETADDRESSDATA
133 {
134   DPID           idPlayer;
135   DWORD          dwFlags;
136   LPDPADDRESS    lpAddress;
137   LPDWORD        lpdwAddressSize;
138   IDirectPlaySP* lpISP;
139 } DPSP_GETADDRESSDATA, *LPDPSP_GETADDRESSDATA;
140
141 typedef struct tagDPSP_GETADDRESSCHOICESDATA
142 {
143   LPDPADDRESS    lpAddress;
144   LPDWORD        lpdwAddressSize;
145   IDirectPlaySP* lpISP;
146 } DPSP_GETADDRESSCHOICESDATA, *LPDPSP_GETADDRESSCHOICESDATA;
147
148 typedef struct tagDPSP_GETCAPSDATA
149 {
150   DPID           idPlayer;
151   LPDPCAPS       lpCaps;
152   DWORD          dwFlags;
153   IDirectPlaySP* lpISP;
154 } DPSP_GETCAPSDATA, *LPDPSP_GETCAPSDATA;
155
156 typedef struct tagDPSP_OPENDATA
157 {
158   BOOL           bCreate;
159   LPVOID         lpSPMessageHeader;
160   IDirectPlaySP* lpISP;
161   BOOL           bReturnStatus;
162   DWORD          dwOpenFlags;
163   DWORD          dwSessionFlags;
164 } DPSP_OPENDATA, *LPDPSP_OPENDATA;
165
166 typedef struct tagDPSP_REMOVEPLAYERFROMGROUPDATA
167 {
168   DPID           idPlayer;
169   DPID           idGroup;
170   IDirectPlaySP* lpISP;
171 } DPSP_REMOVEPLAYERFROMGROUPDATA, *LPDPSP_REMOVEPLAYERFROMGROUPDATA;
172
173 typedef struct tagDPSP_REPLYDATA
174 {      
175   LPVOID         lpSPMessageHeader;
176   LPVOID         lpMessage;
177   DWORD          dwMessageSize;
178   DPID           idNameServer;
179   IDirectPlaySP* lpISP;
180 } DPSP_REPLYDATA, *LPDPSP_REPLYDATA;
181
182 typedef struct tagDPSP_SENDDATA
183 {
184   DWORD          dwFlags;
185   DPID           idPlayerTo;
186   DPID           idPlayerFrom;
187   LPVOID         lpMessage;
188   DWORD          dwMessageSize;
189   BOOL           bSystemMessage;
190   IDirectPlaySP* lpISP;
191 } DPSP_SENDDATA, *LPDPSP_SENDDATA;
192
193 typedef struct tagDPSP_SENDTOGROUPDATA
194 {
195   DWORD          dwFlags;
196   DPID           idGroupTo;
197   DPID           idPlayerFrom;
198   LPVOID         lpMessage;
199   DWORD          dwMessageSize;
200   IDirectPlaySP* lpISP;
201 } DPSP_SENDTOGROUPDATA, *LPDPSP_SENDTOGROUPDATA;
202
203 typedef struct tagDPSP_SENDEXDATA
204 {
205   IDirectPlaySP* lpISP;
206   DWORD          dwFlags;
207   DPID           idPlayerTo;
208   DPID           idPlayerFrom;
209   LPSGBUFFER     lpSendBuffers;
210   DWORD          cBuffers;
211   DWORD          dwMessageSize;
212   DWORD          dwPriority;
213   DWORD          dwTimeout;
214   LPVOID         lpDPContext;
215   LPDWORD        lpdwSPMsgID;
216   BOOL           bSystemMessage;
217 } DPSP_SENDEXDATA, *LPDPSP_SENDEXDATA;
218
219 typedef struct tagDPSP_SENDTOGROUPEXDATA
220 {
221   IDirectPlaySP* lpISP;
222   DWORD          dwFlags;
223   DPID           idGroupTo;
224   DPID           idPlayerFrom;
225   LPSGBUFFER     lpSendBuffers;
226   DWORD          cBuffers;
227   DWORD          dwMessageSize;
228   DWORD          dwPriority;
229   DWORD          dwTimeout;
230   LPVOID         lpDPContext;
231   LPDWORD        lpdwSPMsgID;
232 } DPSP_SENDTOGROUPEXDATA, *LPDPSP_SENDTOGROUPEXDATA;
233
234 typedef struct tagDPSP_GETMESSAGEQUEUEDATA
235 {
236   IDirectPlaySP* lpISP;
237   DWORD          dwFlags;
238   DPID           idFrom;
239   DPID           idTo;
240   LPDWORD        lpdwNumMsgs;
241   LPDWORD        lpdwNumBytes;
242 } DPSP_GETMESSAGEQUEUEDATA, *LPDPSP_GETMESSAGEQUEUEDATA;
243
244 #define DPCANCELSEND_PRIORITY 0x00000001
245 #define DPCANCELSEND_ALL      0x00000002
246
247 typedef struct tagDPSP_CANCELDATA
248 {
249   IDirectPlaySP* lpISP;
250   DWORD          dwFlags;
251   LPRGLPVOID     lprglpvSPMsgID;
252   DWORD          cSPMsgID;
253   DWORD          dwMinPriority;
254   DWORD          dwMaxPriority;
255 } DPSP_CANCELDATA, *LPDPSP_CANCELDATA;
256
257 typedef struct tagDPSP_SHUTDOWNDATA
258 {
259   IDirectPlaySP* lpISP;
260 } DPSP_SHUTDOWNDATA, *LPDPSP_SHUTDOWNDATA;
261
262
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);
286
287
288 typedef struct tagDPSP_SPCALLBACKS
289 {
290     DWORD                        dwSize;
291     DWORD                        dwVersion;
292
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 */
308
309     LPDPSP_CLOSEEX               CloseEx;               /* Optional */
310     LPDPSP_SHUTDOWNEX            ShutdownEx;            /* Optional */
311     LPDPSP_GETADDRESSCHOICES     GetAddressChoices;     /* Optional */
312
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;
318
319 typedef struct tagSPINITDATA
320 {
321     LPDPSP_SPCALLBACKS  lpCB; 
322     IDirectPlaySP*      lpISP;
323     LPWSTR              lpszName;
324     LPGUID              lpGuid;
325     DWORD               dwReserved1; 
326     DWORD               dwReserved2;
327     DWORD               dwSPHeaderSize;     
328     LPDPADDRESS         lpAddress;
329     DWORD               dwAddressSize;      
330     DWORD               dwSPVersion;        
331 } SPINITDATA, *LPSPINITDATA;
332
333 typedef HRESULT (WINAPI *LPDPSP_SPINIT)(LPSPINITDATA);
334
335 /* This variable is exported from the DLL at ordinal 6 to be accessed by the 
336  * SP directly 
337  */
338 extern DWORD gdwDPlaySPRefCount;
339
340 #endif
341