When You get a Module load error

Occasionally you may get some errors that look like this when you are logging on or starting an application:

Error: c0000138 -  {Ordinal Not Found}
The ordinal %ld could not be located in the dynamic link
library %hs.

Error: c0000139 -  {Entry Point Not Found}
The procedure entry point %hs could not be located in the
dynamic link library %hs.

Error: c0000142 {DLL Initialization Failed}
Initialization of the dynamic link library %hs failed. The
process is terminating abnormally.

Error: c0000143 {Missing System File}
The required system file %hs is bad or missing.

In these cases the simplest way of figuring out what is going on is to turn on "loader snaps". Loader snaps can be turned ON by using the gflags utility.They can also be seen under depends.exe when you profile an application.

here is a simple snap shot of what the error will look like under loader snaps.:

[f70,d00] LDR: Recursive DLL load
[f70,d00]   Previous DLL being loaded: "\\?\c:\inetpub\wwwroot\simple.dll"
[f70,d00]   DLL being requested: "Kernel32.dll"
[f70,d00]   DLL whose initializer was currently running: "\\?\c:\inetpub\wwwroot
\simple.dll"
LDR: LdrLoadDll, loading Kernel32.dll from c:\windows\system32\inetsrv;C:\WINDOW
S\system32;C:\WINDOWS\system;C:\WINDOWS;.;C:\WINDOWS\debuggers;C:\WINDOWS\system
32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\idw;C:\WINDOWS\mstools;C:\Webt
est\Tools;C:\Inetpub\AdminScripts
LDR: LdrGetProcedureAddress by NAME - GetUserDefaultUILanguage
(f70.d00): Unknown exception - code e0434f4d (first chance)
[f70,d00] LDR: DLL_PROCESS_ATTACH for dll "\\?\c:\inetpub\wwwroot\simple.dll" (I
nitRoutine: 1000192C) failed
LDR: Unloading \\?\c:\inetpub\wwwroot\simple.dll because either its init routine
 or one of its static imports failed; status = 0xc0000142LDR: Derefcount MSVCR71
.dll (5)
LDR: Derefcount mscoree.dll (6)
LDR: UNINIT LIST
LDR: LdrLoadDll - failing because LdrpLoadDll(\\?\c:\inetpub\wwwroot\simple.dll)
 returned status c0000142