Hi!
I modified the Passthru IM driver. In my ProtocolReceive function when
NdisGetReceivePacket doesn’t return with the full packet I try to create
it from the parameters passed to ProtocolReceive.
I allocate memory for the packet, it’s size is HeaderBufferSize +
PacketSize.
I copy the HeaderBuffer, then the LookAheadBuffer to my memory.
Then i check if LookAheadBufferSize < PacketSize. This check fails, so
the two size is equal.
And here comes the crash. I call NdisDprAllocatePacket(&Status, &Packet,
pAdapt->RecvPacketPoolHandle) and I get a blue screen with
DRIVER_IRQL_NOT_LESS_OR_EQUAL.
From WinDbg:
READ_ADDRESS: 12008432
CURRENT_IRQL: 2
FAULTING_IP:
passthru!PtReceive+280 [c:.…\protocol.c @ 1211]
f0b74000 8b423c mov eax,[edx+0x3c]
DEFAULT_BUCKET_ID: DRIVER_FAULT
BUGCHECK_STR: 0xD1
LAST_CONTROL_TRANSFER: from f0b74000 to 804e187f
STACK_TEXT:
8054ff7c f0b74000 badb0d00 120083f6 ffa4dd93 nt!KiTrap0E+0x233
80550104 f908ebd6 ff460e38 ff962008 f23b209c passthru!PtReceive+0x280
[c:.…\protocol.c @ 1211]
80550138 00030000 02010000 64610400 04016c73
NDIS!EthFilterDprIndicateReceive+0xe0
WARNING: Frame IP not in any known module. Following frames may be wrong.
80550168 f9540802 ff962008 0000ffff ff962008 0x30000
80550178 f9540889 ff962008 804e4a15 811b9658 RTL8139!RTFast_RcvDpc+0x50
80550190 f9087712 00962008 80558e80 80558c20
RTL8139!RTFast_HandleInterrupt+0x2f
805501ac 804dbbd4 ff962074 ff962060 00000000 NDIS!ndisMDpc+0xff
805501d0 804dbb4d 00000000 0000000e 00000000 nt!KiRetireDpcList+0x46
805501d4 00000000 0000000e 00000000 00000000 nt!KiIdleLoop+0x26
STACK_COMMAND: .bugcheck ; kb
FOLLOWUP_IP:
passthru!PtReceive+280 [c:.…\protocol.c @ 1211]
f0b74000 8b423c mov eax,[edx+0x3c]
FAULTING_SOURCE_CODE:
1207: }
1208: }
1209: else
1210: {
> 1211: NdisDprAllocatePacket(&Status, &Packet,
pAdapt->RecvPacketPoolHandle);
1212: if (Status == NDIS_STATUS_SUCCESS)
1213: {
1214: NdisChainBufferAtFront(Packet, LookAheadBuffer);
1215: }
1216: else
Can anyone tell me what’s wrong?
Thanks.
Baki