Code cleanup.

This commit is contained in:
spx
2011-09-29 17:14:51 +00:00
parent 1493aec2a1
commit 86fd454277
5 changed files with 10 additions and 104 deletions

View File

@ -1044,17 +1044,22 @@ ULONGLONG CSystem::GetTickCount64()
**
** This function is a wrapper function for LoadLibrary().
**
** Avoids loading a DLL from current directory.
**
*/
HMODULE CSystem::RmLoadLibrary(LPCWSTR lpLibFileName, DWORD* dwError, bool ignoreErrors)
{
UINT oldMode;
if (ignoreErrors)
{
oldMode = SetErrorMode(0);
SetErrorMode(oldMode | SEM_FAILCRITICALERRORS); // Prevent the system from displaying message box
}
// Remove current directory from DLL search path
SetDllDirectory(L"");
SetLastError(ERROR_SUCCESS);
HMODULE hLib = LoadLibrary(lpLibFileName);