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 41d07d76..c6c20556 100644 Binary files a/Plugins/System.dll and b/Plugins/System.dll differ