mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 09:27:59 +00:00
3de2f13b89
The code to find out the location of the c:\windows\system32 directory was already present, in load_system32_dll(). Now it's moved out into a function of its own, so it can be called in other contexts.
19 lines
438 B
C
19 lines
438 B
C
/*
|
|
* Wrapper function to load a DLL out of c:\windows\system32 without
|
|
* going through the full DLL search path. (Hence no attack is
|
|
* possible by placing a substitute DLL earlier on that path.)
|
|
*/
|
|
|
|
#include "putty.h"
|
|
|
|
HMODULE load_system32_dll(const char *libname)
|
|
{
|
|
char *fullpath;
|
|
HMODULE ret;
|
|
|
|
fullpath = dupcat(get_system_dir(), "\\", libname);
|
|
ret = LoadLibrary(fullpath);
|
|
sfree(fullpath);
|
|
return ret;
|
|
}
|