mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:02:59 +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;
|
LPCSTR lpFuncName;
|
||||||
LPWSTR lpwDllCmdLine;
|
LPWSTR lpwDllCmdLine;
|
||||||
BOOL bUnregister,bSilent,bConsole,bInstall,bNoRegister;
|
BOOL bUnregister,bSilent,bConsole,bInstall,bNoRegister;
|
||||||
UINT nDllCount;
|
UINT nDllCount, fuOldErrorMode;
|
||||||
HMODULE hDll;
|
HMODULE hDll;
|
||||||
DLLREGISTER fnDllRegister;
|
DLLREGISTER fnDllRegister;
|
||||||
DLLINSTALL fnDllInstall;
|
DLLINSTALL fnDllInstall;
|
||||||
|
@ -386,9 +386,11 @@ int WINAPI _tWinMain(
|
||||||
if (*argv[i] != _T('/')) {
|
if (*argv[i] != _T('/')) {
|
||||||
lptDllName = argv[i];
|
lptDllName = argv[i];
|
||||||
|
|
||||||
|
fuOldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||||
// Everything is all setup, so load the dll now
|
// Everything is all setup, so load the dll now
|
||||||
hDll = LoadLibraryEx(lptDllName,0,LOAD_WITH_ALTERED_SEARCH_PATH);
|
hDll = LoadLibraryEx(lptDllName,0,LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||||
if (hDll) {
|
if (hDll) {
|
||||||
|
SetErrorMode(fuOldErrorMode);
|
||||||
if (!bNoRegister) {
|
if (!bNoRegister) {
|
||||||
// Get the address of DllRegisterServer or DllUnregisterServer
|
// Get the address of DllRegisterServer or DllUnregisterServer
|
||||||
fnDllRegister = (DLLREGISTER)GetProcAddress(hDll,lpFuncName);
|
fnDllRegister = (DLLREGISTER)GetProcAddress(hDll,lpFuncName);
|
||||||
|
@ -463,6 +465,7 @@ int WINAPI _tWinMain(
|
||||||
else {
|
else {
|
||||||
// The dll could not be loaded; display an error message
|
// The dll could not be loaded; display an error message
|
||||||
dwErr = GetLastError();
|
dwErr = GetLastError();
|
||||||
|
SetErrorMode(fuOldErrorMode);
|
||||||
lptMsgBuffer = (LPTSTR)malloc((_tcslen(DllNotLoaded) + 2 + _tcslen(lptDllName) + 1) * sizeof(TCHAR));
|
lptMsgBuffer = (LPTSTR)malloc((_tcslen(DllNotLoaded) + 2 + _tcslen(lptDllName) + 1) * sizeof(TCHAR));
|
||||||
_stprintf(lptMsgBuffer,DllNotLoaded,lptDllName,dwErr);
|
_stprintf(lptMsgBuffer,DllNotLoaded,lptDllName,dwErr);
|
||||||
DisplayMessage(bConsole,bSilent,lptMsgBuffer,ModuleTitle,MB_ICONEXCLAMATION);
|
DisplayMessage(bConsole,bSilent,lptMsgBuffer,ModuleTitle,MB_ICONEXCLAMATION);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue