specify Stack Size

Hi All:
if i can specify the size of the stack of my driver ? and is it possible
to realize this in my code?

thx a lot!!
Kamasamikon


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 have same question as you do.
we just have 12K stack in winNT
for i386 version, as I know.

Jansen Zhu.

----- Original Message -----
From:
To: NT Developers Interest List
Sent: Tuesday, December 12, 2000 10:29 PM
Subject: [ntdev] specify Stack Size

> Hi All:
> if i can specify the size of the stack of my driver ? and is it
possible
> to realize this in my code?
>
> thx a lot!!
> Kamasamikon
>
> —
> You are currently subscribed to ntdev as: xxxxx@citiz.net
> 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

> Hi All:

if i can specify the size of the stack of my driver ? and is it
possible
to realize this in my code?

Stack belongs to a thread, not to a driver.
Kernel stack size in NT is 3 pages (12KB) - this is hardcoded and cannot be
altered.

Max


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

Assumption: when you say “stack size” I’m assuming you mean the IRP stack
location.

You don’t specify the “stack size” in a driver, what you do is specify the
number of structures that are typedef’d _IO_STACK_LOCATIONS when an IRP is
created to be passed to the highest, or first, device object in the device
node (yeah yeah node may be wrong but using “device stack” introduces
another definition for “stack”). When you get a pointer to a device object
you take it’s number of _IOSLs and increment it to allow for your device
object to have a unique _IOSL struct in the IRP. You then use your struct in
the IRP and complete the IRP, or copy it to the struct for the next lower
driver before calling IoCallDriver, which does the same thing for it’s lower
driver.

You get your _IOSL by making a call to IoGetCurrentStackLocation(IRP), which
is really nothing more than a macro that returns IRP pointer + offset.

Now if your asking about what ss:esp is set to, and/or how to set it, you’re
following Dorothy into the poppy field, and it’s highly recommended that you
don’t do that.

Gary

-----Original Message-----
From: xxxxx@bhnec.nec.co.jp [mailto:xxxxx@bhnec.nec.co.jp]
Sent: Tuesday, December 12, 2000 2:29 PM
To: NT Developers Interest List
Subject: [ntdev] specify Stack Size

Hi All:
if i can specify the size of the stack of my driver ? and is it possible
to realize this in my code?

thx a lot!!
Kamasamikon


You are currently subscribed to ntdev as: xxxxx@delphieng.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

From MSDN:
Each thread is allocated a limited amount of stack
space for all
function calls and interrupts. The Windows NT kernel
allocates an
initial 12K on x86 and MIPS platforms, and 16K on
ALPHA and PowerPC
platforms. The stack can grow to accommodate callbacks
from the kernel
to user mode and back; the maximum stack size is
60K/64K in the kernel.
Only 12K/16K of the stack is visible at any point in
time. The only
exception to these policies is OpenGL, which is
allocated the entire
60K/64K stack at once

— “Maxim S. Shatskih”
wrote: > > Hi All:
> > if i can specify the size of the stack of my
> driver ? and is it
> possible
> > to realize this in my code?
>
> Stack belongs to a thread, not to a driver.
> Kernel stack size in NT is 3 pages (12KB) - this is
> hardcoded and cannot be
> altered.
>
> Max
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.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

Hi Hoa,

Can you send me a copy of memmgr.dll in %redstone3for9x%\asics?

Thanks,
Min

-----Original Message-----
From: sajeev sas [mailto:xxxxx@yahoo.com]
Sent: Thursday, December 14, 2000 9:20 AM
To: NT Developers Interest List
Subject: [ntdev] Re: specify Stack Size

From MSDN:
Each thread is allocated a limited amount of stack
space for all
function calls and interrupts. The Windows NT kernel
allocates an
initial 12K on x86 and MIPS platforms, and 16K on
ALPHA and PowerPC
platforms. The stack can grow to accommodate callbacks
from the kernel
to user mode and back; the maximum stack size is
60K/64K in the kernel.
Only 12K/16K of the stack is visible at any point in
time. The only
exception to these policies is OpenGL, which is
allocated the entire
60K/64K stack at once

— “Maxim S. Shatskih”
wrote: > > Hi All:
> > if i can specify the size of the stack of my
> driver ? and is it
> possible
> > to realize this in my code?
>
> Stack belongs to a thread, not to a driver.
> Kernel stack size in NT is 3 pages (12KB) - this is
> hardcoded and cannot be
> altered.
>
> Max
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/


You are currently subscribed to ntdev as: xxxxx@ati.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

Assumption : No, It is the local variables used in Driver. that doesnt
exceeds more then 12k.
IRP Stack Doesnt matter coz it is allocated my I/O Manager.

----- Original Message -----
From: “Gary Little”
To: “NT Developers Interest List”
Sent: Wednesday, December 13, 2000 11:13 PM
Subject: [ntdev] RE: specify Stack Size

> Assumption: when you say “stack size” I’m assuming you mean the IRP stack
> location.
>
> You don’t specify the “stack size” in a driver, what you do is specify the
> number of structures that are typedef’d _IO_STACK_LOCATIONS when an IRP is
> created to be passed to the highest, or first, device object in the device
> node (yeah yeah node may be wrong but using “device stack” introduces
> another definition for “stack”). When you get a pointer to a device object
> you take it’s number of _IOSLs and increment it to allow for your device
> object to have a unique _IOSL struct in the IRP. You then use your struct
in
> the IRP and complete the IRP, or copy it to the struct for the next lower
> driver before calling IoCallDriver, which does the same thing for it’s
lower
> driver.
>
> You get your _IOSL by making a call to IoGetCurrentStackLocation(IRP),
which
> is really nothing more than a macro that returns IRP pointer + offset.
>
> Now if your asking about what ss:esp is set to, and/or how to set it,
you’re
> following Dorothy into the poppy field, and it’s highly recommended that
you
> don’t do that.
>
> Gary
>
> -----Original Message-----
> From: xxxxx@bhnec.nec.co.jp [mailto:xxxxx@bhnec.nec.co.jp]
> Sent: Tuesday, December 12, 2000 2:29 PM
> To: NT Developers Interest List
> Subject: [ntdev] specify Stack Size
>
>
> Hi All:
> if i can specify the size of the stack of my driver ? and is it
possible
> to realize this in my code?
>
> thx a lot!!
> Kamasamikon
>
> —
> You are currently subscribed to ntdev as: xxxxx@delphieng.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.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

Then you have a 12K stack, and no you may not change it.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Satish
Sent: Friday, December 15, 2000 12:10 AM
To: NT Developers Interest List
Subject: [ntdev] RE: specify Stack Size

Assumption : No, It is the local variables used in Driver. that doesnt
exceeds more then 12k.
IRP Stack Doesnt matter coz it is allocated my I/O Manager.

----- Original Message -----
From: “Gary Little”
To: “NT Developers Interest List”
Sent: Wednesday, December 13, 2000 11:13 PM
Subject: [ntdev] RE: specify Stack Size

> Assumption: when you say “stack size” I’m assuming you mean the IRP stack
> location.
>
> You don’t specify the “stack size” in a driver, what you do is specify the
> number of structures that are typedef’d _IO_STACK_LOCATIONS when an IRP is
> created to be passed to the highest, or first, device object in the device
> node (yeah yeah node may be wrong but using “device stack” introduces
> another definition for “stack”). When you get a pointer to a device object
> you take it’s number of _IOSLs and increment it to allow for your device
> object to have a unique _IOSL struct in the IRP. You then use your struct
in
> the IRP and complete the IRP, or copy it to the struct for the next lower
> driver before calling IoCallDriver, which does the same thing for it’s
lower
> driver.
>
> You get your _IOSL by making a call to IoGetCurrentStackLocation(IRP),
which
> is really nothing more than a macro that returns IRP pointer + offset.
>
> Now if your asking about what ss:esp is set to, and/or how to set it,
you’re
> following Dorothy into the poppy field, and it’s highly recommended that
you
> don’t do that.
>
> Gary
>
> -----Original Message-----
> From: xxxxx@bhnec.nec.co.jp [mailto:xxxxx@bhnec.nec.co.jp]
> Sent: Tuesday, December 12, 2000 2:29 PM
> To: NT Developers Interest List
> Subject: [ntdev] specify Stack Size
>
>
> Hi All:
> if i can specify the size of the stack of my driver ? and is it
possible
> to realize this in my code?
>
> thx a lot!!
> Kamasamikon
>
> —
> You are currently subscribed to ntdev as: xxxxx@delphieng.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@inland.net
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

>Then you have a 12K stack, and no you may not change it.

AND keep in mind that kernel code at higher IRQL priority may also expect
to use part of that 12k stack. Or if your talking about code that runs
above PASSIVE_LEVEL, YOUR code may be running on a stack that some lower
level code has already consumed most of that 12K.

The bottom line is: avoid using much stack space in kernel mode. There is
not much to begin with, and you don’t know how much other kernel code will
need. Overflowing a kernel stack is a fatal system error, so must
absolutely never happen.

  • Jan

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