James Hawkins : msi: Protect custom actions with a structured exception handler.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jun 14 07:47:01 CDT 2007


Module: wine
Branch: master
Commit: 9ed5c865e219d4d55ab1da32ccb8f7922343c092
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9ed5c865e219d4d55ab1da32ccb8f7922343c092

Author: James Hawkins <truiken at gmail.com>
Date:   Wed Jun 13 11:26:04 2007 -0700

msi: Protect custom actions with a structured exception handler.

---

 dlls/msi/Makefile.in |    2 +-
 dlls/msi/custom.c    |   18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/Makefile.in b/dlls/msi/Makefile.in
index e81dd4c..6edb45f 100644
--- a/dlls/msi/Makefile.in
+++ b/dlls/msi/Makefile.in
@@ -4,7 +4,7 @@ SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = msi.dll
 IMPORTLIB = libmsi.$(IMPLIBEXT)
-IMPORTS   = urlmon wininet comctl32 shell32 shlwapi cabinet oleaut32 ole32 version user32 gdi32 advapi32 kernel32
+IMPORTS   = urlmon wininet comctl32 shell32 shlwapi cabinet oleaut32 ole32 version user32 gdi32 advapi32 kernel32 ntdll
 DELAYIMPORTS = odbccp32
 EXTRALIBS = -luuid
 
diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index e516256..9170a7e 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -25,10 +25,12 @@
 #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_CallDllFunction( const GUID *guid )
         {
             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




More information about the wine-cvs mailing list