Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly means ERROR_INVALID_ORDINAL?

The LoadLibrary function is returning to me the error code 182. From MSDN:

ERROR_INVALID_ORDINAL: "The operating system cannot run %1"

Does anyone have a better description of what this error is?

like image 625
korbes Avatar asked Aug 16 '10 21:08

korbes


1 Answers

Very obscure error. The term "ordinal" is however strongly associated with a DLL. A DLL contains a list of exported functions as well as a list of imported functions. Other DLLs that it has a dependency on. These exports and imports usually have a name, but that's not required. They always have a number, the number is the "ordinal".

To start diagnosing this, use the SDK's Dumpbin.exe tool. Run this first:

Dumpbin /exports Blah.dll

and look at the list of exports. You should see the ordinal as well as the name. If that all checks out, run

Dumpbin /imports Blah.dll

to get a list of the dependencies. Odds are good that it has a dependency on a function in another DLL by number that this DLL doesn't have. Something like that anyway. You can probably make it less laborious by using the DependencyWalker tool. If the first step fails then something went drastically wrong when the DLL was built. If the second step fails then you're probably looking at some kind of DLL Hell problem.

like image 180
Hans Passant Avatar answered Sep 25 '22 15:09

Hans Passant