Marcus Meissner : msi: Call Custom function via wrapper.

Alexandre Julliard julliard at winehq.org
Thu Feb 4 11:11:03 CST 2010


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

Author: Marcus Meissner <meissner at suse.de>
Date:   Wed Feb  3 16:57:00 2010 +0100

msi: Call Custom function via wrapper.

---

 dlls/msi/custom.c |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index 508bf6b..2b2a3e1 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -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
             {




More information about the wine-cvs mailing list