mirror of
https://github.com/reactos/reactos.git
synced 2025-01-04 21:38:43 +00:00
[REGSVR32] Disable error message boxes while loading a dll. CORE-12209
svn path=/trunk/; revision=73077
This commit is contained in:
parent
6acbbeddf8
commit
082463978d
1 changed files with 4 additions and 1 deletions
|
@ -258,7 +258,7 @@ int WINAPI _tWinMain(
|
|||
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 @@ int WINAPI _tWinMain(
|
|||
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 @@ int WINAPI _tWinMain(
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue