| Previous | Next |
| ERROR_TOO_MANY_MODULES | ERROR_EXE_MACHINE_TYPE_MISMATCH |
ERROR_NESTING_NOT_ALLOWED
What ERROR_NESTING_NOT_ALLOWED means
A LoadModule-style operation was called recursively or from a context where nested module loading is prohibited. Older loader implementations restrict re-entrant loading. A module initialization routine that starts another load can violate loader serialization and produce this status.
Common causes
- Initialization code loads another module while the loader lock is held
- A plugin callback triggers recursive discovery
- Dependency resolution cycles back to a module already being initialized
- A hook or instrumentation layer performs loading inside a loader callback
How to investigate
- Capture the full call stack at the nested load
- Record the module initialization state and dependency chain
- Detect cycles in plugin or dependency metadata
- Move deferred initialization outside the loader callback and compare behavior
Developer guidance
Keep module entry points minimal. Defer plugin discovery, thread creation, IPC, and additional module loading until normal application initialization after the loader has released internal locks.
Administrator and support guidance
Disable recently added plugins or instrumentation one at a time to identify the component initiating recursive loading.
How this code differs from related results
ERROR_TOO_MANY_MODULES is a capacity problem; this code is an illegal loading order even with only a few modules.
Evidence worth collecting
For ERROR_NESTING_NOT_ALLOWED, begin the trace at the operation where initialization code loads another module while the loader lock is held. For ERROR_NESTING_NOT_ALLOWED, preserve the exact API boundary, numeric result, process and thread identifiers, relevant object state, and the component version. The first verification point should be to capture the full call stack at the nested load. This evidence distinguishes the specific ERROR_NESTING_NOT_ALLOWED contract from a later secondary failure.
Recovery and verification
Recovery for ERROR_NESTING_NOT_ALLOWED should address the observed condition rather than merely retrying the same call. After the change, reproduce the scenario in which initialization code loads another module while the loader lock is held, then confirm that the intended operation completes and that cleanup returns all associated resources. For ERROR_NESTING_NOT_ALLOWED, also verify that the next repeated operation follows the same successful path without increasing the resource class implicated by this result.
When to escalate
Escalate ERROR_NESTING_NOT_ALLOWED with a minimal reproduction focused on the failing loader boundary. Include the operating-system build, binary architecture, runtime or compatibility-layer version, the exact input values, and a timestamped trace showing initialization code loads another module while the loader lock is held. For the ERROR_NESTING_NOT_ALLOWED escalation record, note whether changing concurrency, object lifetime, target process, module set, or endpoint location alters the result.
References
Looking for a different code? Search another status or error code.
