VirtualBox

Changeset 11814

Show
Ignore:
Timestamp:
08/29/08 14:47:44 (3 months ago)
Author:
vboxsync
Message:

Initial commit of the NetFlt? driver for Windows

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Config.kmk

    r11788 r11814  
    960960DEFS += VBOX_WITH_INTERNAL_NETWORKING 
    961961endif 
     962 
     963ifdef VBOX_WITH_NETFLT_WINDOWS 
     964DEFS.win += VBOX_WITH_NETFLT_WINDOWS 
     965endif 
     966 
    962967 
    963968# 
  • trunk/include/VBox/cdefs.h

    r8564 r11814  
    324324 */ 
    325325#ifdef IN_SUP_R0 
    326 # define SUPR0DECL(type)    DECLEXPORT(type) VBOXCALL 
    327 #else 
    328 # define SUPR0DECL(type)    DECLIMPORT(type) VBOXCALL 
     326# ifdef IN_SUP_STATIC 
     327#  define SUPR0DECL(type)    DECLHIDDEN(type) VBOXCALL 
     328# else 
     329#  define SUPR0DECL(type)    DECLEXPORT(type) VBOXCALL 
     330# endif 
     331#else 
     332# ifdef IN_SUP_STATIC 
     333#  define SUPR0DECL(type)    DECLHIDDEN(type) VBOXCALL 
     334# else 
     335#  define SUPR0DECL(type)    DECLIMPORT(type) VBOXCALL 
     336# endif 
    329337#endif 
    330338 
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/debug.c

    r4027 r11814  
    7171} 
    7272 
     73#endif 
     74 
    7375ULONG __cdecl DbgPrint(PCH pszFormat, ...) 
    7476{ 
     77#ifdef LOG_ENABLED 
    7578    va_list args; 
    7679    va_start(args, pszFormat); 
    77 #ifdef VBOX 
     80# ifdef VBOX 
    7881    RTLogBackdoorPrintfV(pszFormat, args); 
    79 #else 
     82# else 
    8083    EngDebugPrint(STANDARD_DEBUG_PREFIX, pszFormat, args); 
    81 #endif  
     84# endif 
    8285    va_end(args); 
     86#endif 
    8387    return 0; 
    8488} 
    8589 
    86 #endif 
    87  
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r11284 r11814  
    3838#include <iprt/string.h> 
    3939#include <iprt/time.h> 
    40 #ifdef RT_OS_DARWIN 
     40#if defined(RT_OS_DARWIN) || (defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT_WINDOWS)) 
    4141# include <iprt/ctype.h> 
    4242#endif 
     
    914914        strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("wif=") - 1]); 
    915915    } 
     916#elif defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT_WINDOWS) 
     917    /* Temporary hack: attach to a network with the name 'if=en0' and you're hitting the wire. */ 
     918    if (    !OpenReq.szTrunk[0] 
     919        &&   OpenReq.enmTrunkType == kIntNetTrunkType_None 
     920        &&  !strncmp(pThis->szNetwork, "if=en", sizeof("if=en") - 1) 
     921        &&  RT_C_IS_DIGIT(pThis->szNetwork[sizeof("if=en") - 1]) 
     922        &&  !pThis->szNetwork[sizeof("if=en")]) 
     923    { 
     924        OpenReq.enmTrunkType = kIntNetTrunkType_NetFlt; 
     925        strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("if=") - 1]); 
     926    } 
     927    /* Temporary hack: attach to a network with the name 'wif=en0' and you're on the air. */ 
     928    if (    !OpenReq.szTrunk[0] 
     929        &&   OpenReq.enmTrunkType == kIntNetTrunkType_None 
     930        &&  !strncmp(pThis->szNetwork, "wif=en", sizeof("wif=en") - 1) 
     931        &&  RT_C_IS_DIGIT(pThis->szNetwork[sizeof("wif=en") - 1]) 
     932        &&  !pThis->szNetwork[sizeof("wif=en")]) 
     933    { 
     934        OpenReq.enmTrunkType = kIntNetTrunkType_NetFlt; 
     935        OpenReq.fFlags |= INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE; 
     936        strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("wif=") - 1]); 
     937    } 
     938 
     939    //TODO: temporary hack, remove this 
     940    if(OpenReq.enmTrunkType == kIntNetTrunkType_None) 
     941    { 
     942        OpenReq.enmTrunkType = kIntNetTrunkType_NetFlt; 
     943        strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("if=") - 1]); 
     944    } 
     945 
     946 
    916947#endif 
    917948 
  • trunk/src/VBox/HostDrivers/Makefile.kmk

    r11805 r11814  
    3737  include $(PATH_SUB_CURRENT)/VBoxUSB/Makefile.kmk 
    3838 endif 
    39  if1of ($(KBUILD_TARGET), darwin solaris
     39 if1of ($(KBUILD_TARGET), darwin solaris win
    4040  ifndef VBOX_OSE 
    41    include $(PATH_SUB_CURRENT)/VBoxNetFlt/Makefile.kmk 
     41   ifneq ($(KBUILD_TARGET),win) 
     42    include $(PATH_SUB_CURRENT)/VBoxNetFlt/Makefile.kmk 
     43   else ifdef VBOX_WITH_NETFLT_WINDOWS 
     44    include $(PATH_SUB_CURRENT)/VBoxNetFlt/Makefile.kmk 
     45   endif 
    4246  endif 
    4347 endif 
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r11752 r11814  
    186186# 
    187187SUPR0IdcClient_TEMPLATE = VBOXR0DRV 
    188 SUPR0IdcClient_DEFS = IN_RT_R0 IN_SUP_R0 
     188SUPR0IdcClient_DEFS = IN_RT_R0 IN_SUP_R0 IN_SUP_STATIC 
    189189SUPR0IdcClient_SDKS.win = W2K3DDK WINPSDKINCS 
    190190SUPR0IdcClient_SOURCES.$(KBUILD_TARGET) = \ 
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r10731 r11814  
    137137                    pDrvObj->MajorFunction[IRP_MJ_CLOSE]                    = VBoxDrvNtClose; 
    138138                    pDrvObj->MajorFunction[IRP_MJ_DEVICE_CONTROL]           = VBoxDrvNtDeviceControl; 
    139 #if 0 /** @todo test IDC on windows. */ 
     139//#if 0 /** @todo test IDC on windows. */ 
    140140                    pDrvObj->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL]  = VBoxDrvNtInternalDeviceControl; 
    141 #endif 
     141//#endif 
    142142                    pDrvObj->MajorFunction[IRP_MJ_READ]                     = VBoxDrvNtNotSupportedStub; 
    143143                    pDrvObj->MajorFunction[IRP_MJ_WRITE]                    = VBoxDrvNtNotSupportedStub; 
     
    232232    pFileObj->FsContext = NULL; 
    233233    PSUPDRVSESSION pSession; 
    234 #if 0 /** @todo check if this works, consider OBJ_KERNEL_HANDLE too. */ 
     234//#if 0 /** @todo check if this works, consider OBJ_KERNEL_HANDLE too. */ 
    235235    bool fUser = pIrp->RequestorMode != KernelMode; 
    236 #else 
    237     bool fUser = true; 
    238 #endif 
     236//#else 
     237 //   bool fUser = true; 
     238//#endif 
    239239    int rc = supdrvCreateSession(pDevExt, fUser, &pSession); 
    240240    if (!rc) 
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r11484 r11814  
    12531253                    else 
    12541254                    { 
     1255#ifndef VBOX_WITH_NETFLT_WINDOWS 
    12551256                        rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface");     RC_CHECK(); 
    12561257                        rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg);                 RC_CHECK(); 
    12571258                        rc = CFGMR3InsertString(pCfg, "HostInterfaceName", Utf8Str(hostInterfaceName)); RC_CHECK(); 
     1259#else 
     1260                        rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet");            RC_CHECK(); 
     1261                        rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg);                 RC_CHECK(); 
     1262                        rc = CFGMR3InsertString(pCfg, "Trunk", Utf8Str(hostInterfaceName));                RC_CHECK(); 
     1263                        rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); RC_CHECK(); 
     1264#endif 
    12581265                        Guid hostIFGuid; 
    12591266                        hrc = hostInterface->COMGETTER(Id)(hostIFGuid.asOutParam());    H(); 
  • trunk/src/VBox/Runtime/Makefile.kmk

    r11805 r11814  
    10031003        r0drv/nt/thread2-r0drv-nt.cpp \ 
    10041004        r0drv/nt/time-r0drv-nt.cpp \ 
    1005         r0drv/nt/timer-r0drv-nt.cpp 
    1006 ## @todo assert-r0drv-nt.cpp 
     1005        r0drv/nt/timer-r0drv-nt.cpp \ 
     1006        r0drv/nt/assert-r0drv-nt.c \ 
     1007        r0drv/nt/assertA-r0drv-nt.asm  
    10071008 
    10081009RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES) 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy