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.

841 lines
25 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. // File: netcon.idl
  7. //
  8. //----------------------------------------------------------------------------
  9. cpp_quote("//+-------------------------------------------------------------------------")
  10. cpp_quote("//")
  11. cpp_quote("// Microsoft Windows")
  12. cpp_quote("// Copyright (c) Microsoft Corporation. All rights reserved.")
  13. cpp_quote("//")
  14. cpp_quote("//--------------------------------------------------------------------------")
  15. cpp_quote("#if ( _MSC_VER >= 800 )")
  16. cpp_quote("#pragma warning(disable:4201)")
  17. cpp_quote("#endif")
  18. #ifndef DO_NO_IMPORTS
  19. import "oaidl.idl";
  20. import "unknwn.idl";
  21. import "wtypes.idl";
  22. import "prsht.idl";
  23. #endif
  24. cpp_quote("")
  25. cpp_quote("EXTERN_C const CLSID CLSID_ConnectionManager;")
  26. cpp_quote("EXTERN_C const CLSID CLSID_ConnectionCommonUi;")
  27. cpp_quote("EXTERN_C const CLSID CLSID_NetSharingManager;")
  28. cpp_quote("")
  29. cpp_quote("//These strings reference the HKEY_CURRENT_USER registry which")
  30. cpp_quote("//retains whether shortcuts are created on the desktop.")
  31. cpp_quote("#define NETCON_HKEYCURRENTUSERPATH TEXT(\"Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Network\\\\Network Connections\")")
  32. cpp_quote("#define NETCON_DESKTOPSHORTCUT TEXT(\"DesktopShortcut\")")
  33. cpp_quote("#define NETCON_MAX_NAME_LEN 246")
  34. cpp_quote("")
  35. // Reserved GUIDS for our use
  36. //
  37. // C08956A0-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetConnection
  38. // C08956A1-1CD3-11D1-B1C5-00805FC1270E IID_INetConnection
  39. // C08956A2-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionManager
  40. // C08956A3-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionConnectUi
  41. // C08956A4-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionPropertyUi
  42. // C08956A5-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionCommonUi
  43. // C08956A6-1CD3-11D1-B1C5-00805FC1270E IID_INetLanConnectionUiInfo
  44. // ...
  45. // C08956B0-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetSharingPortMapping
  46. // C08956B1-1CD3-11D1-B1C5-00805FC1270E IID_INetSharingPortMapping
  47. // C08956B2-1CD3-11D1-B1C5-00805FC1270E
  48. // C08956B3-1CD3-11D1-B1C5-00805FC1270E
  49. // C08956B4-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetSharingPublicConnection
  50. // C08956B5-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetSharingPrivateConnection
  51. // C08956B6-1CD3-11D1-B1C5-00805FC1270E IID_INetSharingConfiguration
  52. // C08956B7-1CD3-11D1-B1C5-00805FC1270E IID_INetSharingManager
  53. // C08956B8-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetSharingEveryConnection
  54. // C08956B9-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionPropertyUi2
  55. // C08956BA-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionManagerEvents
  56. // ...
  57. // C08956FE-1CD3-11D1-B1C5-00805FC1270E
  58. // C08956FF-1CD3-11D1-B1C5-00805FC1270E
  59. // C0895700-1CD3-11D1-B1C5-00805FC1270E
  60. //
  61. interface IEnumNetConnection;
  62. interface INetConnection;
  63. interface INetConnectionManager;
  64. interface INetConnectionConnectUi;
  65. interface INetConnectionPropertyUi;
  66. interface INetConnectionPropertyUi2;
  67. interface INetConnectionCommonUi;
  68. interface INetLanConnectionUiInfo;
  69. interface INetConnectionManagerEvents;
  70. interface IEnumNetSharingPortMapping;
  71. interface INetSharingPortMapping;
  72. interface IEnumNetSharingPublicConnection;
  73. interface IEnumNetSharingPrivateConnection;
  74. interface IEnumNetSharingEveryConnection;
  75. interface INetSharingConfiguration;
  76. interface INetSharingManager;
  77. //+---------------------------------------------------------------------------
  78. // IEnumNetConnection - An enumerator for INetConnection objects.
  79. //
  80. [
  81. object,
  82. uuid(C08956A0-1CD3-11D1-B1C5-00805FC1270E),
  83. pointer_default(unique)
  84. ]
  85. interface IEnumNetConnection : IUnknown
  86. {
  87. HRESULT Next(
  88. [in] ULONG celt,
  89. [out, size_is(celt), length_is(*pceltFetched)]
  90. INetConnection** rgelt,
  91. [out] ULONG* pceltFetched);
  92. HRESULT Skip(
  93. [in] ULONG celt);
  94. HRESULT Reset();
  95. HRESULT Clone(
  96. [out] IEnumNetConnection** ppenum);
  97. };
  98. //+---------------------------------------------------------------------------
  99. // INetConnection -
  100. //
  101. [
  102. object,
  103. uuid(C08956A1-1CD3-11D1-B1C5-00805FC1270E),
  104. pointer_default(unique)
  105. ]
  106. interface INetConnection : IUnknown
  107. {
  108. typedef enum tagNETCON_CHARACTERISTIC_FLAGS
  109. {
  110. NCCF_NONE = 0x0000, // No special characteristics
  111. NCCF_ALL_USERS = 0x0001, // Connection is available to all users
  112. NCCF_ALLOW_DUPLICATION = 0x0002, // Connection is duplicable
  113. NCCF_ALLOW_REMOVAL = 0x0004, // Connection is removable
  114. NCCF_ALLOW_RENAME = 0x0008, // Connection can be renamed
  115. NCCF_SHOW_ICON = 0x0010, // Shows icon in taskbar when connected
  116. NCCF_INCOMING_ONLY = 0x0020, // Direction is "incoming" only
  117. NCCF_OUTGOING_ONLY = 0x0040, // Direction is "outgoing" only
  118. NCCF_BRANDED = 0x0080, // Icons are branded
  119. NCCF_SHARED = 0x0100, // Connection is shared
  120. NCCF_BRIDGED = 0x0200, // Connection is bridged
  121. NCCF_FIREWALLED = 0x0400, // Connection is firewalled
  122. NCCF_DEFAULT = 0x0800, // This is the default connection
  123. } NETCON_CHARACTERISTIC_FLAGS;
  124. typedef enum tagNETCON_STATUS
  125. {
  126. NCS_DISCONNECTED,
  127. NCS_CONNECTING,
  128. NCS_CONNECTED,
  129. NCS_DISCONNECTING,
  130. NCS_HARDWARE_NOT_PRESENT,
  131. NCS_HARDWARE_DISABLED,
  132. NCS_HARDWARE_MALFUNCTION,
  133. NCS_MEDIA_DISCONNECTED,
  134. NCS_AUTHENTICATING,
  135. NCS_AUTHENTICATION_SUCCEEDED,
  136. NCS_AUTHENTICATION_FAILED,
  137. NCS_INVALID_ADDRESS,
  138. NCS_CREDENTIALS_REQUIRED
  139. } NETCON_STATUS;
  140. typedef enum tagNETCON_TYPE
  141. {
  142. NCT_DIRECT_CONNECT,
  143. NCT_INBOUND,
  144. NCT_INTERNET,
  145. NCT_LAN,
  146. NCT_PHONE,
  147. NCT_TUNNEL,
  148. NCT_BRIDGE,
  149. } NETCON_TYPE;
  150. typedef enum tagNETCON_MEDIATYPE
  151. {
  152. NCM_NONE,
  153. NCM_DIRECT,
  154. NCM_ISDN,
  155. NCM_LAN,
  156. NCM_PHONE,
  157. NCM_TUNNEL,
  158. NCM_PPPOE,
  159. NCM_BRIDGE,
  160. NCM_SHAREDACCESSHOST_LAN,
  161. NCM_SHAREDACCESSHOST_RAS,
  162. } NETCON_MEDIATYPE;
  163. typedef struct tagNETCON_PROPERTIES
  164. {
  165. GUID guidId;
  166. [string] LPWSTR pszwName;
  167. [string] LPWSTR pszwDeviceName;
  168. NETCON_STATUS Status;
  169. NETCON_MEDIATYPE MediaType;
  170. DWORD dwCharacter;
  171. CLSID clsidThisObject;
  172. CLSID clsidUiObject;
  173. } NETCON_PROPERTIES;
  174. HRESULT Connect();
  175. cpp_quote("#define S_OBJECT_NO_LONGER_VALID ((HRESULT)0x00000002L)")
  176. // Disconnect can return S_OBJECT_NO_LONGER_VALID which indicates
  177. // success, but that the object is no longer valid. Clients, when
  178. // getting this error message, should simply release the interface.
  179. //
  180. HRESULT Disconnect();
  181. HRESULT Delete();
  182. HRESULT Duplicate(
  183. [in, string] LPCWSTR pszwDuplicateName,
  184. [out] INetConnection** ppCon);
  185. HRESULT GetProperties(
  186. [out] NETCON_PROPERTIES** ppProps);
  187. HRESULT GetUiObjectClassId(
  188. [out, ref] CLSID* pclsid);
  189. HRESULT Rename(
  190. [in, string] LPCWSTR pszwNewName);
  191. };
  192. cpp_quote("")
  193. cpp_quote("STDAPI_(VOID) NcFreeNetconProperties (NETCON_PROPERTIES* pProps);")
  194. cpp_quote("")
  195. cpp_quote("")
  196. cpp_quote("STDAPI_(BOOL) NcIsValidConnectionName (PCWSTR pszwName);")
  197. cpp_quote("")
  198. //+---------------------------------------------------------------------------
  199. // INetConnectionManager - The top-level object that contains all of the
  200. // INetConnection objects on a machine.
  201. //
  202. // This interface manages INetConnection objects. It provides methods
  203. // to:
  204. // - Enumerate INetConnections
  205. // - Remove an INetConnection
  206. // - Find an INetConnection
  207. //
  208. // Note: Adding a connection is not yet performed programatically through
  209. // the connection manager. Instead, the shell owns creating connection
  210. // objects through a UI interface.
  211. //
  212. [
  213. object,
  214. uuid(C08956A2-1CD3-11D1-B1C5-00805FC1270E),
  215. pointer_default(unique)
  216. ]
  217. interface INetConnectionManager : IUnknown
  218. {
  219. typedef enum tagNETCONMGR_ENUM_FLAGS
  220. {
  221. NCME_DEFAULT = 0x0,
  222. } NETCONMGR_ENUM_FLAGS;
  223. // Return an IEnumNetConnection interface used to enumerate all of
  224. // the contained connection objects.
  225. //
  226. HRESULT EnumConnections(
  227. [in] NETCONMGR_ENUM_FLAGS Flags,
  228. [out] IEnumNetConnection** ppEnum);
  229. };
  230. //+---------------------------------------------------------------------------
  231. // INetConnectionManagerEvents -
  232. //
  233. [
  234. object,
  235. uuid(C08956BA-1CD3-11D1-B1C5-00805FC1270E),
  236. pointer_default(unique)
  237. ]
  238. interface INetConnectionManagerEvents : IUnknown
  239. {
  240. HRESULT RefreshConnections();
  241. HRESULT Enable();
  242. HRESULT Disable(
  243. [in] ULONG ulDisableTimeout);
  244. };
  245. //+---------------------------------------------------------------------------
  246. // INetConnectionConnectUi -
  247. //
  248. [
  249. local,
  250. object,
  251. uuid(C08956A3-1CD3-11D1-B1C5-00805FC1270E),
  252. pointer_default(unique)
  253. ]
  254. interface INetConnectionConnectUi : IUnknown
  255. {
  256. typedef enum tagNETCONUI_CONNECT_FLAGS
  257. {
  258. NCUC_DEFAULT = 0x0000,
  259. NCUC_NO_UI = 0x0001,
  260. } NETCONUI_CONNECT_FLAGS;
  261. HRESULT SetConnection(
  262. [in] INetConnection* pCon);
  263. HRESULT Connect (
  264. [in] HWND hwndParent,
  265. [in] DWORD dwFlags);
  266. HRESULT Disconnect (
  267. [in] HWND hwndParent,
  268. [in] DWORD dwFlags);
  269. };
  270. //+---------------------------------------------------------------------------
  271. // INetConnectionPropertyUi -
  272. //
  273. [
  274. local,
  275. object,
  276. uuid(C08956A4-1CD3-11D1-B1C5-00805FC1270E),
  277. pointer_default(unique)
  278. ]
  279. interface INetConnectionPropertyUi : IUnknown
  280. {
  281. HRESULT SetConnection(
  282. [in] INetConnection* pCon);
  283. HRESULT AddPages (
  284. [in] HWND hwndParent,
  285. [in] LPFNADDPROPSHEETPAGE pfnAddPage,
  286. [in] LPARAM lParam);
  287. };
  288. //+---------------------------------------------------------------------------
  289. // INetConnectionPropertyUi2 -
  290. //
  291. [
  292. local,
  293. object,
  294. uuid(C08956B9-1CD3-11D1-B1C5-00805FC1270E),
  295. pointer_default(unique)
  296. ]
  297. interface INetConnectionPropertyUi2 : INetConnectionPropertyUi
  298. {
  299. HRESULT GetIcon(
  300. [in] DWORD dwSize,
  301. [out] HICON *phIcon);
  302. };
  303. //+---------------------------------------------------------------------------
  304. // INetConnectionCommonUi -
  305. //
  306. [
  307. local,
  308. object,
  309. uuid(C08956A5-1CD3-11D1-B1C5-00805FC1270E),
  310. pointer_default(unique)
  311. ]
  312. interface INetConnectionCommonUi : IUnknown
  313. {
  314. typedef enum tagNETCON_CHOOSEFLAGS
  315. {
  316. NCCHF_CONNECT = 0x0001, // Selected Connection is activated
  317. // and returned. If not set then
  318. // the selected connection interface
  319. // is returned without being activated
  320. NCCHF_CAPTION = 0x0002,
  321. NCCHF_OKBTTNTEXT = 0x0004,
  322. NCCHF_DISABLENEW = 0x0008,
  323. NCCHF_AUTOSELECT = 0x0010, // Automatically Choose or Connect,
  324. // based upon NCCHF_CONNECT if only
  325. // one connection matches the
  326. // dwTypeMask.
  327. } NETCON_CHOOSEFLAGS;
  328. typedef enum tagNETCON_CHOOSETYPE
  329. {
  330. NCCHT_DIRECT_CONNECT = 0x0001,
  331. NCCHT_LAN = 0x0002,
  332. NCCHT_PHONE = 0x0004,
  333. NCCHT_TUNNEL = 0x0008,
  334. NCCHT_ISDN = 0x0010,
  335. NCCHT_ALL = 0x001F
  336. } NETCON_CHOOSETYPE;
  337. typedef struct tagNETCON_CHOOSECONN
  338. {
  339. DWORD lStructSize;
  340. HWND hwndParent;
  341. DWORD dwFlags; // Combine NCCHF_* flags
  342. DWORD dwTypeMask; // Combine NCCHT_* flags
  343. LPCWSTR lpstrCaption;
  344. LPCWSTR lpstrOkBttnText;
  345. } NETCON_CHOOSECONN;
  346. HRESULT ChooseConnection(
  347. [in] NETCON_CHOOSECONN * pChooseConn,
  348. [out] INetConnection** ppCon);
  349. HRESULT ShowConnectionProperties (
  350. [in] HWND hwndParent,
  351. [in] INetConnection* pCon);
  352. HRESULT StartNewConnectionWizard (
  353. [in] HWND hwndParent,
  354. [out] INetConnection** ppCon);
  355. };
  356. //+---------------------------------------------------------------------------
  357. // IEnumNetSharingPortMapping - An enumerator for INetSharingPortMapping objects.
  358. //
  359. [
  360. object,
  361. uuid(C08956B0-1CD3-11D1-B1C5-00805FC1270E),
  362. pointer_default(unique)
  363. ]
  364. interface IEnumNetSharingPortMapping : IUnknown
  365. {
  366. HRESULT Next(
  367. [in] ULONG celt,
  368. [out, size_is(celt), length_is(*pceltFetched)]
  369. VARIANT * rgVar,
  370. [out] ULONG* pceltFetched);
  371. HRESULT Skip(
  372. [in] ULONG celt);
  373. HRESULT Reset();
  374. HRESULT Clone(
  375. [out] IEnumNetSharingPortMapping** ppenum);
  376. };
  377. [
  378. object,
  379. uuid(24B7E9B5-E38F-4685-851B-00892CF5F940),
  380. oleautomation, dual,
  381. pointer_default(unique)
  382. ]
  383. interface INetSharingPortMappingProps : IDispatch
  384. {
  385. [propget, id(1), helpstring("property Name")] HRESULT Name ([out, retval] BSTR * pbstrName);
  386. [propget, id(2), helpstring("property IPProtocol")] HRESULT IPProtocol ([out, retval] UCHAR * pucIPProt);
  387. [propget, id(3), helpstring("property ExternalPort")] HRESULT ExternalPort ([out, retval] long * pusPort);
  388. [propget, id(4), helpstring("property InternalPort")] HRESULT InternalPort ([out, retval] long * pusPort);
  389. [propget, id(5), helpstring("property Options")] HRESULT Options ([out, retval] long * pdwOptions);
  390. [propget, id(6), helpstring("property TargetName")] HRESULT TargetName ([out, retval] BSTR * pbstrTargetName);
  391. [propget, id(7), helpstring("property TargetIPAddress")] HRESULT TargetIPAddress([out, retval] BSTR * pbstrTargetIPAddress);
  392. [propget, id(8), helpstring("property Enabled")] HRESULT Enabled ([out, retval] VARIANT_BOOL * pbool);
  393. };
  394. //+---------------------------------------------------------------------------
  395. // INetSharingPortMapping -
  396. //
  397. [
  398. object,
  399. uuid(C08956B1-1CD3-11D1-B1C5-00805FC1270E),
  400. oleautomation, dual,
  401. pointer_default(unique)
  402. ]
  403. interface INetSharingPortMapping : IDispatch
  404. {
  405. [id(1), helpstring("method Disable")]
  406. HRESULT Disable();
  407. [id(2), helpstring("method Enable")]
  408. HRESULT Enable();
  409. [propget, id(3), helpstring("property Properties")]
  410. HRESULT Properties(
  411. [out, retval] INetSharingPortMappingProps ** ppNSPMP);
  412. [id(4), helpstring("method Delete")]
  413. HRESULT Delete();
  414. };
  415. //+---------------------------------------------------------------------------
  416. // IEnumNetSharingEveryConnection - An enumerator for INetConnection interface pointers
  417. // that represent all connections in the connections folder
  418. //
  419. [
  420. object,
  421. uuid(C08956B8-1CD3-11D1-B1C5-00805FC1270E),
  422. pointer_default(unique)
  423. ]
  424. interface IEnumNetSharingEveryConnection : IUnknown
  425. {
  426. HRESULT Next(
  427. [in] ULONG celt,
  428. [out, size_is(celt), length_is(*pceltFetched)]
  429. VARIANT * rgVar,
  430. [out] ULONG* pceltFetched);
  431. HRESULT Skip(
  432. [in] ULONG celt);
  433. HRESULT Reset();
  434. HRESULT Clone(
  435. [out] IEnumNetSharingEveryConnection** ppenum);
  436. };
  437. //+---------------------------------------------------------------------------
  438. // IEnumNetSharingPublicConnection - An enumerator for INetConnection interface pointers
  439. // that represent connections configured as publicly shared.
  440. //
  441. [
  442. object,
  443. uuid(C08956B4-1CD3-11D1-B1C5-00805FC1270E),
  444. pointer_default(unique)
  445. ]
  446. interface IEnumNetSharingPublicConnection : IUnknown
  447. {
  448. HRESULT Next(
  449. [in] ULONG celt,
  450. [out, size_is(celt), length_is(*pceltFetched)]
  451. VARIANT * rgVar,
  452. [out] ULONG* pceltFetched);
  453. HRESULT Skip(
  454. [in] ULONG celt);
  455. HRESULT Reset();
  456. HRESULT Clone(
  457. [out] IEnumNetSharingPublicConnection** ppenum);
  458. };
  459. //+---------------------------------------------------------------------------
  460. // IEnumNetSharingPrivateConnection - An enumerator for INetConnection interface pointers
  461. // that represent connections configured as privately shared.
  462. //
  463. [
  464. object,
  465. uuid(C08956B5-1CD3-11D1-B1C5-00805FC1270E),
  466. pointer_default(unique)
  467. ]
  468. interface IEnumNetSharingPrivateConnection : IUnknown
  469. {
  470. HRESULT Next(
  471. [in] ULONG celt,
  472. [out, size_is(celt), length_is(*pCeltFetched)] VARIANT * rgVar,
  473. [out] ULONG * pCeltFetched);
  474. HRESULT Skip(
  475. [in] ULONG celt);
  476. HRESULT Reset();
  477. HRESULT Clone(
  478. [out] IEnumNetSharingPrivateConnection** ppenum);
  479. };
  480. // Collection needed for INetSharingConfiguration::EnumPortMappings() below
  481. [
  482. object,
  483. uuid(02E4A2DE-DA20-4E34-89C8-AC22275A010B),
  484. oleautomation, dual,
  485. helpstring("INetSharingPortMappingCollection Interface"),
  486. pointer_default(unique)
  487. ]
  488. interface INetSharingPortMappingCollection : IDispatch
  489. {
  490. [propget, id(DISPID_NEWENUM), restricted, helpstring("property _NewEnum: gets item enumerator")] HRESULT _NewEnum([out, retval] IUnknown* *pVal);
  491. [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] long *pVal);
  492. };
  493. cpp_quote("// properties for INetConnection (wraps NETCON_PROPERTIES)")
  494. [
  495. object,
  496. uuid(F4277C95-CE5B-463D-8167-5662D9BCAA72),
  497. oleautomation, dual,
  498. helpstring("INetConnectionProps Interface"),
  499. pointer_default(unique)
  500. ]
  501. interface INetConnectionProps : IDispatch
  502. {
  503. [propget, id(1), helpstring("property Guid")]
  504. HRESULT Guid ([out, retval] BSTR * pbstrGuid);
  505. [propget, id(2), helpstring("property Name")]
  506. HRESULT Name ([out, retval] BSTR * pbstrName);
  507. [propget, id(3), helpstring("property DeviceName")]
  508. HRESULT DeviceName ([out, retval] BSTR * pbstrDeviceName);
  509. [propget, id(4), helpstring("property Status")]
  510. HRESULT Status ([out, retval] NETCON_STATUS * pStatus);
  511. [propget, id(5), helpstring("property MediaType")]
  512. HRESULT MediaType ([out, retval] NETCON_MEDIATYPE * pMediaType);
  513. [propget, id(6), helpstring("property Characteristics")]
  514. HRESULT Characteristics ([out, retval] DWORD * pdwFlags);
  515. };
  516. //+---------------------------------------------------------------------------
  517. // INetSharingConfiguration - the connection level object that
  518. //
  519. // It provides methods to:
  520. // - Enable/Disable Internet Connection Sharing
  521. // - Enable/Disable Internet Connection Protection
  522. // - Enumerate Port Mappings
  523. // - Add Port Mappings
  524. //
  525. [
  526. object,
  527. uuid(C08956B6-1CD3-11D1-B1C5-00805FC1270E),
  528. oleautomation, dual,
  529. pointer_default(unique)
  530. ]
  531. interface INetSharingConfiguration : IDispatch
  532. {
  533. typedef enum tagSHARINGCONNECTIONTYPE
  534. {
  535. ICSSHARINGTYPE_PUBLIC = 0x0,
  536. ICSSHARINGTYPE_PRIVATE
  537. }
  538. SHARINGCONNECTIONTYPE, *LPSHARINGCONNECTIONTYPE;
  539. typedef enum tagSHARINGCONNECTION_ENUM_FLAGS
  540. {
  541. ICSSC_DEFAULT = 0x0,
  542. ICSSC_ENABLED
  543. }
  544. SHARINGCONNECTION_ENUM_FLAGS;
  545. typedef enum tagICS_TARGETTYPE
  546. {
  547. ICSTT_NAME = 0x0,
  548. ICSTT_IPADDRESS
  549. }
  550. ICS_TARGETTYPE;
  551. [propget, id(1), helpstring("property SharingEnabled")]
  552. HRESULT SharingEnabled([out, retval] VARIANT_BOOL* pbEnabled);
  553. [propget, id(2), helpstring("property SharingConnectionType")]
  554. HRESULT SharingConnectionType([out, retval] SHARINGCONNECTIONTYPE* pType);
  555. [id(3), helpstring("method DisableSharing")]
  556. HRESULT DisableSharing();
  557. [id(4), helpstring("method EnableSharing")]
  558. HRESULT EnableSharing([in] SHARINGCONNECTIONTYPE Type );
  559. [propget, id(5), helpstring("property InternetFirewallEnabled")]
  560. HRESULT InternetFirewallEnabled([out, retval] VARIANT_BOOL *pbEnabled );
  561. [id(6), helpstring("method DisableInternetFirewall")]
  562. HRESULT DisableInternetFirewall();
  563. [id(7), helpstring("method EnableInternetFirewall")]
  564. HRESULT EnableInternetFirewall();
  565. // Return an IEnumNetSharingPortMapping interface used to enumerate all of
  566. // the contained INetSharingPortMapping objects.
  567. //
  568. [propget, id(8), helpstring("EnumPortMappings")]
  569. HRESULT EnumPortMappings(
  570. [in] SHARINGCONNECTION_ENUM_FLAGS Flags,
  571. [out, retval] INetSharingPortMappingCollection** ppColl);
  572. [id(9), helpstring("method AddPortMapping")]
  573. HRESULT AddPortMapping(
  574. [in] BSTR bstrName,
  575. [in] UCHAR ucIPProtocol,
  576. [in] USHORT usExternalPort,
  577. [in] USHORT usInternalPort,
  578. [in] DWORD dwOptions,
  579. [in] BSTR bstrTargetNameOrIPAddress,
  580. [in] ICS_TARGETTYPE eTargetType,
  581. [out, retval] INetSharingPortMapping** ppMapping );
  582. [id(10), helpstring("method RemovePortMapping")]
  583. HRESULT RemovePortMapping([in] INetSharingPortMapping* pMapping );
  584. };
  585. // ICollection interfaces
  586. [
  587. object,
  588. uuid(33C4643C-7811-46FA-A89A-768597BD7223),
  589. oleautomation, dual,
  590. helpstring("INetSharingEveryConnectionCollection Interface"),
  591. pointer_default(unique)
  592. ]
  593. interface INetSharingEveryConnectionCollection : IDispatch
  594. {
  595. [propget, id(DISPID_NEWENUM), restricted, helpstring("property _NewEnum: gets item enumerator")] HRESULT _NewEnum([out, retval] IUnknown* *pVal);
  596. [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] long *pVal);
  597. };
  598. [
  599. object,
  600. uuid(7D7A6355-F372-4971-A149-BFC927BE762A),
  601. oleautomation, dual,
  602. helpstring("INetSharingPublicConnectionCollection Interface"),
  603. pointer_default(unique)
  604. ]
  605. interface INetSharingPublicConnectionCollection : IDispatch
  606. {
  607. [propget, id(DISPID_NEWENUM), restricted, helpstring("property _NewEnum: gets item enumerator")] HRESULT _NewEnum([out, retval] IUnknown* *pVal);
  608. [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] long *pVal);
  609. };
  610. [
  611. object,
  612. uuid(38AE69E0-4409-402A-A2CB-E965C727F840),
  613. oleautomation, dual,
  614. helpstring("INetSharingPrivateConnectionCollection Interface"),
  615. pointer_default(unique)
  616. ]
  617. interface INetSharingPrivateConnectionCollection : IDispatch
  618. {
  619. [propget, id(DISPID_NEWENUM), restricted, helpstring("property _NewEnum: gets item enumerator")] HRESULT _NewEnum([out, retval] IUnknown* *pVal);
  620. [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] long *pVal);
  621. };
  622. //+---------------------------------------------------------------------------
  623. // INetSharingManager - the top level object that
  624. //
  625. // It provides methods to:
  626. // - Determine whether Internet Connection Sharing is installed
  627. // - Enumerate Public Connections
  628. // - Enumerate Private Connections
  629. //
  630. [
  631. object,
  632. uuid(C08956B7-1CD3-11D1-B1C5-00805FC1270E),
  633. oleautomation, dual,
  634. pointer_default(unique)
  635. ]
  636. interface INetSharingManager : IDispatch
  637. {
  638. [propget, id(1), helpstring("property SharingInstalled")]
  639. HRESULT SharingInstalled([out, retval] VARIANT_BOOL *pbInstalled );
  640. // Return an IEnumNetSharingPublicConnection interface used to enumerate all of
  641. // the contained INetConnections configured as a public adapter
  642. //
  643. [propget, id(2), helpstring("EnumPublicConnections")]
  644. HRESULT EnumPublicConnections(
  645. [in] SHARINGCONNECTION_ENUM_FLAGS Flags,
  646. [out, retval] INetSharingPublicConnectionCollection ** ppColl);
  647. // Return an IEnumNetSharingPrivateConnection interface used to enumerate all of
  648. // the contained INetConnections configured as a private adapter
  649. //
  650. [propget, id(3), helpstring("EnumPrivateConnections")]
  651. HRESULT EnumPrivateConnections(
  652. [in] SHARINGCONNECTION_ENUM_FLAGS Flags,
  653. [out, retval] INetSharingPrivateConnectionCollection ** ppColl);
  654. [propget, id(6), helpstring("INetSharingConfigurationForINetConnection")]
  655. HRESULT INetSharingConfigurationForINetConnection(
  656. [in] INetConnection *pNetConnection,
  657. [out, retval] INetSharingConfiguration **ppNetSharingConfiguration
  658. );
  659. // Return an IEnumNetSharingEveryConnection interface used to enumerate all of
  660. // the contained INetConnections configured as a public adapter
  661. //
  662. [propget, id(7), helpstring("EnumEveryConnection")]
  663. HRESULT EnumEveryConnection([out, retval] INetSharingEveryConnectionCollection ** ppColl);
  664. // get properties interface for any INetConnection
  665. [propget, id(8), helpstring("NetConnectionProps")]
  666. HRESULT NetConnectionProps(
  667. [in] INetConnection *pNetConnection,
  668. [out, retval] INetConnectionProps ** ppProps);
  669. };
  670. //
  671. // AlgSetup.idl : IDL source for AlgSetup.dll
  672. //
  673. // To allow third party to Install/Remove ALG PlugIns
  674. //
  675. const int ALG_SETUP_PORTS_LIST_BYTE_SIZE=2048;
  676. [
  677. object,
  678. uuid(A779AF1A-009A-4C44-B9F0-8F0F4CF2AE49),
  679. dual,
  680. helpstring("IAlgSetup Interface"),
  681. pointer_default(unique)
  682. ]
  683. interface IAlgSetup : IDispatch
  684. {
  685. [id(1), helpstring("method Add")]
  686. HRESULT Add(
  687. [in] BSTR pszProgID,
  688. [in] BSTR pszPublisher,
  689. [in] BSTR pszProduct,
  690. [in] BSTR pszVersion,
  691. [in] short nProtocol,
  692. [in] BSTR pszPorts
  693. );
  694. [id(2), helpstring("method Remove")]
  695. HRESULT Remove(
  696. [in] BSTR pszProgID
  697. );
  698. };
  699. [
  700. uuid(43E734CA-043D-4A70-9A2C-A8F254063D91),
  701. version(1.0),
  702. helpstring("NetCon 1.0 Type Library")
  703. ]
  704. library NETCONLib
  705. {
  706. importlib("stdole2.tlb");
  707. [
  708. uuid(5C63C1AD-3956-4FF8-8486-40034758315B),
  709. helpstring("NetSharingManager Class")
  710. ]
  711. coclass NetSharingManager
  712. {
  713. [default] interface INetSharingManager;
  714. };
  715. [
  716. uuid(27D0BCCC-344D-4287-AF37-0C72C161C14C),
  717. helpstring("AlgSetup Class")
  718. ]
  719. coclass AlgSetup
  720. {
  721. [default] interface IAlgSetup;
  722. };
  723. };