From da35c93efac3686c3146641097a466dbbbacf52e Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 21 Jan 2005 21:49:50 +0000 Subject: [PATCH] fixed bug #1102255 - system.nsi example crash git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3884 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/System/SysFunc.nsh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Contrib/System/SysFunc.nsh b/Contrib/System/SysFunc.nsh index 2c967376..e9c90365 100644 --- a/Contrib/System/SysFunc.nsh +++ b/Contrib/System/SysFunc.nsh @@ -131,17 +131,19 @@ Function systemMessageBox StrCpy $1 $2 IntCmp $1 0 0 smbnext smbnext + ; Get module handle + System::Call '${sysGetModuleHandle}($2) .r1' + IntCmp $1 0 loadlib libnotloaded libnotloaded + +loadlib: ; Load module and get handle System::Call '${sysLoadLibrary}($2) .r1' IntCmp $1 0 0 smbnext smbnext - ; Get module handle. This may look stupid (to call GetModuleHandle in case - ; when the LoadLibrary doesn't works, but LoadLibrary couldn't return - ; a handle to starting process (for 'i 0'). - System::Call '${sysGetModuleHandle}($2) .r1' +libnotloaded: + ; Indicate that LoadLibrary wasn't used + StrCpy $2 1 - ; Indicate that LoadLibrary wasn't used - StrCpy $2 1 smbnext: ; Create MSGBOXPARAMS structure System::Call '*${stMSGBOXPARAMS}(, $HWNDPARENT, r1, r3, r4, "$5|${MB_USERICON}", $6, _) .r0'