Leaked source code of windows server 2003
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.

407 lines
19 KiB

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