msi: Call Custom function via wrapper.
authorMarcus Meissner <meissner@suse.de>
Wed, 3 Feb 2010 15:57:00 +0000 (16:57 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 4 Feb 2010 13:06:34 +0000 (14:06 +0100)
dlls/msi/custom.c

index 508bf6b2b4d5f71c8dda7c8bd6c162e4349543c6..2b2a3e1373fc21040fd5c1e6a75f7ac95ce821d1 100644 (file)
@@ -647,6 +647,28 @@ static UINT get_action_info( const GUID *guid, INT *type, MSIHANDLE *handle,
     return ERROR_SUCCESS;
 }
 
+#ifdef __i386__
+extern UINT CUSTOMPROC_wrapper( MsiCustomActionEntryPoint proc, MSIHANDLE handle );
+__ASM_GLOBAL_FUNC( CUSTOMPROC_wrapper,
+       "pushl %ebp\n\t"
+       __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
+       __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
+       "movl %esp,%ebp\n\t"
+       __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
+       "pushl 12(%ebp)\n\t"
+       "movl 8(%ebp),%eax\n\t"
+       "call *%eax\n\t"
+       "leave\n\t"
+       __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
+       __ASM_CFI(".cfi_same_value %ebp\n\t")
+       "ret" )
+#else
+static inline UINT CUSTOMPROC_wrapper( MsiCustomActionEntryPoint proc, MSIHANDLE handle )
+{
+       return proc(handle);
+}
+#endif
+
 static DWORD ACTION_CallDllFunction( const GUID *guid )
 {
     MsiCustomActionEntryPoint fn;
@@ -685,7 +707,7 @@ static DWORD ACTION_CallDllFunction( const GUID *guid )
 
             __TRY
             {
-                r = fn( hPackage );
+                r = CUSTOMPROC_wrapper( fn, hPackage );
             }
             __EXCEPT_PAGE_FAULT
             {