From b0ce233169bc6f4bb7fa06433c8fb217a091d5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Thu, 1 Dec 2005 15:37:00 +0000 Subject: [PATCH] Notify main thread in case of exception svn path=/trunk/; revision=19797 --- reactos/lib/syssetup/syssetup.xml | 1 + reactos/lib/syssetup/wizard.c | 46 +++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/reactos/lib/syssetup/syssetup.xml b/reactos/lib/syssetup/syssetup.xml index d2b5c5937e0..1c0ebfa1d40 100644 --- a/reactos/lib/syssetup/syssetup.xml +++ b/reactos/lib/syssetup/syssetup.xml @@ -20,6 +20,7 @@ ole32 shell32 shlwapi + pseh dllmain.c install.c logfile.c diff --git a/reactos/lib/syssetup/wizard.c b/reactos/lib/syssetup/wizard.c index 373b22cc05b..0cf59a2183e 100644 --- a/reactos/lib/syssetup/wizard.c +++ b/reactos/lib/syssetup/wizard.c @@ -14,6 +14,7 @@ #include #include #include +#include #define NTOS_MODE_USER #include @@ -1421,25 +1422,42 @@ RegistrationProc(LPVOID Parameter) RegistrationData->Registered = 0; RegistrationData->DefaultContext = SetupInitDefaultQueueCallback(RegistrationData->hwndDlg); - if (SetupInstallFromInfSectionW(GetParent(RegistrationData->hwndDlg), - hSysSetupInf, - L"RegistrationPhase2", - SPINST_REGISTRY | - SPINST_REGISTERCALLBACKAWARE | - SPINST_REGSVR, - 0, - NULL, - 0, - RegistrationNotificationProc, - RegistrationData, - NULL, - NULL)) + _SEH_TRY + { + if (SetupInstallFromInfSectionW(GetParent(RegistrationData->hwndDlg), + hSysSetupInf, + L"RegistrationPhase2", + SPINST_REGISTRY | + SPINST_REGISTERCALLBACKAWARE | + SPINST_REGSVR, + 0, + NULL, + 0, + RegistrationNotificationProc, + RegistrationData, + NULL, + NULL)) + { + LastError = NO_ERROR; + } + else + { + LastError = GetLastError(); + } + } + _SEH_HANDLE + { + DPRINT("Catching exception\n"); + LastError = RtlNtStatusToDosError(_SEH_GetExceptionCode()); + } + _SEH_END; + + if (NO_ERROR == LastError) { RegistrationNotify.ErrorMessage = NULL; } else { - LastError = GetLastError(); DPRINT1("SetupInstallFromInfSection failed with error %u\n", LastError); if (0 == FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |