Notify main thread in case of exception
Modified: trunk/reactos/lib/syssetup/syssetup.xml
Modified: trunk/reactos/lib/syssetup/wizard.c
_____
Modified: trunk/reactos/lib/syssetup/syssetup.xml
--- trunk/reactos/lib/syssetup/syssetup.xml 2005-12-01 15:01:38 UTC
(rev 19796)
+++ trunk/reactos/lib/syssetup/syssetup.xml 2005-12-01 15:37:00 UTC
(rev 19797)
@@ -20,6 +20,7 @@
<library>ole32</library>
<library>shell32</library>
<library>shlwapi</library>
+ <library>pseh</library>
<file>dllmain.c</file>
<file>install.c</file>
<file>logfile.c</file>
_____
Modified: trunk/reactos/lib/syssetup/wizard.c
--- trunk/reactos/lib/syssetup/wizard.c 2005-12-01 15:01:38 UTC (rev
19796)
+++ trunk/reactos/lib/syssetup/wizard.c 2005-12-01 15:37:00 UTC (rev
19797)
@@ -14,6 +14,7 @@
#include <tchar.h>
#include <string.h>
#include <setupapi.h>
+#include <pseh/pseh.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
@@ -1421,25 +1422,42 @@
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 |
Show replies by date