0X00000097

Fix ERROR_INVALID_EVENT_COUNT (0x97) on DosMuxSemWait

Old apps or corrupt system files trigger this. The fix is rebuilding the system file cache or reinstalling the app. Takes 10 minutes.

Yeah, this error is annoying. You're trying to run some older app — maybe a legacy business tool, a game from the XP era, or some custom-built utility — and Windows throws 0x97 at you. The app either crashes on launch or hangs. Let's fix it.

Run SFC and DISM — the real fix

The culprit here is almost always a corrupt system file in the kernel layer that handles semaphore events. Windows 10 and 11 have a habit of bungling these during updates. Don't bother reinstalling the app first. Do this:

  1. Open Command Prompt as Admin. Type sfc /scannow and hit Enter. Let it finish. It'll find and replace corrupted files.
  2. After that, run DISM /Online /Cleanup-Image /RestoreHealth. This fixes the component store that SFC relies on. Takes a few minutes.
  3. Restart your machine. Try launching the app again.

I've seen this fix work on Windows 10 22H2 and Windows 11 23H2. If it doesn't, move to the next step.

Reinstall the app with compatibility mode

If SFC didn't help, the problem's likely in how the app registers its semaphore counts. Uninstall the app completely. Reboot. Then reinstall it, but right-click the installer and pick Run as administrator and set Compatibility mode for Windows 7 (or XP if it's really old).

Why compatibility mode? Because older apps assume a specific number of semaphore events — something Windows NT 4.0 and 2000 handled differently. Modern Windows doesn't always map those correctly. Forcing a compatibility layer sorts that.

Why this error happens

Under the hood, DosMuxSemWait is a legacy OS/2-style API call that's been emulated in Windows since the NT days. It waits on multiple semaphore objects. When the app expects 3 semaphores but the kernel only sees 2 — or worse, a corrupt event count — you get 0x97. The corrupt system files I mentioned earlier mess with the kernel's ability to allocate those semaphores properly. SFC and DISM restore that layer.

Less common variations

I've seen this error in a few other places:

  • Custom in-house apps — Developers sometimes hardcode semaphore counts. A recompile with updated Windows headers fixes it. If you can get the dev to rebuild with Visual Studio 2019 or newer, done.
  • Virtualized environments — Running a legacy app inside a Hyper-V or VMware VM? Try giving the VM more memory (2GB minimum) and enabling hardware virtualization extensions. The semaphore timing gets goofy with low resources.
  • Malware injection — Rare, but a virus hooking kernel functions can corrupt semaphore counts. Run a full scan with Malwarebytes (not Defender only).

What NOT to do

Don't mess with the registry. There's no key for semaphore event counts. I've seen people delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager thinking it helps — that just breaks Windows. Don't.

Also don't disable UAC or run everything as admin. That doesn't fix the underlying semaphore issue.

Prevention

Keep your system files clean. Run SFC once a month manually, or set a scheduled task. Avoid shady app installers that bundle crapware — those often corrupt kernel files. And if you're stuck on a legacy app for business reasons, run it in a Windows 7 VM with snapshotting. That way you can roll back when this error pops up again.

Bottom line: SFC + DISM first. Reinstall with compatibility mode second. If both fail, the app's just too old for modern Windows — use a VM or find an alternative.
Related Errors in Windows Errors
0XC00D0FAB NS_E_CD_READ_ERROR_NO_CORRECTION (0XC00D0FAB) — WMP Can't Read Your CD 0XC0262401 Fix 0xC0262401: GPU Child Device Descriptor Error 0X00003632 Fix IPsec IKE invalid auth algorithm (0x00003632) on VPN 0XC00D103D NS_E_WMP_JPG_UNEXPECTED_ENDOFFILE (0xC00D103D) — JPEG Truncated in Windows Media Player

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.