Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

769 lines
26 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dplobby.h
  6. * Content: DirectPlayLobby include file
  7. ***************************************************************************/
  8. #ifndef __DPLOBBY_INCLUDED__
  9. #define __DPLOBBY_INCLUDED__
  10. #include "dplay.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif /* __cplusplus */
  14. /*
  15. * GUIDS used by DirectPlay objects
  16. */
  17. /* {AF465C71-9588-11cf-A020-00AA006157AC} */
  18. DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
  19. /* {26C66A70-B367-11cf-A024-00AA006157AC} */
  20. DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
  21. /* {0194C220-A303-11d0-9C4F-00A0C905425E} */
  22. DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  23. /* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */
  24. DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  25. /* {2DB72490-652C-11d1-A7A8-0000F803ABFC} */
  26. DEFINE_GUID(IID_IDirectPlayLobby3, 0x2db72490, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  27. /* {2DB72491-652C-11d1-A7A8-0000F803ABFC} */
  28. DEFINE_GUID(IID_IDirectPlayLobby3A, 0x2db72491, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  29. /* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */
  30. DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  31. /****************************************************************************
  32. *
  33. * IDirectPlayLobby Structures
  34. *
  35. * Various structures used to invoke DirectPlayLobby.
  36. *
  37. ****************************************************************************/
  38. typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBY;
  39. typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBYA;
  40. typedef struct IDirectPlayLobby IDirectPlayLobbyA;
  41. typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2;
  42. typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2A;
  43. typedef struct IDirectPlayLobby2 IDirectPlayLobby2A;
  44. typedef struct IDirectPlayLobby3 FAR *LPDIRECTPLAYLOBBY3;
  45. typedef struct IDirectPlayLobby3 FAR *LPDIRECTPLAYLOBBY3A;
  46. typedef struct IDirectPlayLobby3 IDirectPlayLobby3A;
  47. /*
  48. * DPLAPPINFO
  49. * Used to hold information about a registered DirectPlay
  50. * application
  51. */
  52. typedef struct DPLAPPINFO
  53. {
  54. DWORD dwSize; // Size of this structure
  55. GUID guidApplication; // GUID of the Application
  56. union
  57. {
  58. LPSTR lpszAppNameA; // Pointer to the Application Name
  59. LPWSTR lpszAppName;
  60. };
  61. } DPLAPPINFO, FAR *LPDPLAPPINFO;
  62. /*
  63. * LPCDPLAPPINFO
  64. * A constant pointer to DPLAPPINFO
  65. */
  66. typedef const DPLAPPINFO FAR *LPCDPLAPPINFO;
  67. /*
  68. * DPCOMPOUNDADDRESSELEMENT
  69. *
  70. * An array of these is passed to CreateCompoundAddresses()
  71. */
  72. typedef struct DPCOMPOUNDADDRESSELEMENT
  73. {
  74. GUID guidDataType;
  75. DWORD dwDataSize;
  76. LPVOID lpData;
  77. } DPCOMPOUNDADDRESSELEMENT, FAR *LPDPCOMPOUNDADDRESSELEMENT;
  78. /*
  79. * LPCDPCOMPOUNDADDRESSELEMENT
  80. * A constant pointer to DPCOMPOUNDADDRESSELEMENT
  81. */
  82. typedef const DPCOMPOUNDADDRESSELEMENT FAR *LPCDPCOMPOUNDADDRESSELEMENT;
  83. /*
  84. * LPDPAPPLICATIONDESC
  85. * Used to register a DirectPlay application
  86. */
  87. typedef struct DPAPPLICATIONDESC
  88. {
  89. DWORD dwSize;
  90. DWORD dwFlags;
  91. union
  92. {
  93. LPSTR lpszApplicationNameA;
  94. LPWSTR lpszApplicationName;
  95. };
  96. GUID guidApplication;
  97. union
  98. {
  99. LPSTR lpszFilenameA;
  100. LPWSTR lpszFilename;
  101. };
  102. union
  103. {
  104. LPSTR lpszCommandLineA;
  105. LPWSTR lpszCommandLine;
  106. };
  107. union
  108. {
  109. LPSTR lpszPathA;
  110. LPWSTR lpszPath;
  111. };
  112. union
  113. {
  114. LPSTR lpszCurrentDirectoryA;
  115. LPWSTR lpszCurrentDirectory;
  116. };
  117. LPSTR lpszDescriptionA;
  118. LPWSTR lpszDescriptionW;
  119. } DPAPPLICATIONDESC, *LPDPAPPLICATIONDESC;
  120. /****************************************************************************
  121. *
  122. * Enumeration Method Callback Prototypes
  123. *
  124. ****************************************************************************/
  125. /*
  126. * Callback for EnumAddress()
  127. */
  128. typedef BOOL (FAR PASCAL *LPDPENUMADDRESSCALLBACK)(
  129. REFGUID guidDataType,
  130. DWORD dwDataSize,
  131. LPCVOID lpData,
  132. LPVOID lpContext);
  133. /*
  134. * Callback for EnumAddressTypes()
  135. */
  136. typedef BOOL (FAR PASCAL *LPDPLENUMADDRESSTYPESCALLBACK)(
  137. REFGUID guidDataType,
  138. LPVOID lpContext,
  139. DWORD dwFlags);
  140. /*
  141. * Callback for EnumLocalApplications()
  142. */
  143. typedef BOOL (FAR PASCAL * LPDPLENUMLOCALAPPLICATIONSCALLBACK)(
  144. LPCDPLAPPINFO lpAppInfo,
  145. LPVOID lpContext,
  146. DWORD dwFlags);
  147. /****************************************************************************
  148. *
  149. * DirectPlayLobby API Prototypes
  150. *
  151. ****************************************************************************/
  152. #ifdef UNICODE
  153. #define DirectPlayLobbyCreate DirectPlayLobbyCreateW
  154. #else
  155. #define DirectPlayLobbyCreate DirectPlayLobbyCreateA
  156. #endif /* UNICODE */
  157. extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
  158. extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD );
  159. /****************************************************************************
  160. *
  161. * IDirectPlayLobby (and IDirectPlayLobbyA) Interface
  162. *
  163. ****************************************************************************/
  164. #undef INTERFACE
  165. #define INTERFACE IDirectPlayLobby
  166. DECLARE_INTERFACE_( IDirectPlayLobby, IUnknown )
  167. {
  168. /* IUnknown Methods */
  169. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  170. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  171. STDMETHOD_(ULONG,Release) (THIS) PURE;
  172. /* IDirectPlayLobby Methods */
  173. STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
  174. STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
  175. STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
  176. STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
  177. STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
  178. STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
  179. STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
  180. STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
  181. STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
  182. STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
  183. STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
  184. };
  185. /****************************************************************************
  186. *
  187. * IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface
  188. *
  189. ****************************************************************************/
  190. #undef INTERFACE
  191. #define INTERFACE IDirectPlayLobby2
  192. DECLARE_INTERFACE_( IDirectPlayLobby2, IDirectPlayLobby )
  193. {
  194. /* IUnknown Methods */
  195. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  196. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  197. STDMETHOD_(ULONG,Release) (THIS) PURE;
  198. /* IDirectPlayLobby Methods */
  199. STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
  200. STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
  201. STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
  202. STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
  203. STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
  204. STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
  205. STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
  206. STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
  207. STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
  208. STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
  209. STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
  210. /* IDirectPlayLobby2 Methods */
  211. STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
  212. };
  213. /****************************************************************************
  214. *
  215. * IDirectPlayLobby3 (and IDirectPlayLobby3A) Interface
  216. *
  217. ****************************************************************************/
  218. #undef INTERFACE
  219. #define INTERFACE IDirectPlayLobby3
  220. DECLARE_INTERFACE_( IDirectPlayLobby3, IDirectPlayLobby )
  221. {
  222. /* IUnknown Methods */
  223. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  224. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  225. STDMETHOD_(ULONG,Release) (THIS) PURE;
  226. /* IDirectPlayLobby Methods */
  227. STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
  228. STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
  229. STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
  230. STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
  231. STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
  232. STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
  233. STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
  234. STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
  235. STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
  236. STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
  237. STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
  238. /* IDirectPlayLobby2 Methods */
  239. STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
  240. /* IDirectPlayLobby3 Methods */
  241. STDMETHOD(ConnectEx) (THIS_ DWORD, REFIID, LPVOID *, IUnknown FAR *) PURE;
  242. STDMETHOD(RegisterApplication) (THIS_ DWORD, LPDPAPPLICATIONDESC) PURE;
  243. STDMETHOD(UnregisterApplication)(THIS_ DWORD, REFGUID) PURE;
  244. STDMETHOD(WaitForConnectionSettings)(THIS_ DWORD) PURE;
  245. };
  246. /****************************************************************************
  247. *
  248. * IDirectPlayLobby interface macros
  249. *
  250. ****************************************************************************/
  251. #if !defined(__cplusplus) || defined(CINTERFACE)
  252. #define IDirectPlayLobby_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  253. #define IDirectPlayLobby_AddRef(p) (p)->lpVtbl->AddRef(p)
  254. #define IDirectPlayLobby_Release(p) (p)->lpVtbl->Release(p)
  255. #define IDirectPlayLobby_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c)
  256. #define IDirectPlayLobby_ConnectEx(p,a,b,c,d) (p)->lpVtbl->ConnectEx(p,a,b,c,d)
  257. #define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f)
  258. #define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
  259. #define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d)
  260. #define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->lpVtbl->EnumAddressTypes(p,a,b,c,d)
  261. #define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->lpVtbl->EnumLocalApplications(p,a,b,c)
  262. #define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->lpVtbl->GetConnectionSettings(p,a,b,c)
  263. #define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->lpVtbl->ReceiveLobbyMessage(p,a,b,c,d,e)
  264. #define IDirectPlayLobby_RegisterApplication(p,a,b) (p)->lpVtbl->RegisterApplication(p,a,b)
  265. #define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->lpVtbl->RunApplication(p,a,b,c,d)
  266. #define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->lpVtbl->SendLobbyMessage(p,a,b,c,d)
  267. #define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
  268. #define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->lpVtbl->SetLobbyMessageEvent(p,a,b,c)
  269. #define IDirectPlayLobby_UnregisterApplication(p,a,b) (p)->lpVtbl->UnregisterApplication(p,a,b)
  270. #define IDirectPlayLobby_WaitForConnectionSettings(p,a) (p)->lpVtbl->WaitForConnectionSettings(p,a)
  271. #else /* C++ */
  272. #define IDirectPlayLobby_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  273. #define IDirectPlayLobby_AddRef(p) (p)->AddRef()
  274. #define IDirectPlayLobby_Release(p) (p)->Release()
  275. #define IDirectPlayLobby_Connect(p,a,b,c) (p)->Connect(a,b,c)
  276. #define IDirectPlayLobby_ConnectEx(p,a,b,c,d) (p)->ConnectEx(a,b,c,d)
  277. #define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->CreateAddress(a,b,c,d,e,f)
  278. #define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->CreateCompoundAddress(a,b,c,d)
  279. #define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->EnumAddress(a,b,c,d)
  280. #define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->EnumAddressTypes(a,b,c,d)
  281. #define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->EnumLocalApplications(a,b,c)
  282. #define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->GetConnectionSettings(a,b,c)
  283. #define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->ReceiveLobbyMessage(a,b,c,d,e)
  284. #define IDirectPlayLobby_RegisterApplication(p,a,b) (p)->RegisterApplication(a,b)
  285. #define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->RunApplication(a,b,c,d)
  286. #define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->SendLobbyMessage(a,b,c,d)
  287. #define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c)
  288. #define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->SetLobbyMessageEvent(a,b,c)
  289. #define IDirectPlayLobby_UnregisterApplication(p,a,b) (p)->UnregisterApplication(a,b)
  290. #define IDirectPlayLobby_WaitForConnectionSettings(p,a) (p)->WaitForConnectionSettings(a)
  291. #endif
  292. /****************************************************************************
  293. *
  294. * DirectPlayLobby Flags
  295. *
  296. ****************************************************************************/
  297. /*
  298. * This flag is used by IDirectPlayLobby->WaitForConnectionSettings to
  299. * cancel a current wait that is in progress.
  300. */
  301. #define DPLWAIT_CANCEL 0x00000001
  302. /*
  303. * This is a message flag used by ReceiveLobbyMessage. It can be
  304. * returned in the dwMessageFlags parameter to indicate a message from
  305. * the system.
  306. */
  307. #define DPLMSG_SYSTEM 0x00000001
  308. /*
  309. * This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage.
  310. * It is used to indicate that the message is a standard lobby message.
  311. * DPLMSG_SETPROPERTY, DPLMSG_SETPROPERTYRESPONSE, DPLMSG_GETPROPERTY,
  312. * DPLMSG_GETPROPERTYRESPONSE
  313. */
  314. #define DPLMSG_STANDARD 0x00000002
  315. /****************************************************************************
  316. *
  317. * DirectPlayLobby messages and message data structures
  318. *
  319. * All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned
  320. * from a call to ReceiveLobbyMessage.
  321. *
  322. * All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned
  323. * from a call to ReceiveLobbyMessage.
  324. *
  325. ****************************************************************************/
  326. /*
  327. * DPLMSG_GENERIC
  328. * Generic message structure used to identify the message type.
  329. */
  330. typedef struct _DPLMSG_GENERIC
  331. {
  332. DWORD dwType; // Message type
  333. } DPLMSG_GENERIC, FAR *LPDPLMSG_GENERIC;
  334. /*
  335. * DPLMSG_SYSTEMMESSAGE
  336. * Generic message format for all system messages --
  337. * DPLSYS_CONNECTIONSETTINGSREAD, DPLSYS_DPLYCONNECTSUCCEEDED,
  338. * DPLSYS_DPLAYCONNECTFAILED, DPLSYS_APPTERMINATED, DPLSYS_NEWCONNECTIONSETTINGS
  339. */
  340. typedef struct _DPLMSG_SYSTEMMESSAGE
  341. {
  342. DWORD dwType; // Message type
  343. GUID guidInstance; // Instance GUID of the dplay session the message corresponds to
  344. } DPLMSG_SYSTEMMESSAGE, FAR *LPDPLMSG_SYSTEMMESSAGE;
  345. /*
  346. * DPLMSG_SETPROPERTY
  347. * Standard message sent by an application to a lobby to set a
  348. * property
  349. */
  350. typedef struct _DPLMSG_SETPROPERTY
  351. {
  352. DWORD dwType; // Message type
  353. DWORD dwRequestID; // Request ID (DPL_NOCONFIRMATION if no confirmation desired)
  354. GUID guidPlayer; // Player GUID
  355. GUID guidPropertyTag; // Property GUID
  356. DWORD dwDataSize; // Size of data
  357. DWORD dwPropertyData[1]; // Buffer containing data
  358. } DPLMSG_SETPROPERTY, FAR *LPDPLMSG_SETPROPERTY;
  359. #define DPL_NOCONFIRMATION 0
  360. /*
  361. * DPLMSG_SETPROPERTYRESPONSE
  362. * Standard message returned by a lobby to confirm a
  363. * DPLMSG_SETPROPERTY message.
  364. */
  365. typedef struct _DPLMSG_SETPROPERTYRESPONSE
  366. {
  367. DWORD dwType; // Message type
  368. DWORD dwRequestID; // Request ID
  369. GUID guidPlayer; // Player GUID
  370. GUID guidPropertyTag; // Property GUID
  371. HRESULT hr; // Return Code
  372. } DPLMSG_SETPROPERTYRESPONSE, FAR *LPDPLMSG_SETPROPERTYRESPONSE;
  373. /*
  374. * DPLMSG_GETPROPERTY
  375. * Standard message sent by an application to a lobby to request
  376. * the current value of a property
  377. */
  378. typedef struct _DPLMSG_GETPROPERTY
  379. {
  380. DWORD dwType; // Message type
  381. DWORD dwRequestID; // Request ID
  382. GUID guidPlayer; // Player GUID
  383. GUID guidPropertyTag; // Property GUID
  384. } DPLMSG_GETPROPERTY, FAR *LPDPLMSG_GETPROPERTY;
  385. /*
  386. * DPLMSG_GETPROPERTYRESPONSE
  387. * Standard message returned by a lobby in response to a
  388. * DPLMSG_GETPROPERTY message.
  389. */
  390. typedef struct _DPLMSG_GETPROPERTYRESPONSE
  391. {
  392. DWORD dwType; // Message type
  393. DWORD dwRequestID; // Request ID
  394. GUID guidPlayer; // Player GUID
  395. GUID guidPropertyTag; // Property GUID
  396. HRESULT hr; // Return Code
  397. DWORD dwDataSize; // Size of data
  398. DWORD dwPropertyData[1]; // Buffer containing data
  399. } DPLMSG_GETPROPERTYRESPONSE, FAR *LPDPLMSG_GETPROPERTYRESPONSE;
  400. /*
  401. * DPLMSG_NEWSESSIONHOST
  402. * Standard message returned by a lobby in response to a
  403. * the session host migrating to a new client
  404. */
  405. typedef struct _DPLMSG_NEWSESSIONHOST
  406. {
  407. DWORD dwType; // Message type
  408. GUID guidInstance; // GUID Instance of the session
  409. } DPLMSG_NEWSESSIONHOST, FAR *LPDPLMSG_NEWSESSIONHOST;
  410. /******************************************
  411. *
  412. * DirectPlay Lobby message dwType values
  413. *
  414. *****************************************/
  415. /*
  416. * The application has read the connection settings.
  417. * It is now O.K. for the lobby client to release
  418. * its IDirectPlayLobby interface.
  419. */
  420. #define DPLSYS_CONNECTIONSETTINGSREAD 0x00000001
  421. /*
  422. * The application's call to DirectPlayConnect failed
  423. */
  424. #define DPLSYS_DPLAYCONNECTFAILED 0x00000002
  425. /*
  426. * The application has created a DirectPlay session.
  427. */
  428. #define DPLSYS_DPLAYCONNECTSUCCEEDED 0x00000003
  429. /*
  430. * The application has terminated.
  431. */
  432. #define DPLSYS_APPTERMINATED 0x00000004
  433. /*
  434. * The message is a DPLMSG_SETPROPERTY message.
  435. */
  436. #define DPLSYS_SETPROPERTY 0x00000005
  437. /*
  438. * The message is a DPLMSG_SETPROPERTYRESPONSE message.
  439. */
  440. #define DPLSYS_SETPROPERTYRESPONSE 0x00000006
  441. /*
  442. * The message is a DPLMSG_GETPROPERTY message.
  443. */
  444. #define DPLSYS_GETPROPERTY 0x00000007
  445. /*
  446. * The message is a DPLMSG_GETPROPERTYRESPONSE message.
  447. */
  448. #define DPLSYS_GETPROPERTYRESPONSE 0x00000008
  449. /*
  450. * The message is a DPLMSG_NEWSESSIONHOST message.
  451. */
  452. #define DPLSYS_NEWSESSIONHOST 0x00000009
  453. /*
  454. * New connection settings are available.
  455. */
  456. #define DPLSYS_NEWCONNECTIONSETTINGS 0x0000000A
  457. /****************************************************************************
  458. *
  459. * DirectPlay defined property GUIDs and associated data structures
  460. *
  461. ****************************************************************************/
  462. /*
  463. * DPLPROPERTY_MessagesSupported
  464. *
  465. * Request whether the lobby supports standard. Lobby with respond with either
  466. * TRUE or FALSE or may not respond at all.
  467. *
  468. * Property data is a single BOOL with TRUE or FALSE
  469. */
  470. // {762CCDA1-D916-11d0-BA39-00C04FD7ED67}
  471. DEFINE_GUID(DPLPROPERTY_MessagesSupported,
  472. 0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
  473. /*
  474. * DPLPROPERTY_LobbyGuid
  475. *
  476. * Request the GUID that identifies the lobby software that the application
  477. * is communicating with.
  478. *
  479. * Property data is a single GUID.
  480. */
  481. // {F56920A0-D218-11d0-BA39-00C04FD7ED67}
  482. DEFINE_GUID(DPLPROPERTY_LobbyGuid,
  483. 0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
  484. /*
  485. * DPLPROPERTY_PlayerGuid
  486. *
  487. * Request the GUID that identifies the player on this machine for sending
  488. * property data back to the lobby.
  489. *
  490. * Property data is the DPLDATA_PLAYERDATA structure
  491. */
  492. // {B4319322-D20D-11d0-BA39-00C04FD7ED67}
  493. DEFINE_GUID(DPLPROPERTY_PlayerGuid,
  494. 0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
  495. /*
  496. * DPLDATA_PLAYERGUID
  497. *
  498. * Data structure to hold the GUID of the player and player creation flags
  499. * from the lobby.
  500. */
  501. typedef struct _DPLDATA_PLAYERGUID
  502. {
  503. GUID guidPlayer;
  504. DWORD dwPlayerFlags;
  505. } DPLDATA_PLAYERGUID, FAR *LPDPLDATA_PLAYERGUID;
  506. /*
  507. * DPLPROPERTY_PlayerScore
  508. *
  509. * Used to send an array of long integers to the lobby indicating the
  510. * score of a player.
  511. *
  512. * Property data is the DPLDATA_PLAYERSCORE structure.
  513. */
  514. // {48784000-D219-11d0-BA39-00C04FD7ED67}
  515. DEFINE_GUID(DPLPROPERTY_PlayerScore,
  516. 0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
  517. /*
  518. * DPLDATA_PLAYERSCORE
  519. *
  520. * Data structure to hold an array of long integers representing a player score.
  521. * Application must allocate enough memory to hold all the scores.
  522. */
  523. typedef struct _DPLDATA_PLAYERSCORE
  524. {
  525. DWORD dwScoreCount;
  526. LONG Score[1];
  527. } DPLDATA_PLAYERSCORE, FAR *LPDPLDATA_PLAYERSCORE;
  528. /****************************************************************************
  529. *
  530. * DirectPlay Address ID's
  531. *
  532. ****************************************************************************/
  533. /* DirectPlay Address
  534. *
  535. * A DirectPlay address consists of multiple chunks of data, each tagged
  536. * with a GUID signifying the type of data in the chunk. The chunk also
  537. * has a length so that unknown chunk types can be skipped.
  538. *
  539. * The EnumAddress() function is used to parse these address data chunks.
  540. */
  541. /*
  542. * DPADDRESS
  543. *
  544. * Header for block of address data elements
  545. */
  546. typedef struct _DPADDRESS
  547. {
  548. GUID guidDataType;
  549. DWORD dwDataSize;
  550. } DPADDRESS;
  551. typedef DPADDRESS FAR *LPDPADDRESS;
  552. /*
  553. * DPAID_TotalSize
  554. *
  555. * Chunk is a DWORD containing size of entire DPADDRESS structure
  556. */
  557. // {1318F560-912C-11d0-9DAA-00A0C90A43CB}
  558. DEFINE_GUID(DPAID_TotalSize,
  559. 0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
  560. /*
  561. * DPAID_ServiceProvider
  562. *
  563. * Chunk is a GUID describing the service provider that created the chunk.
  564. * All addresses must contain this chunk.
  565. */
  566. // {07D916C0-E0AF-11cf-9C4E-00A0C905425E}
  567. DEFINE_GUID(DPAID_ServiceProvider,
  568. 0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  569. /*
  570. * DPAID_LobbyProvider
  571. *
  572. * Chunk is a GUID describing the lobby provider that created the chunk.
  573. * All addresses must contain this chunk.
  574. */
  575. // {59B95640-9667-11d0-A77D-0000F803ABFC}
  576. DEFINE_GUID(DPAID_LobbyProvider,
  577. 0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
  578. /*
  579. * DPAID_Phone and DPAID_PhoneW
  580. *
  581. * Chunk is a string containing a phone number (i.e. "1-800-555-1212")
  582. * in ANSI or UNICODE format
  583. */
  584. // {78EC89A0-E0AF-11cf-9C4E-00A0C905425E}
  585. DEFINE_GUID(DPAID_Phone,
  586. 0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  587. // {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E}
  588. DEFINE_GUID(DPAID_PhoneW,
  589. 0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  590. /*
  591. * DPAID_Modem and DPAID_ModemW
  592. *
  593. * Chunk is a string containing a modem name registered with TAPI
  594. * in ANSI or UNICODE format
  595. */
  596. // {F6DCC200-A2FE-11d0-9C4F-00A0C905425E}
  597. DEFINE_GUID(DPAID_Modem,
  598. 0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  599. // {01FD92E0-A2FF-11d0-9C4F-00A0C905425E}
  600. DEFINE_GUID(DPAID_ModemW,
  601. 0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  602. /*
  603. * DPAID_Inet and DPAID_InetW
  604. *
  605. * Chunk is a string containing a TCP/IP host name or an IP address
  606. * (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format
  607. */
  608. // {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E}
  609. DEFINE_GUID(DPAID_INet,
  610. 0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  611. // {E63232A0-9DBF-11d0-9CC1-00A0C905425E}
  612. DEFINE_GUID(DPAID_INetW,
  613. 0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  614. /*
  615. * DPAID_InetPort
  616. *
  617. * Chunk is the port number used for creating the apps TCP and UDP sockets.
  618. * WORD value (i.e. 47624)
  619. */
  620. // {E4524541-8EA5-11d1-8A96-006097B01411}
  621. DEFINE_GUID(DPAID_INetPort,
  622. 0xe4524541, 0x8ea5, 0x11d1, 0x8a, 0x96, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
  623. /*
  624. * DPCOMPORTADDRESS
  625. *
  626. * Used to specify com port settings. The constants that define baud rate,
  627. * stop bits and parity are defined in WINBASE.H. The constants for flow
  628. * control are given below.
  629. */
  630. #define DPCPA_NOFLOW 0 // no flow control
  631. #define DPCPA_XONXOFFFLOW 1 // software flow control
  632. #define DPCPA_RTSFLOW 2 // hardware flow control with RTS
  633. #define DPCPA_DTRFLOW 3 // hardware flow control with DTR
  634. #define DPCPA_RTSDTRFLOW 4 // hardware flow control with RTS and DTR
  635. typedef struct _DPCOMPORTADDRESS
  636. {
  637. DWORD dwComPort; // COM port to use (1-4)
  638. DWORD dwBaudRate; // baud rate (100-256k)
  639. DWORD dwStopBits; // no. stop bits (1-2)
  640. DWORD dwParity; // parity (none, odd, even, mark)
  641. DWORD dwFlowControl; // flow control (none, xon/xoff, rts, dtr)
  642. } DPCOMPORTADDRESS;
  643. typedef DPCOMPORTADDRESS FAR *LPDPCOMPORTADDRESS;
  644. /*
  645. * DPAID_ComPort
  646. *
  647. * Chunk contains a DPCOMPORTADDRESS structure defining the serial port.
  648. */
  649. // {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E}
  650. DEFINE_GUID(DPAID_ComPort,
  651. 0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
  652. /****************************************************************************
  653. *
  654. * dplobby 1.0 obsolete definitions
  655. * Included for compatibility only.
  656. *
  657. ****************************************************************************/
  658. #define DPLAD_SYSTEM DPLMSG_SYSTEM
  659. #ifdef __cplusplus
  660. };
  661. #endif /* __cplusplus */
  662. #endif /* __DPLOBBY_INCLUDED__ */