1 #ifndef __NETCON_H__ 2 #define __NETCON_H__ 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 typedef enum 9 { 10 NCME_DEFAULT = 0 11 }NETCONMGR_ENUM_FLAGS; 12 13 typedef enum 14 { 15 NCCF_NONE = 0, 16 NCCF_ALL_USERS = 0x1, 17 NCCF_ALLOW_DUPLICATION = 0x2, 18 NCCF_ALLOW_REMOVAL = 0x4, 19 NCCF_ALLOW_RENAME = 0x8, 20 NCCF_SHOW_ICON = 0x10, 21 NCCF_INCOMING_ONLY = 0x20, 22 NCCF_OUTGOING_ONLY = 0x40, 23 NCCF_BRANDED = 0x80, 24 NCCF_SHARED = 0x100, 25 NCCF_BRIDGED = 0x200, 26 NCCF_FIREWALLED = 0x400, 27 NCCF_DEFAULT = 0x800, 28 NCCF_HOMENET_CAPABLE = 0x1000, 29 NCCF_SHARED_PRIVATE = 0x2000, 30 NCCF_QUARANTINED = 0x4000, 31 NCCF_RESERVED = 0x8000, 32 NCCF_BLUETOOTH_MASK = 0xf0000, 33 NCCF_LAN_MASK = 0xf00000 34 }NETCON_CHARACTERISTIC_FLAGS; 35 36 37 typedef enum 38 { 39 NCS_DISCONNECTED = 0, 40 NCS_CONNECTING = NCS_DISCONNECTED + 1, 41 NCS_CONNECTED = NCS_CONNECTING + 1, 42 NCS_DISCONNECTING = NCS_CONNECTED + 1, 43 NCS_HARDWARE_NOT_PRESENT = NCS_DISCONNECTING + 1, 44 NCS_HARDWARE_DISABLED = NCS_HARDWARE_NOT_PRESENT + 1, 45 NCS_HARDWARE_MALFUNCTION = NCS_HARDWARE_DISABLED + 1, 46 NCS_MEDIA_DISCONNECTED = NCS_HARDWARE_MALFUNCTION + 1, 47 NCS_AUTHENTICATING = NCS_MEDIA_DISCONNECTED + 1, 48 NCS_AUTHENTICATION_SUCCEEDED= NCS_AUTHENTICATING + 1, 49 NCS_AUTHENTICATION_FAILED = NCS_AUTHENTICATION_SUCCEEDED + 1, 50 NCS_INVALID_ADDRESS = NCS_AUTHENTICATION_FAILED + 1, 51 NCS_CREDENTIALS_REQUIRED = NCS_INVALID_ADDRESS + 1 52 }NETCON_STATUS; 53 54 typedef enum 55 { 56 NCT_DIRECT_CONNECT = 0, 57 NCT_INBOUND = NCT_DIRECT_CONNECT + 1, 58 NCT_INTERNET = NCT_INBOUND + 1, 59 NCT_LAN = NCT_INTERNET + 1, 60 NCT_PHONE = NCT_LAN + 1, 61 NCT_TUNNEL = NCT_PHONE + 1, 62 NCT_BRIDGE = NCT_TUNNEL + 1 63 }NETCON_TYPE; 64 65 66 typedef enum 67 { 68 NCM_NONE = 0, 69 NCM_DIRECT = NCM_NONE + 1, 70 NCM_ISDN = NCM_DIRECT + 1, 71 NCM_LAN = NCM_ISDN + 1, 72 NCM_PHONE = NCM_LAN + 1, 73 NCM_TUNNEL = NCM_PHONE + 1, 74 NCM_PPPOE = NCM_TUNNEL + 1, 75 NCM_BRIDGE = NCM_PPPOE + 1, 76 NCM_SHAREDACCESSHOST_LAN = NCM_BRIDGE + 1, 77 NCM_SHAREDACCESSHOST_RAS = NCM_SHAREDACCESSHOST_LAN + 1 78 }NETCON_MEDIATYPE; 79 80 81 typedef struct tagNETCON_PROPERTIES 82 { 83 GUID guidId; 84 LPWSTR pszwName; 85 LPWSTR pszwDeviceName; 86 NETCON_STATUS Status; 87 NETCON_MEDIATYPE MediaType; 88 DWORD dwCharacter; 89 CLSID clsidThisObject; 90 CLSID clsidUiObject; 91 }NETCON_PROPERTIES; 92 93 94 #undef INTERFACE 95 #define INTERFACE INetConnection 96 DECLARE_INTERFACE_(INetConnection, IUnknown) 97 { 98 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 99 STDMETHOD_(ULONG,AddRef)(THIS) PURE; 100 STDMETHOD_(ULONG,Release) (THIS) PURE; 101 STDMETHOD_(HRESULT,Connect) (THIS) PURE; 102 STDMETHOD_(HRESULT,Disconnect) (THIS) PURE; 103 STDMETHOD_(HRESULT,Delete) (THIS) PURE; 104 STDMETHOD_(HRESULT,Duplicate)(THIS_ LPCWSTR pszwDuplicateName, INetConnection **ppCon) PURE; 105 STDMETHOD_(HRESULT,GetProperties) (THIS_ NETCON_PROPERTIES **ppProps) PURE; 106 STDMETHOD_(HRESULT,GetUiObjectClassId) (THIS_ CLSID *pclsid) PURE; 107 STDMETHOD_(HRESULT,Rename) (THIS_ LPCWSTR pszwNewName) PURE; 108 }; 109 #undef INTERFACE 110 111 #if !defined(__cplusplus) || defined(CINTERFACE) 112 /*** IUnknown methods ***/ 113 #define INetConnection_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 114 #define INetConnection_AddRef(p) (p)->lpVtbl->AddRef(p) 115 #define INetConnection_Release(p) (p)->lpVtbl->Release(p) 116 #define INetConnection_Connect(p) (p)->lpVtbl->Connect(p) 117 #define INetConnection_Disconnect(p) (p)->lpVtbl->Disconnect(p) 118 #define INetConnection_Delete(p) (p)->lpVtbl->Delete(p) 119 #define INetConnection_Duplicate(p,a,b) (p)->lpVtbl->Duplicate(p,a,b) 120 #define INetConnection_GetProperties(p,a) (p)->lpVtbl->GetProperties(p,a) 121 #define INetConnection_GetUiObjectClassId(p,a) (p)->lpVtbl->GetUiObjectClassId(p,a) 122 #define INetConnection_Rename(p,a) (p)->lpVtbl->Rename(p,a) 123 #endif 124 125 EXTERN_C const IID IID_INetConnection; 126 127 128 #undef INTERFACE 129 #define INTERFACE IEnumNetConnection 130 DECLARE_INTERFACE_(IEnumNetConnection, IUnknown) 131 { 132 STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; 133 STDMETHOD_(ULONG,AddRef) (THIS) PURE; 134 STDMETHOD_(ULONG,Release) (THIS) PURE; 135 STDMETHOD(Next)(THIS_ ULONG celt, INetConnection **rgelt, ULONG *pceltFetched) PURE; 136 STDMETHOD(Skip) (THIS_ ULONG celt) PURE; 137 STDMETHOD(Reset) (THIS) PURE; 138 STDMETHOD(Clone) (THIS_ IEnumNetConnection **ppenum) PURE; 139 }; 140 #undef INTERFACE 141 142 EXTERN_C const IID IID_IEnumNetConnection; 143 144 #if !defined(__cplusplus) || defined(CINTERFACE) 145 #define IEnumNetConnection_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 146 #define IEnumNetConnection_AddRef(p) (p)->lpVtbl->AddRef(p) 147 #define IEnumNetConnection_Release(p) (p)->lpVtbl->Release(p) 148 #define IEnumNetConnection_Next(p,a,b,c) (p)->lpVtbl->Next(p,a,b,c) 149 #define IEnumNetConnection_Skip(p,a) (p)->lpVtbl->Skip(p,a) 150 #define IEnumNetConnection_Reset(p) (p)->lpVtbl->Reset(p) 151 #define IEnumNetConnection_Clone(p,a) (p)->lpVtbl->Clone(p,a) 152 #endif 153 154 #undef INTERFACE 155 #define INTERFACE INetConnectionManager 156 DECLARE_INTERFACE_(INetConnectionManager, IUnknown) 157 { 158 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 159 STDMETHOD_(ULONG,AddRef)(THIS) PURE; 160 STDMETHOD_(ULONG,Release) (THIS) PURE; 161 STDMETHOD_(HRESULT,EnumConnections) (THIS_ NETCONMGR_ENUM_FLAGS Flags, IEnumNetConnection **ppEnum) PURE; 162 }; 163 #undef INTERFACE 164 165 #if !defined(__cplusplus) || defined(CINTERFACE) 166 #define INetConnectionManager_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 167 #define INetConnectionManager_AddRef(p) (p)->lpVtbl->AddRef(p) 168 #define INetConnectionManager_Release(p) (p)->lpVtbl->Release(p) 169 #define INetConnectionManager_EnumConnections(p,a,b) (p)->lpVtbl->EnumConnections(p,a,b) 170 #endif 171 172 EXTERN_C const CLSID CLSID_ConnectionManager; 173 EXTERN_C const IID IID_INetConnectionManager; 174 175 typedef enum 176 { 177 NCUC_DEFAULT = 0, 178 NCUC_NO_UI = 1, 179 NCUC_ENABLE_DISABLE = 2 180 }NETCONUI_CONNECT_FLAGS; 181 182 #undef INTERFACE 183 #define INTERFACE INetConnectionConnectUi 184 DECLARE_INTERFACE_(INetConnectionConnectUi, IUnknown) 185 { 186 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 187 STDMETHOD_(ULONG,AddRef)(THIS) PURE; 188 STDMETHOD_(ULONG,Release) (THIS) PURE; 189 STDMETHOD_(HRESULT,SetConnection)(THIS_ INetConnection* pCon) PURE; 190 STDMETHOD_(HRESULT,Connect) (THIS_ HWND hwndParent, DWORD dwFlags) PURE; 191 STDMETHOD_(HRESULT,Disconnect) (THIS_ HWND hwndParent, DWORD dwFlags) PURE; 192 }; 193 194 #if !defined(__cplusplus) || defined(CINTERFACE) 195 #define INetConnectionConnectUi_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 196 #define INetConnectionConnectUi_AddRef(p) (p)->lpVtbl->AddRef(p) 197 #define INetConnectionConnectUi_Release(p) (p)->lpVtbl->Release(p) 198 #define INetConnectionConnectUi_SetConnection(p,a) (p)->lpVtbl->SetConnection(p,a) 199 #define INetConnectionConnectUi_Connect(p,a,b) (p)->lpVtbl->Connect(p,a,b) 200 #define INetConnectionConnectUi_Disconnect(p,a,b) (p)->lpVtbl->Disconnect(p,a,b) 201 #endif 202 203 EXTERN_C const IID IID_INetConnectionConnectUi; 204 205 #undef INTERFACE 206 #define INTERFACE INetConnectionPropertyUi 207 DECLARE_INTERFACE_(INetConnectionPropertyUi, IUnknown) 208 { 209 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 210 STDMETHOD_(ULONG,AddRef)(THIS) PURE; 211 STDMETHOD_(ULONG,Release) (THIS) PURE; 212 STDMETHOD_(HRESULT, SetConnection) (THIS_ INetConnection *pCon) PURE; 213 STDMETHOD_(HRESULT, AddPages) (THIS_ HWND hwndParent, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) PURE; 214 215 216 }; 217 #undef INTERFACE 218 219 #if !defined(__cplusplus) || defined(CINTERFACE) 220 #define INetConnectionPropertyUi_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 221 #define INetConnectionPropertyUi_AddRef(p) (p)->lpVtbl->AddRef(p) 222 #define INetConnectionPropertyUi_Release(p) (p)->lpVtbl->Release(p) 223 #define INetConnectionPropertyUi_SetConnection(p,a) (p)->lpVtbl->SetConnection(p,a) 224 #define INetConnectionPropertyUi_AddPages(p,a,b,c) (p)->lpVtbl->AddPages(p,a,b,c) 225 #endif 226 227 EXTERN_C const IID IID_INetConnectionPropertyUi; 228 229 #undef INTERFACE 230 #define INTERFACE INetConnectionPropertyUi2 231 DECLARE_INTERFACE_(INetConnectionPropertyUi2, IUnknown) 232 { 233 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 234 STDMETHOD_(ULONG,AddRef)(THIS) PURE; 235 STDMETHOD_(ULONG,Release) (THIS) PURE; 236 STDMETHOD_(HRESULT, SetConnection) (THIS_ INetConnection *pCon) PURE; 237 STDMETHOD_(HRESULT, AddPages) (THIS_ HWND hwndParent, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) PURE; 238 STDMETHOD_(HRESULT, GetIcon) (THIS_ DWORD dwSize, HICON *phIcon) PURE; 239 }; 240 #undef INTERFACE 241 242 #if !defined(__cplusplus) || defined(CINTERFACE) 243 #define INetConnectionPropertyUi2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 244 #define INetConnectionPropertyUi2_AddRef(p) (p)->lpVtbl->AddRef(p) 245 #define INetConnectionPropertyUi2_Release(p) (p)->lpVtbl->Release(p) 246 #define INetConnectionPropertyUi2_SetConnection(p,a) (p)->lpVtbl->SetConnection(p,a) 247 #define INetConnectionPropertyUi2_AddPages(p,a,b,c) (p)->lpVtbl->AddPages(p,a,b,c) 248 #define INetConnectionPropertyUi2_GetIcon(p,a,b) (p)->lpVtbl->GetIcon(p,a,b) 249 #endif 250 251 252 EXTERN_C const IID IID_INetConnectionPropertyUi2; 253 254 255 VOID WINAPI NcFreeNetconProperties (NETCON_PROPERTIES* pProps); 256 257 #ifdef __cplusplus 258 } 259 #endif 260 261 #endif 262