ERROR_MOD_NOT_FOUND - 126 (0x7E)

The specified module could not be found.

Updated: Feb 21, 2026

Technical Meaning

The ERROR_MOD_NOT_FOUND error code indicates that a required module could not be located or loaded. This typically occurs when an application attempts to load a dynamic link library (DLL) but the DLL is missing, corrupted, or inaccessible.

Error Details

This error is returned by various Windows APIs and functions, such as LoadLibrary, which are used for loading modules into memory during program execution. The error signifies that the system was unable to find the specified module in the expected locations, such as the application directory, system directories, or the Windows directory.

Usage Context

The context of this error can vary depending on the specific API call and the application's requirements. Common scenarios include:

  • An application attempting to load a required DLL for functionality.
  • A system service failing to start due to missing dependencies.
  • A user-mode driver or kernel module not being found during initialization.

Developer Interpretation

When encountering ERROR_MOD_NOT_FOUND, developers should consider the following aspects of their code and environment:

  • Ensure that all required DLLs are present in the correct directory. The application's working directory, system directories (e.g., C:\Windows\System32), and the PATH environment variable must include the necessary paths.
  • Verify that the module name is correctly specified without any typos or case sensitivity issues. Windows is case-insensitive for file names in most scenarios but may have specific requirements depending on the operating system version.
  • Check if the application has sufficient permissions to access the required files and directories. Issues with file permissions can prevent successful loading of modules.

Related Errors

  • ERROR_FILE_NOT_FOUND (2): Indicates that a file could not be found, which might precede or follow an attempt to load a module.
  • ERROR_PATH_NOT_FOUND (3): Suggests that the path specified in the module name is incorrect or does not exist.
  • ERROR_BAD_EXE_FORMAT (193): Indicates that the file format of the module is invalid, which might occur if the module has been corrupted.

FAQ

Q: What causes ERROR_MOD_NOT_FOUND?

A: Common causes include missing or corrupted DLL files, incorrect paths specified in the application, and insufficient permissions to access required modules.

Q: How can I resolve this error?

A: Ensure that all necessary DLLs are present and correctly named. Verify the application's working directory and PATH environment variable settings. Check file permissions and ensure that the application has sufficient rights to access the required files.

Summary

ERROR_MOD_NOT_FOUND is a generic error code indicating that a required module could not be found during execution. Developers should focus on ensuring correct paths, verifying file integrity, and confirming appropriate permissions when troubleshooting this issue.