This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |