What 0x40000020 Actually Means
This error code shows up when you're debugging a 32-bit app on a 64-bit Windows system. That's WOW64 — Windows on Windows 64 — the emulation layer that lets 32-bit code run on x64 hardware. The exception itself is informational: it's the emulator saying "I'm done, you can continue now." Normally, your debugger should ignore it and move on.
But sometimes it doesn't. The debugger stops, the app freezes, or you end up hitting "Continue" every 10 seconds. I've seen this most often in Visual Studio 2019 and 2022 when debugging legacy 32-bit C++ apps on Windows 10 21H2 and later. It also happens with some .NET Framework 4.x applications running in 32-bit mode.
You don't have to live with it. Here's how to fix it, starting with the quickest option.
1. The 30-Second Fix: Ignore the Exception in Your Debugger
This one's saved me more times than I can count. Your debugger is probably set to break on all Win32 exceptions, including this informational one. Just tell it to ignore 0x40000020.
In Visual Studio:
- Open your project.
- Go to Debug > Windows > Exception Settings.
- In the Exception Settings window, click the Search box and type
0x40000020. - You'll see STATUS_WX86_EXCEPTION_CONTINUE under Win32 Exceptions.
- Uncheck the box next to it. That's it. Done.
If you're using WinDbg or another debugger, you can skip this exception entirely with a command. In WinDbg, type:
sxd 0x40000020
That sets the break state to "disabled" for this exception. The command sxi does the same thing — they mean "ignore."
For most people, this is all you need. If the error still bugs you after this, move on to the next step.
2. The 5-Minute Fix: Disable WOW64 Exception Logging
Sometimes the exception fires repeatedly even when the debugger ignores it. That's because the WOW64 subsystem logs it to the Windows Event Log or a crash dump. You can turn that off.
Via Registry (Windows 10/11):
- Press Win + R, type
regedit, hit Enter. - Go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WOW - If you don't see a key called Wow64, right-click WOW > New > Key and name it
Wow64. - Inside that key, create a new DWORD (32-bit) value named
DisableExceptionLogging. - Set its value to
1. - Close regedit and restart your computer.
This doesn't disable the emulator — it just stops the logging. Your 32-bit apps will run fine. If you ever need to undo it, set the value back to 0 or delete the DWORD.
Via Group Policy (for IT environments):
If you manage multiple machines, you can push this via Group Policy. The path is under Computer Configuration > Administrative Templates > System > WOW64. Look for "Turn off WOW64 exception logging."
3. The 15+ Minute Fix: Use GFlags to Suppress the Exception
If the registry tweak didn't do it — maybe you have a custom debugger, or you're dealing with a specific 32-bit service that starts before the registry change kicks in — use GFlags. It's a tool that comes with the Windows Debugging Tools.
What You'll Need:
- Windows 10/11 SDK (includes Debugging Tools for Windows)
- Or just download the Debugging Tools standalone from Microsoft's site.
Steps:
- Open Command Prompt as Administrator.
- Navigate to the GFlags folder. Usually:
C:\Program Files (x86)\Windows Kits\10\Debuggers\x64 - Run:
gflags /p /enable yourapp.exe /fullReplace
yourapp.exewith your actual executable name. - Then set the exception filter by adding a registry key:
Registry Key for GFlags Exception Filter:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\yourapp.exe
- Create a DWORD named
DisableExceptionChainValidationand set it to1. - Create another DWORD named
DisableWOW64Exceptionand set it to1. - Restart the app. The exception should stop firing.
This is the nuclear option. It forces the debugger to skip the exception entirely for that specific app. Downside: you're turning off some WOW64 error handling, which might mask real issues. Use it only if the other two fixes failed.
Which Fix Should You Try First?
Start with option 1 — ignoring it in your debugger. It takes 30 seconds and works 80% of the time. If you're still seeing the error in your event logs, go with option 2. Option 3 is for the edge case where the app crashes or hangs silently because the debugger gets stuck in an infinite exception loop.
I've been on both sides: the quick fix that saves a demo, and the deep dive at 2 AM because some old VB6 app wouldn't stop throwing this code. Option 2 saved my bacon that night. Now you know the same trick.
One more thing: if you're using Visual Studio and you see this exception in the Output window but the app runs fine, you can safely ignore it. It's just WOW64 saying "all good, move along."