Skip to content

Instantly share code, notes, and snippets.

@bobaoapae
bobaoapae / AudioSafetyHook.cpp
Created March 11, 2026 03:03
Workaround for Adobe AIR waveOutOpen crash (0x6BA) — IAT hook with Audiosrv pre-check
// AudioSafetyHook.cpp — IAT hook on waveOutOpen to prevent RPC crashes
//
// Problem: When the Windows Audio Service (Audiosrv) is unavailable,
// waveOutOpen() internally calls an RPC endpoint that raises exception 0x6BA
// (RPC_S_SERVER_UNAVAILABLE). Adobe AIR.dll has no SEH guard around this call,
// so the exception propagates and crashes the process.
//
// Solution: Replace the IAT entry for waveOutOpen in Adobe AIR.dll with a
// wrapper that checks if the audio service is running BEFORE calling the
// real waveOutOpen. If the service is down, return MMSYSERR_NODRIVER