Closed GeorgeHahn closed 9 years ago
Solution is to use guid on line 7 here: https://github.com/sirWest/AudioSwitch/blob/master/CoreAudioApi/Interfaces/IPolicyConfig.cs :+1:
Spectacular! Works for me, thanks!
I'm curious, how did you find the new GUID? I tried pulling it out of mmcpl using frida without success.
I used some tool to crawl in Windows interfaces first and then I also discovered it being mentioned in msdn doc for this interface that it uses the IUnknown guid, weird that it also works on previous Windows versions :P I didn't get my own AudioSwitch working otherwise on my home PC and had to find it :)
It works downlevel because you are basically casting it to IUnknown, and then calling a method at that particular v-table slot. Theoretically, if they were use to use something like COM aggregation underneath then this wouldn't work. Think like C#'s dynamic, but a little unsafer - if they change the layout of the underneath interface (move methods around) or add parameters to that method, bad things will occur. :)
I prefer a little more safer code, so I'm using the real GUID.
Great news, thanks! I'm curious - how did you find the new GUID?
Crashes when setting a new default audio device. Exception details:
Crash is in
AudioDeviceManager.SetDefaultAudioDevice Line 85 - called with one of my audio devices &
AudioDeviceRole.Multimedia
.This is on Win10 Build 10041.
Let me know if there's anything I can do to investigate!