;
;               Driver Installation file for the CAN C402 family
;
; CAN-PCIe/402, CAN-PCI/402, CPCI-CAN/402, CPCIserial-CAN/402, CAN-PCIeMini/402
;       CAN-PCIe/402-FD, CAN-PCI/402-FD, PMC-CAN/402-FD, XMC-CAN/402-FD, 
;         CPCI-CAN/402-FD, CPCIserial-CAN/402-FD, CAN-PCIeMini/402-FD,
;                             CAN-PCIe/402-FD-LINIO
;
;                      WDF driver for Windows 10/11 (64-bit)
;                 Copyright (c) 2001 - 2025, esd electronics gmbh
;                              All rights reserved
;

[Version]
Signature=$WINDOWS NT$
Class=CanInterface
ClassGuid={42EEB68D-02B1-406c-B4F6-902F240EF58D}
Provider=%MFGNAME%
DriverPackageDisplayName="CAN 402 Family Device Driver"
DriverPackageType=PlugAndPlay
CatalogFile=canc402ak.cat
DriverVer = 02/18/2025,10.0.4201.0

[DestinationDirs]
DefaultDestDir          = 12                       ; DIRID_DRIVER
Canui64CopyFiles        = 11                       ; DIRID_SYSTEM
Common.AMD64.CopyFiles  = 11                       ; DIRID_SYSTEM
Common.CopyFiles.WOW64  = 10,SysWOW64              ; DIRID_SYSTEM
CoInstaller_CopyFiles   = 11                       ; DIRID_SYSTEM

[SourceDisksFiles]
ntcan.dll        = 1,x86
calcan32.dll     = 1,x86

[SourceDisksFiles.AMD64]
c402ak.sys       = 1,amd64
canui64.dll      = 1,amd64
ntcan64.dll      = 1,amd64
calcan64.dll     = 1,amd64
WdfCoInstaller01009.dll = 1,amd64

[SourceDisksNames]
1=%INSTDISK%,disk1

;------------------------------------------------------------------------------
;  Driver Install section
;------------------------------------------------------------------------------

[Manufacturer]
%MFGNAME%=DeviceList, NTAMD64

[DeviceList.NTAMD64]
; DisplayName             Section          DeviceID
; -----------             -------          --------
%C402E_CC_DESC_22%     =  C402E.AMD64,     PCI\VEN_12FE&DEV_0402&SUBSYS_040212FE     ; CAN-PCIe/402 (22)
%C402E_CC_DESC_30%     =  C402E.AMD64,     PCI\VEN_12FE&DEV_0402&SUBSYS_040312FE     ; CAN-PCIe/402 (30)
%C402E_FD_DESC_22%     =  C402EFD.AMD64,   PCI\VEN_12FE&DEV_0402&SUBSYS_140212FE     ; CAN-PCIe/402-FD (22)
%C402E_FD_DESC_30%     =  C402EFD.AMD64,   PCI\VEN_12FE&DEV_0402&SUBSYS_140312FE     ; CAN-PCIe/402-FD (30)
%C402E_IO_DESC_30%     =  C402ELI.AMD64,   PCI\VEN_12FE&DEV_0402&SUBSYS_340312FE     ; CAN-PCIe/402-FD-LINIO (30)

;------------------------------------------------------------------------------
;  Class Install Section
;------------------------------------------------------------------------------

[ClassInstall32.NTAMD64]
AddReg=Canui64AddReg
CopyFiles=Canui64CopyFiles

[Canui64AddReg]
HKR,,,0,%CLASSNAME%
HKR,,EnumPropPages32,,"canui64.dll,EnumPropPages"
HKR,,Icon,,"100"

[Canui64CopyFiles]
canui64.dll,,,0x62

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

[CoInstaller_CopyFiles]
WdfCoInstaller01009.dll

[CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller01009.dll,WdfCoInstaller"

;------------------------------------------------------------------------------
;  C402 Device Driver Installation Section
;------------------------------------------------------------------------------

[C402E.AMD64]
CopyFiles     = C402E.AMD64.CopyFiles,Common.AMD64.CopyFiles, Common.CopyFiles.WOW64

[C402E.AMD64.Services]
AddService    = c402,2,C402E.AMD64.AddService,C402E.AMD64.AddEventLog

[C402E.AMD64.AddService]
DisplayName   = %SERVICE_DESCRIPTION%
ServiceType   = 1                ;SERVICE_KERNEL_DRIVER
StartType     = 3                ;SERVICE_DEMAND_START
ErrorControl  = 1                ;SERVICE_ERROR_NORMAL
ServiceBinary = %12%\c402ak.sys

[C402E.AMD64.AddEventLog]
AddReg        = C402E.AMD64.AddEventLog.Reg

[C402E.AMD64.AddEventLog.Reg]
HKR,,EventMessageFile,0x00020000,"%%SystemRoot%%\System32\IoLogMsg.dll;%%SystemRoot%%\System32\drivers\c402ak.sys"
HKR,,TypesSupported,0x00010001,7

[C402E.AMD64.HW]
AddReg=C402E.AMD64.RegHW

[C402E.AMD64.RegHW]
HKR,,%BUS_TYPE_ID%,%REG_DWORD%,%BUS_TYPE_PCIE%
HKR,,FriendlyName,,%C402E_CC_FRIENDLYNAME%
; Enable MSI support (limit number of messages to 1 which should prevent MSI-X)
HKR,"Interrupt Management",,%CREATE_KEY%
HKR,"Interrupt Management\MessageSignaledInterruptProperties",,%CREATE_KEY%
HKR,"Interrupt Management\MessageSignaledInterruptProperties",MSISupported,%REG_DWORD%,1
HKR,"Interrupt Management\MessageSignaledInterruptProperties",MessageNumberLimit,%REG_DWORD%,1
; Default IRQ affinity to 'IrqPolicyMachineDefault' and IRQ priority to 'IrqPriorityHigh'
HKR,"Interrupt Management\Affinity Policy",,%CREATE_KEY%
HKR,"Interrupt Management\Affinity Policy",DevicePolicy,%REG_DWORD_NOCLOBBER%,0
HKR,"Interrupt Management\Affinity Policy",DevicePriority,%REG_DWORD_NOCLOBBER%,3

[C402E.AMD64.CopyFiles]
c402ak.sys,,,2

[C402E.AMD64.WMI]
WMIInterface = {BDFC71DE-8B9A-4ffb-B360-6390BE39A60E},1,WMIGuidSecurity_RoAu
WMIInterface = {BD268C3D-A03D-4f93-B1F4-DBEC5C4519EB},1,WMIGuidSecurity_RoAu

[C402E.AMD64.CoInstallers]
AddReg=CoInstaller_AddReg
CopyFiles=CoInstaller_CopyFiles

[C402E.AMD64.Wdf]
KmdfService = c402, C402E_wdfsect

[C402E_wdfsect]
KmdfLibraryVersion = 1.9

;------------------------------------------------------------------------------
;  C402 (FD) Device Driver Installation Section
;------------------------------------------------------------------------------

[C402EFD.AMD64]
CopyFiles     = C402E.AMD64.CopyFiles,Common.AMD64.CopyFiles, Common.CopyFiles.WOW64

[C402EFD.AMD64.Services]
AddService    = c402,2,C402E.AMD64.AddService,C402E.AMD64.AddEventLog

[C402EFD.AMD64.HW]
AddReg        = C402EFD.AMD64.RegHW

[C402EFD.AMD64.RegHW]
HKR,,%BUS_TYPE_ID%,%REG_DWORD%,%BUS_TYPE_PCIE%
HKR,,FriendlyName,,%C402E_FD_FRIENDLYNAME%
; Enable MSI support (limit number of messages to 1 which should prevent MSI-X)
HKR,"Interrupt Management",,%CREATE_KEY%
HKR,"Interrupt Management\MessageSignaledInterruptProperties",,%CREATE_KEY%
HKR,"Interrupt Management\MessageSignaledInterruptProperties",MSISupported,%REG_DWORD%,1
HKR,"Interrupt Management\MessageSignaledInterruptProperties",MessageNumberLimit,%REG_DWORD%,1
; Default IRQ affinity to 'IrqPolicyMachineDefault' and IRQ priority to 'IrqPriorityHigh'
HKR,"Interrupt Management\Affinity Policy",,%CREATE_KEY%
HKR,"Interrupt Management\Affinity Policy",DevicePolicy,%REG_DWORD_NOCLOBBER%,0
HKR,"Interrupt Management\Affinity Policy",DevicePriority,%REG_DWORD_NOCLOBBER%,3

[C402EFD.AMD64.WMI]
WMIInterface = {BDFC71DE-8B9A-4ffb-B360-6390BE39A60E},1,WMIGuidSecurity_RoAu
WMIInterface = {BD268C3D-A03D-4f93-B1F4-DBEC5C4519EB},1,WMIGuidSecurity_RoAu

[C402EFD.AMD64.CoInstallers]
AddReg=CoInstaller_AddReg
CopyFiles=CoInstaller_CopyFiles

[C402EFD.AMD64.Wdf]
KmdfService = c402, C402E_wdfsect

;------------------------------------------------------------------------------
;  C402 (LIN-IO) Device Driver Installation Section
;------------------------------------------------------------------------------

[C402ELI.AMD64]
CopyFiles     = C402E.AMD64.CopyFiles,Common.AMD64.CopyFiles, Common.CopyFiles.WOW64

[C402ELI.AMD64.Services]
AddService    = c402,2,C402E.AMD64.AddService,C402E.AMD64.AddEventLog

[C402ELI.AMD64.HW]
AddReg        = C402ELI.AMD64.RegHW

[C402ELI.AMD64.RegHW]
HKR,,%BUS_TYPE_ID%,%REG_DWORD%,%BUS_TYPE_PCIE%
HKR,,FriendlyName,,%C402E_IO_FRIENDLYNAME%
; Enable MSI support (limit number of messages to 1 which should prevent MSI-X)
HKR,"Interrupt Management",,%CREATE_KEY%
HKR,"Interrupt Management\MessageSignaledInterruptProperties",,%CREATE_KEY%
HKR,"Interrupt Management\MessageSignaledInterruptProperties",MSISupported,%REG_DWORD%,1
HKR,"Interrupt Management\MessageSignaledInterruptProperties",MessageNumberLimit,%REG_DWORD%,1
; Default IRQ affinity to 'IrqPolicyMachineDefault' and IRQ priority to 'IrqPriorityHigh'
HKR,"Interrupt Management\Affinity Policy",,%CREATE_KEY%
HKR,"Interrupt Management\Affinity Policy",DevicePolicy,%REG_DWORD_NOCLOBBER%,0
HKR,"Interrupt Management\Affinity Policy",DevicePriority,%REG_DWORD_NOCLOBBER%,3

[C402ELI.AMD64.WMI]
WMIInterface = {BDFC71DE-8B9A-4ffb-B360-6390BE39A60E},1,WMIGuidSecurity_RoAu
WMIInterface = {BD268C3D-A03D-4f93-B1F4-DBEC5C4519EB},1,WMIGuidSecurity_RoAu

[C402ELI.AMD64.CoInstallers]
AddReg=CoInstaller_AddReg
CopyFiles=CoInstaller_CopyFiles

[C402ELI.AMD64.Wdf]
KmdfService = c402, C402E_wdfsect

;------------------------------------------------------------------------------
;  Common Installation Section
;------------------------------------------------------------------------------
[Common.AMD64.CopyFiles]
ntcan.dll,ntcan64.dll,,2
calcan64.dll,,,2
canui64.dll,,,2

[Common.CopyFiles.WOW64]
ntcan.dll,,,2
calcan32.dll,,,2

;------------------------------------------------------------------------------
;  Common WMI security descriptor
;------------------------------------------------------------------------------
[WMIGuidSecurity_RoAu]
security="O:BAG:BAD:(A;;GR;;;AU)"

;------------------------------------------------------------------------------
;  String Definitions
;------------------------------------------------------------------------------
[Strings]

; -------------------------- Non-Localizable Strings -------------------

REG_SZ                = 0x00000000
REG_MULTI_SZ          = 0x00010000
REG_EXPAND_SZ         = 0x00020000
REG_BINARY            = 0x00000001
REG_DWORD             = 0x00010001
REG_DWORD_NOCLOBBER   = 0x00010003
CREATE_KEY            = 0x00000010
BUS_TYPE_ID           = "BusTypeID"
BUS_TYPE_PCI          = 0x00000000
BUS_TYPE_ISA          = 0x00000001
BUS_TYPE_LPT          = 0x00000002
BUS_TYPE_USB          = 0x00000003
BUS_TYPE_PCIE         = 0x00000004
BUS_TYPE_PCI104       = 0x00000005
BUS_TYPE_PMC          = 0x00000006
BUS_TYPE_VIRTUAL      = 0x00000007
C402E_CC_DESC_22      = "ESD CAN C402 Device"
C402E_CC_DESC_30      = "ESD CAN C402 Device"
C402E_CC_FRIENDLYNAME = "CAN-PCIe/402"
C402E_FD_DESC_22      = "ESD CAN C402-FD Device"
C402E_FD_DESC_30      = "ESD CAN C402-FD Device"
C402E_FD_FRIENDLYNAME = "CAN-PCIe/402-FD"
C402E_IO_DESC_30      = "ESD CAN C402-FD-LINIO Device"
C402E_IO_FRIENDLYNAME = "CAN-PCIe/402-FD-LINIO"
MFGNAME               = "esd electronics gmbh"
CLASSNAME             = "CAN Interface"

; -------------------------- Localizable Strings -----------------------

INSTDISK            = "esd electronics gmbh CAN Driver Installation Disc"
SERVICE_DESCRIPTION = "C402 Device Driver"
