Hello!
Sorry if this has already been discussed, but I didn't find any such post here.
Today, I was trying a number of plugins and encountered a problem with SymbolView plugin. The plugin WLX uses additional implicitly-imported DLL(s). I installed the plugin into a subdirectory of the Total Commander installation directory (i.e. not diretly where the TotalCmd.exe file is). Now, when I tried to activate the plugin, it succeeded only when this subdirectory was opened in the right panel when I tried to activate it for the first time in the Total Commander session. (I'm using Windows 98 SE, btw).
The problem seems to be related to the "search path" that is used when the plugin DLL is loaded (and its imports are searched). So, my question is: would it be possible to slightly change the way Total Commander loads the plugins? Replacing the LoadLibrary() call with LoadLibraryEx(.., .., LOAD_WITH_ALTERED_SEARCH_PATH) would help.
Loading plugins with additional DLLs from other folders
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Just a little remark: today, I was made aware of the following remark from MSDN:
On Windows Me/98/95, if you are using LoadLibraryEx to load a module that does not contain a resource, the function fails and GetLastError returns ERROR_BAD_FORMAT.
If it were true, then it might be a problem of course (since the plugins aren't required to contain any resources); fortunatelly, it's wrong. This remark is only valid if also the parameter LOAD_LIBRARY_AS_DATAFILE is specified; if not, the function loads resource-less libraries without any problems (since in this case, LoadLibraryEx uses the same kernel32 code as LoadLibrary, which doesn't have this "remark"). Tested on Windows 98 SE, but I really doubt it would be different on other Win9x platforms.
On Windows Me/98/95, if you are using LoadLibraryEx to load a module that does not contain a resource, the function fails and GetLastError returns ERROR_BAD_FORMAT.
If it were true, then it might be a problem of course (since the plugins aren't required to contain any resources); fortunatelly, it's wrong. This remark is only valid if also the parameter LOAD_LIBRARY_AS_DATAFILE is specified; if not, the function loads resource-less libraries without any problems (since in this case, LoadLibraryEx uses the same kernel32 code as LoadLibrary, which doesn't have this "remark"). Tested on Windows 98 SE, but I really doubt it would be different on other Win9x platforms.