[SourceDisksFiles.x86] Wdm1.sys=1,objfrei386

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Windows 98

[Wdm1.Install]

CopyFiles=Wdm1.Files.Driver

AddReg=Wdm1.AddReg

[Wdm1.AddReg]

HKR,,DevLoader,,*ntkern

HKR,,NTMPDriver,,Wdm1.sys

[Wdm1.Files.Driver]

Wdm1.sys

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Windows 2000

[Wdm1.Install.NTx86]

CopyFiles=Wdm1.Files.Driver.NTx86

[Wdm1.Files.Driver.NTx86]

Wdm1.sys,,,%COPYFLG_NOSKIP%

[Wdm1.Install.NTx86.Services]

AddService = Wdm1, %SPSVCINST_ASSOCSERVICE%, Wdm1.Service

[Wdm1.Service]

DisplayName = %Wdm1.ServiceName%

ServiceType = %SERVICE_KERNEL_DRIVER%

StartType = %SERVICE_DEMAND_START%

ErrorControl = %SERVICE_ERROR_NORMAL%

ServiceBinary = %10%System32DriversWdm1.sys

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Strings

[Strings]

WDMBook='WDM Book'

Wdm1='WDM Book: Wdm1 Example, free build'

Wdm1.ServiceName='WDM Book Wdm1 Driver'

SPSVCINST_ASSOCSERVICE=0x00000002; Driver service is associated with device being installed

COPYFLG_NOSKIP=2; Do not allow user to skip file

SERVICE_KERNEL_DRIVER=1

SERVICE_AUTO_START=2

SERVICE_DEMAND_START=3

SERVICE_ERROR_NORMAL=1

Listing 4.16 SOURCES

TARGETNAME=Wdm1

TARGETTYPE=DRIVER

DRIVERTYPE=WDM

TARGETPATH=OBJ

INCLUDES=$(BASEDIR)inc;

SOURCES=init.cpp

 dispatch.cpp

 pnp.cpp

 DebugPrint.c

 Wdm1.rc

NTTARGETFILES=PostBuildSteps

Listing 4.17 makefile.inc

PostBuildSteps: $(TARGET)

!if '$(DDKBUILDENV)'='free'

 rebase –B 0x10000 –X . $(TARGET)

!endif

 copy $(TARGET) $(WINDIR)system32drivers

Listing 4.18 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

Listing 4.19 MakeDrvr.bat

@echo off

if '%1'=='' goto usage

if '%3'=='' goto usage

if not exist %1insetenv.bat goto usage

call %1insetenv %1 %4

%2

cd %3

build –b –w %5 %6 %1 %8 %9

goto exit

:usage

echo usage MakeDrvr DDK_dir Driver_Drive Driver_Dir free/checked [build_options]

echo eg MakeDrvr %%DDKROOT%% C: %%WDMBOOK%% free –cef

:exit

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату