Author: cgutman
Date: Mon May 11 01:43:55 2009
New Revision: 40880
URL:
http://svn.reactos.org/svn/reactos?rev=40880&view=rev
Log:
- Allocate space for the packet extension located at NdisPacketOobOffset +
sizeof(NDIS_PACKET_OOB_DATA)
- Fixes more packet corruption
Modified:
trunk/reactos/drivers/network/ndis/ndis/buffer.c
Modified: trunk/reactos/drivers/network/ndis/ndis/buffer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] Mon May 11 01:43:55
2009
@@ -428,7 +428,9 @@
Temp->Private.Pool = Pool;
Temp->Private.ValidCounts = TRUE;
Temp->Private.NdisPacketFlags = fPACKET_ALLOCATED_BY_NDIS;
- Temp->Private.NdisPacketOobOffset = Pool->PacketLength -
sizeof(NDIS_PACKET_OOB_DATA);
+ Temp->Private.NdisPacketOobOffset = Pool->PacketLength -
+ (sizeof(NDIS_PACKET_OOB_DATA) +
+ sizeof(NDIS_PACKET_EXTENSION));
*Packet = Temp;
*Status = NDIS_STATUS_SUCCESS;
@@ -507,7 +509,8 @@
NumberOfDescriptors = 0xffff;
}
- Length = sizeof(NDIS_PACKET) + sizeof(NDIS_PACKET_OOB_DATA) +
ProtocolReservedLength;
+ Length = sizeof(NDIS_PACKET) + sizeof(NDIS_PACKET_OOB_DATA) +
+ sizeof(NDIS_PACKET_EXTENSION) + ProtocolReservedLength;
Size = sizeof(NDISI_PACKET_POOL) + Length * NumberOfDescriptors;
Pool = ExAllocatePool(NonPagedPool, Size);
@@ -712,7 +715,9 @@
Temp->Private.Pool = Pool;
Temp->Private.ValidCounts = TRUE;
Temp->Private.NdisPacketFlags = fPACKET_ALLOCATED_BY_NDIS;
- Temp->Private.NdisPacketOobOffset = Pool->PacketLength -
sizeof(NDIS_PACKET_OOB_DATA);
+ Temp->Private.NdisPacketOobOffset = Pool->PacketLength -
+ (sizeof(NDIS_PACKET_OOB_DATA) +
+ sizeof(NDIS_PACKET_EXTENSION));
*Packet = Temp;
*Status = NDIS_STATUS_SUCCESS;
@@ -762,7 +767,9 @@
Temp->Private.Pool = Pool;
Temp->Private.ValidCounts = TRUE;
Temp->Private.NdisPacketFlags = fPACKET_ALLOCATED_BY_NDIS;
- Temp->Private.NdisPacketOobOffset = Pool->PacketLength -
sizeof(NDIS_PACKET_OOB_DATA);
+ Temp->Private.NdisPacketOobOffset = Pool->PacketLength -
+ (sizeof(NDIS_PACKET_OOB_DATA) +
+ sizeof(NDIS_PACKET_EXTENSION));
*Packet = Temp;
*Status = NDIS_STATUS_SUCCESS;