| Previous | Next |
| STATUS_CALLBACK_RETURNED_TRANSACTION | STATUS_CALLBACK_RETURNED_LANG |
STATUS_CALLBACK_RETURNED_LDR_LOCK
The callback leaked the loader lock
The loader lock serializes sensitive DLL load, unload, and initialization activity. Returning a pooled worker while it still owns this lock can block future module operations and create lock-order deadlocks in unrelated callbacks. The status indicates a severe cleanup failure, not ordinary DLL search failure.
Avoid performing broad callback work from DllMain or other loader-locked paths. If callback code dynamically loads modules, do not call back into shutdown code that waits for pool work while holding loader-sensitive locks. Every acquisition must be balanced before the worker returns.
What to inspect
- Capture the worker stack, module operation, loader-lock owner, and any thread waiting for callback completion.
- Review
DllMainfor waits, thread synchronization, COM initialization, or pool teardown. - Use documented load APIs without retaining private loader-lock state across callbacks.
- Check lock-order cycles between loader operations and cleanup-group waits.
References
- Microsoft Open Specifications: NTSTATUS values
- Microsoft: Dynamic-Link Library Best Practices
- Microsoft: SetThreadpoolCallbackLibrary
- Microsoft: pooled threads and callback environments
Looking for a different code? Search another status or error code.