(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
This commit is contained in:
kichik 2004-06-04 15:32:05 +00:00
parent 5c4deddee2
commit 879a8245bc
5 changed files with 36 additions and 20 deletions

View file

@ -13,13 +13,13 @@ TempStack *tempstack = NULL;
PLUGINFUNCTIONSHORT(Alloc) PLUGINFUNCTIONSHORT(Alloc)
{ {
int size; int size;
if ((size = popint()) == 0) if ((size = popint()) == 0)
{ {
pushint(0); pushint(0);
return; return;
} }
pushint((int) GlobalAlloc(GPTR, size)); pushint((int) GlobalAlloc(GPTR, size));
} }
PLUGINFUNCTIONEND PLUGINFUNCTIONEND
@ -27,9 +27,9 @@ PLUGINFUNCTIONSHORT(Copy)
{ {
int size = 0; int size = 0;
HANDLE source, dest; HANDLE source, dest;
char *str; char *str;
// Get the string // Get the string
if ((str = popstring()) == NULL) return; if ((str = popstring()) == NULL) return;
// Check for size option // Check for size option
if (str[0] == '/') if (str[0] == '/')
@ -43,7 +43,11 @@ PLUGINFUNCTIONSHORT(Copy)
// Ok, check the size // Ok, check the size
if (size == 0) size = (int) GlobalSize(source); if (size == 0) size = (int) GlobalSize(source);
// and the destinantion // and the destinantion
if ((int) dest == 0) dest = GlobalAlloc((GPTR), size); if ((int) dest == 0)
{
dest = GlobalAlloc((GPTR), size);
pushint(dest);
}
// COPY! // COPY!
copymem(dest, source, size); copymem(dest, source, size);

View file

@ -993,7 +993,7 @@ SystemProc __declspec(naked) *CallProc(SystemProc *proc)
// Save return // Save return
proc->Params[0].Value = z1; proc->Params[0].Value = z1;
if (proc->Params[0].Size == 2) // if (proc->Params[0].Size == 2)
proc->Params[0]._value = z2; proc->Params[0]._value = z2;
// Proc result: OK // Proc result: OK
proc->ProcResult = PR_OK; proc->ProcResult = PR_OK;
@ -1161,8 +1161,9 @@ SystemProc __declspec(naked) *CallBack(SystemProc *proc)
_asm _asm
{ {
// Prepare return // Prepare return
// mov eax, z1 // callback proc result
//mov edx, z2 pop edx
pop eax
// Restore temporary stack and return // Restore temporary stack and return
@ -1178,16 +1179,23 @@ SystemProc __declspec(naked) *CallBack(SystemProc *proc)
} }
#ifdef SYSTEM_LOG_DEBUG #ifdef SYSTEM_LOG_DEBUG
_asm
{
push eax
push edx
}
SYSTEM_EVENT("\n\t\t\tSh-Before call-back"); SYSTEM_EVENT("\n\t\t\tSh-Before call-back");
SYSTEM_LOG_POST; SYSTEM_LOG_POST;
_asm
{
// callback proc result
pop edx
pop eax
}
#endif #endif
// Fake return from Callback // Fake return from Callback
_asm { _asm {
// callback proc result
pop edx
pop eax
// Restore registers // Restore registers
pop esi pop esi
pop edi pop edi

View file

@ -82,7 +82,6 @@
RuntimeLibrary="4" RuntimeLibrary="4"
StructMemberAlignment="0" StructMemberAlignment="0"
BufferSecurityCheck="FALSE" BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="3" UsePrecompiledHeader="3"
AssemblerOutput="2" AssemblerOutput="2"
WarningLevel="3" WarningLevel="3"
@ -97,7 +96,6 @@
OutputFile="d:\Program FIles\NSIS\Plugins\System.dll" OutputFile="d:\Program FIles\NSIS\Plugins\System.dll"
LinkIncremental="1" LinkIncremental="1"
IgnoreAllDefaultLibraries="TRUE" IgnoreAllDefaultLibraries="TRUE"
GenerateDebugInformation="TRUE"
GenerateMapFile="TRUE" GenerateMapFile="TRUE"
MapExports="TRUE" MapExports="TRUE"
MapLines="TRUE" MapLines="TRUE"

View file

@ -35,4 +35,10 @@ automaticaly.
release 5, 11 september 2003. release 5, 11 september 2003.
1. u flag - unload dll after procedure call. 1. u flag - unload dll after procedure call.
2. some changes to asm to turn on Whole Program Optimization. 2. some changes to asm to turn on Whole Program Optimization.
3. Dll shrinked for 1 kb. 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).

Binary file not shown.