Sadly, what I did was wrong due to MSDN

the API is designed in a way of weirdness. People call this API sending integer value to subsystem thru randomly choosed arg by the specific SPI_GETblahblah. Recently I posted MmGrowKernelStack patch to ReactOS. This internal func is for cut down the kernelstack memory. Cause most threads use only KERNEL_STACK_SIZE, only GUI threads require KERNEL_LARGE_STACK_SIZE, and what's been done in NT? From the comments in ReactOS code, we find out that NT actually allocates KERNEL_STACK_SIZE for GUI thread at the very beginning. So the GUI thread would have only KERNEL_STACK_SIZE stack, while it could be not enough, so every call of growing kernel stack which might exhaust kernel stack would call MmGrowKernelStack. More details could be seen in bug 2413.

你可能感兴趣的:(thread)