• Audio: fallback to Win7+ IPolicyConfig IID on E_NOINTERFACE
    release / Build Windows .zip (push) Canceled after 0s

    LastSkywalker released this 2026-06-02 21:49:30 +03:00 | 32 commits to main since this release

    User report (screenshot): "Сменить устройство: IPolicyConfig:
    CoCreateInstance hr=0x80004002" on a Win10/11 host with two audio
    outputs. 0x80004002 = E_NOINTERFACE: the Vista IPolicyConfig IID
    (568b9108-…) we'd been using since v0.9.1 simply isn't registered
    on every installer build.

    Two IPolicyConfig IIDs live in the wild, both at the same CLSID:

    Vista layout — SetDefaultEndpoint at vtable slot 12.
    Win7+ layout — adds ResetDeviceFormat at slot 5, sliding
    SetDefaultEndpoint to slot 13.

    audio.SetDefault now tries the Vista IID first (preserves the
    behaviour every audio-switcher tool since SoundSwitch has shipped),
    and on E_NOINTERFACE specifically falls through to the Win7+ IID
    with slot 13. Other HRESULTs (REGDB_E_CLASSNOTREG, E_ACCESSDENIED,
    etc.) are surfaced as-is — they'd apply to both attempts equally.

    The slot number rides along with the interface pointer (acquirePolicy
    Config returns both), so the SetDefaultEndpoint call uses whichever
    slot matches the layout we got.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    Downloads