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.

386 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_APPLICATION_INSTANCE L"applicationinstance"
  76. #define DPNA_KEY_DEVICE L"device"
  77. #define DPNA_KEY_HOSTNAME L"hostname"
  78. #define DPNA_KEY_PORT L"port"
  79. #define DPNA_KEY_PROCESSOR L"processor"
  80. #define DPNA_KEY_PROGRAM L"program"
  81. #define DPNA_KEY_PROVIDER L"provider"
  82. #define DPNA_KEY_SCOPE L"scope"
  83. #define DPNA_KEY_TRAVERSALMODE L"traversalmode"
  84. #define DPNA_KEY_BAUD L"baud"
  85. #define DPNA_KEY_FLOWCONTROL L"flowcontrol"
  86. #define DPNA_KEY_PARITY L"parity"
  87. #define DPNA_KEY_PHONENUMBER L"phonenumber"
  88. #define DPNA_KEY_STOPBITS L"stopbits"
  89. // values for baud rate
  90. #define DPNA_BAUD_RATE_9600 9600
  91. #define DPNA_BAUD_RATE_14400 14400
  92. #define DPNA_BAUD_RATE_19200 19200
  93. #define DPNA_BAUD_RATE_38400 38400
  94. #define DPNA_BAUD_RATE_56000 56000
  95. #define DPNA_BAUD_RATE_57600 57600
  96. #define DPNA_BAUD_RATE_115200 115200
  97. // values for stop bits
  98. #define DPNA_STOP_BITS_ONE L"1"
  99. #define DPNA_STOP_BITS_ONE_FIVE L"1.5"
  100. #define DPNA_STOP_BITS_TWO L"2"
  101. // values for parity
  102. #define DPNA_PARITY_NONE L"NONE"
  103. #define DPNA_PARITY_EVEN L"EVEN"
  104. #define DPNA_PARITY_ODD L"ODD"
  105. #define DPNA_PARITY_MARK L"MARK"
  106. #define DPNA_PARITY_SPACE L"SPACE"
  107. // values for flow control
  108. #define DPNA_FLOW_CONTROL_NONE L"NONE"
  109. #define DPNA_FLOW_CONTROL_XONXOFF L"XONXOFF"
  110. #define DPNA_FLOW_CONTROL_RTS L"RTS"
  111. #define DPNA_FLOW_CONTROL_DTR L"DTR"
  112. #define DPNA_FLOW_CONTROL_RTSDTR L"RTSDTR"
  113. // values for traversal mode
  114. #define DPNA_TRAVERSALMODE_NONE 0
  115. #define DPNA_TRAVERSALMODE_PORTREQUIRED 1
  116. #define DPNA_TRAVERSALMODE_PORTRECOMMENDED 2
  117. // Shortcut values
  118. //
  119. // These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
  120. //
  121. #define DPNA_VALUE_TCPIPPROVIDER L"IP"
  122. #define DPNA_VALUE_IPXPROVIDER L"IPX"
  123. #define DPNA_VALUE_MODEMPROVIDER L"MODEM"
  124. #define DPNA_VALUE_SERIALPROVIDER L"SERIAL"
  125. //// ANSI DEFINITIONS
  126. // Header
  127. #define DPNA_HEADER_A "x-directplay:/"
  128. #define DPNA_SEPARATOR_KEYVALUE_A '='
  129. #define DPNA_SEPARATOR_USERDATA_A '#'
  130. #define DPNA_SEPARATOR_COMPONENT_A ';'
  131. #define DPNA_ESCAPECHAR_A '%'
  132. // key names for address components
  133. #define DPNA_KEY_APPLICATION_INSTANCE_A "applicationinstance"
  134. #define DPNA_KEY_DEVICE_A "device"
  135. #define DPNA_KEY_HOSTNAME_A "hostname"
  136. #define DPNA_KEY_PORT_A "port"
  137. #define DPNA_KEY_PROCESSOR_A "processor"
  138. #define DPNA_KEY_PROGRAM_A "program"
  139. #define DPNA_KEY_PROVIDER_A "provider"
  140. #define DPNA_KEY_SCOPE_A "scope"
  141. #define DPNA_KEY_TRAVERSALMODE_A "traversalmode"
  142. #define DPNA_KEY_BAUD_A "baud"
  143. #define DPNA_KEY_FLOWCONTROL_A "flowcontrol"
  144. #define DPNA_KEY_PARITY_A "parity"
  145. #define DPNA_KEY_PHONENUMBER_A "phonenumber"
  146. #define DPNA_KEY_STOPBITS_A "stopbits"
  147. // values for stop bits
  148. #define DPNA_STOP_BITS_ONE_A "1"
  149. #define DPNA_STOP_BITS_ONE_FIVE_A "1.5"
  150. #define DPNA_STOP_BITS_TWO_A "2"
  151. // values for parity
  152. #define DPNA_PARITY_NONE_A "NONE"
  153. #define DPNA_PARITY_EVEN_A "EVEN"
  154. #define DPNA_PARITY_ODD_A "ODD"
  155. #define DPNA_PARITY_MARK_A "MARK"
  156. #define DPNA_PARITY_SPACE_A "SPACE"
  157. // values for flow control
  158. #define DPNA_FLOW_CONTROL_NONE_A "NONE"
  159. #define DPNA_FLOW_CONTROL_XONXOFF_A "XONXOFF"
  160. #define DPNA_FLOW_CONTROL_RTS_A "RTS"
  161. #define DPNA_FLOW_CONTROL_DTR_A "DTR"
  162. #define DPNA_FLOW_CONTROL_RTSDTR_A "RTSDTR"
  163. // Shortcut values
  164. //
  165. // These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
  166. //
  167. #define DPNA_VALUE_TCPIPPROVIDER_A "IP"
  168. #define DPNA_VALUE_IPXPROVIDER_A "IPX"
  169. #define DPNA_VALUE_MODEMPROVIDER_A "MODEM"
  170. #define DPNA_VALUE_SERIALPROVIDER_A "SERIAL"
  171. /****************************************************************************
  172. *
  173. * DirectPlay8Address Functions
  174. *
  175. ****************************************************************************/
  176. /*
  177. *
  178. * This function is no longer supported. It is recommended that CoCreateInstance be used to create
  179. * DirectPlay8 address objects.
  180. *
  181. * HRESULT WINAPI DirectPlay8AddressCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  182. *
  183. */
  184. /****************************************************************************
  185. *
  186. * DirectPlay8Address Application Interfaces
  187. *
  188. ****************************************************************************/
  189. //
  190. // COM definition for IDirectPlay8Address Generic Interface
  191. //
  192. #undef INTERFACE // External COM Implementation
  193. #define INTERFACE IDirectPlay8Address
  194. DECLARE_INTERFACE_(IDirectPlay8Address,IUnknown)
  195. {
  196. /*** IUnknown methods ***/
  197. STDMETHOD(QueryInterface) (THIS_ DPNAREFIID, LPVOID *) PURE;
  198. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  199. STDMETHOD_(ULONG,Release) (THIS) PURE;
  200. /*** IDirectPlay8Address methods ***/
  201. STDMETHOD(BuildFromURLW)(THIS_ WCHAR *pwszSourceURL ) PURE;
  202. STDMETHOD(BuildFromURLA)(THIS_ CHAR *pszSourceURL ) PURE;
  203. STDMETHOD(Duplicate)(THIS_ PDIRECTPLAY8ADDRESS *ppdpaNewAddress ) PURE;
  204. STDMETHOD(SetEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE;
  205. STDMETHOD(IsEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE;
  206. STDMETHOD(Clear)(THIS ) PURE;
  207. STDMETHOD(GetURLW)(THIS_ WCHAR *pwszURL, PDWORD pdwNumChars ) PURE;
  208. STDMETHOD(GetURLA)(THIS_ CHAR *pszURL, PDWORD pdwNumChars) PURE;
  209. STDMETHOD(GetSP)(THIS_ GUID *pguidSP ) PURE;
  210. STDMETHOD(GetUserData)(THIS_ void *pvUserData, PDWORD pdwBufferSize) PURE;
  211. STDMETHOD(SetSP)(THIS_ const GUID * const pguidSP ) PURE;
  212. STDMETHOD(SetUserData)(THIS_ const void * const pvUserData, const DWORD dwDataSize) PURE;
  213. STDMETHOD(GetNumComponents)(THIS_ PDWORD pdwNumComponents ) PURE;
  214. STDMETHOD(GetComponentByName)(THIS_ const WCHAR * const pwszName, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE;
  215. STDMETHOD(GetComponentByIndex)(THIS_ const DWORD dwComponentID, WCHAR * pwszName, PDWORD pdwNameLen, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE;
  216. STDMETHOD(AddComponent)(THIS_ const WCHAR * const pwszName, const void * const lpvData, const DWORD dwDataSize, const DWORD dwDataType ) PURE;
  217. STDMETHOD(GetDevice)(THIS_ GUID * ) PURE;
  218. STDMETHOD(SetDevice)(THIS_ const GUID * const) PURE;
  219. STDMETHOD(BuildFromDPADDRESS)( THIS_ LPVOID pvAddress, DWORD dwDataSize ) PURE;
  220. };
  221. //
  222. // COM definition for IDirectPlay8AddressIP Generic Interface
  223. //
  224. #undef INTERFACE // External COM Implementation
  225. #define INTERFACE IDirectPlay8AddressIP
  226. DECLARE_INTERFACE_(IDirectPlay8AddressIP,IUnknown)
  227. {
  228. /*** IUnknown methods ***/
  229. STDMETHOD(QueryInterface) (THIS_ DPNAREFIID, PVOID *) PURE;
  230. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  231. STDMETHOD_(ULONG,Release) (THIS) PURE;
  232. /*** IDirectPlay8AddressIP methods ***/
  233. // Constructs a IDirectPlay8 TCP Address from a SOCKADDR structure
  234. STDMETHOD(BuildFromSockAddr)(THIS_ const SOCKADDR * const ) PURE;
  235. // Constructs a TCP Address from a string (hostname) and port
  236. STDMETHOD(BuildAddress)(THIS_ const WCHAR * const wszAddress, const USHORT usPort ) PURE;
  237. // Builds a local TCP Address
  238. STDMETHOD(BuildLocalAddress)(THIS_ const GUID * const pguidAdapter, const USHORT usPort ) PURE;
  239. // Gets the address from the structure in SOCKADR format
  240. STDMETHOD(GetSockAddress)(THIS_ SOCKADDR *, PDWORD ) PURE;
  241. // Gets the local afddress
  242. STDMETHOD(GetLocalAddress)(THIS_ GUID *pguidAdapter, USHORT *pusPort ) PURE;
  243. // Gets the remote address
  244. STDMETHOD(GetAddress)(THIS_ WCHAR *wszAddress, PDWORD pdwAddressLength, USHORT *psPort ) PURE;
  245. };
  246. /****************************************************************************
  247. *
  248. * IDirectPlay8 application interface macros
  249. *
  250. ****************************************************************************/
  251. #if !defined(__cplusplus) || defined(CINTERFACE)
  252. #define IDirectPlay8Address_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  253. #define IDirectPlay8Address_AddRef(p) (p)->lpVtbl->AddRef(p)
  254. #define IDirectPlay8Address_Release(p) (p)->lpVtbl->Release(p)
  255. #define IDirectPlay8Address_BuildFromURLW(p,a) (p)->lpVtbl->BuildFromURLW(p,a)
  256. #define IDirectPlay8Address_BuildFromURLA(p,a) (p)->lpVtbl->BuildFromURLA(p,a)
  257. #define IDirectPlay8Address_Duplicate(p,a) (p)->lpVtbl->Duplicate(p,a)
  258. #define IDirectPlay8Address_SetEqual(p,a) (p)->lpVtbl->SetEqual(p,a)
  259. #define IDirectPlay8Address_IsEqual(p,a) (p)->lpVtbl->IsEqual(p,a)
  260. #define IDirectPlay8Address_Clear(p) (p)->lpVtbl->Clear(p)
  261. #define IDirectPlay8Address_GetURLW(p,a,b) (p)->lpVtbl->GetURLW(p,a,b)
  262. #define IDirectPlay8Address_GetURLA(p,a,b) (p)->lpVtbl->GetURLA(p,a,b)
  263. #define IDirectPlay8Address_GetSP(p,a) (p)->lpVtbl->GetSP(p,a)
  264. #define IDirectPlay8Address_GetUserData(p,a,b) (p)->lpVtbl->GetUserData(p,a,b)
  265. #define IDirectPlay8Address_SetSP(p,a) (p)->lpVtbl->SetSP(p,a)
  266. #define IDirectPlay8Address_SetUserData(p,a,b) (p)->lpVtbl->SetUserData(p,a,b)
  267. #define IDirectPlay8Address_GetNumComponents(p,a) (p)->lpVtbl->GetNumComponents(p,a)
  268. #define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->lpVtbl->GetComponentByName(p,a,b,c,d)
  269. #define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->lpVtbl->GetComponentByIndex(p,a,b,c,d,e,f)
  270. #define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->lpVtbl->AddComponent(p,a,b,c,d)
  271. #define IDirectPlay8Address_SetDevice(p,a) (p)->lpVtbl->SetDevice(p,a)
  272. #define IDirectPlay8Address_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
  273. #define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->lpVtbl->BuildFromDirectPlay4Address(p,a,b)
  274. #define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  275. #define IDirectPlay8AddressIP_AddRef(p) (p)->lpVtbl->AddRef(p)
  276. #define IDirectPlay8AddressIP_Release(p) (p)->lpVtbl->Release(p)
  277. #define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->lpVtbl->BuildFromSockAddr(p,a)
  278. #define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->lpVtbl->BuildAddress(p,a,b)
  279. #define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->lpVtbl->BuildLocalAddress(p,a,b)
  280. #define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->lpVtbl->GetSockAddress(p,a,b)
  281. #define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->lpVtbl->GetLocalAddress(p,a,b)
  282. #define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->lpVtbl->GetAddress(p,a,b,c)
  283. #else /* C++ */
  284. #define IDirectPlay8Address_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  285. #define IDirectPlay8Address_AddRef(p) (p)->AddRef()
  286. #define IDirectPlay8Address_Release(p) (p)->Release()
  287. #define IDirectPlay8Address_BuildFromURLW(p,a) (p)->BuildFromURLW(a)
  288. #define IDirectPlay8Address_BuildFromURLA(p,a) (p)->BuildFromURLA(a)
  289. #define IDirectPlay8Address_Duplicate(p,a) (p)->Duplicate(a)
  290. #define IDirectPlay8Address_SetEqual(p,a) (p)->SetEqual(a)
  291. #define IDirectPlay8Address_IsEqual(p,a) (p)->IsEqual(a)
  292. #define IDirectPlay8Address_Clear(p) (p)->Clear()
  293. #define IDirectPlay8Address_GetURLW(p,a,b) (p)->GetURLW(a,b)
  294. #define IDirectPlay8Address_GetURLA(p,a,b) (p)->GetURLA(a,b)
  295. #define IDirectPlay8Address_GetSP(p,a) (p)->GetSP(a)
  296. #define IDirectPlay8Address_GetUserData(p,a,b) (p)->GetUserData(a,b)
  297. #define IDirectPlay8Address_SetSP(p,a) (p)->SetSP(a)
  298. #define IDirectPlay8Address_SetUserData(p,a,b) (p)->SetUserData(a,b)
  299. #define IDirectPlay8Address_GetNumComponents(p,a) (p)->GetNumComponents(a)
  300. #define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->GetComponentByName(a,b,c,d)
  301. #define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->GetComponentByIndex(a,b,c,d,e,f)
  302. #define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->AddComponent(a,b,c,d)
  303. #define IDirectPlay8Address_SetDevice(p,a) (p)->SetDevice(a)
  304. #define IDirectPlay8Address_GetDevice(p,a) (p)->GetDevice(a)
  305. #define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->BuildFromDirectPlay4Address(a,b)
  306. #define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  307. #define IDirectPlay8AddressIP_AddRef(p) (p)->AddRef()
  308. #define IDirectPlay8AddressIP_Release(p) (p)->Release()
  309. #define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->BuildFromSockAddr(a)
  310. #define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->BuildAddress(a,b)
  311. #define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->BuildLocalAddress(a,b)
  312. #define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->GetSockAddress(a,b)
  313. #define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->GetLocalAddress(a,b)
  314. #define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->GetAddress(a,b,c)
  315. #endif
  316. #ifdef __cplusplus
  317. }
  318. #endif
  319. #endif