Chinaunix首页 | 论坛 | 博客
  • 博客访问: 96527
  • 博文数量: 46
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 505
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-22 19:56
文章分类
文章存档

2008年(46)

我的朋友

分类: WINDOWS

2008-06-16 22:36:12

在xp下使用window ddk里面的build对ndis程序进行编译得到ndis驱动程序时,在ndis程序包里面需要有
 makefile文件和source文件,如果在ndis程序包里面还有子目录的话,那还需要有dirs文件
source:
TARGETNAME=passthru // 生成的驱动程序名为passthru.sys
TARGETPATH=obj  //生成的驱动程序放在obj目录下
TARGETTYPE=DRIVER // 生成驱动程序
C_DEFINES=$(C_DEFINES) -DNDIS_MINIPORT_DRIVER -DNDIS_WDM=1
C_DEFINES=$(C_DEFINES) -DNDIS51_MINIPORT=1
C_DEFINES=$(C_DEFINES) -DNDIS51=1
PRECOMPILED_INCLUDE=precomp.h
PRECOMPILED_PCH=precomp.pch
PRECOMPILED_OBJ=precomp.obj
TARGETLIBS=$(DDK_LIB_PATH)\ndis.lib // 可选项,表示除了ddk lib外其他的库文件
USE_MAPSYM=1
INCLUDES=  // 可选项,表示除了ddk inc外其他的头文件
SOURCES=\  // 驱动程序的源文件,也就是要编译的源文件
    miniport.c \
    passthru.c \
    passthru.rc \
    protocol.c
 
makefile
所有的驱动程序的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 components of NT
#
!INCLUDE $(NTMAKEENV)\makefile.def
 
dirs文件
DIRS= \
     driver \
     notifyob\
     .......
阅读(1464) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~