msi: Protect custom actions with a structured exception handler

James Hawkins truiken at gmail.com
Wed Jun 13 13:26:04 CDT 2007


Hi,

This fixes bug 8062.  http://bugs.winehq.org/show_bug.cgi?id=8062 .
Native msi has the same protection and also catches the exception
caused by one of the Adobe Acrobat installer's custom actions.

Changelog:
* Protect custom actions with a structured exception handler.

 dlls/msi/custom.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index e516256..91a22d8 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -25,10 +25,12 @@ #include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
 #include "msidefs.h"
-#include "msipriv.h"
 #include "winuser.h"
+
+#include "msipriv.h"
 #include "wine/debug.h"
 #include "wine/unicode.h"
+#include "wine/exception.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msi);
 
@@ -583,7 +585,19 @@ static DWORD WINAPI ACTION_CallDllFuncti
         {
             TRACE("calling %s\n", debugstr_w( info->target ) );
             handle_msi_break( info->target );
-            r = fn( hPackage );
+
+            __TRY
+            {
+                r = fn( hPackage );
+            }
+            __EXCEPT_PAGE_FAULT
+            {
+                ERR("Custom action (%s:%s) caused a page fault: %08x\n",
+                    debugstr_w(info->source), debugstr_w(info->target), GetExceptionCode());
+		 r = ERROR_SUCCESS;
+            }
+            __ENDTRY;
+
             MsiCloseHandle( hPackage );
         }
         else
-- 
1.4.1


More information about the wine-patches mailing list