windows驅動編程學習(2)--------第一個驅動 hello

工具: 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;
}




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章