VirtualBox

Changeset 68112 in vbox for trunk


Ignore:
Timestamp:
Jul 25, 2017 3:58:37 PM (7 years ago)
Author:
vboxsync
Message:

NetLwf/Win: (bugref:8488) Do not attach NetLwf filters to host-only adapters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp

    r66719 r68112  
    10101010#endif /* VBOXNETLWF_FIXED_SIZE_POOLS */
    10111011
     1012DECLARE_GLOBAL_CONST_UNICODE_STRING(g_strHostOnlyMiniportName, L"VirtualBox Host-Only");
     1013
    10121014static NDIS_STATUS vboxNetLwfWinAttach(IN NDIS_HANDLE hFilter, IN NDIS_HANDLE hDriverCtx,
    10131015                                       IN PNDIS_FILTER_ATTACH_PARAMETERS pParameters)
     
    10191021    {
    10201022        vboxNetLwfLogErrorEvent(IO_ERR_INTERNAL_ERROR, NDIS_STATUS_FAILURE, 1);
     1023        return NDIS_STATUS_FAILURE;
     1024    }
     1025
     1026    /*
     1027     * We need a copy of NDIS_STRING structure as we are going to modify length
     1028     * of the base miniport instance name since RTL does not support comparing
     1029     * first n characters of two strings. We check if miniport names start with
     1030     * "Virtual Host-Only" to detect host-only adapters. It is a waste of resources
     1031     * to bind our filter to host-only adapters since they now operate independently.
     1032     */
     1033    NDIS_STRING strTruncatedInstanceName = *pParameters->BaseMiniportInstanceName; /* Do not copy data, only the structure itself */
     1034    strTruncatedInstanceName.Length = g_strHostOnlyMiniportName.Length; /* Truncate instance name */
     1035    if (RtlEqualUnicodeString(&strTruncatedInstanceName, &g_strHostOnlyMiniportName, TRUE /* Case insensitive */))
     1036    {
     1037        DbgPrint("vboxNetLwfWinAttach: won't attach to %wZ\n", pParameters->BaseMiniportInstanceName);
    10211038        return NDIS_STATUS_FAILURE;
    10221039    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette