Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Howto increase NT kernel stack size? (if it is possible at all)

0 views
Skip to first unread message

Sergei V

unread,
Mar 26, 2008, 10:12:38 AM3/26/08
to
Is there a way to set the kernel stack size somehow?
To increase it by setting some value? In the registry, or elsewhere?

The story:
It is known the NT stack size to be 12k (approximately).
There is a bug of NT when a call to MmGrowKernelStack fail with
STATUS_STACK_OVERFLOW.
(the bug is concerned with DLL embedding and WH_CALLWNDPROC)
There is a hope to somehow overcome the problem if increase the kernel stack
size.

Thanks.

BTW, is the 64bit NT stack size is 12k too (just wonder)?


Eliyas Yakub [MSFT]

unread,
Mar 26, 2008, 1:37:39 PM3/26/08
to
http://www.microsoft.com/whdc/Driver/tips/KMstack.mspx

-Eliyas


"Sergei V" <s...@a.c.ad.e.m.org> wrote in message
news:eYH3Tu0...@TK2MSFTNGP06.phx.gbl...

SergeV

unread,
Mar 26, 2008, 11:43:13 PM3/26/08
to
Yes, this is a story of how to use the kernel stack (thank you Elyas for
the link) properly,
but (if I didn't miss something) there's nothing about how to change the
stack size.

On the other hand (-: they say :-) DirectX somehow manage to increase
kernel stack size to 64k,
and in the WDK there are (vague) words about stack size increase support
under W2k3 & Vista.

Could somebody firmly state smth like that (for example):
"Under XP (-32) kernel stack size is 12k fixed.To change it ask MS to
rebuild it for you." (or)
"Kernel stack size could be increased but programmatically from within a
driver only and under Vista and later..."

Sergei.

"Eliyas Yakub [MSFT]" <eli...@online.microsoft.com> wrote in message
news:EEA2D8A8-8752-428E...@microsoft.com...

SergeV

unread,
Mar 27, 2008, 12:23:41 AM3/27/08
to
(to that)

Yea, Microsoft say:
"the size of the kernel-mode stack on a given platform is set
by the operating system and cannot be modified."
this is clear.


On the other hand, D.Probert (Microsoft) say:
"kernel stacks.. can grow up to 64k.. in win64 .. 88k."
http://www.i.u-tokyo.ac.jp/edu/training/ss/lecture/new-documents/Lectures/17-Win32K/Win32K.ppt
(probably this is nothing about Windows NT/XP/2000. It is about
Win32k.sys)

Sorry if my questions sound silly.
I try to find a way to do, not to find the reason why I can't do.
Cheers.
Sergei.


David Craig

unread,
Mar 27, 2008, 12:53:43 AM3/27/08
to
Your design is bad. Reconsider. I heard from one person at Microsoft that
many have requested stack size increases for kernel mode drivers and the
kernel team said NO, NO WAY, NO HOW. There are some things that can
increase the stack size such as NTFS, and maybe some in the DirectX stack
(but I don't know about that), but not you. Describe the problem and what
design algorithms you are attempting to use that require that much stack
space. Using more than a few bytes per function for a kernel mode driver is
a very bad idea. Make that a VERY VERY VERY BAD BAD BAD IDEA!!!

"SergeV" <s_no_spam_v@a_ca.de_m.org> wrote in message
news:ewu0pJ8j...@TK2MSFTNGP04.phx.gbl...

Don Burn

unread,
Mar 27, 2008, 7:49:04 AM3/27/08
to
This was limited to extremely special circumstances with graphics subsystem
only IIRC. And even then it was a huge cause of crashes, fix your code.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply


"SergeV" <s_no_spam_v@a_ca.de_m.org> wrote in message
news:ewu0pJ8j...@TK2MSFTNGP04.phx.gbl...

Maxim S. Shatskih

unread,
Mar 27, 2008, 1:09:49 PM3/27/08
to
> On the other hand (-: they say :-) DirectX somehow manage to increase
> kernel stack size to 64k,

Any GUI apps (after first call to win32k) have this increase.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com

Pavel Lebedinsky [MSFT]

unread,
Mar 28, 2008, 3:37:51 AM3/28/08
to
"SergeV" wrote:

> Could somebody firmly state smth like that (for example):
> "Under XP (-32) kernel stack size is 12k fixed.To change it ask MS to
> rebuild it for you." (or)
> "Kernel stack size could be increased but programmatically from within a
> driver only and under Vista and later..."


Vista has KeExpandKernelStackAndCallout. Not quite the same thing
as permanently increasing the stack, but it can be used to achieve similar
effect.

However, as others have said, the general recommendation is still to
avoid using too much stack if at all possible.

--
This posting is provided "AS IS" with no warranties, and confers no
rights.


0 new messages