NDIS equivalent of ExAllocatePoolWithTag

What is the NDIS equivalent of ExAllocatePoolWithTag?
When I try this in my driver, it seems to work, but after I call
ExFreePool, I am getting a Bug Check 0xC2: BAD_POOL_CALLER
error.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

NdisAllocateMemoryWithTag, but you need to look at the windbg (latest
version) help file, as it lists the decoding for C2 that provides a rather
exact reason for why the system decided that your driver was bad. You’ve
done something wrong here and you need to fix it. You should also be calling
NdisFreeMemory.

-----Original Message-----
From: Brian Franklin [mailto:xxxxx@hotmail.com]
Sent: Thursday, December 20, 2001 9:39 AM
To: NT Developers Interest List
Subject: [ntdev] NDIS equivalent of ExAllocatePoolWithTag

What is the NDIS equivalent of ExAllocatePoolWithTag?
When I try this in my driver, it seems to work, but after I call
ExFreePool, I am getting a Bug Check 0xC2: BAD_POOL_CALLER error.


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I tried that. But now I get a SYSTEM_THREAD_EXCEPTION_NOT_HANDLED error.
Here’s what my code looks like.

status = NdisAllocateMemory(
workContext,
sizeof(WORK_CONTEXT),
0,
noMaxAddr);
IoQueueWorkItem(workItem,ArrivalWorker,DelayedWorkQueue,workContext);

//… In ArrivalWorker
NdisFreeMemory(pWorkContext, sizeof(WORK_CONTEXT), 0);


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hold on. I think I found my problem. I wasn’t using
NdisInitializeWorkItem.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com