Author: mjansen
Date: Sun Oct 30 11:50:10 2016
New Revision: 73077
URL:
http://svn.reactos.org/svn/reactos?rev=73077&view=rev
Log:
[REGSVR32] Disable error message boxes while loading a dll. CORE-12209
Modified:
trunk/reactos/base/system/regsvr32/regsvr32.c
Modified: trunk/reactos/base/system/regsvr32/regsvr32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/regsvr32/regsv…
==============================================================================
--- trunk/reactos/base/system/regsvr32/regsvr32.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/regsvr32/regsvr32.c [iso-8859-1] Sun Oct 30 11:50:10 2016
@@ -258,7 +258,7 @@
LPCSTR lpFuncName;
LPWSTR lpwDllCmdLine;
BOOL bUnregister,bSilent,bConsole,bInstall,bNoRegister;
- UINT nDllCount;
+ UINT nDllCount, fuOldErrorMode;
HMODULE hDll;
DLLREGISTER fnDllRegister;
DLLINSTALL fnDllInstall;
@@ -386,9 +386,11 @@
if (*argv[i] != _T('/')) {
lptDllName = argv[i];
+ fuOldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
// Everything is all setup, so load the dll now
hDll = LoadLibraryEx(lptDllName,0,LOAD_WITH_ALTERED_SEARCH_PATH);
if (hDll) {
+ SetErrorMode(fuOldErrorMode);
if (!bNoRegister) {
// Get the address of DllRegisterServer or DllUnregisterServer
fnDllRegister = (DLLREGISTER)GetProcAddress(hDll,lpFuncName);
@@ -463,6 +465,7 @@
else {
// The dll could not be loaded; display an error message
dwErr = GetLastError();
+ SetErrorMode(fuOldErrorMode);
lptMsgBuffer = (LPTSTR)malloc((_tcslen(DllNotLoaded) + 2 + _tcslen(lptDllName) + 1) *
sizeof(TCHAR));
_stprintf(lptMsgBuffer,DllNotLoaded,lptDllName,dwErr);
DisplayMessage(bConsole,bSilent,lptMsgBuffer,ModuleTitle,MB_ICONEXCLAMATION);