[erlang-questions] Re: open_error -192 on erl_ddll:load_driver(crypto_drv)

Robert Raschke rtrlists@REDACTED
Wed Sep 2 12:40:34 CEST 2009


On Wed, Sep 2, 2009 at 11:35 AM, Magnus Henoch <magnus@REDACTED
> wrote:

> Robert Raschke <rtrlists@REDACTED> writes:
>
> > If I try loading the driver manually (with the above erl_ddll:load_driver
> > function), I get the following error:
> > {error, {open_error, -192}}
> >
> > Does anyone have any idea where to look what this actually means?
>
> erl_ddll:format_error({open_error, -192}) would give a clearer message.
> Note that 'due to peculiarities in the dynamic loading interfaces on
> different platform, the returned string is only guaranteed to describe
> the correct error if format_error/1 is called in the same instance of
> the erlang virtual machine as the error appeared in (meaning the same
> operating system process)'.
>

Turns out this is a Windows specific error.

I have dug in the C sources and have found that the error codes returned
from the Windows LoadLibrary() call are returned as (-10 - Windows error
code). So that makes LoadLibrary() fail with 182 = ERROR_INVALID_ORDINAL .
And that in turn appears to mean that Windows couldn't load the DLL, which
is not at all helpful. At least it means it could read it, it just couldn't
do what it's meant to do with it.

Since the paths are all set up correctly, I can only assume that there is
some other underlying reason why a DLL cannot get loaded. Probably something
to do with versioning and "side by side".

Robby


More information about the erlang-questions mailing list