123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796 |
- //+---------------------------------------------------------------------------
- //
- // Microsoft Windows
- // Copyright (c) Microsoft Corporation. All rights reserved.
- //
- // File: netcon.idl
- //
- //----------------------------------------------------------------------------
- cpp_quote("//+-------------------------------------------------------------------------")
- cpp_quote("//")
- cpp_quote("// Microsoft Windows")
- cpp_quote("// Copyright (c) Microsoft Corporation. All rights reserved.")
- cpp_quote("//")
- cpp_quote("//--------------------------------------------------------------------------")
- cpp_quote("#if ( _MSC_VER >= 800 )")
- cpp_quote("#pragma warning(disable:4201)")
- cpp_quote("#endif")
- #ifndef DO_NO_IMPORTS
- import "oaidl.idl";
- import "unknwn.idl";
- import "wtypes.idl";
- import "prsht.idl";
- #endif
- cpp_quote("")
- cpp_quote("EXTERN_C const CLSID CLSID_ConnectionManager;")
- cpp_quote("EXTERN_C const CLSID CLSID_ConnectionCommonUi;")
- cpp_quote("EXTERN_C const CLSID CLSID_NetSharingManager;")
- cpp_quote("")
- cpp_quote("//These strings reference the HKEY_CURRENT_USER registry which")
- cpp_quote("//retains whether shortcuts are created on the desktop.")
- cpp_quote("#define NETCON_HKEYCURRENTUSERPATH TEXT(\"Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Network\\\\Network Connections\")")
- cpp_quote("#define NETCON_DESKTOPSHORTCUT TEXT(\"DesktopShortcut\")")
- cpp_quote("#define NETCON_MAX_NAME_LEN 246")
- cpp_quote("")
- // Reserved GUIDS for our use
- //
- // C08956A0-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetConnection
- // C08956A1-1CD3-11D1-B1C5-00805FC1270E IID_INetConnection
- // C08956A2-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionManager
- // C08956A3-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionConnectUi
- // C08956A4-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionPropertyUi
- // C08956A5-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionCommonUi
- // C08956A6-1CD3-11D1-B1C5-00805FC1270E IID_INetLanConnectionUiInfo
- // ...
- // C08956B0-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetSharingPortMapping
- // C08956B1-1CD3-11D1-B1C5-00805FC1270E IID_INetSharingPortMapping
- // C08956B2-1CD3-11D1-B1C5-00805FC1270E
- // C08956B3-1CD3-11D1-B1C5-00805FC1270E
- // C08956B4-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetSharingPublicConnection
- // C08956B5-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetSharingPrivateConnection
- // C08956B6-1CD3-11D1-B1C5-00805FC1270E IID_INetSharingConfiguration
- // C08956B7-1CD3-11D1-B1C5-00805FC1270E IID_INetSharingManager
- // C08956B8-1CD3-11D1-B1C5-00805FC1270E IID_IEnumNetSharingEveryConnection
- // C08956B9-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionPropertyUi2
- // C08956BA-1CD3-11D1-B1C5-00805FC1270E IID_INetConnectionManagerEvents
- // ...
- // C08956FE-1CD3-11D1-B1C5-00805FC1270E
- // C08956FF-1CD3-11D1-B1C5-00805FC1270E
- // C0895700-1CD3-11D1-B1C5-00805FC1270E
- //
- interface IEnumNetConnection;
- interface INetConnection;
- interface INetConnectionManager;
- interface INetConnectionConnectUi;
- interface INetConnectionPropertyUi;
- interface INetConnectionPropertyUi2;
- interface INetConnectionCommonUi;
- interface INetLanConnectionUiInfo;
- interface INetConnectionManagerEvents;
- interface IEnumNetSharingPortMapping;
- interface INetSharingPortMapping;
- interface IEnumNetSharingPublicConnection;
- interface IEnumNetSharingPrivateConnection;
- interface IEnumNetSharingEveryConnection;
- interface INetSharingConfiguration;
- interface INetSharingManager;
- //+---------------------------------------------------------------------------
- // IEnumNetConnection - An enumerator for INetConnection objects.
- //
- [
- object,
- uuid(C08956A0-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface IEnumNetConnection : IUnknown
- {
- HRESULT Next(
- [in] ULONG celt,
- [out, size_is(celt), length_is(*pceltFetched)]
- INetConnection** rgelt,
- [out] ULONG* pceltFetched);
- HRESULT Skip(
- [in] ULONG celt);
- HRESULT Reset();
- HRESULT Clone(
- [out] IEnumNetConnection** ppenum);
- };
- //+---------------------------------------------------------------------------
- // INetConnection -
- //
- [
- object,
- uuid(C08956A1-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface INetConnection : IUnknown
- {
- typedef enum tagNETCON_CHARACTERISTIC_FLAGS
- {
- NCCF_NONE = 0x0000, // No special characteristics
- NCCF_ALL_USERS = 0x0001, // Connection is available to all users
- NCCF_ALLOW_DUPLICATION = 0x0002, // Connection is duplicable
- NCCF_ALLOW_REMOVAL = 0x0004, // Connection is removable
- NCCF_ALLOW_RENAME = 0x0008, // Connection can be renamed
- NCCF_SHOW_ICON = 0x0010, // Shows icon in taskbar when connected
- NCCF_INCOMING_ONLY = 0x0020, // Direction is "incoming" only
- NCCF_OUTGOING_ONLY = 0x0040, // Direction is "outgoing" only
- NCCF_BRANDED = 0x0080, // Icons are branded
- NCCF_SHARED = 0x0100, // Connection is shared
- NCCF_BRIDGED = 0x0200, // Connection is bridged
- NCCF_FIREWALLED = 0x0400, // Connection is firewalled
- NCCF_DEFAULT = 0x0800, // This is the default connection
- NCCF_HOMENET_CAPABLE = 0x1000, // The device supports home networking
- NCCF_SHARED_PRIVATE = 0x2000, // The connection is private (part of ICS)
- NCCF_QUARANTINED = 0x4000, // Connection is quarantined
- NCCF_RESERVED = 0x8000, // Unused
- NCCF_BLUETOOTH_MASK = 0x000F0000, // Bluetooth Characteristics
- NCCF_LAN_MASK = 0x00F00000 // LAN Characteristics
- } NETCON_CHARACTERISTIC_FLAGS;
- typedef enum tagNETCON_STATUS
- {
- NCS_DISCONNECTED,
- NCS_CONNECTING,
- NCS_CONNECTED,
- NCS_DISCONNECTING,
- NCS_HARDWARE_NOT_PRESENT,
- NCS_HARDWARE_DISABLED,
- NCS_HARDWARE_MALFUNCTION,
- NCS_MEDIA_DISCONNECTED,
- NCS_AUTHENTICATING,
- NCS_AUTHENTICATION_SUCCEEDED,
- NCS_AUTHENTICATION_FAILED,
- NCS_INVALID_ADDRESS,
- NCS_CREDENTIALS_REQUIRED
- } NETCON_STATUS;
- typedef enum tagNETCON_TYPE
- {
- NCT_DIRECT_CONNECT,
- NCT_INBOUND,
- NCT_INTERNET,
- NCT_LAN,
- NCT_PHONE,
- NCT_TUNNEL,
- NCT_BRIDGE,
- } NETCON_TYPE;
- typedef enum tagNETCON_MEDIATYPE
- {
- NCM_NONE,
- NCM_DIRECT,
- NCM_ISDN,
- NCM_LAN,
- NCM_PHONE,
- NCM_TUNNEL,
- NCM_PPPOE,
- NCM_BRIDGE,
- NCM_SHAREDACCESSHOST_LAN,
- NCM_SHAREDACCESSHOST_RAS,
- } NETCON_MEDIATYPE;
- typedef struct tagNETCON_PROPERTIES
- {
- GUID guidId;
- [string] LPWSTR pszwName;
- [string] LPWSTR pszwDeviceName;
- NETCON_STATUS Status;
- NETCON_MEDIATYPE MediaType;
- DWORD dwCharacter;
- CLSID clsidThisObject;
- CLSID clsidUiObject;
- } NETCON_PROPERTIES;
- HRESULT Connect();
- cpp_quote("#define S_OBJECT_NO_LONGER_VALID ((HRESULT)0x00000002L)")
- // Disconnect can return S_OBJECT_NO_LONGER_VALID which indicates
- // success, but that the object is no longer valid. Clients, when
- // getting this error message, should simply release the interface.
- //
- HRESULT Disconnect();
- HRESULT Delete();
- HRESULT Duplicate(
- [in, string] LPCWSTR pszwDuplicateName,
- [out] INetConnection** ppCon);
- HRESULT GetProperties(
- [out] NETCON_PROPERTIES** ppProps);
- HRESULT GetUiObjectClassId(
- [out, ref] CLSID* pclsid);
- HRESULT Rename(
- [in, string] LPCWSTR pszwNewName);
- };
- cpp_quote("")
- cpp_quote("STDAPI_(VOID) NcFreeNetconProperties (NETCON_PROPERTIES* pProps);")
- cpp_quote("")
- cpp_quote("")
- cpp_quote("STDAPI_(BOOL) NcIsValidConnectionName (PCWSTR pszwName);")
- cpp_quote("")
- //+---------------------------------------------------------------------------
- // INetConnectionManager - The top-level object that contains all of the
- // INetConnection objects on a machine.
- //
- // This interface manages INetConnection objects. It provides methods
- // to:
- // - Enumerate INetConnections
- // - Remove an INetConnection
- // - Find an INetConnection
- //
- // Note: Adding a connection is not yet performed programatically through
- // the connection manager. Instead, the shell owns creating connection
- // objects through a UI interface.
- //
- [
- object,
- uuid(C08956A2-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface INetConnectionManager : IUnknown
- {
- typedef enum tagNETCONMGR_ENUM_FLAGS
- {
- NCME_DEFAULT = 0x0,
- } NETCONMGR_ENUM_FLAGS;
- // Return an IEnumNetConnection interface used to enumerate all of
- // the contained connection objects.
- //
- HRESULT EnumConnections(
- [in] NETCONMGR_ENUM_FLAGS Flags,
- [out] IEnumNetConnection** ppEnum);
- };
- //+---------------------------------------------------------------------------
- // INetConnectionManagerEvents -
- //
- [
- object,
- uuid(C08956BA-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface INetConnectionManagerEvents : IUnknown
- {
- HRESULT RefreshConnections();
- HRESULT Enable();
- HRESULT Disable(
- [in] ULONG ulDisableTimeout);
- };
- //+---------------------------------------------------------------------------
- // INetConnectionConnectUi -
- //
- [
- local,
- object,
- uuid(C08956A3-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface INetConnectionConnectUi : IUnknown
- {
- typedef enum tagNETCONUI_CONNECT_FLAGS
- {
- NCUC_DEFAULT = 0x0000,
- NCUC_NO_UI = 0x0001,
- NCUC_ENABLE_DISABLE = 0x0002
- } NETCONUI_CONNECT_FLAGS;
- HRESULT SetConnection(
- [in] INetConnection* pCon);
- HRESULT Connect (
- [in] HWND hwndParent,
- [in] DWORD dwFlags);
- HRESULT Disconnect (
- [in] HWND hwndParent,
- [in] DWORD dwFlags);
- };
- //+---------------------------------------------------------------------------
- // INetConnectionPropertyUi -
- //
- [
- local,
- object,
- uuid(C08956A4-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface INetConnectionPropertyUi : IUnknown
- {
- HRESULT SetConnection(
- [in] INetConnection* pCon);
- HRESULT AddPages (
- [in] HWND hwndParent,
- [in] LPFNADDPROPSHEETPAGE pfnAddPage,
- [in] LPARAM lParam);
- };
- //+---------------------------------------------------------------------------
- // INetConnectionPropertyUi2 -
- //
- [
- local,
- object,
- uuid(C08956B9-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface INetConnectionPropertyUi2 : INetConnectionPropertyUi
- {
- HRESULT GetIcon(
- [in] DWORD dwSize,
- [out] HICON *phIcon);
- };
- //+---------------------------------------------------------------------------
- // INetConnectionCommonUi -
- //
- [
- local,
- object,
- uuid(C08956A5-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface INetConnectionCommonUi : IUnknown
- {
- typedef enum tagNETCON_CHOOSEFLAGS
- {
- NCCHF_CONNECT = 0x0001, // Selected Connection is activated
- // and returned. If not set then
- // the selected connection interface
- // is returned without being activated
- NCCHF_CAPTION = 0x0002,
- NCCHF_OKBTTNTEXT = 0x0004,
- NCCHF_DISABLENEW = 0x0008,
- NCCHF_AUTOSELECT = 0x0010, // Automatically Choose or Connect,
- // based upon NCCHF_CONNECT if only
- // one connection matches the
- // dwTypeMask.
- } NETCON_CHOOSEFLAGS;
- typedef enum tagNETCON_CHOOSETYPE
- {
- NCCHT_DIRECT_CONNECT = 0x0001,
- NCCHT_LAN = 0x0002,
- NCCHT_PHONE = 0x0004,
- NCCHT_TUNNEL = 0x0008,
- NCCHT_ISDN = 0x0010,
- NCCHT_ALL = 0x001F
- } NETCON_CHOOSETYPE;
- typedef struct tagNETCON_CHOOSECONN
- {
- DWORD lStructSize;
- HWND hwndParent;
- DWORD dwFlags; // Combine NCCHF_* flags
- DWORD dwTypeMask; // Combine NCCHT_* flags
- LPCWSTR lpstrCaption;
- LPCWSTR lpstrOkBttnText;
- } NETCON_CHOOSECONN;
- HRESULT ChooseConnection(
- [in] NETCON_CHOOSECONN * pChooseConn,
- [out] INetConnection** ppCon);
- HRESULT ShowConnectionProperties (
- [in] HWND hwndParent,
- [in] INetConnection* pCon);
- HRESULT StartNewConnectionWizard (
- [in] HWND hwndParent,
- [out] INetConnection** ppCon);
- };
- //+---------------------------------------------------------------------------
- // IEnumNetSharingPortMapping - An enumerator for INetSharingPortMapping objects.
- //
- [
- object,
- uuid(C08956B0-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface IEnumNetSharingPortMapping : IUnknown
- {
- HRESULT Next(
- [in] ULONG celt,
- [out, size_is(celt), length_is(*pceltFetched)]
- VARIANT * rgVar,
- [out] ULONG* pceltFetched);
- HRESULT Skip(
- [in] ULONG celt);
- HRESULT Reset();
- HRESULT Clone(
- [out] IEnumNetSharingPortMapping** ppenum);
- };
- [
- object,
- uuid(24B7E9B5-E38F-4685-851B-00892CF5F940),
- oleautomation, dual,
- pointer_default(unique)
- ]
- interface INetSharingPortMappingProps : IDispatch
- {
- [propget, id(1), helpstring("property Name")] HRESULT Name ([out, retval] BSTR * pbstrName);
- [propget, id(2), helpstring("property IPProtocol")] HRESULT IPProtocol ([out, retval] UCHAR * pucIPProt);
- [propget, id(3), helpstring("property ExternalPort")] HRESULT ExternalPort ([out, retval] long * pusPort);
- [propget, id(4), helpstring("property InternalPort")] HRESULT InternalPort ([out, retval] long * pusPort);
- [propget, id(5), helpstring("property Options")] HRESULT Options ([out, retval] long * pdwOptions);
- [propget, id(6), helpstring("property TargetName")] HRESULT TargetName ([out, retval] BSTR * pbstrTargetName);
- [propget, id(7), helpstring("property TargetIPAddress")] HRESULT TargetIPAddress([out, retval] BSTR * pbstrTargetIPAddress);
- [propget, id(8), helpstring("property Enabled")] HRESULT Enabled ([out, retval] VARIANT_BOOL * pbool);
- };
- //+---------------------------------------------------------------------------
- // INetSharingPortMapping -
- //
- [
- object,
- uuid(C08956B1-1CD3-11D1-B1C5-00805FC1270E),
- oleautomation, dual,
- pointer_default(unique)
- ]
- interface INetSharingPortMapping : IDispatch
- {
- [id(1), helpstring("method Disable")]
- HRESULT Disable();
- [id(2), helpstring("method Enable")]
- HRESULT Enable();
- [propget, id(3), helpstring("property Properties")]
- HRESULT Properties(
- [out, retval] INetSharingPortMappingProps ** ppNSPMP);
- [id(4), helpstring("method Delete")]
- HRESULT Delete();
- };
- //+---------------------------------------------------------------------------
- // IEnumNetSharingEveryConnection - An enumerator for INetConnection interface pointers
- // that represent all connections in the connections folder
- //
- [
- object,
- uuid(C08956B8-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface IEnumNetSharingEveryConnection : IUnknown
- {
- HRESULT Next(
- [in] ULONG celt,
- [out, size_is(celt), length_is(*pceltFetched)]
- VARIANT * rgVar,
- [out] ULONG* pceltFetched);
- HRESULT Skip(
- [in] ULONG celt);
- HRESULT Reset();
- HRESULT Clone(
- [out] IEnumNetSharingEveryConnection** ppenum);
- };
- //+---------------------------------------------------------------------------
- // IEnumNetSharingPublicConnection - An enumerator for INetConnection interface pointers
- // that represent connections configured as publicly shared.
- //
- [
- object,
- uuid(C08956B4-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface IEnumNetSharingPublicConnection : IUnknown
- {
- HRESULT Next(
- [in] ULONG celt,
- [out, size_is(celt), length_is(*pceltFetched)]
- VARIANT * rgVar,
- [out] ULONG* pceltFetched);
- HRESULT Skip(
- [in] ULONG celt);
- HRESULT Reset();
- HRESULT Clone(
- [out] IEnumNetSharingPublicConnection** ppenum);
- };
- //+---------------------------------------------------------------------------
- // IEnumNetSharingPrivateConnection - An enumerator for INetConnection interface pointers
- // that represent connections configured as privately shared.
- //
- [
- object,
- uuid(C08956B5-1CD3-11D1-B1C5-00805FC1270E),
- pointer_default(unique)
- ]
- interface IEnumNetSharingPrivateConnection : IUnknown
- {
- HRESULT Next(
- [in] ULONG celt,
- [out, size_is(celt), length_is(*pCeltFetched)] VARIANT * rgVar,
- [out] ULONG * pCeltFetched);
- HRESULT Skip(
- [in] ULONG celt);
- HRESULT Reset();
- HRESULT Clone(
- [out] IEnumNetSharingPrivateConnection** ppenum);
- };
- // Collection needed for INetSharingConfiguration::EnumPortMappings() below
- [
- object,
- uuid(02E4A2DE-DA20-4E34-89C8-AC22275A010B),
- oleautomation, dual,
- helpstring("INetSharingPortMappingCollection Interface"),
- pointer_default(unique)
- ]
- interface INetSharingPortMappingCollection : IDispatch
- {
- [propget, id(DISPID_NEWENUM), restricted, helpstring("property _NewEnum: gets item enumerator")] HRESULT _NewEnum([out, retval] IUnknown* *pVal);
- [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] long *pVal);
- };
- cpp_quote("// properties for INetConnection (wraps NETCON_PROPERTIES)")
- [
- object,
- uuid(F4277C95-CE5B-463D-8167-5662D9BCAA72),
- oleautomation, dual,
- helpstring("INetConnectionProps Interface"),
- pointer_default(unique)
- ]
- interface INetConnectionProps : IDispatch
- {
- [propget, id(1), helpstring("property Guid")]
- HRESULT Guid ([out, retval] BSTR * pbstrGuid);
- [propget, id(2), helpstring("property Name")]
- HRESULT Name ([out, retval] BSTR * pbstrName);
- [propget, id(3), helpstring("property DeviceName")]
- HRESULT DeviceName ([out, retval] BSTR * pbstrDeviceName);
- [propget, id(4), helpstring("property Status")]
- HRESULT Status ([out, retval] NETCON_STATUS * pStatus);
- [propget, id(5), helpstring("property MediaType")]
- HRESULT MediaType ([out, retval] NETCON_MEDIATYPE * pMediaType);
- [propget, id(6), helpstring("property Characteristics")]
- HRESULT Characteristics ([out, retval] DWORD * pdwFlags);
- };
- //+---------------------------------------------------------------------------
- // INetSharingConfiguration - the connection level object that
- //
- // It provides methods to:
- // - Enable/Disable Internet Connection Sharing
- // - Enable/Disable Internet Connection Protection
- // - Enumerate Port Mappings
- // - Add Port Mappings
- //
- [
- object,
- uuid(C08956B6-1CD3-11D1-B1C5-00805FC1270E),
- oleautomation, dual,
- pointer_default(unique)
- ]
- interface INetSharingConfiguration : IDispatch
- {
- typedef enum tagSHARINGCONNECTIONTYPE
- {
- ICSSHARINGTYPE_PUBLIC = 0x0,
- ICSSHARINGTYPE_PRIVATE
- }
- SHARINGCONNECTIONTYPE, *LPSHARINGCONNECTIONTYPE;
- typedef enum tagSHARINGCONNECTION_ENUM_FLAGS
- {
- ICSSC_DEFAULT = 0x0,
- ICSSC_ENABLED
- }
- SHARINGCONNECTION_ENUM_FLAGS;
- typedef enum tagICS_TARGETTYPE
- {
- ICSTT_NAME = 0x0,
- ICSTT_IPADDRESS
- }
- ICS_TARGETTYPE;
- [propget, id(1), helpstring("property SharingEnabled")]
- HRESULT SharingEnabled([out, retval] VARIANT_BOOL* pbEnabled);
- [propget, id(2), helpstring("property SharingConnectionType")]
- HRESULT SharingConnectionType([out, retval] SHARINGCONNECTIONTYPE* pType);
- [id(3), helpstring("method DisableSharing")]
- HRESULT DisableSharing();
- [id(4), helpstring("method EnableSharing")]
- HRESULT EnableSharing([in] SHARINGCONNECTIONTYPE Type );
- [propget, id(5), helpstring("property InternetFirewallEnabled")]
- HRESULT InternetFirewallEnabled([out, retval] VARIANT_BOOL *pbEnabled );
- [id(6), helpstring("method DisableInternetFirewall")]
- HRESULT DisableInternetFirewall();
- [id(7), helpstring("method EnableInternetFirewall")]
- HRESULT EnableInternetFirewall();
- // Return an IEnumNetSharingPortMapping interface used to enumerate all of
- // the contained INetSharingPortMapping objects.
- //
- [propget, id(8), helpstring("EnumPortMappings")]
- HRESULT EnumPortMappings(
- [in] SHARINGCONNECTION_ENUM_FLAGS Flags,
- [out, retval] INetSharingPortMappingCollection** ppColl);
- [id(9), helpstring("method AddPortMapping")]
- HRESULT AddPortMapping(
- [in] BSTR bstrName,
- [in] UCHAR ucIPProtocol,
- [in] USHORT usExternalPort,
- [in] USHORT usInternalPort,
- [in] DWORD dwOptions,
- [in] BSTR bstrTargetNameOrIPAddress,
- [in] ICS_TARGETTYPE eTargetType,
- [out, retval] INetSharingPortMapping** ppMapping );
- [id(10), helpstring("method RemovePortMapping")]
- HRESULT RemovePortMapping([in] INetSharingPortMapping* pMapping );
- };
- // ICollection interfaces
- [
- object,
- uuid(33C4643C-7811-46FA-A89A-768597BD7223),
- oleautomation, dual,
- helpstring("INetSharingEveryConnectionCollection Interface"),
- pointer_default(unique)
- ]
- interface INetSharingEveryConnectionCollection : IDispatch
- {
- [propget, id(DISPID_NEWENUM), restricted, helpstring("property _NewEnum: gets item enumerator")] HRESULT _NewEnum([out, retval] IUnknown* *pVal);
- [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] long *pVal);
- };
- [
- object,
- uuid(7D7A6355-F372-4971-A149-BFC927BE762A),
- oleautomation, dual,
- helpstring("INetSharingPublicConnectionCollection Interface"),
- pointer_default(unique)
- ]
- interface INetSharingPublicConnectionCollection : IDispatch
- {
- [propget, id(DISPID_NEWENUM), restricted, helpstring("property _NewEnum: gets item enumerator")] HRESULT _NewEnum([out, retval] IUnknown* *pVal);
- [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] long *pVal);
- };
- [
- object,
- uuid(38AE69E0-4409-402A-A2CB-E965C727F840),
- oleautomation, dual,
- helpstring("INetSharingPrivateConnectionCollection Interface"),
- pointer_default(unique)
- ]
- interface INetSharingPrivateConnectionCollection : IDispatch
- {
- [propget, id(DISPID_NEWENUM), restricted, helpstring("property _NewEnum: gets item enumerator")] HRESULT _NewEnum([out, retval] IUnknown* *pVal);
- [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] long *pVal);
- };
- //+---------------------------------------------------------------------------
- // INetSharingManager - the top level object that
- //
- // It provides methods to:
- // - Determine whether Internet Connection Sharing is installed
- // - Enumerate Public Connections
- // - Enumerate Private Connections
- //
- [
- object,
- uuid(C08956B7-1CD3-11D1-B1C5-00805FC1270E),
- oleautomation, dual,
- pointer_default(unique)
- ]
- interface INetSharingManager : IDispatch
- {
- [propget, id(1), helpstring("property SharingInstalled")]
- HRESULT SharingInstalled([out, retval] VARIANT_BOOL *pbInstalled );
- // Return an IEnumNetSharingPublicConnection interface used to enumerate all of
- // the contained INetConnections configured as a public adapter
- //
- [propget, id(2), helpstring("EnumPublicConnections")]
- HRESULT EnumPublicConnections(
- [in] SHARINGCONNECTION_ENUM_FLAGS Flags,
- [out, retval] INetSharingPublicConnectionCollection ** ppColl);
- // Return an IEnumNetSharingPrivateConnection interface used to enumerate all of
- // the contained INetConnections configured as a private adapter
- //
- [propget, id(3), helpstring("EnumPrivateConnections")]
- HRESULT EnumPrivateConnections(
- [in] SHARINGCONNECTION_ENUM_FLAGS Flags,
- [out, retval] INetSharingPrivateConnectionCollection ** ppColl);
- [propget, id(6), helpstring("INetSharingConfigurationForINetConnection")]
- HRESULT INetSharingConfigurationForINetConnection(
- [in] INetConnection *pNetConnection,
- [out, retval] INetSharingConfiguration **ppNetSharingConfiguration
- );
- // Return an IEnumNetSharingEveryConnection interface used to enumerate all of
- // the contained INetConnections configured as a public adapter
- //
- [propget, id(7), helpstring("EnumEveryConnection")]
- HRESULT EnumEveryConnection([out, retval] INetSharingEveryConnectionCollection ** ppColl);
- // get properties interface for any INetConnection
- [propget, id(8), helpstring("NetConnectionProps")]
- HRESULT NetConnectionProps(
- [in] INetConnection *pNetConnection,
- [out, retval] INetConnectionProps ** ppProps);
- };
- [
- uuid(43E734CA-043D-4A70-9A2C-A8F254063D91),
- version(1.0),
- helpstring("NetCon 1.0 Type Library")
- ]
- library NETCONLib
- {
- importlib("stdole2.tlb");
- [
- uuid(5C63C1AD-3956-4FF8-8486-40034758315B),
- helpstring("NetSharingManager Class")
- ]
- coclass NetSharingManager
- {
- [default] interface INetSharingManager;
- };
- };
|