windows驱动编程学习(2)--------第一个驱动 hello

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq635968970/article/details/43345241

工具: notepad++, wdk 7600(http://pan.baidu.com/s/1o6sm1Z0),monitor调试器http://pan.baidu.com/s/1c0rQPW0

文件目录


sources代码

TARGETNAME=hello
TARGETTYPE=DRIVER
INCLUDES=.
SOURCES=hello.c

maskfile代码

# Copyright (c) 1990-2005 Microsoft Corporation.
# All Rights Reserved.
# For Windows 2000 and greater
!INCLUDE $(NTMAKEENV)\makefile.def


hello.c源码:

#include "ntddk.h"

VOID DriverUnload(PDRIVER_OBJECT DriverObject)
{
  DbgPrint("stop driver");
}
NTSTATUS DriverEntry( PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegedtryPath)
{
  DbgPrint("start driver");
  DriverObject->DriverUnload = DriverUnload;
  return STATUS_SUCCESS;
}




猜你喜欢

转载自blog.csdn.net/qq635968970/article/details/43345241
今日推荐