;Drew Does what Intel isn't
;
; Module Name:
;    HDA.INF
;
; Abstract:
;    INF file for installing HDA Controller Driver

[Version]
Signature="$CHICAGO$"
Class=MEDIA
ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318}
provider=%MSFT%
DriverVer=6/15/2026,5.00.2195.21

[SourceDisksNames]
222=%DiskDescription%,,,

[SourceDisksFiles]
HDA.sys=222

[Manufacturer]
%CLMfgName%=SiriusCybernetics

;;
;; Mechanism for excluding drivers from the "Add New Hardware" list.
;;
[ControlFlags]
;; *EXCLUDE is a made up ID to prevent rank 1 drivers from showing in list.
ExcludeFromSelect = *EXCLUDE

;; HDA miniport
[SiriusCybernetics]
;Generic PCI class. use at your own risk
%*WDM_HDA.DeviceDesc%=WDM_HDA,            , PCI\CC_0403
%*CTL0051.DeviceDesc%=STUB_DEVICE,          , *CTL0051
%*CTL7FFF.DeviceDesc%=STUB_DEVICE,          , *CTL7FFF
%SBAWE_Virtual_Mpu.DeviceDesc%=STUB_DEVICE, , VIRTUAL\SBAWE-MPUEmulation

[*PNPB003.Det]
AddReg=PreCopySection

[PreCopySection]
HKR,,NoSetupUI,,1

[STUB_DEVICE]

[WDM_HDA]
AlsoInstall=KS.Registration(ks.inf),WDMAUDIO.Registration(wdmaudio.inf)
CopyFiles=HDA.CopyList
AddReg=WDM_HDA.AddReg

[WDM_HDA.Interfaces]
AddInterface=%KSCATEGORY_AUDIO%,%KSNAME_Wave%,WDM_HDA.Interface.Wave
AddInterface=%KSCATEGORY_RENDER%,%KSNAME_Wave%,WDM_HDA.Interface.Wave
AddInterface=%KSCATEGORY_CAPTURE%,%KSNAME_Wave%,WDM_HDA.Interface.Wave
AddInterface=%KSCATEGORY_AUDIO%,%KSNAME_Topology%,WDM_HDA.Interface.Topology
;;AddInterface=%KSCATEGORY_AUDIO%,%KSNAME_UART%,WDM.Interface.UART
;;AddInterface=%KSCATEGORY_RENDER%,%KSNAME_UART%,WDM.Interface.UART
;;AddInterface=%KSCATEGORY_CAPTURE%,%KSNAME_UART%,WDM.Interface.UART
;;AddInterface=%KSCATEGORY_AUDIO%,%KSNAME_FMSynth%,WDM.Interface.FMSynth
;;AddInterface=%KSCATEGORY_RENDER%,%KSNAME_FMSynth%,WDM.Interface.FMSynth

[WDM_HDA.Interface.Wave]
AddReg=WDM_HDA.Interface.Wave.AddReg
[WDM_HDA.Interface.Wave.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%WDM_HDA.Wave.szPname%

[WDM_HDA.Interface.Topology]
AddReg=WDM_HDA.Interface.Topo.AddReg
;; warning!! must be "Topo" because "Topology" is too long
[WDM_HDA.Interface.Topo.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%WDM_HDA.Topology.szPname%

[WDM.Interface.UART]
AddReg=WDM.Interface.UART.AddReg
[WDM.Interface.UART.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%WDM.UART.szPname%

[WDM.Interface.FMSynth]
AddReg=WDM.Interface.FMSynth.AddReg
[WDM.Interface.FMSynth.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%WDM.FMSynth.szPname%

;;Registry keys to add

[WDM_HDA.AddReg]
HKR,,AssociatedFilters,,"wdmaud,swmidi,redbook"
HKR,,Driver,,HDA.SYS
HKR,,NTMPDriver,,"HDA.sys,sbemul.sys"

HKR,Drivers,SubClasses,,"wave,midi,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,,%*WDM_HDA.DeviceDesc%
HKR,Drivers\midi\wdmaud.drv,Description,,%WDM_MIDI%
HKR,Drivers\mixer\wdmaud.drv,Description,,%*WDM_HDA.DeviceDesc%

;; Configuration Options
;; Edit the last number to 0 or 1 to switch options on and off

HKR,Settings,SkipControllerReset,0x00010001,0
HKR,Settings,SkipCodecReset,0x00010001,0
HKR,Settings,UseAltOut,0x00010001,0
HKR,Settings,UseSPDIF,0x00010001,1
HKR,Settings,UseDisabledPins,0x00010001,0
HKR,Settings,UseDmaPos,0x00010001,0

[DestinationDirs]
HDA.CopyList      = 10,system32\drivers ; %SystemRoot%\system32\drivers

[HDA.CopyList]
HDA.sys


;;**************** NT Install ****************

[STUB_DEVICE.NT]
[STUB_DEVICE.NT.SERVICES]
AddService=,0x2

[WDM_HDA.NT]
Include=ks.inf, wdmaudio.inf
Needs=KS.Registration, WDMAUDIO.Registration
CopyFiles=HDA.CopyList
AddReg=WDM_HDA.AddReg

[WDM_HDA.NT.Interfaces]
AddInterface=%KSCATEGORY_AUDIO%,%KSNAME_Wave%,WDM_HDA.Interface.Wave
AddInterface=%KSCATEGORY_RENDER%,%KSNAME_Wave%,WDM_HDA.Interface.Wave
AddInterface=%KSCATEGORY_CAPTURE%,%KSNAME_Wave%,WDM_HDA.Interface.Wave
AddInterface=%KSCATEGORY_AUDIO%,%KSNAME_Topology%,WDM_HDA.Interface.Topology
;;AddInterface=%KSCATEGORY_AUDIO%,%KSNAME_UART%,WDM.Interface.UART
;;AddInterface=%KSCATEGORY_RENDER%,%KSNAME_UART%,WDM.Interface.UART
;;AddInterface=%KSCATEGORY_CAPTURE%,%KSNAME_UART%,WDM.Interface.UART
;;AddInterface=%KSCATEGORY_AUDIO%,%KSNAME_FMSynth%,WDM.Interface.FMSynth
;;AddInterface=%KSCATEGORY_RENDER%,%KSNAME_FMSynth%,WDM.Interface.FMSynth

[WDM_HDA.NT.Services]
AddService = HDA,    0x00000002, sndblst_Service_Inst

[sndblst_Service_Inst]
DisplayName    = %sndblst.SvcDesc%
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
ServiceBinary  = %10%\system32\drivers\HDA.sys

[Strings]
MSFT="DrewHoffman"
CLMfgName="Sirius Cybernetics"
DiskDescription="HD Audio WDM Sample Driver Disk"
*WDM_HDA.DeviceDesc="HD Audio Controller (WDM)"
*CTL0051.DeviceDesc = "WDM Sample Driver for 3D Stereo Enhancement Technology (inactive)"
*CTL7FFF.DeviceDesc = "WDM Sample Driver for Plug and Play Device (Reserved) (inactive)"
SBAWE_Virtual_Mpu.DeviceDesc="WDM Sample Driver for MPU401 Emulation (inactive)"
WDM_HDA.Wave.szPname="HD Audio"
WDM_HDA.Topology.szPname="HD Audio"

MediaCategories="SYSTEM\CurrentControlSet\Control\MediaCategories"
WDM_MIDI="WDM-based Device"

;;TODO: change these GUIDs or this will conflict with an actual Sound Blaster in the PC

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}"
KSNAME_Wave="Wave"
KSNAME_UART="UART"
KSNAME_FMSynth="FMSynth"
KSNAME_Topology="Topology"

WDM.UART.szPname="HDA MPU-401"
WDM.FMSynth.szPname="HDA FM Synthesizer"

sndblst.SvcDesc = "HD Audio Driver Service"

