Sample Code

Windows Driver Samples/ Toaster Package Sample/ C++/ toastcd/ toastpkg.inf/

;/*++
;
;Copyright (c) Microsoft Corporation.  All rights reserved.
;
;    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
;    KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
;    IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
;    PURPOSE.
;
;Module Name:
;
;    TOASTPKG.INF
;
;Abstract:
;
;    INF file for installing toaster device drivers (and, optionally, value-
;    added software) via device-specific coinstaller.
;    This is a mutlios INF file. Same INF file cab be used on
;    x86, ia64 and amd64 platforms.
;
;--*/
[Version]
Signature="$WINDOWS NT$"
Class=TOASTER
ClassGuid={B85B7C50-6A01-11d2-B841-00C04FAD5171}
Provider=%ToastRUs%
DriverVer=09/21/2006,6.0.5736.1
CatalogFile.NTx86  = tostx86.cat
CatalogFile.NTIA64 = tostia64.cat
CatalogFile.NTAMD64 = tstamd64.cat

[DestinationDirs]
DefaultDestDir = 12
CoInstaller_CopyFiles = 11
ToasterClassInstallerCopyFiles = 11

; ================= Class section =====================

[ClassInstall32]
Addreg=ToasterClassReg     
CopyFiles=ToasterClassInstallerCopyFiles

[ToasterClassReg]
HKR,,,0,%ClassName%
HKR,,Icon,,100
HKR,,Installer32,,"tostrcls.dll,ToasterClassInstaller"
HKR,,DeviceCharacteristics,0x10001,0x100        ; Use same security checks on relative opens

[ToasterClassInstallerCopyFiles]
tostrcls.dll

;*****************************************
; Toaster Device  Install Section
;*****************************************

[Manufacturer]
%ToastRUs%=ToastRUs,NTx86, NTia64, NTamd64

; For Win2K
[ToastRUs]
%ToasterDevice.DeviceDesc%=Toaster_Device, {b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster

; For XP and later
[ToastRUs.NTx86]
%ToasterDevice.DeviceDesc%=Toaster_Device, {b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster

[ToastRUs.NTia64]
%ToasterDevice.DeviceDesc%=Toaster_Device, {b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster

[ToastRUs.NTamd64]
%ToasterDevice.DeviceDesc%=Toaster_Device, {b85b7c50-6a01-11d2-b841-00c04fad5171}\MsToaster


[Toaster_Device.NT]
CopyFiles=Toaster_Device.NT.Copy
FriendlyNameFormat=%FriendlyNameFormat%

[Toaster_Device.NT.Copy]
toaster.sys

[Toaster_Device.NT.HW]
AddReg=Toaster_Device.NT.HW.AddReg

[Toaster_Device.NT.HW.AddReg]
HKR,,"BeepCount",0x00010003,4

;-------------- Service installation

[Toaster_Device.NT.Services]
AddService = toaster, %SPSVCINST_ASSOCSERVICE%, toaster_Service_Inst

[toaster_Service_Inst]
DisplayName    = %toaster.SVCDESC%
ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
StartType      = 3               ; SERVICE_DEMAND_START 
ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\toaster.sys
LoadOrderGroup = Extended Base

;-------------- Coinstaller installation

[Toaster_Device.NT.CoInstallers]
AddReg=CoInstaller_AddReg
CopyFiles=CoInstaller_CopyFiles

[CoInstaller_CopyFiles]
tostrco2.dll

[CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000,"tostrco2.dll,ToasterCoInstaller"

[ToastCoInfo]
; Used by the toaster co-installer to figure out where the original media is
; located (so it can launch value-added setup programs).
OriginalInfSourcePath = %1%

[SourceDisksNames.x86]
1 = %DiskId1%, toastpkg.tag,,\i386

[SourceDisksNames.ia64]
1 = %DiskId1%, toastpkg.tag,,\ia64

[SourceDisksNames.amd64]
1 = %DiskId1%, toastpkg.tag,,\amd64

[SourceDisksFiles]
toaster.sys  = 1,,
tostrco2.dll = 1,,
tostrcls.dll = 1,,

[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ToastRUs = "Toast'R'Us"
ClassName = "Toaster"
DiskId1 = "Toaster Device Installation Disk #1"
ToasterDevice.DeviceDesc = "Toaster Package Sample Toaster"
toaster.SVCDESC = "Microsoft Toaster Device Driver"
FriendlyNameFormat = "ToasterDevice%1!u!"

Our Services

  • What our customers say about us?

© 2011-2024 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS