0

I've got a python script that calls a dll in a directory off of C:\ (ctypes module). When I access the script, the errror I get back is

in <module> mydll = ctypes.cdll.LoadLibrary("C:\\DIR\\SomeDLL.dll")
...
...
OSError: [WinError 126] The specified module could not be found

When I run the script from command line it executes fine, so it seems to be a permissions problem, is it because the directory is outside of C:\inetpub?

  • Have you seen: http://stackoverflow.com/questions/10411709/windowserror-error-126-when-loading-a-dll-with-ctypes – Peter Hahndorf Jun 27 '15 at 15:04
  • @Peter Thanks, but this is an IIS specific problem, and I'm looking for advice within IIS. The script works fine outside of IIS, but bombs when run as a CGI within IIS. I'm sure it's just a matter of granting to proper permissions, but I'm new to IIS and can't find it. – Adam vonNieda Jun 29 '15 at 14:03
  • Loading DLLs from outside of C:\inetpub shouldn't be a problem. To troubleshoot permission problems, download Process Monitor and filter for your process name or `Access Denied` result. If you find problems add NTFS read/execute permissions to the affected files to the account running your CGI app. – Peter Hahndorf Jun 29 '15 at 14:07
  • Thanks again Peter. As it turned out, it was something strange with our Python installation, it wasn't "registered" properly, something like that. Once our admin removed it and reinstalled it, the problem magically disappeared. – Adam vonNieda Jun 29 '15 at 19:54

0 Answers0