Windows内核代码片段
+ -

IoCallDriver函数源代码

2022-05-07 0 0

#define IoCallDriver   IofCallDriver


NTSTATUS FASTCALL IofCallDriver    (    IN PDEVICE_OBJECT     DeviceObject,
IN PIRP     Irp 
)    
{
     PDRIVER_OBJECT DriverObject;
     PIO_STACK_LOCATION StackPtr;

     /* Make sure this is a valid IRP */
     ASSERT(Irp->Type == IO_TYPE_IRP);

     /* Get the Driver Object */
     DriverObject = DeviceObject->DriverObject;

     /* Decrease the current location and check if */
     Irp->CurrentLocation--;
     if (Irp->CurrentLocation <= 0)
     {
         /* This IRP ran out of stack, bugcheck */
         KeBugCheckEx(NO_MORE_IRP_STACK_LOCATIONS, (ULONG_PTR)Irp, 0, 0, 0);
     }

     /* Now update the stack location */
     StackPtr = IoGetNextIrpStackLocation(Irp);
     Irp->Tail.Overlay.CurrentStackLocation = StackPtr;

     /* Get the Device Object */
     StackPtr->DeviceObject = DeviceObject;

     /* Call it */
     return DriverObject->MajorFunction[StackPtr->MajorFunction](DeviceObject,
                                                                 Irp);
 }
 `

0 篇笔记 写笔记

IoCallDriver函数源代码
#define IoCallDriver IofCallDriverNTSTATUS FASTCALL IofCallDriver ( IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp ) { PDRI......
作者信息
我爱内核
Windows驱动开发,网站开发
好好学习,天天向上。
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

您的支持,是我们前进的动力!