Index: trunk/src/VBox/Devices/Makefile.kmk
===================================================================
--- trunk/src/VBox/Devices/Makefile.kmk	(revision 18321)
+++ trunk/src/VBox/Devices/Makefile.kmk	(revision 18323)
@@ -767,5 +767,4 @@
   Drivers_DEFS.win     += VBOX_NETFLT_ONDEMAND_BIND
  endif
- Drivers_SOURCES.win   += Network/win/DrvIntNet-win.cpp
 endif
 
Index: trunk/src/VBox/Devices/Network/DrvIntNet.cpp
===================================================================
--- trunk/src/VBox/Devices/Network/DrvIntNet.cpp	(revision 18321)
+++ trunk/src/VBox/Devices/Network/DrvIntNet.cpp	(revision 18323)
@@ -40,8 +40,4 @@
 
 #include "../Builtins.h"
-
-#if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
-# include "win/DrvIntNet-win.h"
-#endif
 
 
@@ -1024,27 +1020,5 @@
         strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("wif=") - 1]);
     }
-
-#elif defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
-    if (OpenReq.enmTrunkType == kIntNetTrunkType_NetFlt
-            || OpenReq.enmTrunkType == kIntNetTrunkType_NetAdp)
-    {
-# ifndef VBOX_NETFLT_ONDEMAND_BIND
-        /*
-         * We have a ndis filter driver started on system boot before the VBoxDrv,
-         * tell the filter driver to init VBoxNetFlt functionality.
-         */
-        rc = drvIntNetWinConstruct(pDrvIns, pCfgHandle, OpenReq.enmTrunkType);
-        AssertLogRelMsgRCReturn(rc, ("drvIntNetWinConstruct failed, rc=%Rrc", rc), rc);
-# endif
-
-        /*
-         * <Describe what this does here or/and in the function docs of drvIntNetWinIfGuidToBindName>.
-         */
-        char szBindName[INTNET_MAX_TRUNK_NAME];
-        rc = drvIntNetWinIfGuidToBindName(OpenReq.szTrunk, szBindName, INTNET_MAX_TRUNK_NAME);
-        AssertLogRelMsgRCReturn(rc, ("drvIntNetWinIfGuidToBindName failed, rc=%Rrc", rc), rc);
-        strcpy(OpenReq.szTrunk, szBindName);
-    }
-#endif /* WINDOWS && NETFLT */
+#endif /* DARWIN */
 
     /*
Index: trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp	(revision 18321)
+++ trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp	(revision 18323)
@@ -61,8 +61,13 @@
 static const RTGETOPTDEF g_aDHCPIPOptions[]
     = {
-        { "--netname",          'n', RTGETOPT_REQ_STRING },
-        { "-netname",           'n', RTGETOPT_REQ_STRING },     // deprecated (if removed check below)
-        { "--ifname",           'i', RTGETOPT_REQ_STRING },
-        { "-ifname",            'i', RTGETOPT_REQ_STRING },     // deprecated
+        { "--netname",          't', RTGETOPT_REQ_STRING },  /* we use 't' instead of 'n' to avoid
+                                                              * 1. the misspelled "-enable" long option to be treated as 'e' (for -enable) + 'n' (for -netname) + "<the_rest_opt>" (for net name)
+                                                              * 2. the misspelled "-netmask" to be treated as 'n' (for -netname) + "<the_rest_opt>" (for net name)
+                                                              */
+        { "-netname",           't', RTGETOPT_REQ_STRING },     // deprecated (if removed check below)
+        { "--ifname",           'f', RTGETOPT_REQ_STRING },  /* we use 'f' instead of 'i' to avoid
+                                                              * 1. the misspelled "-disable" long option to be treated as 'd' (for -disable) + 'i' (for -ifname) + "<the_rest_opt>" (for if name)
+                                                              */
+        { "-ifname",            'f', RTGETOPT_REQ_STRING },     // deprecated
         { "--ip",               'a', RTGETOPT_REQ_STRING },
         { "-ip",                'a', RTGETOPT_REQ_STRING },     // deprecated
@@ -109,5 +114,5 @@
         switch (c)
         {
-            case 'n':   // --netname
+            case 't':   // --netname
                 if(pNetName)
                     return errorSyntax(USAGE_DHCPSERVER, "You can only specify --netname once.");
@@ -119,5 +124,5 @@
                 }
             break;
-            case 'i':   // --ifname
+            case 'f':   // --ifname
                 if(pIfName)
                     return errorSyntax(USAGE_DHCPSERVER, "You can only specify --ifname once.");
Index: trunk/src/VBox/Main/ConsoleImpl2.cpp
===================================================================
--- trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 18321)
+++ trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 18323)
@@ -1485,7 +1485,78 @@
                         H();
                     }
-                    char szDriverGUID[RTUUID_STR_LENGTH];
-                    strcpy(szDriverGUID , hostIFGuid.toString().raw());
-                    const char *pszTrunk = szDriverGUID;
+
+                    INetCfg              *pNc;
+                    ComPtr<INetCfgComponent> pAdaptorComponent;
+                    LPWSTR               lpszApp;
+                    int rc = VERR_INTNET_FLT_IF_NOT_FOUND;
+
+                    hrc = VBoxNetCfgWinQueryINetCfg( FALSE,
+                                       L"VirtualBox",
+                                       &pNc,
+                                       &lpszApp );
+                    Assert(hrc == S_OK);
+                    if(hrc == S_OK)
+                    {
+                        /* get the adapter's INetCfgComponent*/
+                        hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.ptr(), pAdaptorComponent.asOutParam());
+                        if(hrc != S_OK)
+                        {
+                            VBoxNetCfgWinReleaseINetCfg( pNc, FALSE );
+                            LogRel(("NetworkAttachmentType_Bridged: VBoxNetCfgWinGetComponentByGuid failed, hrc (0x%x)", hrc));
+                            H();
+                        }
+                    }
+#define VBOX_WIN_BINDNAME_PREFIX "\\DEVICE\\"
+                    char szTrunkName[INTNET_MAX_TRUNK_NAME];
+                    char *pszTrunkName = szTrunkName;
+                    wchar_t * pswzBindName;
+                    hrc = pAdaptorComponent->GetBindName(&pswzBindName);
+                    Assert(hrc == S_OK);
+                    if (hrc == S_OK)
+                    {
+                        int cwBindName = (int)wcslen(pswzBindName) + 1;
+                        int cbFullBindNamePrefix = sizeof(VBOX_WIN_BINDNAME_PREFIX);
+                        if(sizeof(szTrunkName) > cbFullBindNamePrefix + cwBindName)
+                        {
+                            strcpy(szTrunkName, VBOX_WIN_BINDNAME_PREFIX);
+                            pszTrunkName += cbFullBindNamePrefix-1;
+                            if(!WideCharToMultiByte(CP_ACP, 0, pswzBindName, cwBindName, pszTrunkName,
+                                    sizeof(szTrunkName) - cbFullBindNamePrefix + 1, NULL, NULL))
+                            {
+                                Assert(0);
+                                DWORD err = GetLastError();
+                                hrc = HRESULT_FROM_WIN32(err);
+                                AssertMsgFailed(("%hrc=%Rhrc %#x\n", hrc, hrc));
+                                LogRel(("NetworkAttachmentType_Bridged: WideCharToMultiByte failed, hr=%Rhrc (0x%x)\n", hrc, hrc));
+                            }
+                        }
+                        else
+                        {
+                            Assert(0);
+                            LogRel(("NetworkAttachmentType_Bridged: insufficient szTrunkName buffer space\n"));
+                            /** @todo set appropriate error code */
+                            hrc = E_FAIL;
+                        }
+
+                        if(hrc != S_OK)
+                        {
+                            Assert(0);
+                            CoTaskMemFree(pswzBindName);
+                            VBoxNetCfgWinReleaseINetCfg( pNc, FALSE );
+                            H();
+                        }
+
+                        /* we're not freeing the bind name since we'll use it later for detecting wireless*/
+                    }
+                    else
+                    {
+                        Assert(0);
+                        VBoxNetCfgWinReleaseINetCfg( pNc, FALSE );
+                        LogRel(("NetworkAttachmentType_Bridged: VBoxNetCfgWinGetComponentByGuid failed, hrc (0x%x)", hrc));
+                        H();
+                    }
+                    const char *pszTrunk = szTrunkName;
+                    /* we're not releasing the INetCfg stuff here since we use it later to figure out whether it is wireless */
+
 # elif defined(RT_OS_LINUX)
                     /* @todo Check for malformed names. */
@@ -1539,38 +1610,15 @@
 # elif defined(RT_OS_WINDOWS)
 #  define DEVNAME_PREFIX L"\\\\.\\"
-                    INetCfg              *pNc;
-                    LPWSTR               lpszApp;
-                    HRESULT              hr;
-                    int rc = VERR_INTNET_FLT_IF_NOT_FOUND;
-
                     /* we are getting the medium type via IOCTL_NDIS_QUERY_GLOBAL_STATS Io Control
                      * there is a pretty long way till there though since we need to obtain the symbolic link name
                      * for the adapter device we are going to query given the device Guid */
-                    hr = VBoxNetCfgWinQueryINetCfg( FALSE,
-                                       L"VirtualBox",
-                                       &pNc,
-                                       &lpszApp );
-                    Assert(hr == S_OK);
-                    if(hr == S_OK)
-                    {
-                        /* get the adapter's INetCfgComponent*/
-                        INetCfgComponent *pAdaptorComponent;
-                        hr = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.ptr(), &pAdaptorComponent);
-                        Assert(hr == S_OK);
-                        if(hr == S_OK)
-                        {
-                            /* now get the bind name */
-                            LPWSTR pName;
-                            hr = pAdaptorComponent->GetBindName(&pName);
-                            Assert(hr == S_OK);
-                            if(hr == S_OK)
-                            {
-                                /* prepend the "\\\\.\\" to the bind name to obtain the link name */
-                                wchar_t FileName[MAX_PATH];
-                                wcscpy(FileName, DEVNAME_PREFIX);
-                                wcscpy((wchar_t*)(((char*)FileName) + sizeof(DEVNAME_PREFIX) - sizeof(FileName[0])), pName);
-
-                                /* open the device */
-                                HANDLE hDevice = CreateFile(FileName,
+
+                     /* prepend the "\\\\.\\" to the bind name to obtain the link name */
+                     wchar_t FileName[MAX_PATH];
+                     wcscpy(FileName, DEVNAME_PREFIX);
+                     wcscpy((wchar_t*)(((char*)FileName) + sizeof(DEVNAME_PREFIX) - sizeof(FileName[0])), pswzBindName);
+
+                     /* open the device */
+                     HANDLE hDevice = CreateFile(FileName,
                                                             GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
                                                             NULL,
@@ -1578,14 +1626,14 @@
                                                             FILE_ATTRIBUTE_NORMAL,
                                                             NULL);
-                                if (hDevice != INVALID_HANDLE_VALUE)
-                                {
-                                    /* now issue the OID_GEN_PHYSICAL_MEDIUM query */
-                                    DWORD Oid = OID_GEN_PHYSICAL_MEDIUM;
-                                    NDIS_PHYSICAL_MEDIUM PhMedium;
-                                    DWORD cbResult;
-                                    if (DeviceIoControl(hDevice, IOCTL_NDIS_QUERY_GLOBAL_STATS, &Oid, sizeof(Oid), &PhMedium, sizeof(PhMedium), &cbResult, NULL))
-                                    {
-                                        /* that was simple, now examine PhMedium */
-                                        if(PhMedium == NdisPhysicalMediumWirelessWan
+                     if (hDevice != INVALID_HANDLE_VALUE)
+                     {
+                         /* now issue the OID_GEN_PHYSICAL_MEDIUM query */
+                         DWORD Oid = OID_GEN_PHYSICAL_MEDIUM;
+                         NDIS_PHYSICAL_MEDIUM PhMedium;
+                         DWORD cbResult;
+                         if (DeviceIoControl(hDevice, IOCTL_NDIS_QUERY_GLOBAL_STATS, &Oid, sizeof(Oid), &PhMedium, sizeof(PhMedium), &cbResult, NULL))
+                         {
+                             /* that was simple, now examine PhMedium */
+                             if(PhMedium == NdisPhysicalMediumWirelessWan
                                                 || PhMedium == NdisPhysicalMediumWirelessLan
                                                 || PhMedium == NdisPhysicalMediumNative802_11
@@ -1593,35 +1641,35 @@
                                                 /*|| PhMedium == NdisPhysicalMediumWiMax*/
                                                 )
-                                        {
-                                            Log(("this is a wireles adapter"));
-                                            rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true);    RC_CHECK();
+                             {
+                                 Log(("this is a wireless adapter"));
+                                 rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true);    RC_CHECK();
                                                                         Log(("Set SharedMacOnWire\n"));
-                                        }
-                                        else
-                                        {
-                                            Log(("this is NOT a wireles adapter"));
-                                        }
-                                    }
-                                    else
-                                    {
-                                        int winEr = GetLastError();
-                                        LogRel(("Console::configConstructor: DeviceIoControl failed, err (0x%x), ignoring\n", winEr));
-                                        Assert(winEr == ERROR_INVALID_PARAMETER || winEr == ERROR_NOT_SUPPORTED || winEr == ERROR_BAD_COMMAND);
-                                    }
-
-                                    CloseHandle(hDevice);
-                                }
-                                else
-                                {
-                                    int winEr = GetLastError();
-                                    LogRel(("Console::configConstructor: CreateFile failed, err (0x%x), ignoring\n", winEr));
-                                    AssertBreakpoint();
-                                }
-                                CoTaskMemFree(pName);
-                            }
-                            VBoxNetCfgWinReleaseRef(pAdaptorComponent);
-                        }
-                        VBoxNetCfgWinReleaseINetCfg( pNc, FALSE );
-                    }
+                             }
+                             else
+                             {
+                                 Log(("this is NOT a wireless adapter"));
+                             }
+                         }
+                         else
+                         {
+                             int winEr = GetLastError();
+                             LogRel(("Console::configConstructor: DeviceIoControl failed, err (0x%x), ignoring\n", winEr));
+                             Assert(winEr == ERROR_INVALID_PARAMETER || winEr == ERROR_NOT_SUPPORTED || winEr == ERROR_BAD_COMMAND);
+                         }
+
+                         CloseHandle(hDevice);
+                     }
+                     else
+                     {
+                         int winEr = GetLastError();
+                         LogRel(("Console::configConstructor: CreateFile failed, err (0x%x), ignoring\n", winEr));
+                         AssertBreakpoint();
+                     }
+
+                     CoTaskMemFree(pswzBindName);
+
+                     pAdaptorComponent.setNull();
+                     /* release the pNc finally */
+                     VBoxNetCfgWinReleaseINetCfg( pNc, FALSE );
 # else
                     /** @todo PORTME: wireless detection */
@@ -1790,7 +1838,83 @@
                     H();
                 }
-                char szDriverGUID[RTUUID_STR_LENGTH];
-                strcpy(szDriverGUID , hostIFGuid.toString().raw());
-                const char *pszTrunk = szDriverGUID;
+
+                INetCfg              *pNc;
+                ComPtr<INetCfgComponent> pAdaptorComponent;
+                LPWSTR               lpszApp;
+                int rc = VERR_INTNET_FLT_IF_NOT_FOUND;
+
+                hrc = VBoxNetCfgWinQueryINetCfg( FALSE,
+                                   L"VirtualBox",
+                                   &pNc,
+                                   &lpszApp );
+                Assert(hrc == S_OK);
+                if(hrc == S_OK)
+                {
+                    /* get the adapter's INetCfgComponent*/
+                    hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.ptr(), pAdaptorComponent.asOutParam());
+                    if(hrc != S_OK)
+                    {
+                        VBoxNetCfgWinReleaseINetCfg( pNc, FALSE );
+                        LogRel(("NetworkAttachmentType_HostOnly: VBoxNetCfgWinGetComponentByGuid failed, hrc (0x%x)", hrc));
+                        H();
+                    }
+                }
+#define VBOX_WIN_BINDNAME_PREFIX "\\DEVICE\\"
+                char szTrunkName[INTNET_MAX_TRUNK_NAME];
+                char *pszTrunkName = szTrunkName;
+                wchar_t * pswzBindName;
+                hrc = pAdaptorComponent->GetBindName(&pswzBindName);
+                Assert(hrc == S_OK);
+                if (hrc == S_OK)
+                {
+                    int cwBindName = (int)wcslen(pswzBindName) + 1;
+                    int cbFullBindNamePrefix = sizeof(VBOX_WIN_BINDNAME_PREFIX);
+                    if(sizeof(szTrunkName) > cbFullBindNamePrefix + cwBindName)
+                    {
+                        strcpy(szTrunkName, VBOX_WIN_BINDNAME_PREFIX);
+                        pszTrunkName += cbFullBindNamePrefix-1;
+                        if(!WideCharToMultiByte(CP_ACP, 0, pswzBindName, cwBindName, pszTrunkName,
+                                sizeof(szTrunkName) - cbFullBindNamePrefix + 1, NULL, NULL))
+                        {
+                            Assert(0);
+                            DWORD err = GetLastError();
+                            hrc = HRESULT_FROM_WIN32(err);
+                            AssertMsgFailed(("%hrc=%Rhrc %#x\n", hrc, hrc));
+                            LogRel(("NetworkAttachmentType_HostOnly: WideCharToMultiByte failed, hr=%Rhrc (0x%x)\n", hrc, hrc));
+                        }
+                    }
+                    else
+                    {
+                        Assert(0);
+                        LogRel(("NetworkAttachmentType_HostOnly: insufficient szTrunkName buffer space\n"));
+                        /** @todo set appropriate error code */
+                        hrc = E_FAIL;
+                    }
+
+                    if(hrc != S_OK)
+                    {
+                        Assert(0);
+                        CoTaskMemFree(pswzBindName);
+                        VBoxNetCfgWinReleaseINetCfg( pNc, FALSE );
+                        H();
+                    }
+                }
+                else
+                {
+                    Assert(0);
+                    VBoxNetCfgWinReleaseINetCfg( pNc, FALSE );
+                    LogRel(("NetworkAttachmentType_HostOnly: VBoxNetCfgWinGetComponentByGuid failed, hrc (0x%x)", hrc));
+                    H();
+                }
+
+
+                CoTaskMemFree(pswzBindName);
+
+                pAdaptorComponent.setNull();
+                /* release the pNc finally */
+                VBoxNetCfgWinReleaseINetCfg( pNc, FALSE );
+
+                const char *pszTrunk = szTrunkName;
+
 
                 /* TODO: set the proper Trunk and Network values, currently the driver uses the first adapter instance */
Index: trunk/src/VBox/Runtime/nt/RTErrConvertFromNtStatus.cpp
===================================================================
--- trunk/src/VBox/Runtime/nt/RTErrConvertFromNtStatus.cpp	(revision 18321)
+++ trunk/src/VBox/Runtime/nt/RTErrConvertFromNtStatus.cpp	(revision 18323)
@@ -50,4 +50,6 @@
         case STATUS_USER_APC:
             return VERR_INTERRUPTED;
+        case STATUS_OBJECT_NAME_NOT_FOUND:
+            return VERR_FILE_NOT_FOUND;
     }
 
