Hello,
Recently I have started working on a mini-filter project which was originally written by someone else.
While reading the project, I have observed that every (nested as well) input parameter of routine is validated at the top.
So, my question is, Is it recommended to validate the pointer in nested or in every routine?
Thanks,
Without know exactly what is being done, I will suggest the general comment, that the WDK samples have good mini-filter examples, take a look at that code to make a decision if the original author is doing something out of line. Also, consider that the original author may have had a corruption problem and was trying to identify it.
This was a very general question, but if you get into specifics the NTFSD group is the place for minifilter questions.
Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com
I have observed that every (nested as well) input parameter of routine is validated at the top.
Is it recommended to validate the pointer in nested or in every routine?
As Mr. Burn properly noted, this is a very general question.
So, a very general answer to your very general question is: No.
In Windows, in general kernel-mode callers architecturally trust other kernel-mode callers… because they are all equal members of the trusted computing base. So, again in general we only validate parameters that have been passed in from user-mode, and only then when we’re the first component to receive/process these parameters.
Peter
Thanks to both of you for reply . 