Basic Win64 support (MSVC)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6439 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
204f371097
commit
d799ee53d7
52 changed files with 380 additions and 247 deletions
|
@ -33,10 +33,10 @@ if env['TARGET_ARCH'] != 'amd64':
|
|||
elif conf.TryCompile('.end', '.sx'):
|
||||
files += ['Source/Call.sx']
|
||||
else:
|
||||
print 'WARNING: unable to find assembler for Call.S'
|
||||
print 'WARNING: System.dll: unable to find assembler for Call.S'
|
||||
conf.Finish()
|
||||
else:
|
||||
print 'WARNING: missing Win64 code, dynamic function calls not supported'
|
||||
print 'WARNING: System.dll: missing Win64 code, dynamic function calls not supported'
|
||||
|
||||
BuildPlugin(
|
||||
target,
|
||||
|
|
|
@ -38,7 +38,7 @@ PLUGINFUNCTIONEND
|
|||
|
||||
PLUGINFUNCTIONSHORT(Copy)
|
||||
{
|
||||
int size = 0;
|
||||
SIZE_T size = 0;
|
||||
HANDLE source, dest;
|
||||
TCHAR *str;
|
||||
// Get the string
|
||||
|
@ -47,10 +47,10 @@ PLUGINFUNCTIONSHORT(Copy)
|
|||
// Check for size option
|
||||
if (str[0] == _T('/'))
|
||||
{
|
||||
size = (SIZE_T) myatoi(str+1);
|
||||
size = (SIZE_T) StrToIntPtr(str+1);
|
||||
dest = (HANDLE) popintptr();
|
||||
}
|
||||
else dest = (HANDLE) myatoi(str);
|
||||
else dest = (HANDLE) StrToIntPtr(str);
|
||||
source = (HANDLE) popintptr();
|
||||
|
||||
// Ok, check the size
|
||||
|
|
|
@ -273,9 +273,9 @@ PLUGINFUNCTION(Get)
|
|||
/*
|
||||
TODO: CallProc/Back not implemeted.
|
||||
Fake the behavior of the System plugin for the LoadImage API function so MUI works.
|
||||
BUGBUG: Leaking DeleteObject and failing GetClientRect
|
||||
BUGBUG: MUI is leaking DeleteObject and failing GetClientRect
|
||||
*/
|
||||
static SystemProc* CallProc(SystemProc *proc)
|
||||
SystemProc* CallProc(SystemProc *proc)
|
||||
{
|
||||
INT_PTR ret, *place;
|
||||
LastError = lstrcmp(proc->ProcName, sizeof(TCHAR) > 1 ? _T("LoadImageW") : _T("LoadImageA"));
|
||||
|
@ -294,7 +294,7 @@ static SystemProc* CallProc(SystemProc *proc)
|
|||
if (place) *place = ret;
|
||||
return proc;
|
||||
}
|
||||
static SystemProc* CallBack(SystemProc *proc)
|
||||
SystemProc* CallBack(SystemProc *proc)
|
||||
{
|
||||
proc->ProcResult = PR_ERROR;
|
||||
return proc;
|
||||
|
@ -741,10 +741,10 @@ SystemProc *PrepareProc(BOOL NeedForCall)
|
|||
// it may contain previous inline input
|
||||
if (!((proc->Params[ParamIndex].Input > -1) && (proc->Params[ParamIndex].Input <= __INST_LAST)))
|
||||
GlobalFree((HANDLE) proc->Params[ParamIndex].Input);
|
||||
proc->Params[ParamIndex].Input = temp4;
|
||||
proc->Params[ParamIndex].Input = BUGBUG64(int) temp4;
|
||||
}
|
||||
if (temp3 == 1)
|
||||
proc->Params[ParamIndex].Output = temp4;
|
||||
proc->Params[ParamIndex].Output = BUGBUG64(int) temp4;
|
||||
// Next parameter is output or something else
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic push
|
||||
|
@ -985,7 +985,7 @@ void ParamsIn(SystemProc *proc)
|
|||
case PAT_CALLBACK:
|
||||
// Generate new or use old callback
|
||||
if (lstrlen(realbuf) > 0)
|
||||
par->Value = BUGBUG64(int) CreateCallback((SystemProc*) StrToIntPtr(realbuf));
|
||||
par->Value = (INT_PTR) CreateCallback((SystemProc*) StrToIntPtr(realbuf));
|
||||
break;
|
||||
}
|
||||
GlobalFree(realbuf);
|
||||
|
@ -1254,7 +1254,7 @@ void CallStruct(SystemProc *proc)
|
|||
SYSTEM_LOG_POST;
|
||||
|
||||
// Proc virtual return - pointer to memory struct
|
||||
proc->Params[0].Value = BUGBUG64(int) proc->Proc;
|
||||
proc->Params[0].Value = (INT_PTR) proc->Proc;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
// This should probably be moved to platform.h at some point
|
||||
|
||||
#if defined(_M_X64) || defined(__amd64__)
|
||||
#if defined(_M_X64) || defined(_M_AMD64) || defined(__amd64__)
|
||||
# define SYSTEM_X64
|
||||
#elif defined(_M_IX86) || defined(__i386__) || defined(_X86_)
|
||||
# define SYSTEM_X86
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue