1 | /** @file
|
---|
2 | * VBoxNetFlt - Briefly describe this file, optionally with a longer description
|
---|
3 | * in a separate paragraph. (HostDrivers)
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008 Sun Microsystems, Inc.
|
---|
8 | *
|
---|
9 | * Sun Microsystems, Inc. confidential
|
---|
10 | * All rights reserved
|
---|
11 | */
|
---|
12 | /*
|
---|
13 | * Based in part on Microsoft DDK sample code for Ndis Intermediate Miniport passthru driver sample.
|
---|
14 | *+---------------------------------------------------------------------------
|
---|
15 | *
|
---|
16 | * Microsoft Windows
|
---|
17 | * Copyright (C) Microsoft Corporation, 2001.
|
---|
18 | *
|
---|
19 | * Author: Alok Sinha 15-May-01
|
---|
20 | *
|
---|
21 | *----------------------------------------------------------------------------
|
---|
22 | */
|
---|
23 |
|
---|
24 | #ifndef ___VBox_WinNetConfig_h
|
---|
25 | #define ___VBox_WinNetConfig_h
|
---|
26 |
|
---|
27 | #include <winsock2.h>
|
---|
28 | #include <Windows.h>
|
---|
29 | #include <Netcfgn.h>
|
---|
30 | #include <Setupapi.h>
|
---|
31 | #include <iprt/cdefs.h>
|
---|
32 |
|
---|
33 | /** @defgroup grp_vboxnetcfgwin The Windows Network Configration Library
|
---|
34 | * @{ */
|
---|
35 |
|
---|
36 | /** @def VBOXNETCFGWIN_DECL
|
---|
37 | * The usual declaration wrapper.
|
---|
38 | */
|
---|
39 | #if 0
|
---|
40 | /* enable this in case we include this in a dll*/
|
---|
41 | # ifdef IN_VBOXDDU
|
---|
42 | # define VBOXNETCFGWIN_DECL(_type) DECLEXPORT(_type)
|
---|
43 | # else
|
---|
44 | # define VBOXNETCFGWIN_DECL(_type) DECLIMPORT(_type)
|
---|
45 | # endif
|
---|
46 | #else
|
---|
47 | /*enable this in case we include this in a static lib*/
|
---|
48 | # define VBOXNETCFGWIN_DECL(_type) _type
|
---|
49 | #endif
|
---|
50 |
|
---|
51 | RT_C_DECLS_BEGIN
|
---|
52 |
|
---|
53 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinQueryINetCfg(IN BOOL fGetWriteLock, IN LPCWSTR lpszAppName, OUT INetCfg** ppnc, OUT LPWSTR *lpszLockedBy);
|
---|
54 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinReleaseINetCfg(IN INetCfg *pnc, IN BOOL fHasWriteLock);
|
---|
55 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetComponentEnum(INetCfg *pnc, IN const GUID *pguidClass, OUT IEnumNetCfgComponent **ppencc);
|
---|
56 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetFirstComponent(IN IEnumNetCfgComponent *pencc, OUT INetCfgComponent **ppncc);
|
---|
57 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetNextComponent(IN IEnumNetCfgComponent *pencc, OUT INetCfgComponent **ppncc);
|
---|
58 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinInstallComponent(IN INetCfg *pnc, IN LPCWSTR szComponentId, IN const GUID *pguidClass);
|
---|
59 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinInstallNetComponent(IN INetCfg *pnc, IN LPCWSTR lpszComponentId, IN const GUID *pguidClass,
|
---|
60 | IN LPCWSTR * apInfFullPaths, IN UINT cInfFullPaths);
|
---|
61 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinUninstallComponent(IN INetCfg *pnc, IN INetCfgComponent *pncc);
|
---|
62 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetNextBindingPath(IN IEnumNetCfgBindingPath *pencbp, OUT INetCfgBindingPath **ppncbp);
|
---|
63 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetNextBindingInterface(IN IEnumNetCfgBindingInterface *pencbi, OUT INetCfgBindingInterface **ppncbi);
|
---|
64 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetFirstBindingInterface(IN IEnumNetCfgBindingInterface *pencbi, OUT INetCfgBindingInterface **ppncbi);
|
---|
65 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetBindingInterfaceEnum(IN INetCfgBindingPath *pncbp, OUT IEnumNetCfgBindingInterface **ppencbi);
|
---|
66 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetFirstBindingPath(IN IEnumNetCfgBindingPath *pencbp, OUT INetCfgBindingPath **ppncbp);
|
---|
67 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetBindingPathEnum(IN INetCfgComponent *pncc, IN DWORD dwBindingType, OUT IEnumNetCfgBindingPath **ppencbp);
|
---|
68 | VBOXNETCFGWIN_DECL(VOID) VBoxNetCfgWinReleaseRef(IN IUnknown *punk);
|
---|
69 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetComponentByGuid(IN INetCfg *pNc, IN const GUID *pguidClass, IN const GUID * pComponentGuid, OUT INetCfgComponent **ppncc);
|
---|
70 |
|
---|
71 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinNetFltUninstall(IN INetCfg *pNc);
|
---|
72 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinNetFltInstall(IN INetCfg *pNc, IN LPCWSTR * apInfFullPaths, IN UINT cInfFullPaths);
|
---|
73 |
|
---|
74 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGenHostonlyConnectionName (PCWSTR DevName, WCHAR *pBuf, PULONG pcbBuf);
|
---|
75 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRenameConnection (LPWSTR pGuid, PCWSTR NewName);
|
---|
76 |
|
---|
77 | typedef BOOL (*VBOXNETCFGWIN_NETENUM_CALLBACK) (HDEVINFO hDevInfo, PSP_DEVINFO_DATA pDev, PVOID pContext);
|
---|
78 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnumNetDevices(LPWSTR pPnPId, VBOXNETCFGWIN_NETENUM_CALLBACK callback, PVOID pContext);
|
---|
79 |
|
---|
80 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRemoveHostOnlyNetworkInterface (const GUID *pGUID, BSTR *pErrMsg);
|
---|
81 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRemoveAllNetDevicesOfId(LPWSTR pPnPId);
|
---|
82 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinCreateHostOnlyNetworkInterface (GUID *pGuid, BSTR *lppszName, BSTR *pErrMsg);
|
---|
83 |
|
---|
84 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinDhcpRediscover(const GUID *pGuid);
|
---|
85 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnableDynamicIpConfig(const GUID *pGuid);
|
---|
86 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnableStaticIpConfig(const GUID *pGuid, ULONG ip, ULONG mask);
|
---|
87 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinIsDhcpEnabled(const GUID * pGuid, BOOL *pEnabled);
|
---|
88 |
|
---|
89 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGenHostOnlyNetworkNetworkIp(PULONG pNetIp, PULONG pNetMask);
|
---|
90 |
|
---|
91 | typedef struct _ADAPTER_SETTINGS
|
---|
92 | {
|
---|
93 | ULONG ip;
|
---|
94 | ULONG mask;
|
---|
95 | BOOL bDhcp;
|
---|
96 | }ADAPTER_SETTINGS, *PADAPTER_SETTINGS;
|
---|
97 |
|
---|
98 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetAdapterSettings(const GUID * pGuid, PADAPTER_SETTINGS pSettings);
|
---|
99 |
|
---|
100 | typedef VOID (*LOG_ROUTINE) (LPCWSTR szString);
|
---|
101 | VBOXNETCFGWIN_DECL(VOID) VBoxNetCfgWinSetLogging(LOG_ROUTINE Log);
|
---|
102 |
|
---|
103 | RT_C_DECLS_END
|
---|
104 |
|
---|
105 | /** @} */
|
---|
106 |
|
---|
107 | #endif
|
---|
108 |
|
---|