Returning STATUS_INSUFFICIENT_RESOURCES

Hello Gurus,

I wanted to get my basics straight. I am making a File system driver and
basically need UNICODE memory to hold file names . I see that I am out
of nonpage memory some times. As the routine ExAllocatePoolWithTag does
not always give me allocated memory, detecting this I pass my flow to

Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_INSUFFICIENT_RESOURCES;

Then I see that this out of memory thing is there some times as in the
next Irp I do get an allocated memory ExAllocatePoolWithTag and every
thing seems to works fine. I see no BSOD and driver just seem to work
ok just that it hangs the system after some time.

1> Is "Not getting non page memory:- some time " a major flaw I need to
worry about and need to work with less memory ?

2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free the current
unicode memory held by me.?? Will Held memory and returning
STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??

3> Could hanging of my driver due to this observation .

Any Ideas?

Regards,
Anurag

Perhaps you should look for an allocation leak in your driver?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Anurag Sarin
Sent: Wednesday, October 06, 2004 3:03 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

Hello Gurus,

I wanted to get my basics straight. I am making a File system
driver and basically need UNICODE memory to hold file names .
I see that I am out of nonpage memory some times. As the
routine ExAllocatePoolWithTag does not always give me
allocated memory, detecting this I pass my flow to

Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_INSUFFICIENT_RESOURCES;

Then I see that this out of memory thing is there some times
as in the next Irp I do get an allocated memory
ExAllocatePoolWithTag and every thing seems to works fine. I
see no BSOD and driver just seem to work ok just that it
hangs the system after some time.

1> Is "Not getting non page memory:- some time " a major flaw
I need to
worry about and need to work with less memory ?

2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free
the current
unicode memory held by me.?? Will Held memory and returning
STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??

3> Could hanging of my driver due to this observation .

Any Ideas?

Regards,
Anurag


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks Mark for your response.

Could you elaborate on “allocation leak”

And any ideas on :

1> Is "Not getting non page memory:- some time " a major flaw
I need to worry about and need to work with less memory ?

2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free
the current unicode memory held by me.?? Will Held memory and
returning
STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??

3> Could hanging of my driver due to this observation .

Regards,
Anurag

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Wednesday, October 06, 2004 5:04 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

Perhaps you should look for an allocation leak in your driver?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Anurag Sarin
Sent: Wednesday, October 06, 2004 3:03 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

Hello Gurus,

I wanted to get my basics straight. I am making a File system
driver and basically need UNICODE memory to hold file names .
I see that I am out of nonpage memory some times. As the
routine ExAllocatePoolWithTag does not always give me
allocated memory, detecting this I pass my flow to

Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_INSUFFICIENT_RESOURCES;

Then I see that this out of memory thing is there some times
as in the next Irp I do get an allocated memory
ExAllocatePoolWithTag and every thing seems to works fine. I
see no BSOD and driver just seem to work ok just that it
hangs the system after some time.

1> Is "Not getting non page memory:- some time " a major flaw
I need to
worry about and need to work with less memory ?

2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free
the current
unicode memory held by me.?? Will Held memory and returning
STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??

3> Could hanging of my driver due to this observation .

Any Ideas?

Regards,
Anurag


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@divassoftware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

“Allocation leak” presumably means cases where you may be allocating
memory and inadvertantly not freeing it when you’re finished with it.

Chuck

----- Original Message -----
From: “Anurag Sarin”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, October 06, 2004 6:53 PM
Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

> Thanks Mark for your response.
>
> Could you elaborate on “allocation leak”
>
> And any ideas on :
>
>> 1> Is "Not getting non page memory:- some time " a major flaw
>> I need to worry about and need to work with less memory ?
>
>> 2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free
>> the current unicode memory held by me.?? Will Held memory and
> returning
> STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??
>
>> 3> Could hanging of my driver due to this observation .
>>
>
> Regards,
> Anurag
>
> -----Original Message-----
> From: Mark Roddy [mailto:xxxxx@hollistech.com]
> Sent: Wednesday, October 06, 2004 5:04 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES
>
>
> Perhaps you should look for an allocation leak in your driver?
>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of Anurag Sarin
>> Sent: Wednesday, October 06, 2004 3:03 AM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES
>>
>> Hello Gurus,
>>
>> I wanted to get my basics straight. I am making a File system
>> driver and basically need UNICODE memory to hold file names .
>> I see that I am out of nonpage memory some times. As the
>> routine ExAllocatePoolWithTag does not always give me
>> allocated memory, detecting this I pass my flow to
>>
>> Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
>> Irp->IoStatus.Information = 0;
>> IoCompleteRequest( Irp, IO_NO_INCREMENT );
>> return STATUS_INSUFFICIENT_RESOURCES;
>>
>> Then I see that this out of memory thing is there some times
>> as in the next Irp I do get an allocated memory
>> ExAllocatePoolWithTag and every thing seems to works fine. I
>> see no BSOD and driver just seem to work ok just that it
>> hangs the system after some time.
>>
>>
>>
>> 1> Is "Not getting non page memory:- some time " a major flaw
>> I need to
>> worry about and need to work with less memory ?
>>
>> 2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free
>> the current
>> unicode memory held by me.?? Will Held memory and returning
>> STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??
>>
>> 3> Could hanging of my driver due to this observation .
>>
>>
>> Any Ideas?
>>
>> Regards,
>> Anurag

Is “low resource” enabled in DV?

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
From: Anurag Sarin [mailto:xxxxx@divassoftware.com]
Sent: October 6, 2004 3:03 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

Hello Gurus,

I wanted to get my basics straight. I am making a File system driver and
basically need UNICODE memory to hold file names . I see that I am out
of nonpage memory some times. As the routine ExAllocatePoolWithTag does
not always give me allocated memory, detecting this I pass my flow to

Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_INSUFFICIENT_RESOURCES;

Then I see that this out of memory thing is there some times as in the
next Irp I do get an allocated memory ExAllocatePoolWithTag and every
thing seems to works fine. I see no BSOD and driver just seem to work
ok just that it hangs the system after some time.

1> Is "Not getting non page memory:- some time " a major flaw I need to
worry about and need to work with less memory ?

2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free the current
unicode memory held by me.?? Will Held memory and returning
STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??

3> Could hanging of my driver due to this observation .

Any Ideas?

Regards,
Anurag


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hello Calvin,

Yes.“low resource” is enabled in DV.

But my question is when I go out of memory should I release the memory
in hand and then return STATUS_INSUFFICIENT_RESOURCES or should I not
release memory ?
I am not getting a bug check though . But what is the best practice??

I do get an hang ocasionaly , wondering why?

thanks & regards,
Anurag

-----Original Message-----
From: Calvin Guan [mailto:xxxxx@ati.com]
Sent: Wednesday, October 06, 2004 7:56 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

Is “low resource” enabled in DV?

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
From: Anurag Sarin [mailto:xxxxx@divassoftware.com]
Sent: October 6, 2004 3:03 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

Hello Gurus,

I wanted to get my basics straight. I am making a File system driver and

basically need UNICODE memory to hold file names . I see that I am out
of nonpage memory some times. As the routine ExAllocatePoolWithTag does
not always give me allocated memory, detecting this I pass my flow to

Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_INSUFFICIENT_RESOURCES;

Then I see that this out of memory thing is there some times as in the
next Irp I do get an allocated memory ExAllocatePoolWithTag and every
thing seems to works fine. I see no BSOD and driver just seem to work
ok just that it hangs the system after some time.

1> Is "Not getting non page memory:- some time " a major flaw I need to
worry about and need to work with less memory ?

2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free the current

unicode memory held by me.?? Will Held memory and returning
STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??

3> Could hanging of my driver due to this observation .

Any Ideas?

Regards,
Anurag


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

xxxxx@lists.osr.com wrote on 10/06/2004 03:38:13 PM:

Hello Calvin,

Yes.“low resource” is enabled in DV.

But my question is when I go out of memory should I release the
memory in hand and then return STATUS_INSUFFICIENT_RESOURCES or
should I not release memory ?

You should release any memory related to the current request. Otherwise,
you’ll “leak” memory, which is bad…

Of course, under normal circumstances (Not Low Resource in DV), there’s
only a small chance of actually not being able to allocate non-paged pool,
unless some driver is not behaving properly (leaking non-paged pool, or
hogging it). However, it’s almost necessary that the driver can survive a
low-resource situation, even if it doesn’t actually do anything usueful in
this case. Doing a BSOD because of this is not a recommended solution, and
returning some error cod such as INSUFFICIENT RESOURCES, is a good idea.

I am not getting a bug check though . But what is the best practice??

I do get an hang ocasionaly , wondering why?

Only under low-resource simulation, or at other times too?


Mats

thanks & regards,
Anurag

-----Original Message-----
From: Calvin Guan [mailto:xxxxx@ati.com]
Sent: Wednesday, October 06, 2004 7:56 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

Is “low resource” enabled in DV?

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com
-----Original Message-----
From: Anurag Sarin [mailto:xxxxx@divassoftware.com]
Sent: October 6, 2004 3:03 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES
Hello Gurus,
I wanted to get my basics straight. I am making a File system driver and
basically need UNICODE memory to hold file names . I see that I am out
of nonpage memory some times. As the routine ExAllocatePoolWithTag does
not always give me allocated memory, detecting this I pass my flow to
Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_INSUFFICIENT_RESOURCES;
Then I see that this out of memory thing is there some times as in the
next Irp I do get an allocated memory ExAllocatePoolWithTag and every
thing seems to works fine. I see no BSOD and driver just seem to work
ok just that it hangs the system after some time.

1> Is "Not getting non page memory:- some time " a major flaw I need to
worry about and need to work with less memory ?
2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free the current
unicode memory held by me.?? Will Held memory and returning
STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??
3> Could hanging of my driver due to this observation .

Any Ideas?
Regards,
Anurag


Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
ForwardSourceID:NT00004B5A

Hi Mats,

I do get an hang ocasionaly , wondering why?
Only under low-resource simulation, or at other times too?

The hang is other times too? But I am clueless, can you give me some
commands in windbg that I can test and reason out.

I can move the mouse the cpu and memory are not fully bust. But its
shown the wait mouse icon and is busy doing I do not know what? I do get
my dbgprints but are a bit slow, don’t seem to show any big processing
by my driver also.

Thanks
-anurag

-----Original Message-----
From: Mats PETERSSON [mailto:xxxxx@3dlabs.com]
Sent: Wednesday, October 06, 2004 8:29 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

xxxxx@lists.osr.com wrote on 10/06/2004 03:38:13 PM:

Hello Calvin,

Yes.“low resource” is enabled in DV.

But my question is when I go out of memory should I release the memory

in hand and then return STATUS_INSUFFICIENT_RESOURCES or should I not
release memory ?

You should release any memory related to the current request. Otherwise,
you’ll “leak” memory, which is bad…

Of course, under normal circumstances (Not Low Resource in DV), there’s
only a small chance of actually not being able to allocate non-paged
pool, unless some driver is not behaving properly (leaking non-paged
pool, or hogging it). However, it’s almost necessary that the driver can
survive a low-resource situation, even if it doesn’t actually do
anything usueful in this case. Doing a BSOD because of this is not a
recommended solution, and returning some error cod such as INSUFFICIENT
RESOURCES, is a good idea.

I am not getting a bug check though . But what is the best practice??

I do get an hang ocasionaly , wondering why?

Only under low-resource simulation, or at other times too?


Mats

thanks & regards,
Anurag

-----Original Message-----
From: Calvin Guan [mailto:xxxxx@ati.com]
Sent: Wednesday, October 06, 2004 7:56 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

Is “low resource” enabled in DV?

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com
-----Original Message-----
From: Anurag Sarin [mailto:xxxxx@divassoftware.com]
Sent: October 6, 2004 3:03 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES Hello Gurus,
I wanted to get my basics straight. I am making a File system driver
and
basically need UNICODE memory to hold file names . I see that I am out
of nonpage memory some times. As the routine ExAllocatePoolWithTag
does
not always give me allocated memory, detecting this I pass my flow to
Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_INSUFFICIENT_RESOURCES;
Then I see that this out of memory thing is there some times as in the

next Irp I do get an allocated memory ExAllocatePoolWithTag and every
thing seems to works fine. I see no BSOD and driver just seem to work

ok just that it hangs the system after some time.

1> Is "Not getting non page memory:- some time " a major flaw I need
1> to
worry about and need to work with less memory ?
2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free the
2> current
unicode memory held by me.?? Will Held memory and returning
STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??
3> Could hanging of my driver due to this observation .

Any Ideas?
Regards,
Anurag


Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256 You are currently subscribed to ntdev

as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
ForwardSourceID:NT00004B5A


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@divassoftware.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

DQoNCg0KDQoNCkhlcmUncyBhIGNvdXBsZSBvZiAob2J2aW91cykgcGllY2VzIG9mIGFkdmljZS4g
SSdtIG5vdCB0cnlpbmcgdG8gImR1bXAgeW91DQpkb3duIiwgYnV0IHJhdGhlciBzdGFydGluZyBm
cm9tIHNjcmF0Y2ggYmVjYXVzZSBJJ20gbm90IHN1cmUgaG93IGZhbWlsaWFyDQp5b3UgYXJlIHdp
dGggZHJpdmVyIGRlYnVnZ2luZy4NCjAuIEJyZWFrIGludG8gdGhlIGRlYnVnZ2VyIGFuZCBjaGVj
ayB3aGF0J3Mgb24gdGhlIHN0YWNrLiBJZiBpdCdzIGxvY2tlZCB1cA0KaW4gYSBsb29wIGluIHlv
dXIgZHJpdmVyIChvciBzb21ldGhpZ24gY2FsbGVkIGJ5IHlvdXIgZHJpdmVyKSwgaXQgd2lsbA0K
dXN1YWxseSBnaXZlIHlvdSBzb21lIGNsdWUgb2Ygd2hhdCdzIGdvaW5nIG9uLg0KMS4gVHVybiBv
Z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
c3Vic2NyaWJlZCB0byBudGRldiBhczogdW5rbm93biBsbXN1YnN0IHRhZyBhcmd1bWVudDoNCicn
DQo+IFRvIHVuc3Vic2NyaWJlIHNlbmQgYSBibGFuayBlbWFpbCB0byBsZWF2ZS1udGRldi0xNDA3
OUNAbGlzdHMub3NyLmNvbQ0KPiBGb3J3YXJkU291cmNlSUQ6TlQwMDAwNENDQQ==

Hi Matt,

These suggestions make a lot of sense for a starter like me .

Thanks
-anurag

-----Original Message-----
From: Mats PETERSSON [mailto:xxxxx@3dlabs.com]
Sent: Thursday, October 07, 2004 2:48 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

Here’s a couple of (obvious) pieces of advice. I’m not trying to “dump
you down”, but rather starting from scratch because I’m not sure how
familiar you are with driver debugging. 0. Break into the debugger and
check what’s on the stack. If it’s locked up in a loop in your driver
(or somethign called by your driver), it will usually give you some clue
of what’s going on. 1. Turn of Low Resource Simulation in Driver
Verifier. This makes sure that you’re chasing one type of problem at a
time, and it does by all appearances seem like you have more than one
problem (or a problem that IS NOT caused by low resources). 2. Use
!threads to identify the threads running at the time, and try to
identify what’s going on. !locks is also a useful command, as is
!stacks. Pay particular attention to calls that go into your driver,
obviously (note, you may have a call that goes into your driver, and
then into the kernel, for instance “KeWaitForSingleObject”. 3. Add more
debug prints to see what’s happening in your driver. 4. Being able move
the mouse isn’t really much evidence (other than the machine isn’t
completely hung at high IRQL, as the graphics driver and mouse driver
are both still working). But what is your driver doing? 5. Build a
simple trap for re-entrancy into your driver. In every place where your
driver is enteres, do something like:

static int GlobalReEntranceyCount = 0;
void SomeEntryPoint(…)
{
GlobalReEntrancyCount++;
if (GlobalReEntrancyCount > 1)
DebugPrint(-1, “Reentered into SomeEntryPoint\n”);

… Do some work
GlobalReEntrancyCount–;
}

This is not completely “secure” (particularly not on SMP systems), but
unless you’ve got code that is really synchronised, you’ll catch it
re-entering once in a while if it’s at all happening. Of course, running
multiple copies of the test-software will be helpful to see if you get
re-entrancy in the driver.

If you have re-entrancy, make sure that any shared data-objects (linked
list, reference counters, etc) are re-entrancy safe, by using
Mutex/SpinLock or similar so that your data structures don’t get screwed
up.


Mats

xxxxx@lists.osr.com wrote on 10/07/2004 07:07:02 AM:

Hi Mats,
> I do get an hang ocasionaly , wondering why?
Only under low-resource simulation, or at other times too? The hang is

other times too? But I am clueless, can you give me some commands in
windbg that I can test and reason out. I can move the mouse the cpu
and memory are not fully bust. But its shown the wait mouse icon and
is busy doing I do not know what? I do get my dbgprints but are a bit
slow, don’t seem to show any big processing by my driver also.
Thanks
-anurag

-----Original Message-----
From: Mats PETERSSON [mailto:xxxxx@3dlabs.com]
Sent: Wednesday, October 06, 2004 8:29 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES

xxxxx@lists.osr.com wrote on 10/06/2004 03:38:13 PM:
> Hello Calvin,
>
> Yes.“low resource” is enabled in DV.
>
> But my question is when I go out of memory should I release the
> memory in hand and then return STATUS_INSUFFICIENT_RESOURCES or
> should I not release memory ?
You should release any memory related to the current request.
Otherwise, you’ll “leak” memory, which is bad… Of course, under
normal circumstances (Not Low Resource in DV), there’s only a small
chance of actually not being able to allocate non-paged pool, unless
some driver is not behaving properly (leaking non-paged pool, or
hogging it). However, it’s almost necessary that the driver can
survive a low-resource situation, even if it doesn’t actually do
anything usueful in this case. Doing a BSOD because of this is not a
recommended solution, and returning some error cod such as
INSUFFICIENT RESOURCES, is a good idea.

> I am not getting a bug check though . But what is the best
> practice??
>
> I do get an hang ocasionaly , wondering why?
Only under low-resource simulation, or at other times too?

Mats
>
> thanks & regards,
> Anurag
>
> -----Original Message-----
> From: Calvin Guan [mailto:xxxxx@ati.com]
> Sent: Wednesday, October 06, 2004 7:56 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES Is "low

> resource" enabled in DV?
> -
> Calvin Guan Software Engineer
> ATI Technologies Inc. www.ati.com
> -----Original Message-----
> From: Anurag Sarin [mailto:xxxxx@divassoftware.com]
> Sent: October 6, 2004 3:03 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Returning STATUS_INSUFFICIENT_RESOURCES Hello
> Gurus, I wanted to get my basics straight. I am making a File system

> driver
and
> basically need UNICODE memory to hold file names . I see that I am
> out of nonpage memory some times. As the routine
> ExAllocatePoolWithTag does

> not always give me allocated memory, detecting this I pass my flow
> to
> Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
> Irp->IoStatus.Information = 0;
> IoCompleteRequest( Irp, IO_NO_INCREMENT );
> return STATUS_INSUFFICIENT_RESOURCES;
> Then I see that this out of memory thing is there some times as in
> the next Irp I do get an allocated memory ExAllocatePoolWithTag and
> every thing seems to works fine. I see no BSOD and driver just seem

> to work ok just that it hangs the system after some time.
>
> 1> Is "Not getting non page memory:- some time " a major flaw I need

> 1> to
> worry about and need to work with less memory ?
> 2> Before returning STATUS_INSUFFICIENT_RESOURCES do I free the
> 2> current
> unicode memory held by me.?? Will Held memory and returning
> STATUS_INSUFFICIENT_RESOURCES lead to memory fragmentation ??
> 3> Could hanging of my driver due to this observation .
>
> Any Ideas?
> Regards,
> Anurag
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256 You are currently subscribed to
> ntdev
> as: unknown lmsubst tag argument:
‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com ForwardSourceID:NT00004B5A


Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256 You are currently subscribed to ntdev

as: xxxxx@divassoftware.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
ForwardSourceID:NT00004CCA


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to $subst(‘List.Name’) as:
$subst(‘Recip.EmailAddr’) To unsubscribe send a blank email to
$subst(‘Email.UnSub’)