setdlldirectory

add custom DLL search path @ application startup

我的未来我决定 提交于 2019-12-22 04:09:10
问题 I'm racking my brain trying to come up with an elegant solution to a DLL load problem. I have an application that statically links to other lib files which load DLLs. I'm not loading the DLLs directly. I'd like to have some DLLs in another folder other than the folder that the executable is in. Something like %working_folder%\dlls - I'd rather not have dozens (yes ... dozens) of DLLs in my %working_folder%. I'm trying to develop something that is part of the main app that will adjust the

How to call WinAPI function SetDllDirectory() in Delphi?

我与影子孤独终老i 提交于 2019-12-06 02:51:34
问题 I would like to prevent loading of malicious DLLs that may be possible through access of the current working directory as described in http://msdn.microsoft.com/en-us/library/ff919712(VS.85).aspx The solution implemented in our C++ apps was to make a WinAPI call to SetDllDirectory(""), which would effectively remove the current working directory from the Windows DLL loading search path. However, it seems this solution is not available for our Delphi apps because the SetDllDirectory() function

add custom DLL search path @ application startup

落爺英雄遲暮 提交于 2019-12-05 02:23:05
I'm racking my brain trying to come up with an elegant solution to a DLL load problem. I have an application that statically links to other lib files which load DLLs. I'm not loading the DLLs directly. I'd like to have some DLLs in another folder other than the folder that the executable is in. Something like %working_folder%\dlls - I'd rather not have dozens (yes ... dozens) of DLLs in my %working_folder%. I'm trying to develop something that is part of the main app that will adjust the search path @ startup. The problem I'm running into is that this new custom DLL path isn't in the system

How to call WinAPI function SetDllDirectory() in Delphi?

无人久伴 提交于 2019-12-04 07:59:00
I would like to prevent loading of malicious DLLs that may be possible through access of the current working directory as described in http://msdn.microsoft.com/en-us/library/ff919712(VS.85).aspx The solution implemented in our C++ apps was to make a WinAPI call to SetDllDirectory(""), which would effectively remove the current working directory from the Windows DLL loading search path. However, it seems this solution is not available for our Delphi apps because the SetDllDirectory() function doesn't exist. Is there an equivalent call in Delphi that does the same thing as SetDllDirectory("")?

SetDllDirectory LoadLibrary inside a DLL

别等时光非礼了梦想. 提交于 2019-12-04 06:00:35
问题 Can I use C++ SetDllDirectory and LoadLibrary commands inside a C++ DLL to load another DLL? I have tried using them like this: Executable calls the 1st DLL, then 1st DLL loads the 2nd DLL, then 2nd DLL does the calculations... but when I run the executable, I get this error message: This application has requested the Runtime to terminate it in an unusual way. Please contact the applications support team for more information. 2nd DLL works fine when linked directly to Executable! This is the

SetDllDirectory LoadLibrary inside a DLL

我怕爱的太早我们不能终老 提交于 2019-12-02 13:19:47
Can I use C++ SetDllDirectory and LoadLibrary commands inside a C++ DLL to load another DLL? I have tried using them like this: Executable calls the 1st DLL, then 1st DLL loads the 2nd DLL, then 2nd DLL does the calculations... but when I run the executable, I get this error message: This application has requested the Runtime to terminate it in an unusual way. Please contact the applications support team for more information. 2nd DLL works fine when linked directly to Executable! This is the code inside my executable: #include <windows.h> #include <iostream> int main(){ HINSTANCE hDLL_Link