您的位置:首页 > 其它

windows驱动开发——一个最简单DDK驱动。

2013-05-16 23:21 423 查看
1、mini_ddk.c

#include <ntddk.h>

VOID DriverUnload(PDRIVER_OBJECT dirver)

{

DbgPrint("First:our Driver is unloading.....\n");

}

NTSTATUS DriverEntry(PDRIVER_OBJECT driver, PUNICODE_STRING reg_path)

{

//这里只输出一句话

DbgPrint("first: Hello,my salary!");

//设置一个卸载函数,便于这个函数的退出

driver->DriverUnload = DriverUnload;

return STATUS_SUCCESS;

}

2、Sources

TARGETNAME=mini_ddk

TARGETTYPE=DRIVER

TARGETPATH=OBJ

INCLUDES=$(BASEDIR)\inc;\

$(BASEDIR)\inc\ddk;\

SOURCES=mini_ddk.c\

3、makefile

#

# DO NOT EDIT THIS FILE!!! Edit .\sources. If you want to add a new source

# file to this component. This file merely indirects to the real make file

# that is shared by all the driver components of the Windows NT DDK

#

!INCLUDE $(NTMAKEENV)\makefile.def
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: