Writing a device driver for windows, we need to use driverentry. In driverentry and for its parameter, we use IN PDRIVER_OBJECT. I want to know what is the "IN"?
This is part of the older code annotations. In your case the IN
annotation indicates that the parameter PDRIVER_OBJECT
(which is a DRIVER_OBJECT*
) is received as an input parameter.
These older annotations where very limited and have now been replaced by SAL (source-code annotation language) which is very powerful (but more difficult to handle properly in some cases). The newer SAL annotations can now be statically verified by some tools (including the code analyzer from Microsoft Visual Studio) to find and reduce the number of C/C++ code defects.
Note that SAL annotations can be used for both user and driver code. If you look closely at the definitions of the kernel functions in their respective headers (e.g. <ntifs.h>
), you'll see that they all use the newer SAL annotations.