C/DllSecur.c compilation fix for Mingw32 GCC
A free file archiver for extremely high compression
Brought to you by:
ipavlov
Small compilation patch:
When compiling with Mingw32 GCC, it complains:
../../../../C/DllSecur.c:69:50: error: cast between incompatible function types from 'FARPROC' {aka 'long long int ()()'} to 'BOOL ()(DWORD)' {aka 'int (*)(long unsigned int)'} [-Werror=cast-function-type]
69 | Func_SetDefaultDllDirectories setDllDirs = (Func_SetDefaultDllDirectories)
The attachted file fixes the issue by calling SetDefaultDllDirectories directly, instead of getting the function's address via getprocaddress.
This obviously changes the behavior of the program and it would refuse to run on Windows 7 without KB2533623 installed.
Your code will not work in Windows XP system that don't support
SetDefaultDllDirectories()
function..I tried to google that problem.
And there is such suggestion there:
Please try it, and write here about results.