VBoxNetCfg-win.h revision 7420e5ee5565b181c144eabb14da0da9e8cce657
46aaabc8a214c34755a130aa619fba2483d50370vboxsync/* $Id$ */
46aaabc8a214c34755a130aa619fba2483d50370vboxsync/** @file
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync * Network Configuration API for Windows platforms.
46aaabc8a214c34755a130aa619fba2483d50370vboxsync */
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsync/*
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * Copyright (C) 2011 Oracle Corporation
46aaabc8a214c34755a130aa619fba2483d50370vboxsync *
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * available from http://www.virtualbox.org. This file is free software;
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * you can redistribute it and/or modify it under the terms of the GNU
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * General Public License (GPL) as published by the Free Software
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
46aaabc8a214c34755a130aa619fba2483d50370vboxsync */
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#ifndef ___VBox_VBoxNetCfg_win_h
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#define ___VBox_VBoxNetCfg_win_h
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsync#include <winsock2.h>
46aaabc8a214c34755a130aa619fba2483d50370vboxsync#include <Windows.h>
46aaabc8a214c34755a130aa619fba2483d50370vboxsync#include <Netcfgn.h>
46aaabc8a214c34755a130aa619fba2483d50370vboxsync#include <Setupapi.h>
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#include <VBox/cdefs.h>
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsync/** @defgroup grp_vboxnetcfgwin The Windows Network Configration Library
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * @{ */
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsync/** @def VBOXNETCFGWIN_DECL
46aaabc8a214c34755a130aa619fba2483d50370vboxsync * The usual declaration wrapper.
46aaabc8a214c34755a130aa619fba2483d50370vboxsync */
46aaabc8a214c34755a130aa619fba2483d50370vboxsync#if 0
46aaabc8a214c34755a130aa619fba2483d50370vboxsync/* enable this in case we include this in a dll*/
46aaabc8a214c34755a130aa619fba2483d50370vboxsync# ifdef IN_VBOXDDU
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync# define VBOXNETCFGWIN_DECL(a_Type) DECLEXPORT(a_Type)
46aaabc8a214c34755a130aa619fba2483d50370vboxsync# else
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync# define VBOXNETCFGWIN_DECL(a_Type) DECLIMPORT(a_Type)
46aaabc8a214c34755a130aa619fba2483d50370vboxsync# endif
46aaabc8a214c34755a130aa619fba2483d50370vboxsync#else
46aaabc8a214c34755a130aa619fba2483d50370vboxsync/*enable this in case we include this in a static lib*/
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync# define VBOXNETCFGWIN_DECL(a_Type) a_Type VBOXCALL
46aaabc8a214c34755a130aa619fba2483d50370vboxsync#endif
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncRT_C_DECLS_BEGIN
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinQueryINetCfg(OUT INetCfg **ppNetCfg,
46aaabc8a214c34755a130aa619fba2483d50370vboxsync IN BOOL fGetWriteLock,
46aaabc8a214c34755a130aa619fba2483d50370vboxsync IN LPCWSTR pszwClientDescription,
46aaabc8a214c34755a130aa619fba2483d50370vboxsync IN DWORD cmsTimeout,
46aaabc8a214c34755a130aa619fba2483d50370vboxsync OUT LPWSTR *ppszwClientDescription);
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinReleaseINetCfg(IN INetCfg *pNetCfg, IN BOOL fHasWriteLock);
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetComponentByGuid(IN INetCfg *pNc, IN const GUID *pguidClass,
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync IN const GUID * pComponentGuid, OUT INetCfgComponent **ppncc);
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinNetFltInstall(IN INetCfg *pNc, IN LPCWSTR * apInfFullPaths, IN UINT cInfFullPaths);
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinNetFltUninstall(IN INetCfg *pNc);
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinCreateHostOnlyNetworkInterface(IN LPCWSTR pInfPath, IN bool bIsInfPathFile,
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync OUT GUID *pGuid, OUT BSTR *lppszName,
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync OUT BSTR *pErrMsg);
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRemoveHostOnlyNetworkInterface(IN const GUID *pGUID, OUT BSTR *pErrMsg);
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRemoveAllNetDevicesOfId(IN LPCWSTR lpszPnPId);
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGenHostOnlyNetworkNetworkIp(OUT PULONG pNetIp, OUT PULONG pNetMask);
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsynctypedef struct ADAPTER_SETTINGS
46aaabc8a214c34755a130aa619fba2483d50370vboxsync{
46aaabc8a214c34755a130aa619fba2483d50370vboxsync ULONG ip;
46aaabc8a214c34755a130aa619fba2483d50370vboxsync ULONG mask;
46aaabc8a214c34755a130aa619fba2483d50370vboxsync BOOL bDhcp;
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync} ADAPTER_SETTINGS, *PADAPTER_SETTINGS; /**< I'm not prefixed */
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnableStaticIpConfig(IN const GUID *pGuid, IN ULONG ip, IN ULONG mask);
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetAdapterSettings(IN const GUID * pGuid, OUT PADAPTER_SETTINGS pSettings);
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnableDynamicIpConfig(IN const GUID *pGuid);
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinDhcpRediscover(IN const GUID *pGuid);
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsynctypedef VOID (*LOG_ROUTINE)(LPCSTR szString); /**< I'm not prefixed. */
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncVBOXNETCFGWIN_DECL(VOID) VBoxNetCfgWinSetLogging(IN LOG_ROUTINE pfnLog);
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsyncRT_C_DECLS_END
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
46aaabc8a214c34755a130aa619fba2483d50370vboxsync/** @} */
46aaabc8a214c34755a130aa619fba2483d50370vboxsync
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#endif
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync