- Zero the whole packet in other packet allocation routines

- Set ValidCount TRUE because we don't have any buffers chained yet
 - Set the fPACKET_ALLOCATED_BY_NDIS flag (fixes storing media-specific data)

svn path=/trunk/; revision=40664
This commit is contained in:
Cameron Gutman
2009-04-23 10:32:41 +00:00
parent 197a0b05ce
commit 0152087f27
+9 -3
View File
@@ -426,6 +426,8 @@ NdisAllocatePacket(
RtlZeroMemory(Temp, sizeof(NDIS_PACKET));
Temp->Private.Pool = Pool;
Temp->Private.ValidCounts = TRUE;
Temp->Private.NdisPacketFlags = fPACKET_ALLOCATED_BY_NDIS;
*Packet = Temp;
*Status = NDIS_STATUS_SUCCESS;
@@ -705,8 +707,10 @@ NdisDprAllocatePacket(
KeReleaseSpinLockFromDpcLevel(&Pool->SpinLock.SpinLock);
RtlZeroMemory(&Temp->Private, sizeof(NDIS_PACKET_PRIVATE));
RtlZeroMemory(Temp, sizeof(NDIS_PACKET));
Temp->Private.Pool = Pool;
Temp->Private.ValidCounts = TRUE;
Temp->Private.NdisPacketFlags = fPACKET_ALLOCATED_BY_NDIS;
*Packet = Temp;
*Status = NDIS_STATUS_SUCCESS;
@@ -752,8 +756,10 @@ NdisDprAllocatePacketNonInterlocked(
Temp = Pool->FreeList;
Pool->FreeList = (PNDIS_PACKET)Temp->Reserved[0];
RtlZeroMemory(&Temp->Private, sizeof(NDIS_PACKET_PRIVATE));
RtlZeroMemory(Temp, sizeof(NDIS_PACKET));
Temp->Private.Pool = Pool;
Temp->Private.ValidCounts = TRUE;
Temp->Private.NdisPacketFlags = fPACKET_ALLOCATED_BY_NDIS;
*Packet = Temp;
*Status = NDIS_STATUS_SUCCESS;
@@ -1102,4 +1108,4 @@ NdisUnchainBufferAtFront(
*Buffer = NdisBuffer;
}
/* EOF */
/* EOF */