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.

305 lines
9.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. // File: HNetBcon.idl
  7. //
  8. // Contents: This interface definition contains objects to query ICS Beaconing Service
  9. //
  10. // History: 09-JUL-00 RGatta - created file
  11. //
  12. //--------------------------------------------------------------------------
  13. cpp_quote("//+--------------------------------------------------------------------------")
  14. cpp_quote("//")
  15. cpp_quote("// Microsoft Windows")
  16. cpp_quote("// Copyright (c) Microsoft Corporation. All rights reserved.")
  17. cpp_quote("//")
  18. cpp_quote("//---------------------------------------------------------------------------")
  19. // This file will be processed by the MIDL tool to
  20. // produce the type library (HomeNetBeaconObjects.tlb) and marshalling code.
  21. #ifndef DO_NO_IMPORTS
  22. import "unknwn.idl";
  23. import "wtypes.idl";
  24. #endif
  25. cpp_quote("")
  26. cpp_quote("EXTERN_C const CLSID CLSID_InternetConnectionBeaconService;")
  27. // Reserved GUIDS for our use
  28. //
  29. //04df6137-5610-11d4-9ec8-00b0d022dd1f IID_IInternetConnectionDevice
  30. //04df6138-5610-11d4-9ec8-00b0d022dd1f IID_IInternetConnectionDeviceSharedConnection
  31. //04df6139-5610-11d4-9ec8-00b0d022dd1f IID_IInternetConnectionDeviceClient
  32. //04df613a-5610-11d4-9ec8-00b0d022dd1f CLSID_InternetConnectionBeaconService
  33. //...
  34. //04df6199-5610-11d4-9ec8-00b0d022dd1f
  35. //04df619a-5610-11d4-9ec8-00b0d022dd1f
  36. interface IInternetConnectionDevice;
  37. interface IInternetConnectionDeviceSharedConnection;
  38. interface IInternetConnectionDeviceClient;
  39. //===========================================================================
  40. //
  41. // USAGE NOTES:
  42. //
  43. // The two interfaces (IInternetConnectionDevice and
  44. // IInternetConnectionDeviceSharedConnection) defined below are designed
  45. // primarily for querying the ICS Device state. Since this implies in a query
  46. // and response behaviour, the caller may be blocked till a reply is received.
  47. // For this reason, such functions have been written to be used in BLOCKING
  48. // and NON-BLOCKING modes. The last parameter in each of these query
  49. // functions is a boolean value which if TRUE means block else dont block.
  50. //
  51. // (Also note that the control functions are ALL blocking calls - no option
  52. // is provided here for non-blocking.)
  53. //
  54. // SEMANTICS:
  55. //
  56. // + Blocking Mode : This would mean that the component would do a fresh
  57. // query for the required information and return the
  58. // most uptodate information. The maximum delay for a
  59. // blocking call would be 9 seconds.
  60. //
  61. // + Non-Blocking Mode : This would mean that the component would return
  62. // the latest cached information in its information
  63. // store.
  64. //
  65. // Default Mode is Blocking Mode (TRUE) which means a fresh query each time.
  66. //
  67. //
  68. // SPECIFIC FUNCTION NOTES:
  69. //
  70. // GetICSDeviceNameInfo : the MachineName that is returned by the ICS Device
  71. // depends on the naming conventions used by the ICS Device. If the
  72. // ICS Device is NT based, then the name returned will be the
  73. // NetBIOS name (assuming NetBIOS is enabled).
  74. //
  75. // GetICSDeviceOSVersion : the OSVersion (ICS_OS_VER) field tells us the kind
  76. // of OS we are receiving the beacon from. Special processing is done
  77. // for a Windows Millenium (WINME_OS) beacon. Default values will be
  78. // returned in such a case. The use of such a beacon is deprecated.
  79. //
  80. //===========================================================================
  81. //===========================================================================
  82. //
  83. // IInternetConnectionDevice Interface
  84. //
  85. // The IInternetConnectionDevice interface is used to query state of the
  86. // ICS Host Beaconing Device
  87. //
  88. //
  89. // [Member functions]
  90. //
  91. // IsICSDeviceAvailable - returns the presence of ICS Beacon Device
  92. // on the (private) connected network.
  93. //
  94. // GetICSDeviceNameInfo - returns info on the machine hosting the
  95. // ICS shared connection.
  96. //
  97. // GetICSDeviceSystemTime - returns the system time on the machine hosting
  98. // the ICS shared connection as a FILETIME.
  99. //
  100. // GetICSDeviceOSVersion - returns OS version info on the machine hosting
  101. // the ICS shared connection.
  102. //
  103. [
  104. object,
  105. uuid(04df6137-5610-11d4-9ec8-00b0d022dd1f),
  106. helpstring("HomeNet ICS Beacon Device info"),
  107. pointer_default(unique)
  108. ]
  109. interface IInternetConnectionDevice : IUnknown
  110. {
  111. HRESULT
  112. IsICSDeviceAvailable(
  113. [in] BOOL fBlock
  114. );
  115. HRESULT
  116. GetICSDeviceNameInfo(
  117. [out, string] LPOLESTR *ppszMachineName,
  118. [out, string] LPOLESTR *ppszDomainName,
  119. [out, string] LPOLESTR *ppszSharedAdapterName,
  120. [in] BOOL fBlock
  121. );
  122. HRESULT
  123. GetICSDeviceSystemTime(
  124. [out] FILETIME *pTime,
  125. [in] BOOL fBlock
  126. );
  127. //
  128. // The ICS_OSVER is meant to help identifying which kind of beacon we are
  129. // receiving. A WINME beacon calls for special exception handling since
  130. // its use is deprecated.
  131. //
  132. typedef [v1_enum] enum tagICS_OS_VER
  133. {
  134. WINDOWS_OS = 1, // beacon sent by versions of Windows before WinME (none)
  135. WINME_OS = 2, // beacon sent by WinME (deprecated unsupported version)
  136. WINNT_OS = 3, // beacon sent by versions of NT (prime supported version)
  137. OTHER_OS = 4, // beacon sent by none of the above && non NT based OSes
  138. UNK_OS = 5 // beacon sent by unknown OS
  139. } ICS_OS_VER;
  140. HRESULT
  141. GetICSDeviceOSVersion(
  142. [out] ICS_OS_VER *pOSVersion,
  143. [out] DWORD *pdwOSMajorVersion,
  144. [out] DWORD *pdwOSMinorVersion,
  145. [out] DWORD *pdwOSBuildNumber,
  146. [out, string] LPOLESTR *ppszOSName,
  147. [out, string] LPOLESTR *ppszPlatformName,
  148. [in] BOOL fBlock
  149. );
  150. }
  151. //===========================================================================
  152. //
  153. // IInternetConnectionDeviceSharedConnection Interface
  154. //
  155. // The IInternetConnectionDeviceSharedConnection interface is used to query
  156. // state of the shared (single public) connection
  157. //
  158. //
  159. // [Member functions]
  160. //
  161. // Connect - If the public interface is a LAN connection,
  162. // it is enabled
  163. // If the public interface is a RAS connection,
  164. // it is dialed
  165. //
  166. // Disconnect - If the public interface is a LAN connection,
  167. // it is disabled
  168. // If the public interface is a RAS connection,
  169. // it is disconnected
  170. //
  171. // GetDialState - returns the current state of the shared connection
  172. //
  173. // GetConnectionInfo - returns the bytes & packets, sent & received on the
  174. // shared connection as well duration (in secs) connection
  175. // has been up
  176. //
  177. // GetConnectionSpeed - returns the connection speed of the
  178. // shared connection
  179. //
  180. // GetConnectionType - returns the type of the shared connection
  181. //
  182. [
  183. object,
  184. uuid(04df6138-5610-11d4-9ec8-00b0d022dd1f),
  185. helpstring("HomeNet ICS Beacon Device's shared connection"),
  186. pointer_default(unique)
  187. ]
  188. interface IInternetConnectionDeviceSharedConnection : IUnknown
  189. {
  190. HRESULT
  191. Connect(
  192. );
  193. HRESULT
  194. Disconnect(
  195. );
  196. typedef [v1_enum] enum tagICS_CONN_DIAL_STATE
  197. {
  198. STARTING = 1,
  199. CONNECTING = 2,
  200. CONNECTED = 3,
  201. DISCONNECTING = 4,
  202. DISCONNECTED = 5,
  203. STOPPED = 6,
  204. PERMANENT = 7,
  205. UNK_DIAL_STATE = 8,
  206. CALLWAITING = 9
  207. } ICS_CONN_DIAL_STATE;
  208. HRESULT
  209. GetDialState(
  210. [out] ICS_CONN_DIAL_STATE *pDialState,
  211. [in] BOOL fBlock
  212. );
  213. HRESULT
  214. GetConnectionInfo(
  215. [out] ULONGLONG *pBytesSent,
  216. [out] ULONGLONG *pBytesRecv,
  217. [out] ULONGLONG *pPktsSent,
  218. [out] ULONGLONG *pPktsRecv,
  219. [out] ULONGLONG *pUptime,
  220. [in] BOOL fBlock
  221. );
  222. HRESULT
  223. GetConnectionSpeed(
  224. [out] DWORD *pdwBps,
  225. [in] BOOL fBlock
  226. );
  227. typedef [v1_enum] enum tagICS_CONN_TYPE
  228. {
  229. LAN = 1,
  230. RAS = 2,
  231. UNK_CONN_TYPE = 3
  232. } ICS_CONN_TYPE;
  233. HRESULT
  234. GetConnectionType(
  235. [out] ICS_CONN_TYPE *pConnectionType,
  236. [in] BOOL fBlock
  237. );
  238. };
  239. //===========================================================================
  240. //
  241. // IInternetConnectionDeviceClient Interface
  242. //
  243. // The IInternetConnectionDeviceClient interface is used to query
  244. // the local client which listens to the ICS Device.
  245. //
  246. //
  247. // [Member functions]
  248. //
  249. // GetAdapterGuid - returns the guid of the adapter on which the local
  250. // client is listening for the beacon packets
  251. //
  252. [
  253. object,
  254. uuid(04df6139-5610-11d4-9ec8-00b0d022dd1f),
  255. helpstring("HomeNet ICS Beacon Device's Local Client"),
  256. pointer_default(unique)
  257. ]
  258. interface IInternetConnectionDeviceClient : IUnknown
  259. {
  260. HRESULT
  261. GetAdapterGuid(
  262. [out] GUID **ppGuid
  263. );
  264. };