71d8f118da
Include throughout files using LoadLibrary function. * cygcheck.cc (dump_sysinfo): Retrieve kernel32.dll handle via GetModuleHandle, rather than using LoadLibrary. * cygpath.cc (get_long_name): Ditto. (do_sysfolders): Append .dll suffix in LoadLibrary call. * ldh.cc (WinMain): Use LoadLibraryExW with DONT_RESOLVE_DLL_REFERENCES to avoid loading malicious library code. * locale.cc (print_locale_with_codeset): Change way to retrieve kernel32.dll path.
18 lines
383 B
C++
18 lines
383 B
C++
#include <windows.h>
|
|
int APIENTRY
|
|
WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
|
{
|
|
LPWSTR cmd = GetCommandLineW ();
|
|
while (*cmd)
|
|
if (*cmd != ' ' || cmd[1] != L'-' || cmd[2] != '-' || cmd[3] != ' ')
|
|
cmd++;
|
|
else
|
|
{
|
|
cmd += 4;
|
|
break;
|
|
}
|
|
if (!*cmd || !LoadLibraryExW (cmd, NULL, DONT_RESOLVE_DLL_REFERENCES))
|
|
ExitProcess (0x0100);
|
|
ExitProcess (0x0000);
|
|
}
|