Sometimes SEM_FAILCRITICALERRORS flag (disable critical-error-handler GUI
messages) is not enough for LoadLibrary() and SEM_NOOPENFILEERRORBOX flag
(disable file-not-found GUI messages) is needed too to prevent showing GUI
messages on LoadLibrary() failures.
BOOL ret;
/*
- * Load ntdll.dll library with disabled critical-error-handler message box.
+ * Load ntdll.dll library with disabled critical-error-handler and
+ * file-not-found message box.
* It means that NT kernel does not show unwanted GUI message box to user
* when LoadLibrary() function fails.
*/
- prev_error_mode = win32_change_error_mode(SEM_FAILCRITICALERRORS);
+ prev_error_mode = win32_change_error_mode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
ntdll = LoadLibrary(TEXT("ntdll.dll"));
win32_change_error_mode(prev_error_mode);
if (!ntdll)
* On older NT-based systems these functions are available in
* psapi.dll library without K32 prefix.
*/
- prev_error_mode = win32_change_error_mode(SEM_FAILCRITICALERRORS);
+ prev_error_mode = win32_change_error_mode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
psapi = LoadLibrary(TEXT("psapi.dll"));
win32_change_error_mode(prev_error_mode);
if (win32_sysdbg_initialized)
return 1;
- prev_error_mode = win32_change_error_mode(SEM_FAILCRITICALERRORS);
+ prev_error_mode = win32_change_error_mode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
ntdll = LoadLibrary(TEXT("ntdll.dll"));
win32_change_error_mode(prev_error_mode);
if (!ntdll)