;/*++
;
;Copyright (c) Microsoft Corporation.  All rights reserved.
;
;Module Name:
;
;    ApxUnit.INF
;
;--*/

[Version]
Signature="$WINDOWS NT$"
Class=MEDIA
ClassGuid={4d36e96c-e325-11ce-bfc1-08002be10318}
Provider=%ProviderName%
DriverVer = 10/18/2023,10.0.22621.2506
PnpLockdown=1

[DestinationDirs]
DefaultDestDir = 13

;*****************************************
; Audio Device Install Section
;*****************************************
[ControlFlags]
ExcludeFromSelect = APXENUM\APXUNIT
ExcludeFromSelect = APXENUM\APXAUDIO
PreConfigureDriver = APXENUM\APXAUDIO

[Manufacturer]
%StdMfg%=Standard,NTamd64

[Standard.NTamd64]
%ApxUnitDevice.DeviceDesc%=Audio_Device, APXENUM\APXUNIT
%ApxUnitChildDevice.DeviceDesc%=Audio_Child_Device, APXENUM\APXAUDIO

[Audio_Device.NT]
CopyFiles=Audio_Device.NT.Copy

[Audio_Child_Device.NT]
CopyFiles=Audio_Device.NT.Copy

[Audio_Device.NT.Copy]
ApxUnit.sys

;-------------- Service installation

[Audio_Device.NT.Services]
AddService = ApxUnit, %SPSVCINST_ASSOCSERVICE%, Audio_Service_Inst

[Audio_Child_Device.NT.Services]
;NULL Driver
AddService = , %SPSVCINST_ASSOCSERVICE%

[Audio_Service_Inst]
DisplayName    = %ApxUnitDevice.DeviceDesc%
ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
StartType      = 3               ; SERVICE_DEMAND_START
ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
ServiceBinary  = %13%\ApxUnit.sys

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

[SourceDisksFiles]
ApxUnit.sys  = 1,,

[Audio_Device.NT.Wdf]
KmdfService = ApxUnit, Audio_wdfsect
[Audio_wdfsect]
KmdfLibraryVersion = 1.31

;
; render interfaces: speaker
;
[Audio_Device.I.Speaker]
AddReg=Audio_Device.I.Speaker.AddReg
[Audio_Device.I.Speaker.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%Audio_Device.Speaker.szPname%
; The following lines opt-in to pull mode.
HKR,EP\0,%PKEY_AudioEndpoint_Association%,,%KSNODETYPE_ANY%
HKR,EP\0,%PKEY_AudioEndpoint_Supports_EventDriven_Mode%,0x00010001,0x1

;
; capture interfaces: microphone
;
[Audio_Device.I.Microphone]
AddReg=Audio_Device.I.Microphone.AddReg
[Audio_Device.I.Microphone.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%Audio_Device.Microphone.szPname%
; The following lines opt-in to pull mode.
HKR,EP\0,%PKEY_AudioEndpoint_Association%,,%KSNODETYPE_ANY%
HKR,EP\0,%PKEY_AudioEndpoint_Supports_EventDriven_Mode%,0x00010001,0x1

;
; PnP add interface directives for dynamic enumerated audio endpoints. 
;
[Audio_Child_Device.NT.Interfaces]
; Interfaces for render endpoint. capture is used for loopback.
AddInterface=%KSCATEGORY_AUDIO%,    %KSNAME_Speaker%,  Audio_Device.I.Speaker
AddInterface=%KSCATEGORY_RENDER%,   %KSNAME_Speaker%,  Audio_Device.I.Speaker
AddInterface=%KSCATEGORY_REALTIME%, %KSNAME_Speaker%,  Audio_Device.I.Speaker
;AddInterface=%KSCATEGORY_CAPTURE%, %KSNAME_Speaker%,  Audio_Device.I.Speaker

; Interfaces for mic capture endpoint 
AddInterface=%KSCATEGORY_AUDIO%,    %KSNAME_Microphone%, Audio_Device.I.Microphone
AddInterface=%KSCATEGORY_CAPTURE%,  %KSNAME_Microphone%, Audio_Device.I.Microphone
AddInterface=%KSCATEGORY_REALTIME%, %KSNAME_Microphone%, Audio_Device.I.Microphone

[Strings]
;
;Non-localizable
;
KSNAME_Speaker      = "Speaker"
KSNAME_Microphone   = "Microphone"

SPSVCINST_ASSOCSERVICE = 0x00000002
ProviderName        = "Microsoft"

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}"

KSNODETYPE_ANY      = "{00000000-0000-0000-0000-000000000000}"

PKEY_AudioEndpoint_ControlPanelPageProvider  = "{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},1"
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"

MediaCategories="SYSTEM\CurrentControlSet\Control\MediaCategories"

;
;Localizable
;
StdMfg = "Audio Kernel-Mode Proxy Unit Device"
DiskId1 = "Audio Kernel-Mode Proxy Unit Driver Installation Disk"
ApxUnitDevice.DeviceDesc = "Audio Kernel-Mode Proxy Unit Device"
ApxUnitChildDevice.DeviceDesc = "Audio Kernel-Mode Proxy Audio Device"

; friendly names
Audio_Device.Speaker.szPname="APX Speaker"
Audio_Device.Microphone.szPname="APX Microphone"
