- DriverEntry parameters
- Posted by Tobias Philipp on November 3rd, 2006
Hello,
Code:
************************************************** *********************
extern "C" NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath)
{ // DriverEntry
************************************************** *********************
This is generated Code from Oney's WDM Driver Generator. Ist for an
Function Driver in Oney's book MS Windows Driver Model 2. Edition on
Page 54.
In the same book on Page 649 Chapter HID you can find the following
Code:
************************************************** *********************
extern "C" NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
{ // DriverEntry
************************************************** *********************
Why is here no "IN" ???
regards
Tobias Philipp
- Posted by Stephan Wolf [MVP] on November 3rd, 2006
IN and OUT are defined as empty macros. Their one and only purpose is
to illustrate the way in which function arguments are used. This
information is not used by the compiler in any way (since the macros
are empty) but is only there to help humans better understand the code.
So I guess Walter just forgot to add the "IN" here.
Stephan
---
Tobias Philipp wrote:
- Posted by Chris Doré on November 3rd, 2006
The IN and OUT macros are defined as nothing. They have no effect on code
generation and are simply there for a developer's visual aid. See ntdef.h.
Chris
"Tobias Philipp" <fh-tphilipp@web.de> wrote in message
news:4r11mjFp59c4U1@individual.net...
- Posted by Maxim S. Shatskih on November 3rd, 2006
IN is a comment, a macro defined to empty space, for human reading only.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
- Posted by Mark Roddy on November 3rd, 2006
On Fri, 03 Nov 2006 15:23:09 +0100, Tobias Philipp
<fh-tphilipp@web.de> wrote:
IN defines to nothing. It is a pretty decoration and a useful aid to
code understanding and you have stumbled over an error of little
consequence in the text.
Now having just said that, there is a tool, prefast, that uses the
nice decorations such as IN that in recent DDKs don't actually define
to nothing but instead define to SAL annotations like _in which in
turn are either ignored (by the compiler) or used for static code
analysis by prefast.
=====================
Mark Roddy DDK MVP
Windows Vista/2003/XP/2000 Consulting
Device and Filesystem Drivers
Hollis Technology Solutions 603-321-1032
www.hollistech.com