From 879a8245bc73c9ad389f67ade35e01fcdf282d4d Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 4 Jun 2004 15:32:05 +0000 Subject: [PATCH] (brainsucker) bug-fix-release, 4.06.2004 1. System::Copy /SIZE fixed (Kichik). 2. System::Copy with destination auto-allocation now pushes destination address on stack. 3. Callbacks fixed (Kichik's kick is awesome). git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3555 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/System/Source/Buffers.c | 24 ++++++++++++++---------- Contrib/System/Source/System.c | 22 +++++++++++++++------- Contrib/System/Source/System.vcproj | 2 -- Contrib/System/WhatsNew.txt | 8 +++++++- Plugins/System.dll | Bin 9216 -> 9216 bytes 5 files changed, 36 insertions(+), 20 deletions(-) diff --git a/Contrib/System/Source/Buffers.c b/Contrib/System/Source/Buffers.c index 2ac61536..e3824827 100644 --- a/Contrib/System/Source/Buffers.c +++ b/Contrib/System/Source/Buffers.c @@ -13,13 +13,13 @@ TempStack *tempstack = NULL; PLUGINFUNCTIONSHORT(Alloc) { - int size; - if ((size = popint()) == 0) - { - pushint(0); - return; - } - pushint((int) GlobalAlloc(GPTR, size)); + int size; + if ((size = popint()) == 0) + { + pushint(0); + return; + } + pushint((int) GlobalAlloc(GPTR, size)); } PLUGINFUNCTIONEND @@ -27,9 +27,9 @@ PLUGINFUNCTIONSHORT(Copy) { int size = 0; HANDLE source, dest; - char *str; + char *str; // Get the string - if ((str = popstring()) == NULL) return; + if ((str = popstring()) == NULL) return; // Check for size option if (str[0] == '/') @@ -43,7 +43,11 @@ PLUGINFUNCTIONSHORT(Copy) // Ok, check the size if (size == 0) size = (int) GlobalSize(source); // and the destinantion - if ((int) dest == 0) dest = GlobalAlloc((GPTR), size); + if ((int) dest == 0) + { + dest = GlobalAlloc((GPTR), size); + pushint(dest); + } // COPY! copymem(dest, source, size); diff --git a/Contrib/System/Source/System.c b/Contrib/System/Source/System.c index 840e13f3..2b204a43 100644 --- a/Contrib/System/Source/System.c +++ b/Contrib/System/Source/System.c @@ -993,7 +993,7 @@ SystemProc __declspec(naked) *CallProc(SystemProc *proc) // Save return proc->Params[0].Value = z1; - if (proc->Params[0].Size == 2) +// if (proc->Params[0].Size == 2) proc->Params[0]._value = z2; // Proc result: OK proc->ProcResult = PR_OK; @@ -1161,8 +1161,9 @@ SystemProc __declspec(naked) *CallBack(SystemProc *proc) _asm { // Prepare return -// mov eax, z1 - //mov edx, z2 + // callback proc result + pop edx + pop eax // Restore temporary stack and return @@ -1178,16 +1179,23 @@ SystemProc __declspec(naked) *CallBack(SystemProc *proc) } #ifdef SYSTEM_LOG_DEBUG + _asm + { + push eax + push edx + } SYSTEM_EVENT("\n\t\t\tSh-Before call-back"); SYSTEM_LOG_POST; + _asm + { + // callback proc result + pop edx + pop eax + } #endif // Fake return from Callback _asm { - // callback proc result - pop edx - pop eax - // Restore registers pop esi pop edi diff --git a/Contrib/System/Source/System.vcproj b/Contrib/System/Source/System.vcproj index 2a446803..c59f1c2f 100644 --- a/Contrib/System/Source/System.vcproj +++ b/Contrib/System/Source/System.vcproj @@ -82,7 +82,6 @@ RuntimeLibrary="4" StructMemberAlignment="0" BufferSecurityCheck="FALSE" - EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" AssemblerOutput="2" WarningLevel="3" @@ -97,7 +96,6 @@ OutputFile="d:\Program FIles\NSIS\Plugins\System.dll" LinkIncremental="1" IgnoreAllDefaultLibraries="TRUE" - GenerateDebugInformation="TRUE" GenerateMapFile="TRUE" MapExports="TRUE" MapLines="TRUE" diff --git a/Contrib/System/WhatsNew.txt b/Contrib/System/WhatsNew.txt index c1b4d2c6..eb3042f4 100644 --- a/Contrib/System/WhatsNew.txt +++ b/Contrib/System/WhatsNew.txt @@ -35,4 +35,10 @@ automaticaly. release 5, 11 september 2003. 1. u flag - unload dll after procedure call. 2. some changes to asm to turn on Whole Program Optimization. -3. Dll shrinked for 1 kb. \ No newline at end of file +3. Dll shrinked for 1 kb. + +bug-fix-release, 4.06.2004 +1. System::Copy /SIZE fixed (Kichik). +2. System::Alloc with destination auto-allocation now pushes destination +address on stack. +3. Callbacks fixed (Kichik's kick is awesome). \ No newline at end of file diff --git a/Plugins/System.dll b/Plugins/System.dll index 41d07d7665fd32bdc7dd62b966664fae51d15d78..c6c205560ff23fbf671007c3cbf6518f42d1b020 100644 GIT binary patch delta 1261 zcmb`H{ZAZ47{_OhgS&&1Zh!*{S2&b6E0vwuoxLr^yK5WTLq%4P77mMGHHuL6Y`C_u z&`|M`2UEVJ5z;vFYf6RlH#xzRKOTwl^lm&+QrkTPquC_E$goeR*k$-@56Oe|` z5zL=4NRU=zq+>&hA*02JP|sK}PKzXJEuN?iiAd1GyZK7virP_(Q0R}I`L>6k&f<{z8(8?L4DwdPi=@e%X(!fjBXHfpniL<+kXqCr#hqp>*B zy?}$Z=<(Om5NfXD6_!ZylLB;-+`Wi{7GL;$xRH-0-H%ss!PLqKiG z(cnU;YA!S$zRahxTXfBS4BuBm5Gn(_z-C}8@D#8I7yyQW4}nqOM_?M52Vx@)u1svW zKud1Kyd}rQCdHd}Y)**TkY_F(iFpq2%E5E|$J6+^ob1Z~tr>l7t{d0qE?xZZ;DK;E zk!gv2kRJlZ00j5pf(@Zk(Br^k5NBi{bOz$Hus#LM0KWm3fIoq&l%IF3)3+Ni?u2cV zP$gbW7H<<3(IY-D4vHh<=i-;*_u{m8Nt_eo$p&&SsUd#y5&4XKOU{r8`HL87A}yvO zT}{1IqYd;C8lXYiPhX{@^lN&W4#_9vaTzl!D`g5>$70 zNj@n5AfJ_|^D~mv={ib_`b2`ddYgdejLwaYhjy)HVw4)!2{Eyq8HW!}V zj$O`RqY5Ffb!(|x?GFVtQ0N~Cs>1ck>6f)`jZ-m3K(#;AKIV=tS)R;468I?M6BV9e z1!@^zXB}z_KE{UBovIiED~zne_3TFEk+cq|EK!VFkm)pENO7xcyy1M>7s76%@>!1o zp_*n^teMue=nG$C?fdRc!g&Ub>O?v6&B&0u0m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