Sample Code

windows driver samples/ PortIO Sample Driver/ C++/ sys/ genport.inx/

;/*++
;
;Copyright (c) 1990-2000 Microsoft Corporation All rights Reserved
;
;Module Name:
;
;    Portio.INF
;
;Abstract:
;    INF file for installing sample portio driver
;
;--*/

[Version]
Signature="$WINDOWS NT$"
Class=Sample
ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171}
Provider=%MSFT%
DriverVer=09/21/2006,6.0.5736.1
CatalogFile=KmdfSamples.cat

[DestinationDirs]
DefaultDestDir = 12

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

[ClassInstall32]
Addreg=SampleClassReg     

[SampleClassReg]
HKR,,,0,%ClassName%
HKR,,Icon,,-5
HKR,,DeviceCharacteristics,0x10001,0x100     ;Use same security checks on relative opens
HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GA;;;BA)" ;Allow generic all access to system and built-in Admin. 


; ================= Device Install section =====================

[Manufacturer]
%MSFT%=MSFT,NT$ARCH$

; For Win2K
[MSFT]
%PortIO.DRVDESC%=PortIO_Inst,root\portio

; For XP and later
[MSFT.NT$ARCH$]
%PortIO.DRVDESC%=PortIO_Inst,root\portio

[PortIO_Inst.NT]
CopyFiles=PortIO.CopyFiles
LogConfig=PortIO.LC0, PortIO.LC1

[PortIO.CopyFiles]
genport.sys

[PortIO_Inst.NT.Services]
AddService=PORTIO,0x00000002,PortIO_Service 

;Uncomment following lines if your device can only work with factory default settings
;[PortIO.NT.FactDef]
;ConfigPriority=HARDRECONFIG
;IOConfig=300-303(3ff::)  ; 10 bit decode ranging from 300 - 303

[PortIO.LC0]
ConfigPriority=DESIRED 
IOConfig=300-303(3ff::)  ; 10 bit decode ranging from 300 - 303

[PortIO.LC1]
ConfigPriority=NORMAL
IOConfig=4@300-3ff(3ff::) ; 4 ports starting anywhere between 300 and 3fc

[PortIO_Service]
DisplayName    = %PortIO.SVCDESC%                            
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\genport.sys                            

[SourceDisksFiles]
genport.sys=1,,

[SourceDisksNames]
1 = %DiskId1%,,,""

; ADDING NEW ---------------------------

[DestinationDirs]
PORTIO_Device_CoInstaller_CopyFiles = 11

[PORTIO_Inst.NT.CoInstallers]
AddReg=PORTIO_Device_CoInstaller_AddReg
CopyFiles=PORTIO_Device_CoInstaller_CopyFiles

[PORTIO_Device_CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "wdfcoinstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller"

[PORTIO_Device_CoInstaller_CopyFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll

[SourceDisksFiles]
wdfcoinstaller$KMDFCOINSTALLERVERSION$.dll=1 ; make sure the number matches with SourceDisksNames

[PORTIO_Inst.NT.Wdf]
KmdfService =  PORTIO, PORTIO_wdfsect

[PORTIO_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$

; DONE ADDING NEW ----------------------------
[Strings]
MSFT = "Microsoft"
ClassName = "Sample Drivers"
PortIO.SVCDESC = "Sample PortIO Service"
PortIO.DRVDESC = "Sample PortIO Driver (KMDF)"
DiskId1 = "Portio Sample Install Disk"

Our Services

  • What our customers say about us?

© 2011-2025 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