VirtualBox

Ignore:
Timestamp:
Oct 30, 2009 8:24:36 PM (15 years ago)
Author:
vboxsync
Message:

netflt/win: fix Protocol/Miniport reserved field usage

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

Legend:

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

    r24190 r24217  
    23652365                                   MIN_PACKET_POOL_SIZE,
    23662366                                   MAX_PACKET_POOL_SIZE - MIN_PACKET_POOL_SIZE,
    2367                                    sizeof(PT_RSVD));
     2367                                   sizeof(SEND_RSVD));
    23682368
    23692369        if (Status != NDIS_STATUS_SUCCESS)
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.h

    r24190 r24217  
    464464
    465465/** obtains the PTRANSFERDATA_RSVD given a single list entry it contains */
    466 #define PT_SLE_2_TRANSFERDATA_RSVD(_pl) \
    467     ( (PTRANSFERDATA_RSVD)((uint8_t *)(_pl) - RT_OFFSETOF(TRANSFERDATA_RSVD, ListEntry)))
    468 
    469 /** obtains the ndis packet given a single list entry assuming it is stored in ProtocolReserved field of the packet */
    470 #define PT_SLE_2_NDIS_PACKET(_pl) \
    471    ( (PNDIS_PACKET)((uint8_t *)PT_SLE_2_TRANSFERDATA_RSVD(_pl) - RT_OFFSETOF(NDIS_PACKET, ProtocolReserved)))
     466//#define PT_SLE_2_TRANSFERDATA_RSVD(_pl) \
     467//    ( (PTRANSFERDATA_RSVD)((uint8_t *)(_pl) - RT_OFFSETOF(TRANSFERDATA_RSVD, ListEntry)))
     468
     469///** obtains the ndis packet given a single list entry assuming it is stored in ProtocolReserved field of the packet */
     470//#define PT_SLE_2_NDIS_PACKET(_pl) \
     471//   ( (PNDIS_PACKET)((uint8_t *)PT_SLE_2_TRANSFERDATA_RSVD(_pl) - RT_OFFSETOF(NDIS_PACKET, ProtocolReserved)))
    472472
    473473/**************************************************************************
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltCommon-win.h

    r23927 r24217  
    471471} RECV_RSVD, *PRECV_RSVD;
    472472
    473 typedef struct _PT_RSVD
    474 {
    475     union
    476     {
    477         RECV_RSVD RecvRsvd;
    478         TRANSFERDATA_RSVD TransferDataRsvd;
    479     } u;
    480 } PT_RSVD, *PPT_RSVD;
    481 
    482 
    483473#ifndef VBOX_NETFLT_ONDEMAND_BIND
    484474
    485475C_ASSERT(sizeof(RECV_RSVD) <= sizeof(((PNDIS_PACKET)0)->MiniportReserved));
     476C_ASSERT(sizeof(TRANSFERDATA_RSVD) <= PROTOCOL_RESERVED_SIZE_IN_PACKET);
    486477#endif
    487478
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltPt-win.c

    r24212 r24217  
    814814static bool vboxNetFltWinRemovePacketFromList(PINTERLOCKED_SINGLE_LIST pList, PNDIS_PACKET pPacket)
    815815{
    816     PTRANSFERDATA_RSVD pTDR = &((PPT_RSVD)pPacket->ProtocolReserved)->u.TransferDataRsvd;
     816    PTRANSFERDATA_RSVD pTDR = (PTRANSFERDATA_RSVD)pPacket->ProtocolReserved;
    817817    return vboxNetFltWinInterlockedSearchListEntry(pList, &pTDR->ListEntry,
    818818            true /* remove*/);
     
    824824static void vboxNetFltWinPutPacketToList(PINTERLOCKED_SINGLE_LIST pList, PNDIS_PACKET pPacket, PNDIS_BUFFER pOrigBuffer)
    825825{
    826     PTRANSFERDATA_RSVD pTDR = &((PPT_RSVD)pPacket->ProtocolReserved)->u.TransferDataRsvd;
     826    PTRANSFERDATA_RSVD pTDR = (PTRANSFERDATA_RSVD)pPacket->ProtocolReserved;
    827827    pTDR->pOriginalBuffer = pOrigBuffer;
    828828    vboxNetFltWinInterlockedPutTail(pList, &pTDR->ListEntry);
     
    933933        return false;
    934934
    935     pTDR = &((PPT_RSVD)pPacket->ProtocolReserved)->u.TransferDataRsvd;
     935    pTDR = (PTRANSFERDATA_RSVD)pPacket->ProtocolReserved;
    936936    Assert(pTDR);
    937937    Assert(pTDR->pOriginalBuffer);
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