prefast complains

i am building file sys filter using prefast. it complains:
Function uses ‘2120’ bytes of stack: exceeds /analyze:stacksize’1024’.
Consider moving some data to heap.

how useful is this information. should i really move the data to heap or
2120 bytes on stack is ok.

The Windows kernel stack is small, and you are taking over 1/6th of total
in one function, you definitely should move the code to heap.


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

“Mani” wrote in message news:xxxxx@ntfsd…
>i am building file sys filter using prefast. it complains:
> Function uses ‘2120’ bytes of stack: exceeds /analyze:stacksize’1024’.
> Consider moving some data to heap.
>
> how useful is this information. should i really move the data to heap or
> 2120 bytes on stack is ok.
>
>
>
>

Quoting Mani :

> i am building file sys filter using prefast. it complains:
> Function uses ‘2120’ bytes of stack: exceeds /analyze:stacksize’1024’.
> Consider moving some data to heap.
>
> how useful is this information. should i really move the data to heap or
> 2120 bytes on stack is ok.
>
>

I am not sure it is that excessive but it could be pointing to casual use of the stack which is not good.

If you have declarations like
UCHAR Buffer[512]
you should probably be using lookaside lists instead.

On the other hand if the warning has been triggered by complex code it may be difficult to reduce in which case I
would be inclined to accept the warning.

Thanks Don.
i think i must move it to heap.

“Don Burn” wrote in message news:xxxxx@ntfsd…
> The Windows kernel stack is small, and you are taking over 1/6th of total
> in one function, you definitely should move the code to heap.
>
>
> –
> 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
>
> “Mani” wrote in message news:xxxxx@ntfsd…
>>i am building file sys filter using prefast. it complains:
>> Function uses ‘2120’ bytes of stack: exceeds /analyze:stacksize’1024’.
>> Consider moving some data to heap.
>>
>> how useful is this information. should i really move the data to heap or
>> 2120 bytes on stack is ok.
>>
>>
>>
>>
>
>
>