设备驱动程序中的 IN PDRIVER_OBJECT driverObject 中的 IN 是什么?

What is IN in IN PDRIVER_OBJECT driverObject in device driver?

为windows编写设备驱动程序,我们需要使用driverentry。 在 driverentry 及其参数中,我们使用 IN PDRIVER_OBJECT。 我想知道什么是"IN"?

这是旧代码注释的一部分。在您的情况下,IN 注释指示参数 PDRIVER_OBJECT(即 DRIVER_OBJECT*)作为 input 参数接收。

这些较旧的注释非常有限,现在已被 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 来自 Microsoft Visual Studio)取代,以查找和减少 C/C++ 代码缺陷的数量。

请注意,SAL 注释可用于用户代码和 driver 代码。如果您仔细查看内核函数在它们各自 headers 中的定义(例如 <ntifs.h>),您会发现它们都使用较新的 SAL 注释。