VirtualBox

Changeset 29682 in vbox


Ignore:
Timestamp:
May 20, 2010 11:16:03 AM (15 years ago)
Author:
vboxsync
Message:

netflt/win: dbg: use ExAllocatePoolWithTag for debugging (to make verifier blame memory leaks)

Location:
trunk/src/VBox/HostDrivers/VBoxNetFlt/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c

    r29667 r29682  
    166166DECLHIDDEN(NDIS_STATUS) vboxNetFltWinMemAlloc(PVOID* ppMemBuf, UINT cbLength)
    167167{
     168#ifdef DEBUG_NETFLT_USE_EXALLOC
     169    *ppMemBuf = ExAllocatePoolWithTag(NonPagedPool, cbLength, MEM_TAG);
     170    if(*ppMemBuf)
     171    {
     172        NdisZeroMemory(*ppMemBuf, cbLength);
     173        return NDIS_STATUS_SUCCESS;
     174    }
     175    return NDIS_STATUS_FAILURE;
     176#else
    168177    NDIS_STATUS fStatus = NdisAllocateMemoryWithTag(ppMemBuf, cbLength, MEM_TAG);
    169178    if(fStatus == NDIS_STATUS_SUCCESS)
     
    172181    }
    173182    return fStatus;
     183#endif
    174184}
    175185
     
    177187DECLHIDDEN(void) vboxNetFltWinMemFree(PVOID pvMemBuf)
    178188{
     189#ifdef DEBUG_NETFLT_USE_EXALLOC
     190    ExFreePool(pvMemBuf);
     191#else
    179192    NdisFreeMemory(pvMemBuf, 0, 0);
     193#endif
    180194}
    181195
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltCommon-win.h

    r29643 r29682  
    4242//# define DEBUG_NETFLT_RECV_NOPACKET
    4343//# define DEBUG_NETFLT_RECV_TRANSFERDATA
     44
     45//#define DEBUG_NETFLT_USE_EXALLOC
    4446#endif
    4547
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