;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Copyright 2017 Logitech
;; Logitech X52 HOTAS
;; x64
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[Version]
Signature=    $Windows NT$
Class=        HIDClass
ClassGuid=    {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
Provider=     %PROVIDER%
DriverVer=    04/12/2017, 8.0.116.0 
CatalogFile=  Sai0255.cat
PnpLockDown=  1

[Manufacturer]
Saitek =    SAITEK_MODELS, NTamd64
 
[SAITEK_MODELS.NTamd64]
%HID_NAME%=     SAI_HID_Inst,    HID\VID_06A3&PID_0255
%USB_NAME%=     SAI_USB_Inst,    USB\VID_06A3&PID_0255

[ControlFlags]
ExcludeFromSelect= *

[SourceDisksNames]
1=%DISKNAME%,,,.
 
[SourceDisksFiles]
SaiK0255.sys = 1 ; programming driver
SaiU0255.sys = 1 ; hidusb lower filter driver
SaiD0255.pr0 = 1 ; default profile
SaiC0255.Dll = 1 ; control panel
SaiC0255_07.dll = 1   ; german language resources
SaiC0255_09.dll = 1   ; english language resources
SaiC0255_0A.dll = 1   ; spanish language resources
SaiC0255_0C.dll = 1   ; french language resources
SaiC0255_10.dll = 1   ; italian language resources
SaiC0255_11.dll = 1   ; japanese language resources
SaiC0255_0402.dll = 1 ; chinese language resources
SaiC0255_12.dll = 1   ; korean language resources
SaiC0255_05.dll = 1   ; czech language resources
SaiC0255_19.dll = 1   ; rusian language resources
WdfCoInstaller01009.dll = 1 ; make sure the number matches with SourceDisksNames
 
[DestinationDirs]
DefaultDestDir=     10,system32\drivers
SAI_HID_Inst_Dlls.CopyFiles= 11
SAI_Inst_CoInstaller_CopyFiles = 11

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

[SAI_HID_Inst.NTamd64.CoInstallers]
AddReg=SAI_Inst_CoInstaller_AddReg
CopyFiles=SAI_Inst_CoInstaller_CopyFiles

[SAI_HID_Inst.NTamd64.Wdf]
KmdfService = SaiK0255, SAI_Inst_WDFSect

[SAI_USB_Inst.NTamd64.CoInstallers]
AddReg=SAI_Inst_CoInstaller_AddReg
CopyFiles=SAI_Inst_CoInstaller_CopyFiles

[SAI_USB_Inst.NTamd64.Wdf]
KmdfService = SaiU0255, SAI_Inst_WDFSect

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

[SAI_Inst_CoInstaller_CopyFiles]
WdfCoInstaller01009.dll,,,2

[SAI_Inst_WDFSect]
KmdfLibraryVersion = 1.9

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

[SAI_HID_Inst.NTamd64]
Copyfiles = SAI_HID_Inst.CopyFiles, SAI_HID_Inst_Dlls.CopyFiles
AddReg = SAI_HID_Inst.AddReg

[SAI_HID_Inst.CopyFiles]
SaiK0255.sys,,,2

[SAI_HID_Inst_Dlls.CopyFiles]
SaiD0255.pr0
SaiC0255.Dll
SaiC0255_07.dll
SaiC0255_09.dll
SaiC0255_0A.dll
SaiC0255_0C.dll
SaiC0255_10.dll
SaiC0255_11.dll
SaiC0255_0402.dll
SaiC0255_12.dll
SaiC0255_05.dll
SaiC0255_19.dll

[SAI_HID_Inst.AddReg]
HKLM, %KEY_OEM%\VID_06A3&PID_0255,     OEMName,     0, %DEV_NAME%
HKLM, %KEY_OEM%\VID_06A3&PID_0255,     ConfigCLSID, 0, %GUID_CPL%
HKLM, %KEY_OEM%\VID_06A3&PID_0255,     OEMData, 1,     00, 00, 00, 00, 22, 00, 00, 00
; cpl
HKCR, CLSID\%GUID_CPL%\ProgID        ,               , ,%USB_NAME%
HKCR, CLSID\%GUID_CPL%\InProcHandler32,              , ,"%11%\gchand.dll"
HKCR, CLSID\%GUID_CPL%\InProcServer32,               , ,"%11%\SaiC0255.dll"
HKCR, CLSID\%GUID_CPL%\InProcServer32, ThreadingModel, ,"Apartment"
; Do I Create a RawPDO for comms?
HKR, , UseInterface, 0x00010001, 0
; What Interfaces do I register
HKR, InterfacesSupported, %GUID_TORONTO%,       0x00010001, 1
HKR, InterfacesSupported, %GUID_SYDNEY%,        0x00010001, 1
HKR, InterfacesSupported, %GUID_AVIEMORE%,      0x00010001, 1
HKR, InterfacesSupported, %GUID_AUKLAND%,       0x00010001, 1
HKR, InterfacesSupported, %GUID_CLOCK%,         0x00010001, 1
; Settings for each Interface
; Toronto
HKR, Programming, Alias, ,          %GUID_ALIAS%
HKR, Programming, Balias, ,         %GUID_BALIAS%
HKR, Programming, DefaultProfile, , %DEFAULT_PROFILE%
; aukland data
HKR, Led, Brightness,			        0x00010001, 0x00000064
HKR, Led, Max,					0x00010001, 0x00000002
; aviemore data
HKR, Mfd, ClutchButton,			0x00010001, 0x0000001E
HKR, Mfd, ClutchMode,			0x00010001, 0x00000000
HKR, Mfd, Scale,			0x00010001, 0x00000002
HKR, Mfd, Brightness,			0x00010001, 0x00000064
HKR, Mfd, ShiftControl_0,		0x00010001, 0x00090018
HKR, Mfd, ShiftControl_1,		0x00010001, 0x00090019
HKR, Mfd, ShiftControl_2,		0x00010001, 0x0009001A
 
; modify the control panel
HKLM, %CONFIGURATION%\%GUID_ALIAS%, HideIcon, 0x00010001, 0x00000001

[SAI_HID_Inst.NTamd64.HW]
AddReg = SAI_HID_Inst.HW.AddReg

[SAI_HID_Inst.HW.AddReg]
HKR,, "UpperFilters", 0x00010000, "SaiK0255"

[SAI_HID_Inst.NTamd64.Services]
AddService = ,0x00000002
AddService = SaiK0255,, SaiHid_Service_Inst
 
[SaiHid_Service_Inst]
DisplayName    = SaiK0255
ServiceType    = 1
StartType      = 3
ErrorControl   = 0
ServiceBinary  = %12%\SaiK0255.sys
AddReg         = Sai_Service_Inst.AddReg
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[SAI_USB_Inst.NTamd64]
Include=Input.inf
Needs=HID_Inst.NT
CopyFiles=SAI_USB_Inst.CopyFiles

[SAI_USB_Inst.CopyFiles]
SaiU0255.sys

[SAI_USB_Inst.NTamd64.HW]
Include = INPUT.INF
Needs = HID_Inst.NT.HW
AddReg=SAI_USB_Inst.HW.AddReg

[SAI_USB_Inst.HW.AddReg]
HKR,,"LowerFilters", 0x00010000, "SaiU0255" 

[SAI_USB_Inst.NTamd64.Services]
Include=Input.inf
Needs=HID_Inst.NT.SERVICES
AddService = SaiU0255,, SaiUsb_Service_Inst

[SaiUsb_Service_Inst]
DisplayName    = SaiU0255
ServiceType    = 1
StartType      = 3
ErrorControl   = 1
ServiceBinary  = %12%\SaiU0255.sys
AddReg         = Sai_Service_Inst.AddReg

[Sai_Service_Inst.AddReg]
HKR,"Parameters","CdoGuid",0x00000000,%GUID_CDO%

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
[strings]
KEY_OEM       = "System\CurrentControlSet\Control\MediaProperties\PrivateProperties\Joystick\OEM"
CONFIGURATION = "Software\Logitech\Configuration\Controllers"
GUID_SYDNEY   = "{DAF1A7EE-68B2-4757-829E-C3E9226EA2DF}"
GUID_AUKLAND  = "{0040FD64-C5F1-49e3-A3EB-38E7B3AB3B3C}"
GUID_AVIEMORE = "{19D936F8-BAC2-4636-82B7-BC2C35F33F2A}"
GUID_TORONTO  = "{0C244C6F-2C78-4F0C-A036-8DB0E9012B27}"
GUID_CLOCK    = "{EF0BB43B-EF34-4192-8804-D5C0FA4A6A97}"

GUID_CPL    = "{F0FD8392-370C-4E1A-8EC6-F835543F3C2B}"
GUID_ALIAS  = "{C7719F41-F667-4514-BBB4-3F38C9E4D05A}"
GUID_BALIAS = "{E81D998B-C604-4d71-BE97-35CA01439C7E}"

GUID_CDO = "{ED4F83D8-C569-47CC-B6C2-2C916D6E0EB4}"

DEFAULT_PROFILE = "System32\SaiD0255.pr0"

PROVIDER= "Logitech"
DISKNAME= "Logitech Driver Media"
DEV_NAME= "X52 H.O.T.A.S."
HID_NAME= "X52 H.O.T.A.S. (HID)"
USB_NAME= "X52 H.O.T.A.S. (USB)"
