comctl32: Added context menu to treeview.
[wine] / dlls / dplayx / dplaysp.h
1 /*
2  * Copyright 2000 Peter Hunnisett
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #ifndef __WINE_DIRECT_PLAY_SP_H
20 #define __WINE_DIRECT_PLAY_SP_H
21
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "dplay.h"
28 #include "dplobby.h"
29
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 *LPDIRECTPLAYSP;
33
34
35 typedef BOOL (CALLBACK *LPENUMMRUCALLBACK)( LPCVOID lpData,
36                                             DWORD  dwDataSize,
37                                             LPVOID lpContext );
38
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
43
44 #define DPSP_MAJORVERSIONMASK 0xFFFF0000
45 #define DPSP_MINORVERSIONMASK 0x0000FFFF
46
47
48 /* Some flags */
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
57
58 /* Define the COM interface */
59 #define INTERFACE IDirectPlaySP
60 DECLARE_INTERFACE_(IDirectPlaySP,IUnknown)
61 {
62     /*** IUnknown methods ***/
63     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
64     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
65     STDMETHOD_(ULONG,Release)(THIS) PURE;
66     /*** IDirectPlaySP methods ***/
67     STDMETHOD(AddMRUEntry)(THIS_ LPCWSTR lpSection, LPCWSTR lpKey, LPCVOID lpData, DWORD dwDataSize, DWORD dwMaxEntries ) PURE;
68     STDMETHOD(CreateAddress)(THIS_ REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize, LPVOID lpAddress,LPDWORD lpdwAddressSize) PURE;
69     STDMETHOD(EnumAddress)(THIS_ LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext ) PURE;
70     STDMETHOD(EnumMRUEntries)(THIS_ LPCWSTR lpSection, LPCWSTR lpKey, LPENUMMRUCALLBACK lpEnumMRUCallback, LPVOID lpContext ) PURE;
71     STDMETHOD(GetPlayerFlags)(THIS_ DPID idPlayer, LPDWORD lpdwPlayerFlags ) PURE;
72     STDMETHOD(GetSPPlayerData)(THIS_ DPID idPlayer, LPVOID *lplpData, LPDWORD lpdwDataSize, DWORD dwFlags ) PURE;
73     STDMETHOD(HandleMessage)(THIS_ LPVOID lpMessageBody, DWORD dwMessageBodySize, LPVOID lpMessageHeader ) PURE;
74     STDMETHOD(SetSPPlayerData)(THIS_ DPID idPlayer, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) PURE;
75     STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount, LPVOID lpAddress, LPDWORD lpdwAddressSize ) PURE;
76     STDMETHOD(GetSPData)(THIS_ LPVOID *lplpData, LPDWORD dwDataSize, DWORD dwFlags ) PURE;
77     STDMETHOD(SetSPData)(THIS_ LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) PURE;
78     STDMETHOD_(VOID,SendComplete)(THIS_ LPVOID , DWORD  ) PURE;
79 };
80 #undef INTERFACE
81
82
83 /* NOTE: The microsoft provided header file doesn't have these access
84  * functions
85  */
86 #if !defined (__cplusplus) || defined(CINTERFACE)
87 /*** IUnknown methods ***/
88 #define IDirectPlaySP_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
89 #define IDirectPlaySP_AddRef(p)                    (p)->lpVtbl->AddRef(p)
90 #define IDirectPlaySP_Release(p)                   (p)->lpVtbl->Release(p)
91 /*** IDirectPlaySP methods ***/
92 #define IDirectPlaySP_AddMRUEntry(p,a,b,c,d,e)     (p)->lpVtbl->AddMRUEntry(p,a,b,c,d,e)
93 #define IDirectPlaySP_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f)
94 #define IDirectPlaySP_EnumAddress(p,a,b,c,d)       (p)->lpVtbl->EnumAddress(p,a,b,c,d)
95 #define IDirectPlaySP_EnumMRUEntries(p,a,b,c,d)    (p)->lpVtbl->EnumMRUEntries(p,a,b,c,d)
96 #define IDirectPlaySP_GetPlayerFlags(p,a,b)        (p)->lpVtbl->GetPlayerFlags(p,a,b)
97 #define IDirectPlaySP_GetSPPlayerData(p,a,b,c,d)   (p)->lpVtbl->GetSPPlayerData(p,a,b,c,d)
98 #define IDirectPlaySP_HandleMessage(p,a,b,c)       (p)->lpVtbl->HandleMessage(p,a,b,c)
99 #define IDirectPlaySP_SetSPPlayerData(p,a,b,c,d)   (p)->lpVtbl->SetSPPlayerData(p,a,b,c,d)
100 #define IDirectPlaySP_CreateCompoundAddress(p,a,b,c,d)  (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
101 #define IDirectPlaySP_GetSPData(p,a,b,c)           (p)->lpVtbl->GetSPData(p,a,b,c)
102 #define IDirectPlaySP_SetSPData(p,a,b,c)           (p)->lpVtbl->SetSPData(p,a,b,c)
103 #define IDirectPlaySP_SendComplete(p,a,b)          (p)->lpVtbl->SendComplete(p,a,b)
104 #endif
105
106 /* SP Callback stuff */
107
108 typedef struct tagDPSP_ADDPLAYERTOGROUPDATA
109 {
110   DPID           idPlayer;
111   DPID           idGroup;
112   IDirectPlaySP* lpISP;
113 } DPSP_ADDPLAYERTOGROUPDATA, *LPDPSP_ADDPLAYERTOGROUPDATA;
114
115 typedef struct tagDPSP_CLOSEDATA
116 {
117   IDirectPlaySP* lpISP;
118 } DPSP_CLOSEDATA, *LPDPSP_CLOSEDATA;
119
120 typedef struct tagDPSP_CREATEGROUPDATA
121 {
122   DPID           idGroup;
123   DWORD          dwFlags;
124   LPVOID         lpSPMessageHeader;
125   IDirectPlaySP* lpISP;
126 } DPSP_CREATEGROUPDATA, *LPDPSP_CREATEGROUPDATA;
127
128 typedef struct tagDPSP_CREATEPLAYERDATA
129 {
130   DPID           idPlayer;
131   DWORD          dwFlags;
132   LPVOID         lpSPMessageHeader;
133   IDirectPlaySP* lpISP;
134 } DPSP_CREATEPLAYERDATA, *LPDPSP_CREATEPLAYERDATA;
135
136 typedef struct tagDPSP_DELETEGROUPDATA
137 {
138   DPID           idGroup;
139   DWORD          dwFlags;
140   IDirectPlaySP* lpISP;
141 } DPSP_DELETEGROUPDATA, *LPDPSP_DELETEGROUPDATA;
142
143 typedef struct tagDPSP_DELETEPLAYERDATA
144 {
145   DPID           idPlayer;
146   DWORD          dwFlags;
147   IDirectPlaySP* lpISP;
148 } DPSP_DELETEPLAYERDATA, *LPDPSP_DELETEPLAYERDATA;
149
150 typedef struct tagDPSP_ENUMSESSIONSDATA
151 {
152   LPVOID         lpMessage;
153   DWORD          dwMessageSize;
154   IDirectPlaySP* lpISP;
155   BOOL           bReturnStatus;
156 } DPSP_ENUMSESSIONSDATA, *LPDPSP_ENUMSESSIONSDATA;
157
158 typedef struct _DPSP_GETADDRESSDATA
159 {
160   DPID           idPlayer;
161   DWORD          dwFlags;
162   LPDPADDRESS    lpAddress;
163   LPDWORD        lpdwAddressSize;
164   IDirectPlaySP* lpISP;
165 } DPSP_GETADDRESSDATA, *LPDPSP_GETADDRESSDATA;
166
167 typedef struct tagDPSP_GETADDRESSCHOICESDATA
168 {
169   LPDPADDRESS    lpAddress;
170   LPDWORD        lpdwAddressSize;
171   IDirectPlaySP* lpISP;
172 } DPSP_GETADDRESSCHOICESDATA, *LPDPSP_GETADDRESSCHOICESDATA;
173
174 typedef struct tagDPSP_GETCAPSDATA
175 {
176   DPID           idPlayer;
177   LPDPCAPS       lpCaps;
178   DWORD          dwFlags;
179   IDirectPlaySP* lpISP;
180 } DPSP_GETCAPSDATA, *LPDPSP_GETCAPSDATA;
181
182 typedef struct tagDPSP_OPENDATA
183 {
184   BOOL           bCreate;
185   LPVOID         lpSPMessageHeader;
186   IDirectPlaySP* lpISP;
187   BOOL           bReturnStatus;
188   DWORD          dwOpenFlags;
189   DWORD          dwSessionFlags;
190 } DPSP_OPENDATA, *LPDPSP_OPENDATA;
191
192 typedef struct tagDPSP_REMOVEPLAYERFROMGROUPDATA
193 {
194   DPID           idPlayer;
195   DPID           idGroup;
196   IDirectPlaySP* lpISP;
197 } DPSP_REMOVEPLAYERFROMGROUPDATA, *LPDPSP_REMOVEPLAYERFROMGROUPDATA;
198
199 typedef struct tagDPSP_REPLYDATA
200 {
201   LPVOID         lpSPMessageHeader;
202   LPVOID         lpMessage;
203   DWORD          dwMessageSize;
204   DPID           idNameServer;
205   IDirectPlaySP* lpISP;
206 } DPSP_REPLYDATA, *LPDPSP_REPLYDATA;
207
208 typedef struct tagDPSP_SENDDATA
209 {
210   DWORD          dwFlags;
211   DPID           idPlayerTo;
212   DPID           idPlayerFrom;
213   LPVOID         lpMessage;
214   DWORD          dwMessageSize;
215   BOOL           bSystemMessage;
216   IDirectPlaySP* lpISP;
217 } DPSP_SENDDATA, *LPDPSP_SENDDATA;
218
219 typedef struct tagDPSP_SENDTOGROUPDATA
220 {
221   DWORD          dwFlags;
222   DPID           idGroupTo;
223   DPID           idPlayerFrom;
224   LPVOID         lpMessage;
225   DWORD          dwMessageSize;
226   IDirectPlaySP* lpISP;
227 } DPSP_SENDTOGROUPDATA, *LPDPSP_SENDTOGROUPDATA;
228
229 typedef struct tagDPSP_SENDEXDATA
230 {
231   IDirectPlaySP* lpISP;
232   DWORD          dwFlags;
233   DPID           idPlayerTo;
234   DPID           idPlayerFrom;
235   LPSGBUFFER     lpSendBuffers;
236   DWORD          cBuffers;
237   DWORD          dwMessageSize;
238   DWORD          dwPriority;
239   DWORD          dwTimeout;
240   LPVOID         lpDPContext;
241   LPDWORD        lpdwSPMsgID;
242   BOOL           bSystemMessage;
243 } DPSP_SENDEXDATA, *LPDPSP_SENDEXDATA;
244
245 typedef struct tagDPSP_SENDTOGROUPEXDATA
246 {
247   IDirectPlaySP* lpISP;
248   DWORD          dwFlags;
249   DPID           idGroupTo;
250   DPID           idPlayerFrom;
251   LPSGBUFFER     lpSendBuffers;
252   DWORD          cBuffers;
253   DWORD          dwMessageSize;
254   DWORD          dwPriority;
255   DWORD          dwTimeout;
256   LPVOID         lpDPContext;
257   LPDWORD        lpdwSPMsgID;
258 } DPSP_SENDTOGROUPEXDATA, *LPDPSP_SENDTOGROUPEXDATA;
259
260 typedef struct tagDPSP_GETMESSAGEQUEUEDATA
261 {
262   IDirectPlaySP* lpISP;
263   DWORD          dwFlags;
264   DPID           idFrom;
265   DPID           idTo;
266   LPDWORD        lpdwNumMsgs;
267   LPDWORD        lpdwNumBytes;
268 } DPSP_GETMESSAGEQUEUEDATA, *LPDPSP_GETMESSAGEQUEUEDATA;
269
270 #define DPCANCELSEND_PRIORITY 0x00000001
271 #define DPCANCELSEND_ALL      0x00000002
272
273 typedef struct tagDPSP_CANCELDATA
274 {
275   IDirectPlaySP* lpISP;
276   DWORD          dwFlags;
277   LPRGLPVOID     lprglpvSPMsgID;
278   DWORD          cSPMsgID;
279   DWORD          dwMinPriority;
280   DWORD          dwMaxPriority;
281 } DPSP_CANCELDATA, *LPDPSP_CANCELDATA;
282
283 typedef struct tagDPSP_SHUTDOWNDATA
284 {
285   IDirectPlaySP* lpISP;
286 } DPSP_SHUTDOWNDATA, *LPDPSP_SHUTDOWNDATA;
287
288
289 /* Prototypes returned by SPInit */
290 typedef HRESULT (WINAPI *LPDPSP_CREATEPLAYER)(LPDPSP_CREATEPLAYERDATA);
291 typedef HRESULT (WINAPI *LPDPSP_DELETEPLAYER)(LPDPSP_DELETEPLAYERDATA);
292 typedef HRESULT (WINAPI *LPDPSP_SEND)(LPDPSP_SENDDATA);
293 typedef HRESULT (WINAPI *LPDPSP_ENUMSESSIONS)(LPDPSP_ENUMSESSIONSDATA);
294 typedef HRESULT (WINAPI *LPDPSP_REPLY)(LPDPSP_REPLYDATA);
295 typedef HRESULT (WINAPI *LPDPSP_SHUTDOWN)(void);
296 typedef HRESULT (WINAPI *LPDPSP_CREATEGROUP)(LPDPSP_CREATEGROUPDATA);
297 typedef HRESULT (WINAPI *LPDPSP_DELETEGROUP)(LPDPSP_DELETEGROUPDATA);
298 typedef HRESULT (WINAPI *LPDPSP_ADDPLAYERTOGROUP)(LPDPSP_ADDPLAYERTOGROUPDATA);
299 typedef HRESULT (WINAPI *LPDPSP_REMOVEPLAYERFROMGROUP)(LPDPSP_REMOVEPLAYERFROMGROUPDATA);
300 typedef HRESULT (WINAPI *LPDPSP_GETCAPS)(LPDPSP_GETCAPSDATA);
301 typedef HRESULT (WINAPI *LPDPSP_GETADDRESS)(LPDPSP_GETADDRESSDATA);
302 typedef HRESULT (WINAPI *LPDPSP_GETADDRESSCHOICES)(LPDPSP_GETADDRESSCHOICESDATA);
303 typedef HRESULT (WINAPI *LPDPSP_OPEN)(LPDPSP_OPENDATA);
304 typedef HRESULT (WINAPI *LPDPSP_CLOSE)(void);
305 typedef HRESULT (WINAPI *LPDPSP_SENDTOGROUP)(LPDPSP_SENDTOGROUPDATA);
306 typedef HRESULT (WINAPI *LPDPSP_SHUTDOWNEX)(LPDPSP_SHUTDOWNDATA);
307 typedef HRESULT (WINAPI *LPDPSP_CLOSEEX)(LPDPSP_CLOSEDATA);
308 typedef HRESULT (WINAPI *LPDPSP_SENDEX)(LPDPSP_SENDEXDATA);
309 typedef HRESULT (WINAPI *LPDPSP_SENDTOGROUPEX)(LPDPSP_SENDTOGROUPEXDATA);
310 typedef HRESULT (WINAPI *LPDPSP_CANCEL)(LPDPSP_CANCELDATA);
311 typedef HRESULT (WINAPI *LPDPSP_GETMESSAGEQUEUE)(LPDPSP_GETMESSAGEQUEUEDATA);
312
313
314 typedef struct tagDPSP_SPCALLBACKS
315 {
316     DWORD                        dwSize;
317     DWORD                        dwVersion;
318
319     LPDPSP_ENUMSESSIONS          EnumSessions;          /* Must be provided */
320     LPDPSP_REPLY                 Reply;                 /* Must be provided */
321     LPDPSP_SEND                  Send;                  /* Must be provided */
322     LPDPSP_ADDPLAYERTOGROUP      AddPlayerToGroup;      /* Optional */
323     LPDPSP_CLOSE                 Close;                 /* Optional */
324     LPDPSP_CREATEGROUP           CreateGroup;           /* Optional */
325     LPDPSP_CREATEPLAYER          CreatePlayer;          /* Optional */
326     LPDPSP_DELETEGROUP           DeleteGroup;           /* Optional */
327     LPDPSP_DELETEPLAYER          DeletePlayer;          /* Optional */
328     LPDPSP_GETADDRESS            GetAddress;            /* Optional */
329     LPDPSP_GETCAPS               GetCaps;               /* Optional */
330     LPDPSP_OPEN                  Open;                  /* Optional */
331     LPDPSP_REMOVEPLAYERFROMGROUP RemovePlayerFromGroup; /* Optional */
332     LPDPSP_SENDTOGROUP           SendToGroup;           /* Optional */
333     LPDPSP_SHUTDOWN              Shutdown;              /* Optional */
334
335     LPDPSP_CLOSEEX               CloseEx;               /* Optional */
336     LPDPSP_SHUTDOWNEX            ShutdownEx;            /* Optional */
337     LPDPSP_GETADDRESSCHOICES     GetAddressChoices;     /* Optional */
338
339     LPDPSP_SENDEX                SendEx;                /* Optional */
340     LPDPSP_SENDTOGROUPEX         SendToGroupEx;         /* Optional */
341     LPDPSP_CANCEL                Cancel;                /* Optional */
342     LPDPSP_GETMESSAGEQUEUE       GetMessageQueue;       /* Optional */
343 } DPSP_SPCALLBACKS, *LPDPSP_SPCALLBACKS;
344
345 typedef struct tagSPINITDATA
346 {
347     LPDPSP_SPCALLBACKS  lpCB;
348     IDirectPlaySP*      lpISP;
349     LPWSTR              lpszName;
350     LPGUID              lpGuid;
351     DWORD               dwReserved1;
352     DWORD               dwReserved2;
353     DWORD               dwSPHeaderSize;
354     LPDPADDRESS         lpAddress;
355     DWORD               dwAddressSize;
356     DWORD               dwSPVersion;
357 } SPINITDATA, *LPSPINITDATA;
358
359 typedef HRESULT (WINAPI *LPDPSP_SPINIT)(LPSPINITDATA);
360
361 /* This variable is exported from the DLL at ordinal 6 to be accessed by the
362  * SP directly
363  */
364 extern DWORD gdwDPlaySPRefCount;
365
366 #endif