;-------------------------------------------------------------------------------
; INTEL CONFIDENTIAL
;
; Copyright (c) 2013-2018 Intel Corporation All Rights Reserved 
;
; The source code contained or described herein and all documents related to 
; the source code ("Material") are owned by Intel Corporation or its suppliers 
; or licensors. Title to the Material remains with Intel Corporation or its 
; suppliers and licensors. The Material contains trade secrets and proprietary 
; and confidential information of Intel or its suppliers and licensors. The 
; Material is protected by worldwide copyright and trade secret laws and treaty 
; provisions. No part of the Material may be used, copied, reproduced, 
; modified, published, uploaded, posted, transmitted, distributed, or 
; disclosed in any way without Intel's prior express written permission.
;
; No license under any patent, copyright, trade secret or other intellectual 
; property right is granted to or conferred upon you by disclosure or delivery 
; of the Materials, either expressly, by implication, inducement, estoppel or 
; otherwise. Any license under such intellectual property rights must be 
; expressed and approved by Intel in writing.
;------------------------------------------------------------------------------

[Version] 
Signature = "$WINDOWS NT$" 
Class=System
ClassGUID = {4D36E97D-E325-11CE-BFC1-08002BE10318}
Provider = %INTEL% 
CatalogFile = dptf_cpu.cat
DriverVer = 08/28/2018,8.5.10101.6917

;----------------------------------------------------------------------
; File Information
;----------------------------------------------------------------------

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

[SourceDisksFiles]
esif_lf.sys = 1
esif_umdf2.dll = 1
dptf_cpu.sys = 1
dsp.dv = 1
esif_uf.exe = 1
Dptf.dll = 1
DptfPolicyRfim.dll = 1
DptfPolicyActive.dll = 1
DptfPolicyActive2.dll = 1
DptfPolicyAdaptivePerformance.dll = 1
DptfPolicyCritical.dll = 1
DptfPolicyConfigTdp.dll = 1
DptfPolicyPassive.dll = 1
DptfPolicyPassive2.dll = 1
DptfPolicyPid.dll = 1
DptfPolicyPowerBoss.dll = 1
DptfPolicyVirtualSensor.dll = 1
DptfPolicyPowerShare.dll = 1
upe_wwan.dll = 1
upe_wifi.dll = 1
upe_nvme.dll = 1
upe_battery.dll = 1
dptf_helper.exe = 1
esif_cmp.dll = 1
esif_ws.dll = 1

[DestinationDirs]
DefaultDestDir = 12
EsifUf10.0_CopyFiles = 12, UMDF
EsifDspDv_CopyFiles = 10, %DvDir%
EsifUfService_CopyFiles = 11, %InstallDir%
EsifDptfDll_CopyFiles = 11, %InstallDir%

;-------------------------------------------------------------------------------
; Manufacturer and Models Section
;-------------------------------------------------------------------------------

[Manufacturer]
%INTEL% = INTEL, NTamd64.10.0

[INTEL.NTamd64.10.0]
%PROCSNB.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_0103
%PROCIVB.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_0153
%PROCHSW.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_0C03
%PROCHSW.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_0A03
%PROCHSW.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_0D03
%PROCBDW.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_1603
%PROCSKL.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_1903
%PROCCHT.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_22DC
%PROCBX0.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_0A8C
%PROCBX1.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_1A8C
%PROCBXX.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_4A8C
%PROCBXP.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_5A8C
%PROCCNL.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_5A03
%PROCGLK.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_318C
%PROCICL.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_8A03
%PROCLKF.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_9820
%PROCTGL.DeviceDesc%  = EsifManager10.0,PCI\VEN_8086&DEV_9A03

;------------------------------------------------------------------------------
; EsifManager 
;------------------------------------------------------------------------------

[EsifManager10.0.NTamd64]
CopyFiles = EsifLf_CopyFiles, EsifUfService_CopyFiles, EsifUf10.0_CopyFiles, EsifDptfDll_CopyFiles, EsifDspDv_CopyFiles
AddPowerSetting = DptfPolicyConfigTdpLevelDppeSettings
AddPowerSetting = DptfPolicyOsPowerSettingNotificationDppeSettings


[EsifLf_CopyFiles]
esif_lf.sys,,,2
dptf_cpu.sys,,,2

[EsifUf10.0_CopyFiles]
esif_umdf2.dll,,,2

[EsifManager10.0.NTamd64.Services]
AddService = esif_lf,, EsifLf_InstallService, EsifLfEtw_Install, System, esif_lf
AddService = dptf_cpu,0x00000002, EsifCpu_InstallService, DptfCpuEtw_Install, System, dptf_cpu
AddService = WUDFRd,0x000001f8, WUDFRD_InstallService, EsifUmdf2Etw_Install, Application
AddService = esifsvc, 0x000009f8, EsifUf_InstallService, EsifUfEventLog_Install, Application, DPTF

[EsifLf_InstallService]
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_DEMAND_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %12%\esif_lf.sys
LoadOrderGroup = Base

[EsifCpu_InstallService]
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_DEMAND_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %12%\dptf_cpu.sys
LoadOrderGroup = Base

[WUDFRD_InstallService]
DisplayName    = %DisplayName%
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_DEMAND_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %12%\WUDFRd.sys

[EsifManager10.0.NTamd64.HW]
AddReg = Hw_AddFilterReg

[Hw_AddFilterReg]
HKR,,"UpperFilters", 0x00010008, "esif_lf"
HKR,,"UpperFilters", 0x00010008, "WUDFRd"
HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GA;;;BA)"

[EsifManager10.0.NTamd64.Wdf]
KmdfService = esif_lf, Wdf_KmdfSection
KmdfService = dptf_cpu, Wdf_KmdfSection
UmdfService = esif_umdf2, Wdf_UmdfSection10.0
UmdfServiceOrder = esif_umdf2
UmdfImpersonationLevel = Impersonation
UmdfKernelModeClientPolicy = AllowKernelModeClients 
UmdfFileObjectPolicy = AllowNullAndUnknownFileObjects
UmdfHostProcessSharing = ProcessSharingDisabled
UmdfDispatcher = FileHandle

[Wdf_KmdfSection]
KmdfLibraryVersion = 1.11

[Wdf_UmdfSection10.0]
UmdfLibraryVersion = 2.0.0 ;hardcoded as the same inf is used for 1.11 too.
ServiceBinary = %12%\UMDF\esif_umdf2.dll

;----------------------------------------------------------------------
; ETW Support compontents
;----------------------------------------------------------------------

[EsifLfEtw_Install]
AddReg=EsifLfEtw_AddReg

[EsifLfEtw_AddReg]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{FDC7B3F9-EB64-4043-9D47-BF2B7457BAA6}",,%FLG_ADDREG_TYPE_SZ%,"EsifLfEtwProvider"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{FDC7B3F9-EB64-4043-9D47-BF2B7457BAA6}","ResourceFileName",%REG_EXPAND_SZ%,"%%SystemRoot%%\system32\drivers\esif_lf.sys"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{FDC7B3F9-EB64-4043-9D47-BF2B7457BAA6}","MessageFileName",%REG_EXPAND_SZ%,"%%SystemRoot%%\system32\drivers\esif_lf.sys"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{FDC7B3F9-EB64-4043-9D47-BF2B7457BAA6}","Enabled",%FLG_ADDREG_TYPE_DWORD%,1

[DptfCpuEtw_Install]
AddReg=DptfCpuEtw_AddReg

[DptfCpuEtw_AddReg]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{651E0E5C-0946-43FF-B70F-AECD299B29B4}",,%FLG_ADDREG_TYPE_SZ%,"DptfCpuEtwProvider"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{651E0E5C-0946-43FF-B70F-AECD299B29B4}","ResourceFileName",%REG_EXPAND_SZ%,"%%SystemRoot%%\system32\drivers\dptf_cpu.sys"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{651E0E5C-0946-43FF-B70F-AECD299B29B4}","MessageFileName",%REG_EXPAND_SZ%,"%%SystemRoot%%\system32\drivers\dptf_cpu.sys"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{651E0E5C-0946-43FF-B70F-AECD299B29B4}","Enabled",%FLG_ADDREG_TYPE_DWORD%,1

[EsifUmdf2Etw_Install]
AddReg=EsifUmdf2Etw_AddReg

[EsifUmdf2Etw_AddReg]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{3F51786B-B787-4B2F-84FC-272B76348F6D}",,%FLG_ADDREG_TYPE_SZ%,"EsifUmdf2EtwProvider"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{3F51786B-B787-4B2F-84FC-272B76348F6D}","ResourceFileName",%REG_EXPAND_SZ%,"%%SystemRoot%%\system32\drivers\UMDF\esif_umdf2.dll"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{3F51786B-B787-4B2F-84FC-272B76348F6D}","MessageFileName",%REG_EXPAND_SZ%,"%%SystemRoot%%\system32\drivers\UMDF\esif_umdf2.dll"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{3F51786B-B787-4B2F-84FC-272B76348F6D}","Enabled",%FLG_ADDREG_TYPE_DWORD%,1


;----------------------------------------------------------------------
; Various ESIF UF components.
;----------------------------------------------------------------------

[EsifUfService_CopyFiles]
esif_uf.exe,,,%COPYFLG_NOSKIP%

[EsifDptfDll_CopyFiles]
Dptf.dll,,,%COPYFLG_NOSKIP%
DptfPolicyRfim.dll,,,%COPYFLG_NOSKIP%
DptfPolicyActive.dll,,,%COPYFLG_NOSKIP%
DptfPolicyActive2.dll,,,%COPYFLG_NOSKIP%
DptfPolicyAdaptivePerformance.dll,,,%COPYFLG_NOSKIP%
DptfPolicyCritical.dll,,,%COPYFLG_NOSKIP%
DptfPolicyConfigTdp.dll,,,%COPYFLG_NOSKIP%
DptfPolicyPassive.dll,,,%COPYFLG_NOSKIP%
DptfPolicyPassive2.dll,,,%COPYFLG_NOSKIP%
DptfPolicyPid.dll,,,%COPYFLG_NOSKIP%
DptfPolicyPowerBoss.dll,,,%COPYFLG_NOSKIP%
DptfPolicyVirtualSensor.dll,,,%COPYFLG_NOSKIP%
DptfPolicyPowerShare.dll,,,%COPYFLG_NOSKIP%
upe_wwan.dll,,,%COPYFLG_NOSKIP%
upe_wifi.dll,,,%COPYFLG_NOSKIP%
upe_nvme.dll,,,%COPYFLG_NOSKIP%
upe_battery.dll,,,%COPYFLG_NOSKIP%
dptf_helper.exe,,,%COPYFLG_NOSKIP%
esif_cmp.dll,,,%COPYFLG_NOSKIP%
esif_ws.dll,,,%COPYFLG_NOSKIP%

[EsifDspDv_CopyFiles]
dsp.dv,,,%COPYFLG_NOSKIP%

[EsifUf_InstallService]
DisplayName=%ServiceDisplayName%
Description=%ServiceDescription%
ServiceType = %SERVICE_WIN32_OWN_PROCESS%
StartType = %SERVICE_AUTO_START%
ErrorControl = %SERVICE_ERROR_NORMAL%
ServiceBinary = %11%\%InstallDir%\%ServiceFile%

[EsifUfEventLog_Install]
AddReg=EsifUfEventLog_AddReg

[EsifUfEventLog_AddReg]
HKLM,%EventLogProviderKey%,,%FLG_ADDREG_TYPE_SZ%,"DPTF"
HKLM,%EventLogProviderKey%,"ResourceFileName",%REG_EXPAND_SZ%,"%%SystemRoot%%\system32\Intel\DPTF\esif_uf.exe"
HKLM,%EventLogProviderKey%,"MessageFileName",%REG_EXPAND_SZ%,"%%SystemRoot%%\system32\Intel\DPTF\esif_uf.exe"
HKLM,%EventLogProviderKey%,"Enabled",%FLG_ADDREG_TYPE_DWORD%,1
HKLM,%EventLogProviderKey%"\ChannelReferences","Count",%FLG_ADDREG_TYPE_DWORD%,1
HKLM,%EventLogProviderKey%"\ChannelReferences\0\",,%FLG_ADDREG_TYPE_SZ%,"Application"
HKLM,%EventLogProviderKey%"\ChannelReferences\0\","Flags",%FLG_ADDREG_TYPE_DWORD%,1
HKLM,%EventLogProviderKey%"\ChannelReferences\0\","Id",%FLG_ADDREG_TYPE_DWORD%,9
HKLM,%EventLogChannelKey%,"Enabled",%FLG_ADDREG_TYPE_DWORD%,1
HKLM,%EventLogChannelKey%,"EnableLevel",%FLG_ADDREG_TYPE_DWORD%,0
HKLM,%EventLogChannelKey%,"EnableProperty",%FLG_ADDREG_TYPE_DWORD%,1
HKLM,%EventLogChannelKey%,"LoggerName",%REG_EXPAND_SZ%,"EventLog-Application"
HKLM,%EventLogChannelKey%,"MatchAnyKeyword",%FLG_ADDREG_TYPE_QWORD%,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80
HKLM,%EventLogChannelKey%,"MatchAllKeyword",%FLG_ADDREG_TYPE_QWORD%,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00


;----------------------------------------------------------------------
; Dptf DPPE settings.
;----------------------------------------------------------------------

; The default config TDP AC/DC settings are index 0, they will be overwritten when the config TDP service is started 
[DptfPolicyConfigTdpLevelDppeSettings]
SubGroup    = %GUID_DPTF_GROUP%,"Intel(R) Dynamic Platform and Thermal Framework Settings", "Intel(R) Dynamic Platform and Thermal Framework Settings"
Setting     = %GUID_DPTF_CONFIGTDP_LEVEL%,"Config TDP Level","Specify the Config TDP Level for Intel(R) Dynamic Platform and Thermal Framework"
Value       = 0, "High TDP", "Configure High TDP Level", %REG_DWORD%, 0
Value       = 1, "Nominal TDP", "Configure Nominal TDP Level", %REG_DWORD%, 1
Value       = 2, "Low TDP", "Configure Low TDP Level", %REG_DWORD%, 2
Default     = %GUID_MAX_POWER_SAVINGS%, %AC%, 0
Default     = %GUID_MAX_POWER_SAVINGS%, %DC%, 0
Default     = %GUID_TYP_POWER_SAVINGS%, %AC%, 0
Default     = %GUID_TYP_POWER_SAVINGS%, %DC%, 0
Default     = %GUID_MIN_POWER_SAVINGS%, %AC%, 0
Default     = %GUID_MIN_POWER_SAVINGS%, %DC%, 0

[DptfPolicyOsPowerSettingNotificationDppeSettings]
Subgroup    = %GUID_POWER_SLIDER_GROUP%
Setting     = %GUID_POWER_SLIDER_STATE%, "Intel(R) Dynamic Platform and Thermal Framework Power Slider Notification", "Indicates the current power scheme for Intel(R) Dynamic Platform and Thermal Framework", 
Value       = 0, "Low Performance", "Intel(R) Dynamic Platform and Thermal Framework Better Battery", %FLG_ADDREG_TYPE_DWORD%, 50
Value       = 1, "Medium Performance", "Intel(R) Dynamic Platform and Thermal Framework Better Performance", %FLG_ADDREG_TYPE_DWORD%,75 
Value       = 2, "High Performance", "Intel(R) Dynamic Platform and Thermal Framework Best Performance", %FLG_ADDREG_TYPE_DWORD%, 100
Default     = %GUID_BETTER_BATTERY%, %AC%, 0 
Default     = %GUID_BETTER_BATTERY%, %DC%, 0 
Default     = %GUID_TYP_POWER_SAVINGS%, %AC%, 1 
Default     = %GUID_TYP_POWER_SAVINGS%, %DC%, 1
Default     = %GUID_BEST_PERFORMANCE%, %AC%, 2 
Default     = %GUID_BEST_PERFORMANCE%, %DC%, 2


;----------------------------------------------------------------------
; Strings and Constants
;----------------------------------------------------------------------

[Strings]
SERVICE_DEMAND_START  = 3
SERVICE_KERNEL_DRIVER = 1
SERVICE_ERROR_NORMAL  = 1

INTEL = "Intel"
DiskName = "Intel(R) Dynamic Platform and Thermal Framework"

DisplayName="Windows Driver Foundation - User-mode Driver Framework Reflector"

REG_DWORD                       = 0x00010001
REG_MULTI_SZ                    = 0x00010000
REG_EXPAND_SZ                   = 0x00020000
REG_SZ                          = 0x00000000

AC                              = 0
DC                              = 1

GUID_MAX_POWER_SAVINGS          = "{a1841308-3541-4fab-bc81-f71556f20b4a}"  ; Power Saver mode
GUID_TYP_POWER_SAVINGS          = "{381b4222-f694-41f0-9685-ff5bb260df2e}"  ; Balanced
GUID_MIN_POWER_SAVINGS          = "{8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c}"  ; High Performance
GUID_BETTER_BATTERY             = "{961cc777-2547-4F9d-8174-7d86181b8a7a}"
GUID_BEST_PERFORMANCE	        = "{ded574b5-45a0-4f42-8737-46345c09c238}"

GUID_DPTF_GROUP                 = "{48df9d60-4f68-11dc-8314-0800200c9a66}"
GUID_DPTF_CONFIGTDP_LEVEL       = "{07029cd8-4664-4698-95d8-43b2e9666596}"

GUID_POWER_SLIDER_GROUP         = "{f1e029fb-fdcb-4d31-b5d9-906e13fe3b67}"
GUID_POWER_SLIDER_STATE     	= "{a4f06079-f3e9-45e0-8562-8aa45ae221fa}"

;----------------------------------------------------------------------
;Strings/Constants specific to ESIF UF Service
;----------------------------------------------------------------------

SERVICE_WIN32_OWN_PROCESS = 0x00000010
SERVICE_AUTO_START = 0x2

FLG_ADDREG_TYPE_SZ = 0x00000000
FLG_ADDREG_TYPE_DWORD = 0x00010001
FLG_ADDREG_TYPE_QWORD = 0x000B0001

COPYFLG_NOSKIP = 0x00000002

ProductMessageKey="application\DPTF"
ServiceDisplayName="Intel(R) Dynamic Platform and Thermal Framework service"
ServiceDescription="Intel(R) Dynamic Platform and Thermal Framework service"
ServiceFile="esif_uf.exe"
DvDir="\ServiceProfiles\LocalService\AppData\Local\Intel\DPTF"
DspDir="dsp"
InstallDir="Intel\DPTF"
EventLogProviderKey="SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Publishers\{d3cb85d1-d61c-4bcf-9674-7910ee54d6af}"
EventLogChannelKey="SYSTEM\CurrentControlSet\Control\WMI\Autologger\EventLog-Application\{d3cb85d1-d61c-4bcf-9674-7910ee54d6af}"

PROCSNB.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCIVB.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCHSW.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCBDW.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCSKL.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCCHT.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCBX0.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCBX1.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCBXX.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCBXP.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCCNL.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCGLK.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCICL.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCLKF.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
PROCTGL.DeviceDesc  = "Intel(R) Dynamic Platform and Thermal Framework Processor Participant"
