- bogus PREfast warning
- Posted by Hannes on May 24th, 2005
I am running DRVfast (PREfast for drivers) on my IM driver, and see the
following warnings:
warning 8126: The AccessMode parameter to ObReferenceObject* should be
IRP->RequestorMode.
warning 309: Potential NULL argument 3 to 'ObReferenceObjectByPointer'.
The "offending" source line looks like this:
status = ObReferenceObjectByPointer(pCtx->pDeviceObject, FILE_ALL_ACCESS,
NULL, KernelMode);
The MSDN docs for 'ObReferenceObjectByPointer' say that the 3rd argument
SHOULD be 'NULL' for lower-level drivers, and it also says the 4th argument
SHOULD be 'KernelMode'.
Can I in any way tell PREfast that my driver is a "lower-level driver" ?
/ Hannes.
- Posted by Ray Trent on May 24th, 2005
You might want to try using the latest Prefast from the WDF beta 3 disk
(assuming you have access to that, but if not you can sign up).
I had this error pop up with the old 1.52 build from the Server 2k3
prefast, but it went away for me in the 2.1 builds given out at DDC.
In any event, you can always pragma out the warning.
Hannes wrote:
--
.../ray\..
- Posted by Hannes on June 2nd, 2005
"Ray Trent" wrote:
WDF beta 3 only seems to contain PREfast, but not DRVfast? I would prefer to
use DRVfast for my device driver development.
Is it possible to apply the driver-specific rules to the PREfast in WDF?
Looking at other DDK's, PREfast and DRVfast appear to be separate
applications.
/ Hannes.
- Posted by Ray Trent on June 2nd, 2005
I hadn't really noticed the difference before. I will say that the
Prefast on the WDF disk certainly seems to detect quite a number of
driver specific things such as releasing cancel spinlocks from
non-cancel routines (though it still gets that wrong if you use a
wrapper function in a C++ class).
I had just assumed from the discussions at the DDC that the Prefast on
that disk was Prefast for Drivers, but perhaps someone from MS can say
definitively...?
Hannes wrote:
--
.../ray\..
- Posted by Doron Holan [MS] on June 4th, 2005
yes, it was PFD.
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ray Trent" <ratrent@nospam.nospam> wrote in message
news:%23Bvd$Z7ZFHA.2768@tk2msftngp13.phx.gbl...