[Version]
Signature="$Windows NT$"
Class=MEDIA
Provider=%ProviderName%
ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318}
DriverVer = 09/18/2019,4.10.42.816
CatalogFile=RZSurround.cat

[SourceDisksNames]
222="RZSurround Driver Disk","",222

[SourceDisksFiles]
RZSurround.sys=222
RZSurroundApo.dll=222

;[SignatureAttributes]
;RZSurround.sys=SignatureAttributes.DRM
;RZSurroundApo.dll=SignatureAttributes.PETrust

;[SignatureAttributes.DRM]
;DRMLevel=1300

;[SignatureAttributes.PETrust]
;PETrust=true

[Manufacturer]
%MfgName%=RZVAD,NTamd64

[RZVAD.NTamd64]
%RZVAD_SA.DeviceDesc%=RZVAD_SA,Root\RZSurround

[DestinationDirs]
RZVAD_SA.CopyList=12 ; windows\system32\drivers
DYSAPO.CopyList=11 ; windows\system32

;======================================================
; RZVAD_SA
;======================================================
[RZVAD_SA.CopyList]
RZSurround.sys

[DYSAPO.CopyList]
RZSurroundApo.dll

[RZVAD_SA.AddReg]
HKR,,AssociatedFilters,,"wdmaud,redbook"
HKR,,Driver,,RZSurround.sys

;
; For demo only, please review these power management settings for your architecture. 
;
HKR,PowerSettings,SingleComponentMultiFxStates,3,1,0,0,0  ; Turn on multi Fx support.
HKR,PowerSettings,ConservationIdleTime,3,3,0,0,0          ; 3 seconds for idle power management when on battery
HKR,PowerSettings,PerformanceIdleTime,3,3,0,0,0           ; 3 seconds for idle power management when on AC power
HKR,PowerSettings,IdlePowerState,3,3,0,0,0                ; go to D3 for idle power management

;HKR,Drivers,SubClasses,,"wave,midi,mixer"
HKR,Drivers,SubClasses,,"wave,mixer"

HKR,Drivers\wave\wdmaud.drv,Driver,,wdmaud.drv
;HKR,Drivers\midi\wdmaud.drv,Driver,,wdmaud.drv
HKR,Drivers\mixer\wdmaud.drv,Driver,,wdmaud.drv

HKR,Drivers\wave\wdmaud.drv,Description,,%RZVAD_SA.DeviceDesc%
;HKR,Drivers\midi\wdmaud.drv,Description,,%RZVAD_MIDI%
HKR,Drivers\mixer\wdmaud.drv,Description,,%RZVAD_SA.DeviceDesc%

[DYSAPO.AddReg]
; Stream effect APO COM registration
HKCR,CLSID\%FX_STREAM_CLSID%,,,%SYSFX_FriendlyName%
HKCR,CLSID\%FX_STREAM_CLSID%\InProcServer32,,0x00020000,%%SystemRoot%%\System32\RZSurroundApo.dll
HKCR,CLSID\%FX_STREAM_CLSID%\InProcServer32,ThreadingModel,,"Both"

; Mode effect APO COM registration
HKCR,CLSID\%FX_MODE_CLSID%,,,%SYSFX_FriendlyName%a
HKCR,CLSID\%FX_MODE_CLSID%\InProcServer32,,0x00020000,%%SystemRoot%%\System32\RZSurroundApo.dll
HKCR,CLSID\%FX_MODE_CLSID%\InProcServer32,ThreadingModel,,"Both"

; Stream effect APO registration
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "FriendlyName", ,%SYSFX_FriendlyName%
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "Copyright", ,%DysCopyRight%
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "MajorVersion", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "MinorVersion", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "Flags", 0x00010001, 0xc
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "MinInputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "MaxInputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "MinOutputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "MaxOutputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "MaxInstances", 0x00010001, 0xffffffff
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "NumAPOInterfaces", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_STREAM_CLSID%, "APOInterface0", ,"{7828239E-5EA0-41F9-AA79-B93170156233}"

; Mode effect APO registration
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "FriendlyName", ,%MFX_FriendlyName%
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "Copyright", ,%DysCopyRight%
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "MajorVersion", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "MinorVersion", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "Flags", 0x00010001, 0xc
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "MinInputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "MaxInputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "MinOutputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "MaxOutputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "MaxInstances", 0x00010001, 0xffffffff
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "NumAPOInterfaces", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%FX_MODE_CLSID%, "APOInterface0", ,"{CEE5A119-CDD9-4E9F-9088-1EAAF58D5300}"


;======================================================
; render interfaces: speaker (external: headphone)
;======================================================
[RZVAD.I.WaveSpeakerHeadphone]
AddReg=RZVAD.I.WaveSpeakerHeadphone.AddReg
[RZVAD.I.WaveSpeakerHeadphone.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%RZVAD.WaveSpeakerHeadphone.szPname%

[RZVAD.I.TopologySpeakerHeadphone]
AddReg=RZVAD.I.TopologySpeakerHeadphone.AddReg,DYSAPO.I.Association0.AddReg
[RZVAD.I.TopologySpeakerHeadphone.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%RZVAD.TopologySpeakerHeadphone.szPname%
; The following lines opt-in to pull mode.
HKR,EP\\0,%PKEY_AudioEndpoint_Association%,,%KSNODETYPE_ANY%
HKR,FX\\0,%PKEY_FX_Association%,,%KSNODETYPE_ANY%
HKR,EP\\0,%PKEY_AudioEndpoint_Supports_EventDriven_Mode%,0x00010001,0x1

;======================================================
; APO per-interface registry
;======================================================
[DYSAPO.I.Association0.AddReg]
HKR,"FX\\0",%PKEY_ItemNameDisplay%,,%SYSFX_FriendlyName%
HKR,"FX\\0",%PKEY_AudioEndpoint_Disable_SysFx%, %REG_DWORD%, 0x0000 ; Enable SysFX
HKR,"FX\\0",%PKEY_FX_StreamEffectClsid%,,%FX_STREAM_CLSID%
HKR,"FX\\0",%PKEY_FX_ModeEffectClsid%,,%FX_MODE_CLSID%
HKR,"FX\\0",%PKEY_SFX_ProcessingModes_Supported_For_Streaming%,%REG_MULTI_SZ%,%AUDIO_SIGNALPROCESSINGMODE_DEFAULT%,%AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS%,%AUDIO_SIGNALPROCESSINGMODE_RAW%
HKR,"FX\\0",%PKEY_MFX_ProcessingModes_Supported_For_Streaming%,%REG_MULTI_SZ%,%AUDIO_SIGNALPROCESSINGMODE_DEFAULT%,%AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS%,%AUDIO_SIGNALPROCESSINGMODE_RAW%
HKR,"EP\\0",%PKEY_DYS_APO_ID%,,%DYS_APO_ID%
HKR,"EP\\0",%PKEY_AudioEngine_OEMFormat%, %REG_BINARY%, 41,00,00,00,28,00,00,00,FE,FF,08,00,80,BB,00,00,00,B8,0B,00,10,00,10,00,16,00,10,00,3F,06,00,00,01,00,00,00,00,00,10,00,80,00,00,AA,00,38,9B,71

;======================================================
; RZVAD_SA
;======================================================
[RZVAD_SA.NT]
Include=ks.inf,wdmaudio.inf
Needs=KS.Registration, WDMAUDIO.Registration
CopyFiles=RZVAD_SA.CopyList,DYSAPO.CopyList
AddReg=RZVAD_SA.AddReg,DYSAPO.AddReg

[RZVAD_SA.NT.Interfaces]
;
; Interfaces for speaker (external: headphone) render endpoint.
;
AddInterface=%KSCATEGORY_AUDIO%, %KSNAME_WaveSpeakerHeadphone%, RZVAD.I.WaveSpeakerHeadphone
AddInterface=%KSCATEGORY_RENDER%, %KSNAME_WaveSpeakerHeadphone%, RZVAD.I.WaveSpeakerHeadphone
AddInterface=%KSCATEGORY_REALTIME%, %KSNAME_WaveSpeakerHeadphone%, RZVAD.I.WaveSpeakerHeadphone
AddInterface=%KSCATEGORY_AUDIO%, %KSNAME_TopologySpeakerHeadphone%, RZVAD.I.TopologySpeakerHeadphone
AddInterface=%KSCATEGORY_TOPOLOGY%, %KSNAME_TopologySpeakerHeadphone%, RZVAD.I.TopologySpeakerHeadphone

[RZVAD_SA.NT.Services]
AddService=sRZVAD,0x00000002,RZVAD_Service_Inst

[RZVAD_Service_Inst]
DisplayName=%RZVAD.SvcDesc%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\RZSurround.sys

[RZVAD_SA.NT.HW]
AddReg = AUDIOHW.AddReg

[AUDIOHW.AddReg]
; FILE_DEVICE_SOUND
HKR,,DeviceType,0x10001,0x0000001D
; SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RWX_RES_RWX
HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGWGX;;;WD)(A;;GRGWGX;;;RC)"

[DeviceInstall32]
AddDevice = ROOT\RZSurround\0001,,RZVAD_RootDevice_Inst

[RZVAD_RootDevice_Inst]
HardwareIds = ROOT\RZSurround

;======================================================
; WDF
;======================================================
[RZVAD_SA.NT.Wdf]
KmdfService = RZVAD,RZVAD_SA_WdfSect
[RZVAD_SA_WdfSect]
KmdfLibraryVersion = 1.15

;======================================================
; COMMON
;======================================================
[Strings]

;Non-localizable

KSNAME_WaveSpeaker="WaveSpeaker"
KSNAME_TopologySpeaker="TopologySpeaker"

KSNAME_WaveSpeakerHeadphone="WaveSpeakerHeadphone"
KSNAME_TopologySpeakerHeadphone="TopologySpeakerHeadphone"

Proxy.CLSID									= "{17CCA71B-ECD7-11D0-B908-00A0C9223196}"
KSCATEGORY_AUDIO							= "{6994AD04-93EF-11D0-A3CC-00A0C9223196}"
KSCATEGORY_RENDER							= "{65E8773E-8F56-11D0-A3B9-00A0C9223196}"
KSCATEGORY_CAPTURE							= "{65E8773D-8F56-11D0-A3B9-00A0C9223196}"
KSCATEGORY_REALTIME							= "{EB115FFC-10C8-4964-831D-6DCB02E6F23F}"
KSCATEGORY_TOPOLOGY							= "{DDA54A40-1E4C-11D1-A050-405705C10000}"
KSNODETYPE_ANY								= "{00000000-0000-0000-0000-000000000000}"

PKEY_AudioEngine_OEMFormat					= "{E4870E26-3CC5-4CD2-BA46-CA0A9A70ED04},3"
PKEY_AudioEndpoint_Disable_SysFx			= "{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},5"
PKEY_AudioEndpoint_Association				= "{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},2"
PKEY_AudioEndpoint_Supports_EventDriven_Mode= "{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},7"
;PKEY_AudioEndpoint_Default_VolumeInDb		= "{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},9"

PKEY_FX_Association							= "{D04E05A6-594B-4FB6-A80D-01AF5EED7D1D},0"
PKEY_FX_StreamEffectClsid					= "{D04E05A6-594B-4fb6-A80D-01AF5EED7D1D},5"
PKEY_FX_ModeEffectClsid						= "{D04E05A6-594B-4fb6-A80D-01AF5EED7D1D},6"

PKEY_SFX_ProcessingModes_Supported_For_Streaming	= "{D3993A3F-99C2-4402-B5EC-A92A0367664B},5"
PKEY_MFX_ProcessingModes_Supported_For_Streaming	= "{D3993A3F-99C2-4402-B5EC-A92A0367664B},6"

PKEY_ItemNameDisplay						= "{B725F130-47EF-101A-A5F1-02608C9EEBAC},10"

AUDIO_SIGNALPROCESSINGMODE_DEFAULT			= "{C18E2F7E-933D-4965-B7D1-1EEF228D2AF3}"
AUDIO_SIGNALPROCESSINGMODE_MEDIA			= "{4780004E-7133-41D8-8C74-660DADD2C0EE}"
AUDIO_SIGNALPROCESSINGMODE_MOVIE			= "{B26FEB0D-EC94-477C-9494-D1AB8E753F6E}"
AUDIO_SIGNALPROCESSINGMODE_RAW				= "{9E90EA20-B493-4FD1-A1A8-7E1361A956CF}"
AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS   = "{98951333-B9CD-48B1-A0A3-FF40682D73F7}"

; see audioenginebaseapo.idl for APO_FLAG enum values
;APO_FLAG_DEFAULT					= 0x0000000e

PKEY_DYS_APO_ID						= "{DA29E02B-E54B-46F2-A15D-27A5D25616D6},0"
DYS_APO_ID							= "VAD"
SYSFX_FriendlyName					= "7.1 Surround Sound SFX APO"
MFX_FriendlyName					= "7.1 Surround Sound MFX APO"
FX_STREAM_CLSID						= "{D7D659E7-E415-41D7-848C-2A69C2B1EE0E}"
FX_MODE_CLSID						= "{C57DD664-CB0F-4D5E-B5D8-851AFB2CA685}"

REG_BINARY							= 0x00000001
REG_DWORD							= 0x00010001
REG_MULTI_SZ						= 0x00010000

;Localizable

ProviderName	= "Razer"
MfgName			= "Razer"
DysCopyRight	= "Copyright (c) Razer"

RZVAD_SA.DeviceDesc="7.1 Surround Sound"
RZVAD.SvcDesc="7.1 Surround Sound"
;RZVAD_MIDI="7.1 Surround Sound MIDI"

; friendly names
RZVAD.WaveSpeaker.szPname="7.1 Surround Sound Wave Speaker"
RZVAD.TopologySpeaker.szPname="7.1 Surround Sound Topology Speaker"

RZVAD.WaveSpeakerHeadphone.szPname="7.1 Surround Sound Wave Speaker Headphone"
RZVAD.TopologySpeakerHeadphone.szPname="7.1 Surround Sound Topology Speaker Headphone"
