64bit fixes and optimizations
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6486 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
0bcb8f40ed
commit
36deb84820
14 changed files with 74 additions and 51 deletions
|
@ -320,14 +320,14 @@ end:
|
|||
BOOL (WINAPI *OPT)(HANDLE, DWORD,PHANDLE);
|
||||
BOOL (WINAPI *LPV)(LPCTSTR,LPCTSTR,PLUID);
|
||||
BOOL (WINAPI *ATP)(HANDLE,BOOL,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
|
||||
#ifndef _WIN64
|
||||
#ifdef _WIN64
|
||||
OPT=OpenProcessToken, LPV=LookupPrivilegeValue, ATP=AdjustTokenPrivileges;
|
||||
#else
|
||||
OPT=myGetProcAddress(MGA_OpenProcessToken);
|
||||
LPV=myGetProcAddress(MGA_LookupPrivilegeValue);
|
||||
ATP=myGetProcAddress(MGA_AdjustTokenPrivileges);
|
||||
#else
|
||||
OPT=OpenProcessToken, LPV=LookupPrivilegeValue, ATP=AdjustTokenPrivileges;
|
||||
#endif
|
||||
if (OPT && LPV && ATP)
|
||||
#endif
|
||||
{
|
||||
HANDLE hToken;
|
||||
TOKEN_PRIVILEGES tkp;
|
||||
|
|
|
@ -236,16 +236,17 @@ FORCE_INLINE int NSISCALL ui_doinstall(void)
|
|||
|
||||
LANGID (WINAPI *GUDUIL)();
|
||||
|
||||
#ifndef _WIN64
|
||||
GUDUIL = myGetProcAddress(MGA_GetUserDefaultUILanguage);
|
||||
#else
|
||||
#ifdef _WIN64
|
||||
GUDUIL = GetUserDefaultUILanguage;
|
||||
#endif
|
||||
#else
|
||||
GUDUIL = myGetProcAddress(MGA_GetUserDefaultUILanguage);
|
||||
if (GUDUIL)
|
||||
#endif
|
||||
{
|
||||
// Windows ME/2000+
|
||||
myitoa(state_language, GUDUIL());
|
||||
}
|
||||
#ifndef _WIN64
|
||||
else
|
||||
{
|
||||
static const TCHAR reg_9x_locale[] = _T("Control Panel\\Desktop\\ResourceLocale");
|
||||
|
@ -270,6 +271,7 @@ FORCE_INLINE int NSISCALL ui_doinstall(void)
|
|||
|
||||
mystrcat(state_language, g_tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
// set default language
|
||||
set_language();
|
||||
|
|
|
@ -457,6 +457,7 @@ BOOL NSISCALL myReadFile(HANDLE h, LPVOID buf, DWORD cb)
|
|||
}
|
||||
|
||||
#ifdef NSIS_SUPPORT_MOVEONREBOOT
|
||||
#ifndef _WIN64
|
||||
/** Modifies the wininit.ini file to rename / delete a file.
|
||||
*
|
||||
* @param prevName The previous / current name of the file.
|
||||
|
@ -555,6 +556,7 @@ void RenameViaWininit(const TCHAR* prevName, const TCHAR* newName)
|
|||
CloseHandle(hfile);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MoveFileOnReboot tries to move a file by the name of pszExisting to the
|
||||
|
@ -577,11 +579,12 @@ void NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
|
|||
{
|
||||
fOk=mfea(pszExisting, pszNew, MOVEFILE_DELAY_UNTIL_REBOOT|MOVEFILE_REPLACE_EXISTING);
|
||||
}
|
||||
|
||||
if (!fOk && sizeof(void*) <= 4)
|
||||
#ifndef _WIN64
|
||||
if (!fOk)
|
||||
{
|
||||
RenameViaWininit(pszExisting, pszNew);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NSIS_SUPPORT_REBOOT
|
||||
g_exec_flags.exec_reboot++;
|
||||
|
@ -610,7 +613,7 @@ void NSISCALL myRegGetStr(HKEY root, const TCHAR *sub, const TCHAR *name, TCHAR
|
|||
void NSISCALL iptrtostr(TCHAR *s, INT_PTR d)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
static const TCHAR c[] = _T("%I64d");
|
||||
static const TCHAR c[] = _T("%Id");
|
||||
#else
|
||||
static const TCHAR c[] = _T("%d");
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue