]> jfr.im git - irc/unrealircd/unrealircd.git/commitdiff
- Windows: When trying to load a module (DLL) windows can give us the
authorBram Matthys <redacted>
Wed, 17 Nov 2010 18:25:56 +0000 (18:25 +0000)
committerBram Matthys <redacted>
Wed, 17 Nov 2010 18:25:56 +0000 (18:25 +0000)
  mysterious error 'The specified module could not be found' even though the
  file exists. This usually means that it depends on another DLL, but
  apparently Microsoft decided not to mention that in the error message.
  We now append some small text when such an error happens, saying that it
  could be because of a missing dependency. Reported by Phil.

Changes
src/modules.c

diff --git a/Changes b/Changes
index 24c5367278ac420b6fb800544af64f27e71b45f2..e1192aa81f4e2e37460de01fd3da9f5da6d0defa 100644 (file)
--- a/Changes
+++ b/Changes
 - Added set::options::allow-insane-bans which makes it possible to set
   really broad bans such as *@*.xx. Needless to say this can be very
   dangerous. Reported and patch provided by Stealth (#0003963).
+- Windows: When trying to load a module (DLL) windows can give us the
+  mysterious error 'The specified module could not be found' even though the
+  file exists. This usually means that it depends on another DLL, but
+  apparently Microsoft decided not to mention that in the error message.
+  We now append some small text when such an error happens, saying that it
+  could be because of a missing dependency. Reported by Phil.
index b88d8a5df3d3096354b93cd1a274e753d8c4b671..a12a05dc0f56cd7b8174bf5d0017162543dd6c6c 100644 (file)
@@ -1754,6 +1754,10 @@ const char *our_dlerror(void)
        DWORD err = GetLastError();
        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err,
                0, errbuf, 512, NULL);
+       if (err == 126)) /* FIXME: find the correct code for 126  */
+               strlcat(errbuf, " This could be because the DLL depends on another DLL, for example if you "
+                              "are trying to load a 3rd party module which was compiled with a different compiler version.",
+                              sizeof(errbuf));
        return errbuf;
 }
 #endif