/[cvs]/api/include/dplobby8.h
ViewVC logotype

Contents of /api/include/dplobby8.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Sun Jul 1 20:47:59 2001 UTC (23 years, 5 months ago) by bearsoft
Branch: lazy, MAIN
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
First import

1 /*==========================================================================
2 *
3 * Copyright (C) 2000 Microsoft Corporation. All Rights Reserved.
4 *
5 * File: DPLobby.h
6 * Content: DirectPlay8 Lobby Include File
7 *
8 ***************************************************************************/
9
10 #ifndef __DPLOBBY_H__
11 #define __DPLOBBY_H__
12
13 #include <ole2.h>
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 /****************************************************************************
20 *
21 * DirectPlay8Lobby CLSIDs
22 *
23 ****************************************************************************/
24
25 // {667955AD-6B3B-43ca-B949-BC69B5BAFF7F}
26 DEFINE_GUID(CLSID_DirectPlay8LobbiedApplication,
27 0x667955ad, 0x6b3b, 0x43ca, 0xb9, 0x49, 0xbc, 0x69, 0xb5, 0xba, 0xff, 0x7f);
28
29 // {3B2B6775-70B6-45af-8DEA-A209C69559F3}
30 DEFINE_GUID(CLSID_DirectPlay8LobbyClient,
31 0x3b2b6775, 0x70b6, 0x45af, 0x8d, 0xea, 0xa2, 0x9, 0xc6, 0x95, 0x59, 0xf3);
32
33 /****************************************************************************
34 *
35 * DirectPlay8Lobby Interface IIDs
36 *
37 ****************************************************************************/
38
39 // {819074A3-016C-11d3-AE14-006097B01411}
40 DEFINE_GUID(IID_IDirectPlay8LobbiedApplication,
41 0x819074a3, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
42
43 // {819074A2-016C-11d3-AE14-006097B01411}
44 DEFINE_GUID(IID_IDirectPlay8LobbyClient,
45 0x819074a2, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
46
47 /****************************************************************************
48 *
49 * DirectPlay8Lobby Interface Pointer
50 *
51 ****************************************************************************/
52
53 typedef struct IDirectPlay8LobbiedApplication *PDIRECTPLAY8LOBBIEDAPPLICATION;
54 typedef struct IDirectPlay8LobbyClient *PDIRECTPLAY8LOBBYCLIENT;
55
56 /****************************************************************************
57 *
58 * DirectPlay8 Lobby Message IDs
59 *
60 ****************************************************************************/
61
62 #define DPL_MSGID_LOBBY 0x8000
63 #define DPL_MSGID_RECEIVE (0x0001 | DPL_MSGID_LOBBY)
64 #define DPL_MSGID_CONNECT (0x0002 | DPL_MSGID_LOBBY)
65 #define DPL_MSGID_DISCONNECT (0x0003 | DPL_MSGID_LOBBY)
66 #define DPL_MSGID_SESSION_STATUS (0x0004 | DPL_MSGID_LOBBY)
67 #define DPL_MSGID_CONNECTION_SETTINGS (0x0005 | DPL_MSGID_LOBBY)
68
69 /****************************************************************************
70 *
71 * DirectPlay8Lobby Constants
72 *
73 ****************************************************************************/
74
75 //
76 // Specifies that operation should be performed on all open connections
77 //
78 #define DPLHANDLE_ALLCONNECTIONS 0xFFFFFFFF
79
80 //
81 // The associated game session has suceeded in connecting / hosting
82 //
83 #define DPLSESSION_CONNECTED 0x0001
84
85 // The associated game session failed connecting / hosting
86 //
87 #define DPLSESSION_COULDNOTCONNECT 0x0002
88
89 //
90 // The associated game session has disconnected
91 //
92 #define DPLSESSION_DISCONNECTED 0x0003
93
94 //
95 // The associated game session has terminated
96 //
97 #define DPLSESSION_TERMINATED 0x0004
98
99 //
100 // The associated game session's host has migrated
101 //
102 #define DPLSESSION_HOSTMIGRATED 0x0005
103
104 //
105 // The associated game session's host has migrated to the local client
106 //
107 #define DPLSESSION_HOSTMIGRATEDHERE 0x0006
108
109
110 /****************************************************************************
111 *
112 * DirectPlay8 Lobby Flags
113 *
114 ****************************************************************************/
115
116 //
117 // Do not automatically make the lobby app unavailable when a connection is established
118 //
119 #define DPLAVAILABLE_ALLOWMULTIPLECONNECT 0x0001
120
121 //
122 // Launch a new instance of the application to connect to
123 //
124 #define DPLCONNECT_LAUNCHNEW 0x0001
125
126 //
127 // Launch a new instance of the application if one is not waiting
128 //
129 #define DPLCONNECT_LAUNCHNOTFOUND 0x0002
130
131 //
132 // When starting the associated game session, start it as a host
133 //
134 #define DPLCONNECTSETTINGS_HOST 0x0001
135
136 //
137 // Disable parameter validation
138 //
139 #define DPLINITIALIZE_DISABLEPARAMVAL 0x0001
140
141 /****************************************************************************
142 *
143 * DirectPlay8Lobby Structures (Non-Message)
144 *
145 ****************************************************************************/
146
147 //
148 // Information on a registered game
149 //
150 typedef struct _DPL_APPLICATION_INFO {
151 GUID guidApplication; // GUID of the application
152 PWSTR pwszApplicationName; // Name of the application
153 DWORD dwNumRunning; // # of instances of this application running
154 DWORD dwNumWaiting; // # of instances of this application waiting
155 DWORD dwFlags; // Flags
156 } DPL_APPLICATION_INFO, *PDPL_APPLICATION_INFO;
157
158 //
159 // Settings to be used for connecting / hosting a game session
160 //
161 typedef struct _DPL_CONNECTION_SETTINGS {
162 DWORD dwSize; // Size of this structure
163 DWORD dwFlags; // Connection settings flags (DPLCONNECTSETTINGS_...)
164 DPN_APPLICATION_DESC dpnAppDesc; // Application desc for the associated DirectPlay session
165 IDirectPlay8Address *pdp8HostAddress; // Address of host to connect to
166 IDirectPlay8Address **ppdp8DeviceAddresses; // Address of device to connect from / host on
167 DWORD cNumDeviceAddresses; // # of addresses specified in ppdp8DeviceAddresses
168 PWSTR pwszPlayerName; // Name to give the player
169 } DPL_CONNECTION_SETTINGS, *PDPL_CONNECTION_SETTINGS;
170
171 //
172 // Information for performing a lobby connect
173 // (ConnectApplication)
174 //
175 typedef struct _DPL_CONNECT_INFO {
176 DWORD dwSize; // Size of this structure
177 DWORD dwFlags; // Flags (DPLCONNECT_...)
178 GUID guidApplication; // GUID of application to launch
179 PDPL_CONNECTION_SETTINGS pdplConnectionSettings;
180 // Settings application should use
181 PVOID pvLobbyConnectData; // User defined data block
182 DWORD dwLobbyConnectDataSize;
183 // Size of user defined data block
184 } DPL_CONNECT_INFO, *PDPL_CONNECT_INFO;
185
186 //
187 // Information for registering an application
188 // (RegisterApplication)
189 //
190 typedef struct _DPL_PROGRAM_DESC {
191 DWORD dwSize;
192 DWORD dwFlags;
193 GUID guidApplication; // Application GUID
194 PWSTR pwszApplicationName; // Unicode application name
195 PWSTR pwszCommandLine; // Unicode command line arguments
196 PWSTR pwszCurrentDirectory; // Unicode current directory
197 PWSTR pwszDescription; // Unicode application description
198 PWSTR pwszExecutableFilename; // Unicode filename of application executable
199 PWSTR pwszExecutablePath; // Unicode path of application executable
200 PWSTR pwszLauncherFilename; // Unicode filename of launcher executable
201 PWSTR pwszLauncherPath; // Unicode path of launcher executable
202 } DPL_PROGRAM_DESC, *PDPL_PROGRAM_DESC;
203
204 /****************************************************************************
205 *
206 * DirectPlay8 Lobby Message Structures
207 *
208 ****************************************************************************/
209
210 //
211 // A connection was established
212 // (DPL_MSGID_CONNECT)
213 //
214 typedef struct _DPL_MESSAGE_CONNECT
215 {
216 DWORD dwSize; // Size of this structure
217 DPNHANDLE hConnectId; // Handle of new connection
218 PDPL_CONNECTION_SETTINGS pdplConnectionSettings; // Connection settings for this connection
219 PVOID pvLobbyConnectData; // User defined lobby data block
220 DWORD dwLobbyConnectDataSize; // Size of user defined lobby data block
221 PVOID pvConnectionContext; // Context value for this connection (user set)
222 } DPL_MESSAGE_CONNECT, *PDPL_MESSAGE_CONNECT;
223
224 //
225 // Connection settings have been updated
226 // (DPL_MSGID_CONNECTION_SETTINGS)
227 //
228 typedef struct _DPL_MESSAGE_CONNECTION_SETTINGS
229 {
230 DWORD dwSize; // Size of this structure
231 DPNHANDLE hSender; // Handle of the connection for these settings
232 PDPL_CONNECTION_SETTINGS pdplConnectionSettings; // Connection settings
233 PVOID pvConnectionContext; // Context value for this connection
234 } DPL_MESSAGE_CONNECTION_SETTINGS, *PDPL_MESSAGE_CONNECTION_SETTINGS;
235
236 //
237 // A connection has been disconnected
238 // (DPL_MSGID_DISCONNECT)
239 //
240 typedef struct _DPL_MESSAGE_DISCONNECT
241 {
242 DWORD dwSize; // Size of this structure
243 DPNHANDLE hDisconnectId; // Handle of the connection that was terminated
244 HRESULT hrReason; // Reason the connection was broken
245 PVOID pvConnectionContext; // Context value for this connection
246 } DPL_MESSAGE_DISCONNECT, *PDPL_MESSAGE_DISCONNECT;
247
248 //
249 // Data was received through a connection
250 // (DPL_MSGID_RECEIVE)
251 //
252 typedef struct _DPL_MESSAGE_RECEIVE
253 {
254 DWORD dwSize; // Size of this structure
255 DPNHANDLE hSender; // Handle of the connection that is from
256 BYTE *pBuffer; // Contents of the message
257 DWORD dwBufferSize; // Size of the message context
258 PVOID pvConnectionContext; // Context value for this connection
259 } DPL_MESSAGE_RECEIVE, *PDPL_MESSAGE_RECEIVE;
260
261 //
262 // Current status of the associated connection
263 // (DPL_MSGID_SESSION_STATUS)
264 //
265 typedef struct _DPL_MESSAGE_SESSION_STATUS
266 {
267 DWORD dwSize; // Size of this structure
268 DPNHANDLE hSender; // Handle of the connection that this is from
269 DWORD dwStatus; // Status (DPLSESSION_...)
270 PVOID pvConnectionContext; // Context value for this connection
271 } DPL_MESSAGE_SESSION_STATUS, *PDPL_MESSAGE_SESSION_STATUS;
272
273 /****************************************************************************
274 *
275 * DirectPlay8Lobby Create
276 *
277 ****************************************************************************/
278
279 extern HRESULT WINAPI DirectPlay8LobbyCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
280
281 /****************************************************************************
282 *
283 * DirectPlay8 Functions
284 *
285 ****************************************************************************/
286
287 //
288 // COM definition for DirectPlayLobbyClient
289 //
290 #undef INTERFACE // External COM Implementation
291 #define INTERFACE IDirectPlay8LobbyClient
292 DECLARE_INTERFACE_(IDirectPlay8LobbyClient,IUnknown)
293 {
294 // IUnknown methods
295 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
296 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
297 STDMETHOD_(ULONG,Release) (THIS) PURE;
298 // IDirectPlayLobbyClient methods
299 STDMETHOD(Initialize) (THIS_ const PVOID pvUserContext,const PFNDPNMESSAGEHANDLER pfn,const DWORD dwFlags) PURE;
300 STDMETHOD(EnumLocalPrograms) (THIS_ GUID *const pGuidApplication,BYTE *const pEnumData,DWORD *const pdwEnumData,DWORD *const pdwItems, const DWORD dwFlags) PURE;
301 STDMETHOD(ConnectApplication) (THIS_ DPL_CONNECT_INFO *const pdplConnectionInfo,const PVOID pvConnectionContext,DPNHANDLE *const hApplication,const DWORD dwTimeOut,const DWORD dwFlags) PURE;
302 STDMETHOD(Send) (THIS_ const DPNHANDLE hConnection,BYTE *const pBuffer,const DWORD pBufferSize,const DWORD dwFlags) PURE;
303 STDMETHOD(ReleaseApplication) (THIS_ const DPNHANDLE hConnection, const DWORD dwFlags ) PURE;
304 STDMETHOD(Close) (THIS_ const DWORD dwFlags ) PURE;
305 STDMETHOD(GetConnectionSettings) (THIS_ const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo, DWORD *pdwInfoSize, const DWORD dwFlags ) PURE;
306 STDMETHOD(SetConnectionSettings) (THIS_ const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo, const DWORD dwFlags ) PURE;
307 };
308
309
310 //
311 // COM definition for DirectPlayLobbiedApplication
312 //
313 #undef INTERFACE // External COM Implementation
314 #define INTERFACE IDirectPlay8LobbiedApplication
315 DECLARE_INTERFACE_(IDirectPlay8LobbiedApplication,IUnknown)
316 {
317 // IUnknown methods
318 STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) PURE;
319 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
320 STDMETHOD_(ULONG,Release) (THIS) PURE;
321 // IDirectPlayLobbiedApplication methods
322 STDMETHOD(Initialize) (THIS_ const PVOID pvUserContext,const PFNDPNMESSAGEHANDLER pfn,DPNHANDLE * const pdpnhConnection, const DWORD dwFlags) PURE;
323 STDMETHOD(RegisterProgram) (THIS_ PDPL_PROGRAM_DESC pdplProgramDesc,const DWORD dwFlags) PURE;
324 STDMETHOD(UnRegisterProgram) (THIS_ GUID *pguidApplication,const DWORD dwFlags) PURE;
325 STDMETHOD(Send) (THIS_ const DPNHANDLE hConnection,BYTE *const pBuffer,const DWORD pBufferSize,const DWORD dwFlags) PURE;
326 STDMETHOD(SetAppAvailable) (THIS_ const BOOL fAvailable, const DWORD dwFlags ) PURE;
327 STDMETHOD(UpdateStatus) (THIS_ const DPNHANDLE hConnection, const DWORD dwStatus, const DWORD dwFlags ) PURE;
328 STDMETHOD(Close) (THIS_ const DWORD dwFlags ) PURE;
329 STDMETHOD(GetConnectionSettings) (THIS_ const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo, DWORD *pdwInfoSize, const DWORD dwFlags ) PURE;
330 STDMETHOD(SetConnectionSettings) (THIS_ const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo, const DWORD dwFlags ) PURE;
331 };
332
333
334 /****************************************************************************
335 *
336 * DirectPlayLobby Interface Macros
337 *
338 ****************************************************************************/
339
340 #if !defined(__cplusplus) || defined(CINTERFACE)
341
342 #define IDirectPlay8LobbyClient_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
343 #define IDirectPlay8LobbyClient_AddRef(p) (p)->lpVtbl->AddRef(p)
344 #define IDirectPlay8LobbyClient_Release(p) (p)->lpVtbl->Release(p)
345 #define IDirectPlay8LobbyClient_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
346 #define IDirectPlay8LobbyClient_EnumLocalPrograms(p,a,b,c,d,e) (p)->lpVtbl->EnumLocalPrograms(p,a,b,c,d,e)
347 #define IDirectPlay8LobbyClient_ConnectApplication(p,a,b,c,d,e) (p)->lpVtbl->ConnectApplication(p,a,b,c,d,e)
348 #define IDirectPlay8LobbyClient_Send(p,a,b,c,d) (p)->lpVtbl->Send(p,a,b,c,d)
349 #define IDirectPlay8LobbyClient_ReleaseApplication(p,a,b) (p)->lpVtbl->ReleaseApplication(p,a,b)
350 #define IDirectPlay8LobbyClient_Close(p,a) (p)->lpVtbl->Close(p,a)
351 #define IDirectPlay8LobbyClient_GetConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetConnectionSettings(p,a,b,c,d)
352 #define IDirectPlay8LobbyClient_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
353
354 #define IDirectPlay8LobbiedApplication_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
355 #define IDirectPlay8LobbiedApplication_AddRef(p) (p)->lpVtbl->AddRef(p)
356 #define IDirectPlay8LobbiedApplication_Release(p) (p)->lpVtbl->Release(p)
357 #define IDirectPlay8LobbiedApplication_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d)
358 #define IDirectPlay8LobbiedApplication_RegisterProgram(p,a,b) (p)->lpVtbl->RegisterProgram(p,a,b)
359 #define IDirectPlay8LobbiedApplication_UnRegisterProgram(p,a,b) (p)->lpVtbl->UnRegisterProgram(p,a,b)
360 #define IDirectPlay8LobbiedApplication_Send(p,a,b,c,d) (p)->lpVtbl->Send(p,a,b,c,d)
361 #define IDirectPlay8LobbiedApplication_SetAppAvailable(p,a,b) (p)->lpVtbl->SetAppAvailable(p,a,b)
362 #define IDirectPlay8LobbiedApplication_UpdateStatus(p,a,b,c) (p)->lpVtbl->UpdateStatus(p,a,b,c)
363 #define IDirectPlay8LobbiedApplication_Close(p,a) (p)->lpVtbl->Close(p,a)
364 #define IDirectPlay8LobbiedApplication_GetConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetConnectionSettings(p,a,b,c,d)
365 #define IDirectPlay8LobbiedApplication_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
366
367 #else /* C++ */
368
369 #define IDirectPlay8LobbyClient_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
370 #define IDirectPlay8LobbyClient_AddRef(p) (p)->AddRef()
371 #define IDirectPlay8LobbyClient_Release(p) (p)->Release()
372 #define IDirectPlay8LobbyClient_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
373 #define IDirectPlay8LobbyClient_EnumLocalPrograms(p,a,b,c,d,e) (p)->EnumLocalPrograms(a,b,c,d,e)
374 #define IDirectPlay8LobbyClient_ConnectApplication(p,a,b,c,d,e) (p)->ConnectApplication(a,b,c,d,e)
375 #define IDirectPlay8LobbyClient_Send(p,a,b,c,d) (p)->Send(a,b,c,d)
376 #define IDirectPlay8LobbyClient_ReleaseApplication(p,a,b) (p)->ReleaseApplication(a,b)
377 #define IDirectPlay8LobbyClient_Close(p,a) (p)->Close(a)
378 #define IDirectPlay8LobbyClient_GetConnectionSettings(p,a,b,c,d) (p)->GetConnectionSettings(a,b,c,d)
379 #define IDirectPlay8LobbyClient_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c)
380
381 #define IDirectPlay8LobbiedApplication_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
382 #define IDirectPlay8LobbiedApplication_AddRef(p) (p)->AddRef()
383 #define IDirectPlay8LobbiedApplication_Release(p) (p)->Release()
384 #define IDirectPlay8LobbiedApplication_Initialize(p,a,b,c,d) (p)->Initialize(a,b,c,d)
385 #define IDirectPlay8LobbiedApplication_RegisterProgram(p,a,b) (p)->RegisterProgram(a,b)
386 #define IDirectPlay8LobbiedApplication_UnRegisterProgram(p,a,b) (p)->UnRegisterProgram(a,b)
387 #define IDirectPlay8LobbiedApplication_Send(p,a,b,c,d) (p)->Send(a,b,c,d)
388 #define IDirectPlay8LobbiedApplication_SetAppAvailable(p,a,b) (p)->SetAppAvailable(a,b)
389 #define IDirectPlay8LobbiedApplication_UpdateStatus(p,a,b,c) (p)->UpdateStatus(a,b,c)
390 #define IDirectPlay8LobbiedApplication_Close(p,a) (p)->Close(a)
391 #define IDirectPlay8LobbiedApplication_GetConnectionSettings(p,a,b,c,d) (p)->GetConnectionSettings(a,b,c,d)
392 #define IDirectPlay8LobbiedApplication_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c)
393
394 #endif
395
396 #ifdef __cplusplus
397 }
398 #endif
399
400 #endif // __DPLOBBY_H__
401

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26