Quick answer: Error 0xc0000142 is STATUS_DLL_INIT_FAILED: while Windows was starting the process, the initialisation routine of one DLL (its DllMain or static initialisers) reported failure, so the loader stopped before any of your game’s code ran. The DLL is usually something injected by other software, or a library you ship that does too much at load time. Find it with Process Monitor or loader snaps, keep your own DllMain empty, and have players disable overlays and repair the Visual C++ runtimes.
Every file is present and every file is the right architecture, and the game still refuses to start. That is what separates 0xc0000142 from the other launch errors: the loader found and mapped all the DLLs, then one of them said no when asked to initialise. Windows does not tell the player which one. The work is in naming that DLL, because the fix depends entirely on whether it is yours, a third-party library in your build, or something another program pushed into your process. This guide covers the tools that name it, the rules for your own libraries, and a reply you can give players.
- The exact error
- How it differs from the other launch errors
- What causes it
- How to find the DLL that failed
- Fix 1: keep your own DllMain empty
- Fix 2: audit the DLLs you ship
- What to tell players
- How to confirm the fix
- What Bugnet can do for a failure before start-up
- Related guides
- Frequently asked questions
The exact error
MyGame.exe - Application Error
The application was unable to start correctly (0xc0000142). Click OK to close the application.
Older Windows versions word it “The application failed to initialize properly (0xc0000142)”. The code is the NTSTATUS value STATUS_DLL_INIT_FAILED, whose own message text is {DLL Initialization Failed} Initialization of the dynamic link library %hs failed. The process is terminating abnormally.
When a process starts, the loader maps the executable and every DLL it imports, then calls each DLL’s entry point with DLL_PROCESS_ATTACH. That entry point runs the library’s C++ static initialisers and its DllMain. If one returns FALSE, or an exception escapes it, process start-up is abandoned with this status. Your main never ran, your log file was never opened, and your crash handler was never installed.
How it differs from the other launch errors
| What the player sees | Status | Meaning |
|---|---|---|
| “X.dll was not found” or 0xc0000135 | STATUS_DLL_NOT_FOUND | An imported DLL is missing. |
| “The procedure entry point could not be located” | STATUS_ENTRYPOINT_NOT_FOUND | The DLL exists but is a version without a function the game imports. |
| 0xc000007b | STATUS_INVALID_IMAGE_FORMAT | A DLL is the wrong architecture or is corrupted. |
| 0xc0000142 | STATUS_DLL_INIT_FAILED | Every DLL loaded, and one failed to initialise. |
| 0xc0000005 at start | STATUS_ACCESS_VIOLATION | Initialisation code crashed outright. See the access violation guide. |
The practical difference: for the first three, a dependency viewer pointed at your build folder finds the problem. For 0xc0000142 it finds nothing, because the files are fine on disk. The failure only exists at run time, on that machine.
What causes it
- A DLL injected by other software fails to initialise in your process. Overlays and capture tools, RGB and peripheral utilities, performance monitors and antivirus products load their own DLL into every program that starts. When that DLL is outdated or does not expect your game’s runtime, its initialisation fails and takes your process with it. This is the usual cause when the game runs for most players and fails for a few.
- A DLL you ship fails on some machines. A DRM, anti-tamper or anti-cheat wrapper that refuses the environment; an SDK library whose start-up code expects a service, a driver or a registry key that is not there; a library whose static initialiser reads a file relative to the working directory.
- Your own
DllMaindoes too much. Loading other libraries, starting threads and waiting for them, calling COM or the registry. It works on your PC and deadlocks or fails elsewhere. - A mod or proxy DLL in the game folder. Injectors that work by impersonating a system library (
dxgi.dll,d3d9.dll,dinput8.dll,winhttp.dll,version.dllbeside the executable) load before everything else. An old one after a game update is a classic. - Damaged runtime files. A half-installed Visual C++ runtime or DirectX component whose DLL loads but cannot initialise.
- Compatibility mode. A compatibility setting on the executable makes Windows load shim DLLs into the process. Players turn these on while trying to fix something else.
- The process cannot connect to the desktop.
user32.dllfails to initialise when a program is started as another user, from a service, or when the session has run out of desktop heap. Rare for a game started by double-click; possible when a launcher or updater service starts it. - The legacy
AppInit_DLLshook. DLLs listed in the registry are loaded into every process that loadsuser32.dll. Since Windows 8 the mechanism is disabled when Secure Boot is on, so this is mostly seen on older or Secure-Boot-off machines.
How to find the DLL that failed
There is usually no Application Error record and no crash dump, because nothing crashed: the loader ended the process deliberately. Windows only logs the dialog itself (Event Viewer > Windows Logs > System, source Application Popup, event ID 26), which repeats the text without naming a DLL. The process exit status, which Process Monitor shows, is normally -1073741502: the same code read as a signed integer.
Process Monitor
The quickest method on a player’s machine. Run Sysinternals Process Monitor, set a filter of Process Name is MyGame.exe, start the game, and click OK on the error. In the capture, look at the Load Image operations just before Process Exit. Every path that is not your game folder and not under C:\Windows is a DLL some other product injected. The last few images loaded before the exit are the suspects. A player can save the capture (File > Save, CSV) and send it.
Loader snaps
On a machine where you can reproduce it, make the loader narrate. With the Debugging Tools for Windows installed:
gflags /i MyGame.exe +sls
windbg MyGame.exe
rem press g to run, read the output, then switch it off again:
gflags /i MyGame.exe -sls
sls is the Show Loader Snaps flag. With it set, the loader prints each DLL as it is mapped and initialised to the debugger. Search the output for ERROR. The wording varies between Windows versions, but the line you want names an init routine and a DLL path and says it failed during DLL_PROCESS_ATTACH, followed by a line reporting that process initialisation failed with status 0xc0000142.
Bisecting
Without tools: copy the game to a clean Windows virtual machine. If it starts there, your shipped DLLs are sound and the cause is on the player’s side. On the affected machine, a clean boot (below) that makes the error disappear confirms an injected DLL, and re-enabling startup items in halves finds which.
To inspect the legacy hook, from an administrator Command Prompt:
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v AppInit_DLLs
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v LoadAppInit_DLLs
LoadAppInit_DLLs set to 1 with a non-empty AppInit_DLLs means those DLLs are being loaded into your game. A 32-bit game reads the same values from the Wow6432Node copy of that key.
Fix 1: keep your own DllMain empty
DllMain runs while the loader lock is held. Microsoft’s guidance lists what must never happen there: calling LoadLibrary, synchronising with other threads, initialising COM with CoInitializeEx, calling registry functions, calling CreateProcess, calling into User32.dll or Gdi32.dll, and running managed code. Code like this is a 0xc0000142 waiting for the right machine:
// Broken: heavy work and a failure path inside DllMain
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID)
{
if (reason == DLL_PROCESS_ATTACH) {
g_backend = LoadLibraryW(L"audio_backend.dll"); // loader lock is held
if (!g_backend)
return FALSE; // kills the whole process
g_worker = std::thread(WorkerMain);
WaitForSingleObject(g_workerReady, INFINITE); // deadlock risk
}
return TRUE;
}
// Fixed: DllMain does nothing, the game calls an explicit init
BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID)
{
return TRUE;
}
bool AudioLib_Init() // called from the game after start-up
{
g_backend = LoadLibraryW(L"audio_backend.dll");
if (!g_backend)
return false; // the game can log it and carry on without audio
g_worker = std::thread(WorkerMain);
return true;
}
The second version turns an unexplained launch failure into an error your game can log, report and survive. Global objects count too: a constructor of a global in a DLL runs inside the same entry point, under the same lock. Replace globals that open files, read configuration or allocate devices with functions that initialise on first use.
Fix 2: audit the DLLs you ship
List every DLL the executable imports directly (the open-source Dependencies tool shows the tree) and ask of each one whether it has to load at process start. A library that is only needed for one feature can be delay-loaded with the linker’s /DELAYLOAD option or loaded with LoadLibrary when the feature is first used. If it then fails to initialise, the call fails and your code handles it, instead of the loader ending the process.
For protection wrappers and anti-cheat, read the vendor’s list of known conflicts and test with the overlays your players use. If a wrapper is the failing DLL, only its vendor can fix it; your part is to report it with a Process Monitor capture and to offer an unwrapped build if the problem is widespread.
What to tell players
- Restart the PC, then try once before changing anything.
- Close overlays and background utilities: Discord overlay, MSI Afterburner and RivaTuner, RGB and peripheral software, screen recorders.
- Verify the game files, and remove mod files from the game folder, in particular
dxgi.dll,d3d9.dll,dinput8.dll,winhttp.dllorversion.dllthat did not come with the game. - Right-click the game’s
.exe, choose Properties > Compatibility, and untick every compatibility option. - Repair the Visual C++ 2015 and later redistributable, both x64 and x86.
- Add the game folder to the antivirus exclusions, or pause the antivirus for one launch.
- Do a clean boot: Win + R,
msconfig, Services, tick Hide all Microsoft services, Disable all, restart. If the game now starts, re-enable services in groups to find the one responsible. - As a last resort, run
sfc /scannowfrom an administrator Command Prompt to repair Windows system files.
Ask anyone who finds the culprit to tell you which program it was. Three players naming the same utility is a known issue you can publish.
How to confirm the fix
For a change in your own libraries, run the new build under WinDbg with loader snaps on and confirm no init routine reports an error, then start it on a clean virtual machine and on a machine with the usual overlays running. For a player-side cause, the confirmation is the bisect: the game starts with the named program closed and fails again when it is reopened. Record the program and its version; vendors fix these when they get precise reports.
What Bugnet can do for a failure before start-up
Nothing from inside the game: the process ends before any SDK is loaded, so there is no automatic report, no session and no log to send. That applies to every in-game tool. The useful part is on the outside. A project’s public bug tracker can carry a known-issue entry titled with the exact text, “The application was unable to start correctly (0xc0000142)”, listing the steps above and the conflicting programs found so far. Players who search the message land on it, and their upvotes are the only count you will get of how many are affected. Once a player is in the game, a report sent through the in-game form arrives with OS version, CPU, GPU and RAM attached, which is the place to ask “what did you have to close?”.
Related guides
- How to Fix “The application was unable to start correctly (0xc000007b)” for Your Game
- How to Fix “api-ms-win-crt-runtime-l1-1-0.dll is missing” for Your Game
- How to Fix “The procedure entry point could not be located in the dynamic link library” for Your Game
- How to Fix “The application has failed to start because its side-by-side configuration is incorrect” for Your Game
- How to Fix “MSVCP140.dll was not found” Errors for Your Game’s Players
Frequently asked questions
What does error 0xc0000142 mean?
It is STATUS_DLL_INIT_FAILED. While Windows was starting the program, one of the DLLs loaded into it reported that its initialisation failed, so the loader stopped the process before the program’s own code ran. The dialog does not say which DLL was responsible.
How do I find which DLL caused 0xc0000142?
Capture the launch with Sysinternals Process Monitor filtered to the game’s process and read the Load Image entries just before Process Exit. On a development machine, enable loader snaps with gflags and run under WinDbg; the output names the DLL whose init routine failed.
How is 0xc0000142 different from 0xc000007b?
0xc000007b means a DLL could not be loaded at all because it is the wrong architecture or corrupted. 0xc0000142 means every DLL loaded correctly and one of them then failed while initialising. The first is found by inspecting files; the second only shows up at run time.
Can an overlay or antivirus cause 0xc0000142?
Yes, and it is the most common cause when only some players are affected. These programs inject a DLL into every process. If that DLL fails to initialise inside the game, the game fails to start. Closing the program or doing a clean boot confirms it.
Why should DllMain be kept empty?
DllMain runs while Windows holds the loader lock, so loading other libraries, waiting on threads, COM and registry calls can deadlock or fail there, and returning FALSE ends the whole process. Moving the work into an explicit init function lets the game handle the failure.
0xc0000142 never names the DLL, so the first job is always to name it. Process Monitor on the affected machine does that in two minutes, and the fix follows from whose DLL it is.