Counter Strike : Global Offensive Source Code
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.

392 lines
16 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 2000-2002 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dpaddr.h
  6. * Content: DirectPlayAddress include file
  7. ***************************************************************************/
  8. #ifndef __DIRECTPLAYADDRESS__
  9. #define __DIRECTPLAYADDRESS__
  10. #include <ole2.h> // for DECLARE_INTERFACE_ and HRESULT
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #include "dplay8.h"
  15. /****************************************************************************
  16. *
  17. * DirectPlay8Address CLSIDs
  18. *
  19. ****************************************************************************/
  20. // {934A9523-A3CA-4bc5-ADA0-D6D95D979421}
  21. DEFINE_GUID(CLSID_DirectPlay8Address,
  22. 0x934a9523, 0xa3ca, 0x4bc5, 0xad, 0xa0, 0xd6, 0xd9, 0x5d, 0x97, 0x94, 0x21);
  23. /****************************************************************************
  24. *
  25. * DirectPlay8Address Interface IIDs
  26. *
  27. ****************************************************************************/
  28. typedef REFIID DPNAREFIID;
  29. // {83783300-4063-4c8a-9DB3-82830A7FEB31}
  30. DEFINE_GUID(IID_IDirectPlay8Address,
  31. 0x83783300, 0x4063, 0x4c8a, 0x9d, 0xb3, 0x82, 0x83, 0xa, 0x7f, 0xeb, 0x31);
  32. // {E5A0E990-2BAD-430b-87DA-A142CF75DE58}
  33. DEFINE_GUID(IID_IDirectPlay8AddressIP,
  34. 0xe5a0e990, 0x2bad, 0x430b, 0x87, 0xda, 0xa1, 0x42, 0xcf, 0x75, 0xde, 0x58);
  35. /****************************************************************************
  36. *
  37. * DirectPlay8Address Interface Pointer definitions
  38. *
  39. ****************************************************************************/
  40. typedef struct IDirectPlay8Address *PDIRECTPLAY8ADDRESS, *LPDIRECTPLAY8ADDRESS;
  41. typedef struct IDirectPlay8AddressIP *PDIRECTPLAY8ADDRESSIP, *LPDIRECTPLAY8ADDRESSIP;
  42. /****************************************************************************
  43. *
  44. * DirectPlay8Address Forward Declarations For External Types
  45. *
  46. ****************************************************************************/
  47. typedef struct sockaddr SOCKADDR;
  48. /****************************************************************************
  49. *
  50. * DirectPlay8Address Constants
  51. *
  52. ****************************************************************************/
  53. //
  54. // Asynchronous operation flags
  55. //
  56. #define DPNA_DATATYPE_STRING 0x00000001
  57. #define DPNA_DATATYPE_DWORD 0x00000002
  58. #define DPNA_DATATYPE_GUID 0x00000003
  59. #define DPNA_DATATYPE_BINARY 0x00000004
  60. #define DPNA_DATATYPE_STRING_ANSI 0x00000005
  61. #define DPNA_DPNSVR_PORT 6073
  62. #define DPNA_INDEX_INVALID 0xFFFFFFFF
  63. /****************************************************************************
  64. *
  65. * DirectPlay8Address Address Elements
  66. *
  67. ****************************************************************************/
  68. #define DPNA_SEPARATOR_KEYVALUE L'='
  69. #define DPNA_SEPARATOR_USERDATA L'#'
  70. #define DPNA_SEPARATOR_COMPONENT L';'
  71. #define DPNA_ESCAPECHAR L'%'
  72. // Header
  73. #define DPNA_HEADER L"x-directplay:/"
  74. // key names for address components
  75. #define DPNA_KEY_NAT_RESOLVER L"natresolver"
  76. #define DPNA_KEY_NAT_RESOLVER_USER_STRING L"natresolveruserstring"
  77. #define DPNA_KEY_APPLICATION_INSTANCE L"applicationinstance"
  78. #define DPNA_KEY_DEVICE L"device"
  79. #define DPNA_KEY_HOSTNAME L"hostname"
  80. #define DPNA_KEY_PORT L"port"
  81. #define DPNA_KEY_NAMEINFO L"nameinfo"
  82. #define DPNA_KEY_PROCESSOR L"processor"
  83. #define DPNA_KEY_PROGRAM L"program"
  84. #define DPNA_KEY_PROVIDER L"provider"
  85. #define DPNA_KEY_SCOPE L"scope"
  86. #define DPNA_KEY_TRAVERSALMODE L"traversalmode"
  87. #define DPNA_KEY_BAUD L"baud"
  88. #define DPNA_KEY_FLOWCONTROL L"flowcontrol"
  89. #define DPNA_KEY_PARITY L"parity"
  90. #define DPNA_KEY_PHONENUMBER L"phonenumber"
  91. #define DPNA_KEY_STOPBITS L"stopbits"
  92. // values for baud rate
  93. #define DPNA_BAUD_RATE_9600 9600
  94. #define DPNA_BAUD_RATE_14400 14400
  95. #define DPNA_BAUD_RATE_19200 19200
  96. #define DPNA_BAUD_RATE_38400 38400
  97. #define DPNA_BAUD_RATE_56000 56000
  98. #define DPNA_BAUD_RATE_57600 57600
  99. #define DPNA_BAUD_RATE_115200 115200
  100. // values for stop bits
  101. #define DPNA_STOP_BITS_ONE L"1"
  102. #define DPNA_STOP_BITS_ONE_FIVE L"1.5"
  103. #define DPNA_STOP_BITS_TWO L"2"
  104. // values for parity
  105. #define DPNA_PARITY_NONE L"NONE"
  106. #define DPNA_PARITY_EVEN L"EVEN"
  107. #define DPNA_PARITY_ODD L"ODD"
  108. #define DPNA_PARITY_MARK L"MARK"
  109. #define DPNA_PARITY_SPACE L"SPACE"
  110. // values for flow control
  111. #define DPNA_FLOW_CONTROL_NONE L"NONE"
  112. #define DPNA_FLOW_CONTROL_XONXOFF L"XONXOFF"
  113. #define DPNA_FLOW_CONTROL_RTS L"RTS"
  114. #define DPNA_FLOW_CONTROL_DTR L"DTR"
  115. #define DPNA_FLOW_CONTROL_RTSDTR L"RTSDTR"
  116. // values for traversal mode
  117. #define DPNA_TRAVERSALMODE_NONE 0
  118. #define DPNA_TRAVERSALMODE_PORTREQUIRED 1
  119. #define DPNA_TRAVERSALMODE_PORTRECOMMENDED 2
  120. // Shortcut values
  121. //
  122. // These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
  123. //
  124. #define DPNA_VALUE_TCPIPPROVIDER L"IP"
  125. #define DPNA_VALUE_IPXPROVIDER L"IPX"
  126. #define DPNA_VALUE_MODEMPROVIDER L"MODEM"
  127. #define DPNA_VALUE_SERIALPROVIDER L"SERIAL"
  128. //// ANSI DEFINITIONS
  129. // Header
  130. #define DPNA_HEADER_A "x-directplay:/"
  131. #define DPNA_SEPARATOR_KEYVALUE_A '='
  132. #define DPNA_SEPARATOR_USERDATA_A '#'
  133. #define DPNA_SEPARATOR_COMPONENT_A ';'
  134. #define DPNA_ESCAPECHAR_A '%'
  135. // key names for address components
  136. #define DPNA_KEY_NAT_RESOLVER_A "natresolver"
  137. #define DPNA_KEY_NAT_RESOLVER_USER_STRING_A "natresolveruserstring"
  138. #define DPNA_KEY_APPLICATION_INSTANCE_A "applicationinstance"
  139. #define DPNA_KEY_DEVICE_A "device"
  140. #define DPNA_KEY_HOSTNAME_A "hostname"
  141. #define DPNA_KEY_PORT_A "port"
  142. #define DPNA_KEY_NAMEINFO_A "nameinfo"
  143. #define DPNA_KEY_PROCESSOR_A "processor"
  144. #define DPNA_KEY_PROGRAM_A "program"
  145. #define DPNA_KEY_PROVIDER_A "provider"
  146. #define DPNA_KEY_SCOPE_A "scope"
  147. #define DPNA_KEY_TRAVERSALMODE_A "traversalmode"
  148. #define DPNA_KEY_BAUD_A "baud"
  149. #define DPNA_KEY_FLOWCONTROL_A "flowcontrol"
  150. #define DPNA_KEY_PARITY_A "parity"
  151. #define DPNA_KEY_PHONENUMBER_A "phonenumber"
  152. #define DPNA_KEY_STOPBITS_A "stopbits"
  153. // values for stop bits
  154. #define DPNA_STOP_BITS_ONE_A "1"
  155. #define DPNA_STOP_BITS_ONE_FIVE_A "1.5"
  156. #define DPNA_STOP_BITS_TWO_A "2"
  157. // values for parity
  158. #define DPNA_PARITY_NONE_A "NONE"
  159. #define DPNA_PARITY_EVEN_A "EVEN"
  160. #define DPNA_PARITY_ODD_A "ODD"
  161. #define DPNA_PARITY_MARK_A "MARK"
  162. #define DPNA_PARITY_SPACE_A "SPACE"
  163. // values for flow control
  164. #define DPNA_FLOW_CONTROL_NONE_A "NONE"
  165. #define DPNA_FLOW_CONTROL_XONXOFF_A "XONXOFF"
  166. #define DPNA_FLOW_CONTROL_RTS_A "RTS"
  167. #define DPNA_FLOW_CONTROL_DTR_A "DTR"
  168. #define DPNA_FLOW_CONTROL_RTSDTR_A "RTSDTR"
  169. // Shortcut values
  170. //
  171. // These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
  172. //
  173. #define DPNA_VALUE_TCPIPPROVIDER_A "IP"
  174. #define DPNA_VALUE_IPXPROVIDER_A "IPX"
  175. #define DPNA_VALUE_MODEMPROVIDER_A "MODEM"
  176. #define DPNA_VALUE_SERIALPROVIDER_A "SERIAL"
  177. /****************************************************************************
  178. *
  179. * DirectPlay8Address Functions
  180. *
  181. ****************************************************************************/
  182. /*
  183. *
  184. * This function is no longer supported. It is recommended that CoCreateInstance be used to create
  185. * DirectPlay8 address objects.
  186. *
  187. * HRESULT WINAPI DirectPlay8AddressCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  188. *
  189. */
  190. /****************************************************************************
  191. *
  192. * DirectPlay8Address Application Interfaces
  193. *
  194. ****************************************************************************/
  195. //
  196. // COM definition for IDirectPlay8Address Generic Interface
  197. //
  198. #undef INTERFACE // External COM Implementation
  199. #define INTERFACE IDirectPlay8Address
  200. DECLARE_INTERFACE_(IDirectPlay8Address,IUnknown)
  201. {
  202. /*** IUnknown methods ***/
  203. STDMETHOD(QueryInterface) (THIS_ DPNAREFIID, LPVOID *) PURE;
  204. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  205. STDMETHOD_(ULONG,Release) (THIS) PURE;
  206. /*** IDirectPlay8Address methods ***/
  207. STDMETHOD(BuildFromURLW)(THIS_ WCHAR *pwszSourceURL ) PURE;
  208. STDMETHOD(BuildFromURLA)(THIS_ CHAR *pszSourceURL ) PURE;
  209. STDMETHOD(Duplicate)(THIS_ PDIRECTPLAY8ADDRESS *ppdpaNewAddress ) PURE;
  210. STDMETHOD(SetEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE;
  211. STDMETHOD(IsEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE;
  212. STDMETHOD(Clear)(THIS ) PURE;
  213. STDMETHOD(GetURLW)(THIS_ WCHAR *pwszURL, PDWORD pdwNumChars ) PURE;
  214. STDMETHOD(GetURLA)(THIS_ CHAR *pszURL, PDWORD pdwNumChars) PURE;
  215. STDMETHOD(GetSP)(THIS_ GUID *pguidSP ) PURE;
  216. STDMETHOD(GetUserData)(THIS_ void *pvUserData, PDWORD pdwBufferSize) PURE;
  217. STDMETHOD(SetSP)(THIS_ const GUID * const pguidSP ) PURE;
  218. STDMETHOD(SetUserData)(THIS_ const void * const pvUserData, const DWORD dwDataSize) PURE;
  219. STDMETHOD(GetNumComponents)(THIS_ PDWORD pdwNumComponents ) PURE;
  220. STDMETHOD(GetComponentByName)(THIS_ const WCHAR * const pwszName, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE;
  221. STDMETHOD(GetComponentByIndex)(THIS_ const DWORD dwComponentID, WCHAR * pwszName, PDWORD pdwNameLen, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE;
  222. STDMETHOD(AddComponent)(THIS_ const WCHAR * const pwszName, const void * const lpvData, const DWORD dwDataSize, const DWORD dwDataType ) PURE;
  223. STDMETHOD(GetDevice)(THIS_ GUID * ) PURE;
  224. STDMETHOD(SetDevice)(THIS_ const GUID * const) PURE;
  225. STDMETHOD(BuildFromDPADDRESS)( THIS_ LPVOID pvAddress, DWORD dwDataSize ) PURE;
  226. };
  227. //
  228. // COM definition for IDirectPlay8AddressIP Generic Interface
  229. //
  230. #undef INTERFACE // External COM Implementation
  231. #define INTERFACE IDirectPlay8AddressIP
  232. DECLARE_INTERFACE_(IDirectPlay8AddressIP,IUnknown)
  233. {
  234. /*** IUnknown methods ***/
  235. STDMETHOD(QueryInterface) (THIS_ DPNAREFIID, PVOID *) PURE;
  236. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  237. STDMETHOD_(ULONG,Release) (THIS) PURE;
  238. /*** IDirectPlay8AddressIP methods ***/
  239. // Constructs a IDirectPlay8 TCP Address from a SOCKADDR structure
  240. STDMETHOD(BuildFromSockAddr)(THIS_ const SOCKADDR * const ) PURE;
  241. // Constructs a TCP Address from a string (hostname) and port
  242. STDMETHOD(BuildAddress)(THIS_ const WCHAR * const wszAddress, const USHORT usPort ) PURE;
  243. // Builds a local TCP Address
  244. STDMETHOD(BuildLocalAddress)(THIS_ const GUID * const pguidAdapter, const USHORT usPort ) PURE;
  245. // Gets the address from the structure in SOCKADR format
  246. STDMETHOD(GetSockAddress)(THIS_ SOCKADDR *, PDWORD ) PURE;
  247. // Gets the local afddress
  248. STDMETHOD(GetLocalAddress)(THIS_ GUID *pguidAdapter, USHORT *pusPort ) PURE;
  249. // Gets the remote address
  250. STDMETHOD(GetAddress)(THIS_ WCHAR *wszAddress, PDWORD pdwAddressLength, USHORT *psPort ) PURE;
  251. };
  252. /****************************************************************************
  253. *
  254. * IDirectPlay8 application interface macros
  255. *
  256. ****************************************************************************/
  257. #if !defined(__cplusplus) || defined(CINTERFACE)
  258. #define IDirectPlay8Address_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  259. #define IDirectPlay8Address_AddRef(p) (p)->lpVtbl->AddRef(p)
  260. #define IDirectPlay8Address_Release(p) (p)->lpVtbl->Release(p)
  261. #define IDirectPlay8Address_BuildFromURLW(p,a) (p)->lpVtbl->BuildFromURLW(p,a)
  262. #define IDirectPlay8Address_BuildFromURLA(p,a) (p)->lpVtbl->BuildFromURLA(p,a)
  263. #define IDirectPlay8Address_Duplicate(p,a) (p)->lpVtbl->Duplicate(p,a)
  264. #define IDirectPlay8Address_SetEqual(p,a) (p)->lpVtbl->SetEqual(p,a)
  265. #define IDirectPlay8Address_IsEqual(p,a) (p)->lpVtbl->IsEqual(p,a)
  266. #define IDirectPlay8Address_Clear(p) (p)->lpVtbl->Clear(p)
  267. #define IDirectPlay8Address_GetURLW(p,a,b) (p)->lpVtbl->GetURLW(p,a,b)
  268. #define IDirectPlay8Address_GetURLA(p,a,b) (p)->lpVtbl->GetURLA(p,a,b)
  269. #define IDirectPlay8Address_GetSP(p,a) (p)->lpVtbl->GetSP(p,a)
  270. #define IDirectPlay8Address_GetUserData(p,a,b) (p)->lpVtbl->GetUserData(p,a,b)
  271. #define IDirectPlay8Address_SetSP(p,a) (p)->lpVtbl->SetSP(p,a)
  272. #define IDirectPlay8Address_SetUserData(p,a,b) (p)->lpVtbl->SetUserData(p,a,b)
  273. #define IDirectPlay8Address_GetNumComponents(p,a) (p)->lpVtbl->GetNumComponents(p,a)
  274. #define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->lpVtbl->GetComponentByName(p,a,b,c,d)
  275. #define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->lpVtbl->GetComponentByIndex(p,a,b,c,d,e,f)
  276. #define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->lpVtbl->AddComponent(p,a,b,c,d)
  277. #define IDirectPlay8Address_SetDevice(p,a) (p)->lpVtbl->SetDevice(p,a)
  278. #define IDirectPlay8Address_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
  279. #define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->lpVtbl->BuildFromDirectPlay4Address(p,a,b)
  280. #define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  281. #define IDirectPlay8AddressIP_AddRef(p) (p)->lpVtbl->AddRef(p)
  282. #define IDirectPlay8AddressIP_Release(p) (p)->lpVtbl->Release(p)
  283. #define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->lpVtbl->BuildFromSockAddr(p,a)
  284. #define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->lpVtbl->BuildAddress(p,a,b)
  285. #define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->lpVtbl->BuildLocalAddress(p,a,b)
  286. #define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->lpVtbl->GetSockAddress(p,a,b)
  287. #define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->lpVtbl->GetLocalAddress(p,a,b)
  288. #define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->lpVtbl->GetAddress(p,a,b,c)
  289. #else /* C++ */
  290. #define IDirectPlay8Address_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  291. #define IDirectPlay8Address_AddRef(p) (p)->AddRef()
  292. #define IDirectPlay8Address_Release(p) (p)->Release()
  293. #define IDirectPlay8Address_BuildFromURLW(p,a) (p)->BuildFromURLW(a)
  294. #define IDirectPlay8Address_BuildFromURLA(p,a) (p)->BuildFromURLA(a)
  295. #define IDirectPlay8Address_Duplicate(p,a) (p)->Duplicate(a)
  296. #define IDirectPlay8Address_SetEqual(p,a) (p)->SetEqual(a)
  297. #define IDirectPlay8Address_IsEqual(p,a) (p)->IsEqual(a)
  298. #define IDirectPlay8Address_Clear(p) (p)->Clear()
  299. #define IDirectPlay8Address_GetURLW(p,a,b) (p)->GetURLW(a,b)
  300. #define IDirectPlay8Address_GetURLA(p,a,b) (p)->GetURLA(a,b)
  301. #define IDirectPlay8Address_GetSP(p,a) (p)->GetSP(a)
  302. #define IDirectPlay8Address_GetUserData(p,a,b) (p)->GetUserData(a,b)
  303. #define IDirectPlay8Address_SetSP(p,a) (p)->SetSP(a)
  304. #define IDirectPlay8Address_SetUserData(p,a,b) (p)->SetUserData(a,b)
  305. #define IDirectPlay8Address_GetNumComponents(p,a) (p)->GetNumComponents(a)
  306. #define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->GetComponentByName(a,b,c,d)
  307. #define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->GetComponentByIndex(a,b,c,d,e,f)
  308. #define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->AddComponent(a,b,c,d)
  309. #define IDirectPlay8Address_SetDevice(p,a) (p)->SetDevice(a)
  310. #define IDirectPlay8Address_GetDevice(p,a) (p)->GetDevice(a)
  311. #define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->BuildFromDirectPlay4Address(a,b)
  312. #define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  313. #define IDirectPlay8AddressIP_AddRef(p) (p)->AddRef()
  314. #define IDirectPlay8AddressIP_Release(p) (p)->Release()
  315. #define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->BuildFromSockAddr(a)
  316. #define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->BuildAddress(a,b)
  317. #define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->BuildLocalAddress(a,b)
  318. #define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->GetSockAddress(a,b)
  319. #define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->GetLocalAddress(a,b)
  320. #define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->GetAddress(a,b,c)
  321. #endif
  322. #ifdef __cplusplus
  323. }
  324. #endif
  325. #endif