#ifdef __cplusplus
extern "C"
{
#endif

    #include <ntddk.h> //以"C"语言的方式编译

#ifdef __cplusplus
}
#endif

#define PAGECODE code_seg("PAGE")    //分页内存中运行
#pragma PAGECODE

void UnLoadDriver(IN PDRIVER_OBJECT pDriverObj);    //卸载驱动

//驱动入口
extern "C" NTSTATUS DriverEntry(PDRIVER_OBJECT pDriveObj, PUNICODE_STRING pStr)
{
    KdPrint(("我的第一个驱动程序"));
    pDriveObj->DriverUnload = UnLoadDriver;    //卸载驱动
    return STATUS_SUCCESS;
}

void UnLoadDriver(PDRIVER_OBJECT pDriverObj)
{
    KdPrint(("驱动成功卸载!"));
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2021-10-11
  • 2021-09-01
  • 2022-02-09
  • 2021-05-04
  • 2022-01-10
猜你喜欢
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
相关资源
相似解决方案