If I execute , then Windows will load ONLY from "c: \ windows \ system32 \ ole32.dll"? Does LoadLibrary () in C also understand an environment variable? LoadLibrary("%windir%\\system32\\ole32.dll")
LoadLibrary("%windir%\\system32\\ole32.dll")
as Serge said and thoroughly tested, LoadLibrary does not replace environment variables in the path.
but API Windows is a function to replace the environment variables in the rows: ExpandEnvironmentStrings(). You can make the required replacement on your way to the call LoadLibrary().
ExpandEnvironmentStrings()
LoadLibrary()
The docs for LoadLibrary clearly state that:
, , .
, . , : , API .
BTW, , LoadLibrary() %windir%\blah.dll , UNC-. , , %windir%, !
%windir%\blah.dll
%windir%
: . = 126: .