[Version]
Signature   = "$WINDOWS NT$"
Class       = Monitor
ClassGuid   = {4d36e96e-e325-11ce-bfc1-08002be10318}
Provider    = %MSFT%
PnpLockdown = 1
DriverVer = 06/21/2006,10.0.22621.1

[ClassInstall32]
AddReg = ClassInstall_AddReg

[ClassInstall_AddReg]
HKR,,,,"%ClassDesc%"
HKR,,NoInstallClass,,1
HKR,,SilentInstall,,1
HKR,,DefaultService,,"monitor"
HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GA;;;BA)(A;;GA;;;S-1-2-1)(A;;GA;;;S-1-5-4)"
HKR,,IconPath,%REG_MULTI_SZ%,"%%SystemRoot%%\system32\setupapi.dll,-35"

[ClassInstall32.Configuration]
AddReg = ClassConfiguration_AddReg

[ClassConfiguration_AddReg]
HKR,Reset\Driver\MODES,,%FLG_ADDREG_DELKEY%
HKR,Reset\Driver,MaxResolution,%FLG_ADDREG_DELVAL%
HKR,Reset\Driver,DPMS,%FLG_ADDREG_DELVAL%
HKR,Driver\$!MODES\$MaxRes,,%FLG_ADDREG_KEYONLY%
HKR,Driver,$!MaxResolution,,%DEFAULT_MAX_RES%
HKR,Driver,$!DPMS,%REG_DWORD%,1
HKR,Variables\MaxRes,,,"KeyValue"
HKR,Variables\MaxRes,KeyRoot,,"Driver"
HKR,Variables\MaxRes,ValueName,,"MaxResolution"

; The below registry entries describe to PnP how to compute the friendly name for the device:
; * If an OEM creates a primary INF for the monitor, the INF device description wins
; * If an OEM creates an extension INF for the monitor, and they set a regkey UseBusDeviceDesc = 0, the INF device description wins
; * By default, the bus driver device description wins

; FriendlyName = AutoDeviceDesc
HKR,Instance,$!FriendlyName,,"$AutoDeviceDesc"

; AutoDeviceDesc = HasCustomInfOverride ? DEVPKEY_Device_BusReportedDeviceDesc : DEVPKEY_Device_DeviceDesc
HKR,Variables\AutoDeviceDesc,,,"Expression"
HKR,Variables\AutoDeviceDesc,Tokens,%REG_MULTI_SZ%,"HasCustomInfOverride","DefaultDeviceDesc","BusDeviceDesc","?:"

; HasCustomInfOverride = (DEVPKEY_Device_DriverInfPath != "monitor.inf") || (!!DEVPKEY_Device_DriverExtendedInfs && !UseBusDeviceDesc)
HKR,Variables\HasCustomInfOverride,,,"Expression"
HKR,Variables\HasCustomInfOverride,Tokens,%REG_MULTI_SZ%,"DriverInfPath","MonitorInfName","!=","DriverExtendedInfs","?","UseBusDeviceDesc","!","&&","||"

; UseBusDeviceDesc = Regkey under device called "UseBusDeviceDesc"
HKR,Variables\UseBusDeviceDesc,,,"KeyValue"
HKR,Variables\UseBusDeviceDesc,KeyRoot,,"Driver"
HKR,Variables\UseBusDeviceDesc,ValueName,,"UseBusDeviceDesc"
HKR,Variables\UseBusDeviceDesc,DefaultValue,%REG_DWORD%,1

; DriverInfPath = [DEVPKEY_Device_DriverInfPath]
HKR,Variables\DriverInfPath,,,"DeviceProperty"
HKR,Variables\DriverInfPath,PropertyGuid,,"{a8b865dd-2e3d-4094-ad97-e593a70c75d6}"
HKR,Variables\DriverInfPath,PropertyId,%REG_DWORD%,5

; DriverExtendedInfs = [DEVPKEY_Device_DriverExtendedInfs]
HKR,Variables\DriverExtendedInfs,,,"DeviceProperty"
HKR,Variables\DriverExtendedInfs,PropertyGuid,,"{a8b865dd-2e3d-4094-ad97-e593a70c75d6}"
HKR,Variables\DriverExtendedInfs,PropertyId,%REG_DWORD%,20

; BusDeviceDesc = [DEVPKEY_Device_BusReportedDeviceDesc]
HKR,Variables\BusDeviceDesc,,,"DeviceProperty"
HKR,Variables\BusDeviceDesc,PropertyGuid,,"{540b947e-8b40-45bc-a8a2-6a0b894cbda2}"
HKR,Variables\BusDeviceDesc,PropertyId,%REG_DWORD%,4

; DefaultDeviceDesc = [DEVPKEY_Device_DeviceDesc]
HKR,Variables\DefaultDeviceDesc,,,"DeviceProperty"
HKR,Variables\DefaultDeviceDesc,PropertyGuid,,"{a45c254e-df1c-4efd-8020-67d146a850e0}"
HKR,Variables\DefaultDeviceDesc,PropertyId,%REG_DWORD%,2

; MonitorInfName = "monitor.inf"
HKR,Variables\MonitorInfName,,,"Constant"
HKR,Variables\MonitorInfName,Value,,"monitor.inf"


[Strings]
; localizable strings
MSFT = "Microsoft"
ClassDesc = "Monitors"

; non-localizable strings
DEFAULT_MAX_RES    = "1600,1200"
REG_MULTI_SZ       = 0x00010000
REG_DWORD          = 0x00010001
FLG_ADDREG_KEYONLY = 0x00000010
FLG_ADDREG_DELVAL  = 0x00000004
FLG_ADDREG_DELKEY  = 0x00002004
