|
From: <and...@us...> - 2013-09-06 23:49:03
|
Revision: 6413
http://sourceforge.net/p/nsis/code/6413
Author: anders_k
Date: 2013-09-06 23:48:59 +0000 (Fri, 06 Sep 2013)
Log Message:
-----------
Win64 fixes
Modified Paths:
--------------
NSIS/trunk/Contrib/Banner/Banner.c
NSIS/trunk/Contrib/ExDLL/pluginapi.c
NSIS/trunk/Contrib/ExDLL/pluginapi.h
NSIS/trunk/Contrib/LangDLL/LangDLL.c
NSIS/trunk/Contrib/MakeLangId/MakeLangId.cpp
NSIS/trunk/Contrib/Makensisw/jnetlib/httpget.cpp
NSIS/trunk/Contrib/Makensisw/makensisw.xml
NSIS/trunk/Contrib/NSISdl/nsisdl.cpp
NSIS/trunk/Contrib/StartMenu/StartMenu.c
NSIS/trunk/Contrib/System/SConscript
NSIS/trunk/Contrib/System/Source/Buffers.c
NSIS/trunk/Contrib/System/Source/Plugin.c
NSIS/trunk/Contrib/System/Source/Plugin.h
NSIS/trunk/Contrib/System/Source/System.c
NSIS/trunk/Contrib/System/Source/System.h
NSIS/trunk/Contrib/System/System.nsh
NSIS/trunk/Contrib/System/System.nsi
NSIS/trunk/Contrib/UIs/ui.c
NSIS/trunk/Contrib/nsDialogs/example.nsi
NSIS/trunk/Contrib/nsDialogs/nsDialogs.c
NSIS/trunk/Contrib/nsDialogs/nsDialogs.nsh
NSIS/trunk/Contrib/nsDialogs/welcome.nsi
NSIS/trunk/Contrib/zip2exe/main.cpp
NSIS/trunk/Docs/src/usefulfunc.but
NSIS/trunk/Docs/src/usefulinfos.but
NSIS/trunk/Examples/makensis.nsi
NSIS/trunk/Include/FileFunc.nsh
NSIS/trunk/Include/StrFunc.nsh
NSIS/trunk/Include/TextFunc.nsh
NSIS/trunk/Include/x64.nsh
NSIS/trunk/SConstruct
NSIS/trunk/Source/Tests/winver.nsi
NSIS/trunk/Source/build.cpp
NSIS/trunk/Source/build.h
NSIS/trunk/Source/exehead/Ui.c
NSIS/trunk/Source/exehead/fileform.c
NSIS/trunk/Source/exehead/fileform.h
NSIS/trunk/Source/script.cpp
Modified: NSIS/trunk/Contrib/Banner/Banner.c
===================================================================
--- NSIS/trunk/Contrib/Banner/Banner.c 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/Banner/Banner.c 2013-09-06 23:48:59 UTC (rev 6413)
@@ -11,7 +11,7 @@
TCHAR buf[1024];
-BOOL CALLBACK BannerProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK BannerProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_INITDIALOG)
{
@@ -42,7 +42,7 @@
{
DestroyWindow(hwndDlg);
}
- return 0;
+ return FALSE;
}
BOOL ProcessMessages()
Modified: NSIS/trunk/Contrib/ExDLL/pluginapi.c
===================================================================
--- NSIS/trunk/Contrib/ExDLL/pluginapi.c 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/ExDLL/pluginapi.c 2013-09-06 23:48:59 UTC (rev 6413)
@@ -46,7 +46,7 @@
*g_stacktop=th;
}
-TCHAR * NSISCALL getuservariable(const int varnum)
+TCHAR* NSISCALL getuservariable(const int varnum)
{
if (varnum < 0 || varnum >= __INST_LAST) return NULL;
return g_variables+varnum*g_stringsize;
@@ -159,9 +159,9 @@
// playing with integers
-int NSISCALL myatoi(const TCHAR *s)
+INT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s)
{
- int v=0;
+ INT_PTR v=0;
if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))
{
s++;
@@ -204,7 +204,7 @@
return v;
}
-unsigned NSISCALL myatou(const TCHAR *s)
+unsigned int NSISCALL myatou(const TCHAR *s)
{
unsigned int v=0;
@@ -270,13 +270,12 @@
return v;
}
-int NSISCALL popint()
+INT_PTR NSISCALL popintptr()
{
TCHAR buf[128];
if (popstringn(buf,COUNTOF(buf)))
return 0;
-
- return myatoi(buf);
+ return nsishelper_str_to_ptr(buf);
}
int NSISCALL popint_or()
@@ -284,13 +283,12 @@
TCHAR buf[128];
if (popstringn(buf,COUNTOF(buf)))
return 0;
-
return myatoi_or(buf);
}
-void NSISCALL pushint(int value)
+void NSISCALL pushintptr(INT_PTR value)
{
- TCHAR buffer[1024];
- wsprintf(buffer, _T("%d"), value);
+ TCHAR buffer[30];
+ wsprintf(buffer, sizeof(void*) > 4 ? _T("%Id") : _T("%d"), value);
pushstring(buffer);
}
Modified: NSIS/trunk/Contrib/ExDLL/pluginapi.h
===================================================================
--- NSIS/trunk/Contrib/ExDLL/pluginapi.h 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/ExDLL/pluginapi.h 2013-09-06 23:48:59 UTC (rev 6413)
@@ -56,16 +56,19 @@
extern stack_t **g_stacktop;
extern TCHAR *g_variables;
+void NSISCALL pushstring(const TCHAR *str);
+void NSISCALL pushintptr(INT_PTR value);
+#define pushint(v) pushintptr((INT_PTR)(v))
int NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack
int NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize
-int NSISCALL popint(); // pops an integer
+INT_PTR NSISCALL popintptr();
+#define popint() ( (int) popintptr() )
int NSISCALL popint_or(); // with support for or'ing (2|4|8)
-int NSISCALL myatoi(const TCHAR *s); // converts a string to an integer
-unsigned NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only
+INT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s);
+#define myatoi(s) ( (int) nsishelper_str_to_ptr(s) ) // converts a string to an integer
+unsigned int NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only
int NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)
-void NSISCALL pushstring(const TCHAR *str);
-void NSISCALL pushint(int value);
-TCHAR * NSISCALL getuservariable(const int varnum);
+TCHAR* NSISCALL getuservariable(const int varnum);
void NSISCALL setuservariable(const int varnum, const TCHAR *var);
#ifdef _UNICODE
Modified: NSIS/trunk/Contrib/LangDLL/LangDLL.c
===================================================================
--- NSIS/trunk/Contrib/LangDLL/LangDLL.c 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/LangDLL/LangDLL.c 2013-09-06 23:48:59 UTC (rev 6413)
@@ -32,7 +32,7 @@
UINT cp;
} *langs;
-BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
int i, size;
TCHAR *selected_language = NULL;
Modified: NSIS/trunk/Contrib/MakeLangId/MakeLangId.cpp
===================================================================
--- NSIS/trunk/Contrib/MakeLangId/MakeLangId.cpp 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/MakeLangId/MakeLangId.cpp 2013-09-06 23:48:59 UTC (rev 6413)
@@ -193,7 +193,7 @@
CBL(SUBLANG_UZBEK_CYRILLIC)
};
-BOOL CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
+INT_PTR CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
size_t i;
switch (uMsg) {
case WM_INITDIALOG:
@@ -222,7 +222,7 @@
TCHAR *lang_id = (TCHAR *)GlobalLock(hMem);
wsprintf(lang_id, _T("%u"), MAKELANGID(primary[SendDlgItemMessage(hwndDlg, IDC_PRIMARY, CB_GETCURSEL, 0, 0)].id, sub[SendDlgItemMessage(hwndDlg, IDC_SUB, CB_GETCURSEL, 0, 0)].id));
GlobalUnlock(hMem);
- if (!OpenClipboard(hwndDlg)) return 0;
+ if (!OpenClipboard(hwndDlg)) return FALSE;
EmptyClipboard();
#ifdef _UNICODE
SetClipboardData(CF_UNICODETEXT,hMem);
@@ -234,7 +234,7 @@
}
break;
}
- return 0;
+ return FALSE;
}
NSIS_ENTRYPOINT_GUINOCRT
Modified: NSIS/trunk/Contrib/Makensisw/jnetlib/httpget.cpp
===================================================================
--- NSIS/trunk/Contrib/Makensisw/jnetlib/httpget.cpp 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/Makensisw/jnetlib/httpget.cpp 2013-09-06 23:48:59 UTC (rev 6413)
@@ -16,7 +16,7 @@
#include "util.h"
#include "httpget.h"
-void *operator new( unsigned int num_bytes ){return GlobalAlloc(GPTR,num_bytes);}
+void *operator new( size_t num_bytes ){return GlobalAlloc(GPTR,num_bytes);}
void operator delete( void *p ) { if (p) GlobalFree(p); }
JNL_HTTPGet::JNL_HTTPGet(JNL_AsyncDNS *dns, int recvbufsize, char *proxy)
Modified: NSIS/trunk/Contrib/Makensisw/makensisw.xml
===================================================================
--- NSIS/trunk/Contrib/Makensisw/makensisw.xml 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/Makensisw/makensisw.xml 2013-09-06 23:48:59 UTC (rev 6413)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
-<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Nullsoft.NSIS.makensisw" type="win32"/>
+<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="Nullsoft.NSIS.makensisw" type="win32"/>
<description>MakeNSIS Wrapper</description>
<dependency>
<dependentAssembly>
-<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
+<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
Modified: NSIS/trunk/Contrib/NSISdl/nsisdl.cpp
===================================================================
--- NSIS/trunk/Contrib/NSISdl/nsisdl.cpp 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/NSISdl/nsisdl.cpp 2013-09-06 23:48:59 UTC (rev 6413)
@@ -30,7 +30,7 @@
#include <nsis/pluginapi.h> // nsis plugin
-void *operator new( unsigned int num_bytes )
+void *operator new( size_t num_bytes )
{
return GlobalAlloc(GPTR,num_bytes);
}
Modified: NSIS/trunk/Contrib/StartMenu/StartMenu.c
===================================================================
--- NSIS/trunk/Contrib/StartMenu/StartMenu.c 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/StartMenu/StartMenu.c 2013-09-06 23:48:59 UTC (rev 6413)
@@ -25,8 +25,8 @@
void (__stdcall *validate_filename)(TCHAR *);
-BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-static BOOL CALLBACK ParentWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static INT_PTR CALLBACK ParentWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
void AddFolderFromReg(int nFolder);
static UINT_PTR PluginCallback(enum NSPIM msg)
@@ -158,9 +158,9 @@
}
}
-static BOOL CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- BOOL bRes = CallWindowProc(lpWndProcOld,hwnd,message,wParam,lParam);
+ INT_PTR bRes = CallWindowProc(lpWndProcOld,hwnd,message,wParam,lParam);
if (message == WM_NOTIFY_OUTER_NEXT && !bRes)
{
// if leave function didn't abort (lRes != 0 in that case)
@@ -191,7 +191,7 @@
\
y_offset += cy + 3;
-BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HWND hwLocation = GetDlgItem(hwndDlg, IDC_LOCATION);
HWND hwDirList = GetDlgItem(hwndDlg, IDC_DIRLIST);
@@ -424,7 +424,7 @@
return SendMessage(hwParent, uMsg, wParam, lParam);
break;
}
- return 0;
+ return FALSE;
}
BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
Modified: NSIS/trunk/Contrib/System/SConscript
===================================================================
--- NSIS/trunk/Contrib/System/SConscript 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/System/SConscript 2013-09-06 23:48:59 UTC (rev 6413)
@@ -26,14 +26,17 @@
Import('BuildPlugin env')
-conf = env.Configure()
-if conf.TryCompile('END', '.S'):
- files += ['Source/Call.S']
-elif conf.TryCompile('.end', '.sx'):
- files += ['Source/Call.sx']
+if env['TARGET_ARCH'] != 'amd64':
+ conf = env.Configure()
+ if conf.TryCompile('END', '.S'):
+ files += ['Source/Call.S']
+ elif conf.TryCompile('.end', '.sx'):
+ files += ['Source/Call.sx']
+ else:
+ print 'WARNING: unable to find assembler for Call.S'
+ conf.Finish()
else:
- print 'WARNING: unable to find assembler for Call.S'
-conf.Finish()
+ print 'WARNING: missing Win64 code, dynamic function calls not supported'
BuildPlugin(
target,
Modified: NSIS/trunk/Contrib/System/Source/Buffers.c
===================================================================
--- NSIS/trunk/Contrib/System/Source/Buffers.c 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/System/Source/Buffers.c 2013-09-06 23:48:59 UTC (rev 6413)
@@ -15,8 +15,8 @@
static void AllocWorker(unsigned int mult)
{
- int size;
- if ((size = popint()) == 0)
+ size_t size;
+ if ((size = popintptr()) == 0)
{
system_pushint(0);
return;
@@ -56,7 +56,7 @@
// Ok, check the size
if (size == 0) size = (SIZE_T) GlobalSize(source);
// and the destinantion
- if ((int) dest == 0)
+ if (!dest)
{
dest = GlobalAlloc((GPTR), size);
system_pushintptr((INT_PTR) dest);
Modified: NSIS/trunk/Contrib/System/Source/Plugin.c
===================================================================
--- NSIS/trunk/Contrib/System/Source/Plugin.c 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/System/Source/Plugin.c 2013-09-06 23:48:59 UTC (rev 6413)
@@ -134,20 +134,20 @@
*buffer = 0;
}
-int system_popint()
+INT_PTR system_popintptr()
{
- int value;
+ INT_PTR value;
TCHAR *str;
if ((str = system_popstring()) == NULL) return -1;
- value = myatoi(str);
+ value = StrToIntPtr(str);
GlobalFree(str);
return value;
}
-void system_pushint(int value)
+void system_pushintptr(INT_PTR value)
{
- TCHAR buffer[80];
- wsprintf(buffer, _T("%d"), value);
+ TCHAR buffer[50];
+ wsprintf(buffer, sizeof(void*) > 4 ? _T("%Id") : _T("%d"), value);
system_pushstring(buffer);
}
Modified: NSIS/trunk/Contrib/System/Source/Plugin.h
===================================================================
--- NSIS/trunk/Contrib/System/Source/Plugin.h 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/System/Source/Plugin.h 2013-09-06 23:48:59 UTC (rev 6413)
@@ -5,15 +5,17 @@
// Always use system* functions to keep the size down
#define pushstring error(use system_pushstring)
+#undef pushint
#define pushint error(use system_pushint)
+#define pushintptr error(use system_pushintptr)
-#define popint system_popint
+#undef myatoi
#define myatoi(str) ( (int) myatoi64(str) )
+#define system_pushint(v) system_pushintptr((INT_PTR)(v))
+#define popintptr system_popintptr
#ifdef _WIN64
-# error TODO
+# define StrToIntPtr(str) ( (INT_PTR)myatoi64((str)) )
#else
-# define system_pushintptr system_pushint
-# define popintptr popint
# define StrToIntPtr(str) ( (INT_PTR)myatoi((str)) )
#endif
@@ -39,8 +41,8 @@
extern TCHAR* system_popstring(); // NULL - stack empty
extern TCHAR* system_pushstring(TCHAR *str);
extern __int64 myatoi64(TCHAR *s);
-extern int system_popint(); // -1 -> stack empty
-extern void system_pushint(int value);
+extern INT_PTR system_popintptr(); // -1 -> stack empty
+extern void system_pushintptr(INT_PTR value);
extern HANDLE GlobalCopy(HANDLE Old);
extern void *copymem(void *output, void *input, size_t cbSize);
Modified: NSIS/trunk/Contrib/System/Source/System.c
===================================================================
--- NSIS/trunk/Contrib/System/Source/System.c 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/System/Source/System.c 2013-09-06 23:48:59 UTC (rev 6413)
@@ -30,18 +30,18 @@
#define PCD_PARAMS 2
#define PCD_DONE 3 // Just Continue
+const int PARAMSIZEBYTYPE_PTR = (4==sizeof(void*)) ? 1 : 2;
const int ParamSizeByType[7] = {
- 0, // PAT_VOID (Size will be equal to 1)
+ 0, // PAT_VOID (Size will be equal to 1) //BUGBUG64?
1, // PAT_INT
2, // PAT_LONG
- 1, // PAT_STRING
- 1, // PAT_WSTRING
- 1, // PAT_GUID
+ sizeof(void*) / 4, // PAT_STRING //BUGBUG64?
+ sizeof(void*) / 4, // PAT_WSTRING //BUGBUG64?
+ sizeof(void*) / 4, // PAT_GUID //BUGBUG64?
0}; // PAT_CALLBACK (Size will be equal to 1) //BUGBUG64?
-const int PARAMSIZEBYTYPE_PTR = (4==sizeof(void*)) ? 1 : 2;
// Thomas needs to look at this.
-const int ByteSizeByType[7] = {
+static const int ByteSizeByType[7] = {
1, // PAT_VOID
1, // PAT_INT
1, // PAT_LONG
@@ -55,7 +55,7 @@
DWORD LastError;
volatile SystemProc *LastProc;
int CallbackIndex;
-CallbackThunk* CallbackThunkListHead;
+CallbackThunk* g_CallbackThunkListHead;
HINSTANCE g_hInstance;
// Return to callback caller with stack restore
@@ -145,7 +145,7 @@
GetLocalTime(&t);
GetTimeFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_NOUSEROVERRIDE, &t, NULL, buftime, 1024);
GetDateFormat(LOCALE_SYSTEM_DEFAULT, LOCALE_NOUSEROVERRIDE, &t, NULL, bufdate, 1024);
- wsprintf(buffer, _T("System, %s %s [build ") __TTIME__ _T(" ") __TDATE__ _T("]\n"), buftime, bufdate);
+ wsprintf(buffer, _T("System, %s %s [build %hs %hs]\n"), buftime, bufdate, __TIME__, __DATE__);
WriteToLog(buffer);
} else ;
else
@@ -207,9 +207,9 @@
{
HANDLE memtofree = (HANDLE)popintptr();
- if (CallbackThunkListHead)
+ if (g_CallbackThunkListHead)
{
- CallbackThunk *pCb=CallbackThunkListHead,*pPrev=NULL;
+ CallbackThunk *pCb=g_CallbackThunkListHead,*pPrev=NULL;
do
{
if (GetAssociatedSysProcFromCallbackThunkPtr(pCb) == (SystemProc*)memtofree)
@@ -217,7 +217,7 @@
if (pPrev)
pPrev->pNext=pCb->pNext;
else
- CallbackThunkListHead=pCb->pNext;
+ g_CallbackThunkListHead=pCb->pNext;
--(CallbackIndex);
VirtualFree(pCb,0,MEM_RELEASE);
@@ -268,12 +268,45 @@
}
} PLUGINFUNCTIONEND
+
+#ifdef _WIN64
+/*
+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
+*/
+static SystemProc* CallProc(SystemProc *proc)
+{
+ INT_PTR ret, *place;
+ LastError = lstrcmp(proc->ProcName, sizeof(TCHAR) > 1 ? _T("LoadImageW") : _T("LoadImageA"));
+ if (!LastError)
+ {
+ ret = (INT_PTR) LoadImage((HINSTANCE)proc->Params[1].Value,
+ (LPCTSTR)proc->Params[2].Value, (UINT)proc->Params[3].Value,
+ (int)proc->Params[4].Value, (int)proc->Params[5].Value,
+ (UINT)proc->Params[6].Value);
+ LastError = GetLastError();
+ }
+ else
+ proc->ProcResult = PR_ERROR, ret = 0;
+ place = (INT_PTR*) proc->Params[0].Value;
+ if (proc->Params[0].Option != -1) place = (INT_PTR*) &(proc->Params[0].Value);
+ if (place) *place = ret;
+ return proc;
+}
+static SystemProc* CallBack(SystemProc *proc)
+{
+ proc->ProcResult = PR_ERROR;
+ return proc;
+}
+#endif
+
+
PLUGINFUNCTION(Call)
{
// Prepare input
SystemProc *proc = PrepareProc(TRUE);
- if (proc == NULL)
- return;
+ if (proc == NULL) return;
SYSTEM_LOG_ADD(_T("Call "));
SYSTEM_LOG_ADD(proc->DllName);
@@ -281,8 +314,7 @@
SYSTEM_LOG_ADD(proc->ProcName);
//SYSTEM_LOG_ADD(_T("\n"));
SYSTEM_LOG_POST;
- if (proc->ProcResult != PR_CALLBACK)
- ParamAllocate(proc);
+ if (proc->ProcResult != PR_CALLBACK) ParamAllocate(proc);
ParamsIn(proc);
// Make the call
@@ -308,35 +340,30 @@
// Always return flag set - return separate return and result
ParamsOut(proc);
GlobalFree(system_pushstring(GetResultStr(proc)));
- } else
+ }
+ else
{
if (proc->ProcResult != PR_OK)
{
- ProcParameter pp;
- // Save old return param
- pp = proc->Params[0];
+ ProcParameter pp = proc->Params[0]; // Save old return param
// Return result instead of return value
- proc->Params[0].Value = BUGBUG64(int) GetResultStr(proc);
+ proc->Params[0].Value = (INT_PTR) GetResultStr(proc);
proc->Params[0].Type = PAT_TSTRING;
- // Return all params
- ParamsOut(proc);
- // Restore old return param
- proc->Params[0] = pp;
- } else
+ ParamsOut(proc); // Return all params
+ proc->Params[0] = pp; // Restore old return param
+ }
+ else
ParamsOut(proc);
}
if (proc->ProcResult != PR_CALLBACK)
{
- // Deallocate params if not callback
ParamsDeAllocate(proc);
// if not callback - check for unload library option
- if ((proc->Options & POPT_UNLOAD)
- && (proc->ProcType == PT_PROC)
- && (proc->Dll != NULL))
+ if ((proc->Options & POPT_UNLOAD) && proc->ProcType == PT_PROC && proc->Dll)
FreeLibrary(proc->Dll); // and unload it :)
// In case of POPT_ERROR - first pop will be proc error
@@ -344,8 +371,7 @@
}
// If proc is permanent?
- if ((proc->Options & POPT_PERMANENT) == 0)
- GlobalFree((HANDLE) proc); // No, free it
+ if ((proc->Options & POPT_PERMANENT) == 0) GlobalFree((HANDLE) proc); // No, free it
} PLUGINFUNCTIONEND
PLUGINFUNCTIONSHORT(Int64Op)
@@ -602,13 +628,14 @@
case _T('v'):
case _T('V'): temp2 = PAT_VOID; break;
- #if !defined(SYSTEM_X86)
- #error "TODO: handle p"
- #else
- case _T('p'):
- #endif
+#ifndef _WIN64
+ case _T('p'):
+#endif
case _T('i'):
case _T('I'): temp2 = PAT_INT; break;
+#ifdef _WIN64
+ case _T('p'):
+#endif
case _T('l'):
case _T('L'): temp2 = PAT_LONG; break;
case _T('m'):
@@ -865,12 +892,9 @@
void ParamAllocate(SystemProc *proc)
{
int i;
-
for (i = 0; i <= proc->ParamCount; i++)
- if (((HANDLE) proc->Params[i].Value == NULL) && (proc->Params[i].Option == -1))
- {
- proc->Params[i].Value = BUGBUG64(int) GlobalAlloc(GPTR, 4*ParamSizeByType[proc->Params[i].Type]);
- }
+ if (!proc->Params[i].Value && proc->Params[i].Option == -1)
+ proc->Params[i].Value = (INT_PTR) GlobalAlloc(GPTR, 4*ParamSizeByType[proc->Params[i].Type]);
}
void ParamsIn(SystemProc *proc)
@@ -958,7 +982,7 @@
#ifdef SYSTEM_LOG_DEBUG
{
TCHAR buf[666];
- wsprintf(buf, _T("\t\t\tParam In %d: type %d value 0x%08X value2 0x%08X"), i,
+ wsprintf(buf, _T("\t\t\tParam In %d: type %d value ")SYSFMT_HEXPTR _T(" value2 0x%08X"), i,
par->Type, par->Value, par->_value);
SYSTEM_LOG_ADD(buf);
SYSTEM_LOG_POST;
@@ -974,18 +998,18 @@
void ParamsDeAllocate(SystemProc *proc)
{
int i;
-
for (i = proc->ParamCount; i >= 0; i--)
- if (((HANDLE) proc->Params[i].Value != NULL) && (proc->Params[i].Option == -1))
+ if (proc->Params[i].Value && proc->Params[i].Option == -1)
{
GlobalFree((HANDLE) (proc->Params[i].Value));
- proc->Params[i].Value = (int) NULL;
+ proc->Params[i].Value = 0;
}
}
void ParamsOut(SystemProc *proc)
{
- int i, *place;
+ INT_PTR *place;
+ int i;
TCHAR *realbuf;
LPWSTR wstr;
@@ -993,8 +1017,8 @@
do
{
// Retreive pointer to place
- if (proc->Params[i].Option == -1) place = BUGBUG64(int*) proc->Params[i].Value;
- else place = BUGBUG64(int*) &(proc->Params[i].Value);
+ if (proc->Params[i].Option == -1) place = (INT_PTR*) proc->Params[i].Value;
+ else place = (INT_PTR*) &(proc->Params[i].Value);
realbuf = AllocString();
@@ -1005,7 +1029,7 @@
lstrcpy(realbuf,_T(""));
break;
case PAT_INT:
- wsprintf(realbuf, _T("%d"), *((int*) place));
+ wsprintf(realbuf, _T("%d"), (int)(*((INT_PTR*) place)));
break;
case PAT_LONG:
myitoa64(*((__int64*) place), realbuf);
@@ -1038,7 +1062,7 @@
#endif
break;
case PAT_CALLBACK:
- wsprintf(realbuf, _T("%d"), proc->Params[i].Value);
+ wsprintf(realbuf, _T("%d"), BUGBUG64(proc->Params[i].Value));
break;
}
@@ -1083,6 +1107,9 @@
HANDLE CreateCallback(SystemProc *cbproc)
{
+#ifdef SYSTEM_X64
+ return BUGBUG64(HANDLE) NULL;
+#else
char *mem;
if (cbproc->Proc == NULL)
@@ -1093,8 +1120,8 @@
mem = (char *) (cbproc->Proc = VirtualAlloc(NULL, sizeof(CallbackThunk), MEM_COMMIT, PAGE_EXECUTE_READWRITE));
- ((CallbackThunk*)mem)->pNext=CallbackThunkListHead;
- CallbackThunkListHead=(CallbackThunk*)mem;
+ ((CallbackThunk*)mem)->pNext=g_CallbackThunkListHead;
+ g_CallbackThunkListHead=(CallbackThunk*)mem;
#ifdef SYSTEM_X86
*(mem++) = (char) 0xB8; // Mov eax, const
@@ -1111,6 +1138,7 @@
// Return proc address
return cbproc->Proc;
+#endif
}
void CallStruct(SystemProc *proc)
@@ -1215,7 +1243,7 @@
SYSTEM_LOG_POST;
// Proc virtual return - pointer to memory struct
- proc->Params[0].Value = (int) proc->Proc;
+ proc->Params[0].Value = BUGBUG64(int) proc->Proc;
}
/*
@@ -1231,25 +1259,28 @@
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, LPVOID lpReserved)
{
- g_hInstance=hInst;
-
- if (DLL_PROCESS_ATTACH == fdwReason)
- {
- // change the protection of return command
- VirtualProtect(&retexpr, sizeof(retexpr), PAGE_EXECUTE_READWRITE, (PDWORD)&LastStackPlace);
+ g_hInstance=hInst;
- // initialize some variables
- LastStackPlace = 0;
- LastStackReal = 0;
- LastError = 0;
- LastProc = NULL;
- CallbackIndex = 0;
- CallbackThunkListHead = NULL;
- retexpr[0] = (char) 0xC2;
- retexpr[2] = 0x00;
- }
+ if (DLL_PROCESS_ATTACH == fdwReason)
+ {
+ // change the protection of return command
+ VirtualProtect(&retexpr, sizeof(retexpr), PAGE_EXECUTE_READWRITE, (PDWORD)&LastStackPlace);
- return TRUE;
+ // initialize some variables
+ LastStackPlace = 0, LastStackReal = 0;
+ LastError = 0;
+ LastProc = NULL;
+ CallbackIndex = 0, g_CallbackThunkListHead = NULL;
+#ifdef SYSTEM_X86
+ retexpr[0] = (char) 0xC2;
+ retexpr[2] = 0x00;
+#elif defined(SYSTEM_X64)
+ retexpr[0] = BUGBUG64(0);
+#else
+#error TODO
+#endif
+ }
+ return TRUE;
}
/*
Modified: NSIS/trunk/Contrib/System/Source/System.h
===================================================================
--- NSIS/trunk/Contrib/System/Source/System.h 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/System/Source/System.h 2013-09-06 23:48:59 UTC (rev 6413)
@@ -10,9 +10,13 @@
#else
# error "Unknown architecture!"
#endif
+#ifdef _WIN64
+#define SYSFMT_HEXPTR _T("0x%016IX")
+#else
+#define SYSFMT_HEXPTR _T("0x%08X")
+#endif
-
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the SYSTEM_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
@@ -76,8 +80,8 @@
{
int Type;
int Option; // -1 -> Pointer, 1-... -> Special+1
- int Value; // it can hold any 4 byte value BUGBUG: What about pointers on Win64?
- int _value; // value buffer for structures > 4 bytes (I hope 8 bytes will be enough)
+ INT_PTR Value; // it can hold any pointer sized value
+ int _value; // value buffer for structures > 4 bytes (I hope 8 bytes will be enough) BUGBUG: Does Win64 need this?
int Size; // Value real size (should be either 1 or 2 (the number of pushes))
int Input; //BUGBUG: What about pointers on Win64?
int Output;
@@ -119,6 +123,8 @@
#pragma pack(pop)
*/
char asm_code[10];
+ #elif defined(SYSTEM_X64)
+ char asm_code[BUGBUG64(1)]; // TODO: BUGBUG64
#else
#error "Asm thunk not implemeted for this architecture!"
#endif
@@ -129,6 +135,8 @@
// Free() only knows about pNext in CallbackThunk, it does not know anything about the assembly, that is where this helper comes in...
#ifdef SYSTEM_X86
# define GetAssociatedSysProcFromCallbackThunkPtr(pCbT) ( (SystemProc*) *(unsigned int*) (((char*)(pCbT))+1) )
+#elif defined(SYSTEM_X64)
+# define GetAssociatedSysProcFromCallbackThunkPtr(pCbT) BUGBUG64(NULL)
#else
# error "GetAssociatedSysProcFromCallbackThunkPtr not defined for the current architecture!"
#endif
Modified: NSIS/trunk/Contrib/System/System.nsh
===================================================================
--- NSIS/trunk/Contrib/System/System.nsh 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/System/System.nsh 2013-09-06 23:48:59 UTC (rev 6413)
@@ -14,105 +14,105 @@
; ------------- Functions --------------
; LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-!define sysWNDPROC "(i.s, i.s, i.s, i.s) iss"
+!define sysWNDPROC "(p.s, i.s, p.s, p.s) pss"
; LRESULT DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
-!define sysDefWindowProc "user32::DefWindowProc(i, i, i, i) i"
+!define sysDefWindowProc "user32::DefWindowProc(p, i, p, p) p"
-!define sysMessageBox "user32::MessageBox(i, t, t, i) i"
+!define sysMessageBox "user32::MessageBox(p, t, t, i) i"
!define sysMessageBeep "user32::MessageBeep(i) i"
-!define sysMessageBoxIndirect 'user32::MessageBoxIndirect(i) i'
+!define sysMessageBoxIndirect 'user32::MessageBoxIndirect(p) i'
; HMODULE GetModuleHandle(LPCTSTR lpModuleName);
!define sysGetModuleHandle "kernel32::GetModuleHandle(t) i"
; HMODULE LoadLibrary(LPCTSTR lpFileName);
-!define sysLoadLibrary "kernel32::LoadLibrary(t) i"
+!define sysLoadLibrary "kernel32::LoadLibrary(t) p"
; BOOL FreeLibrary(HMODULE hModule);
-!define sysFreeLibrary "kernel32::FreeLibrary(i) i"
+!define sysFreeLibrary "kernel32::FreeLibrary(p) i"
; HCURSOR LoadCursor(HINSTANCE hInstance, LPCTSTR lpCursorName);
-!define sysLoadCursor "user32::LoadCursor(i, t) i"
+!define sysLoadCursor "user32::LoadCursor(p, t) p"
; ATOM RegisterClass(CONST WNDCLASS *lpWndClass);
-!define sysRegisterClass "user32::RegisterClass(i) i"
+!define sysRegisterClass "user32::RegisterClass(p) i"
; HANDLE LoadImage(HINSTANCE hinst, LPCTSTR lpszName, UINT uType,
; int cxDesired, int cyDesired, UINT fuLoad);
-!define sysLoadImage "user32::LoadImage(i, t, i, i, i, i) i"
+!define sysLoadImage "user32::LoadImage(p, t, i, i, i, i) p"
; BOOL PlaySound(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
-!define sysPlaySound "winmm.dll::PlaySound(t, i, i) i"
+!define sysPlaySound "winmm.dll::PlaySound(t, p, i) i"
; HWND CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName,
; DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent,
; HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
-!define sysCreateWindowEx "user32::CreateWindowEx(i, t, t, i, i, i, i, i, i, i, i, i) i"
+!define sysCreateWindowEx "user32::CreateWindowEx(i, t, t, i, i, i, i, i, p, p, p, p) p"
; BOOL IsWindow(HWND hWnd);
-!define sysIsWindow "user32::IsWindow(i) i"
+!define sysIsWindow "user32::IsWindow(p) i"
; LONG SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong);
-!define sysSetWindowLong "user32::SetWindowLong(i, i, i) i"
+!define sysSetWindowLong "user32::SetWindowLong(p, i, p) p"
; BOOL SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
-!define sysSetWindowPos "user32::SetWindowPos(i, i, i, i, i, i, i) i"
+!define sysSetWindowPos "user32::SetWindowPos(p, p, i, i, i, i, i) i"
; BOOL ShowWindow(HWND hWnd, int nCmdShow);
-!define sysShowWindow "user32::ShowWindow(i, i) i"
+!define sysShowWindow "user32::ShowWindow(p, i) i"
; BOOL DestroyWindow(HWND hWnd);
-!define sysDestroyWindow "user32::DestroyWindow(i) i"
+!define sysDestroyWindow "user32::DestroyWindow(p) i"
; BOOL GetClientRect(HWND hWnd, LPRECT lpRect);
-!define sysGetClientRect "user32::GetClientRect(i, i) i"
+!define sysGetClientRect "user32::GetClientRect(p, p) i"
; BOOL GetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax);
-!define sysGetMessage "user32::GetMessage(i, i, i, i) i"
+!define sysGetMessage "user32::GetMessage(p, p, i, i) i"
; LRESULT DispatchMessage(CONST MSG *lpmsg);
-!define sysDispatchMessage "user32::DispatchMessage(i) i"
+!define sysDispatchMessage "user32::DispatchMessage(p) p"
; BOOL DeleteObject(HGDIOBJ hObject);
-!define sysDeleteObject "gdi32::DeleteObject(i) i"
+!define sysDeleteObject "gdi32::DeleteObject(p) i"
; int GetObject(HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject);
-!define sysGetObject "gdi32::GetObject(i, i, i) i"
+!define sysGetObject "gdi32::GetObject(p, i, p) i"
; HGDIOBJ SelectObject(HDC hdc, HGDIOBJ hgdiobj);
-!define sysSelectObject "gdi32::SelectObject(i, i) i"
+!define sysSelectObject "gdi32::SelectObject(p, p) p"
; HDC CreateCompatibleDC(HDC hdc);
-!define sysCreateCompatibleDC "gdi32::CreateCompatibleDC(i) i"
+!define sysCreateCompatibleDC "gdi32::CreateCompatibleDC(p) p"
; BOOL DeleteDC(HDC hdc);
-!define sysDeleteDC "gdi32::DeleteDC(i) i"
+!define sysDeleteDC "gdi32::DeleteDC(p) i"
; BOOL BitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight,
; HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop);
-!define sysBitBlt "gdi32::BitBlt(i, i, i, i, i, i, i, i, i) i"
+!define sysBitBlt "gdi32::BitBlt(p, i, i, i, i, p, i, i, i) i"
; proposed by abgandar
; int AddFontResource(LPCTSTR lpszFilename);
!define sysAddFontResource "gdi32::AddFontResource(t) i"
; HDC BeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint);
-!define sysBeginPaint "user32::BeginPaint(i, i) i"
+!define sysBeginPaint "user32::BeginPaint(p, p) p"
; BOOL EndPaint(HWND hWnd, CONST PAINTSTRUCT *lpPaint);
-!define sysEndPaint "user32::EndPaint(i, i) i"
+!define sysEndPaint "user32::EndPaint(p, p) i"
; BOOL SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
-!define sysSystemParametersInfo "user32::SystemParametersInfo(i, i, i, i) i"
+!define sysSystemParametersInfo "user32::SystemParametersInfo(i, i, p, i) i"
; UINT_PTR SetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc);
-!define sysSetTimer "user32::SetTimer(i, i, i, k) i"
+!define sysSetTimer "user32::SetTimer(p, p, i, k) i"
; DWORD GetLogicalDriveStrings(DWORD nBufferLength, LPTSTR LpBuffer);
-!define sysGetLogicalDriveStrings 'kernel32::GetLogicalDriveStrings(i, i) i'
+!define sysGetLogicalDriveStrings 'kernel32::GetLogicalDriveStrings(i, p) i'
!define sysGetDiskFreeSpaceEx 'kernel32::GetDiskFreeSpaceEx(t, *l, *l, *l) i'
@@ -120,14 +120,14 @@
!define sysGetDriveType 'kernel32::GetDriveType(t) i'
; HANDLE FindFirstFile(LPCTSTR lpFileName,LPWIN32_FIND_DATA lpFindFileData);
-!define sysFindFirstFile 'kernel32::FindFirstFile(t, i) i'
+!define sysFindFirstFile 'kernel32::FindFirstFile(t, p) p'
; BOOL FindClose(HANDLE hFindFile);
-!define sysFindClose 'kernel32::FindClose(i) i'
+!define sysFindClose 'kernel32::FindClose(p) i'
; BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime,
; LPSYSTEMTIME lpSystemTime);
-!define sysFileTimeToSystemTime 'kernel32::FileTimeToSystemTime(*l, i) i'
+!define sysFileTimeToSystemTime 'kernel32::FileTimeToSystemTime(*l, p) i'
; BOOL FileTimeToLocalFileTime(
; CONST FILETIME *lpFileTime,
@@ -136,7 +136,7 @@
; BOOL SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION lpTimeZone,
; LPSYSTEMTIME lpUniversalTime, LPSYSTEMTIME lpLocalTime);
-!define sysSystemTimeToTzSpecificLocalTime 'kernel32::SystemTimeToTzSpecificLocalTime(i, i, i) i'
+!define sysSystemTimeToTzSpecificLocalTime 'kernel32::SystemTimeToTzSpecificLocalTime(p, p, p) i'
!define syslstrlen 'kernel32::lstrlen(t) i'
@@ -157,7 +157,7 @@
; LPCTSTR lpszMenuName;
; LPCTSTR lpszClassName;
; } WNDCLASS, *PWNDCLASS;
-!define stWNDCLASS "(i, k, i, i, i, i, i, i, t, t) i"
+!define stWNDCLASS "(i, k, i, i, p, p, p, p, t, t) p"
; typedef struct tagMSG {
; HWND hwnd;
@@ -167,7 +167,7 @@
; DWORD time;
; POINT pt; -> will be presented as two separate px and py
; } MSG, *PMSG;
-!define stMSG "(i, i, i, i, i, i, i) i"
+!define stMSG "(p, i, p, p, i, i, i) p"
; typedef struct tagBITMAP {
; LONG bmType;
@@ -178,7 +178,7 @@
; WORD bmBitsPixel;
; LPVOID bmBits;
; } BITMAP, *PBITMAP;
-!define stBITMAP "(i, i, i, i, i, i, i) i"
+!define stBITMAP "(i, i, i, i, i, i, p) p"
; typedef struct _RECT {
; LONG left;
@@ -186,7 +186,7 @@
; LONG right;
; LONG bottom;
; } RECT, *PRECT;
-!define stRECT "(i, i, i, i) i"
+!define stRECT "(i, i, i, i) p"
; typedef struct tagPAINTSTRUCT {
; HDC hdc;
@@ -196,7 +196,7 @@
; BOOL fIncUpdate;
; BYTE rgbReserved[32];
; } PAINTSTRUCT, *PPAINTSTRUCT;
-!define stPAINTSTRUCT "(i, i, i, i, i, i, i, i, &v32) i"
+!define stPAINTSTRUCT "(p, i, i, i, i, i, i, i, &v32) p"
; typedef struct {
; UINT cbSize;
@@ -210,7 +210,7 @@
; MSGBOXCALLBACK lpfnMsgBoxCallback;
; DWORD dwLanguageId;
; } MSGBOXPARAMS, *PMSGBOXPARAMS;
-!define stMSGBOXPARAMS '(&l4, i, i, t, t, i, t, i, k, i) i'
+!define stMSGBOXPARAMS '(&l4, p, p, t, t, i, t, p, k, i) p'
; typedef struct _SYSTEMTIME {
; WORD wYear;
@@ -222,7 +222,7 @@
; WORD wSecond;
; WORD wMilliseconds;
; } SYSTEMTIME, *PSYSTEMTIME;
-!define stSYSTEMTIME '(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2) i'
+!define stSYSTEMTIME '(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2) p'
; Maximal windows path
!define /ifndef MAX_PATH 260
@@ -239,7 +239,7 @@
; TCHAR cFileName[ MAX_PATH ];
; TCHAR cAlternateFileName[ 14 ];
; } WIN32_FIND_DATA, *PWIN32_FIND_DATA;
-!define stWIN32_FIND_DATA '(i, l, l, l, i, i, i, i, &t${MAX_PATH}, &t14) i'
+!define stWIN32_FIND_DATA '(i, l, l, l, i, i, i, i, &t${MAX_PATH}, &t14) p'
; ------------- Constants --------------
Modified: NSIS/trunk/Contrib/System/System.nsi
===================================================================
--- NSIS/trunk/Contrib/System/System.nsi 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/System/System.nsi 2013-09-06 23:48:59 UTC (rev 6413)
@@ -73,7 +73,7 @@
; ----- Sample 3 ----- Direct proc defenition -----
; Direct specification demo
- System::Call 'user32::MessageBox(i $HWNDPARENT, t "Just direct MessageBox specification demo ;)", t "System Example 3", i ${MB_OK}) i.s'
+ System::Call 'user32::MessageBox(p $HWNDPARENT, t "Just direct MessageBox specification demo ;)", t "System Example 3", i ${MB_OK}) i.s'
Pop $0
; ----- Sample 4 ----- Int64, mixed definition demo -----
Modified: NSIS/trunk/Contrib/UIs/ui.c
===================================================================
--- NSIS/trunk/Contrib/UIs/ui.c 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/UIs/ui.c 2013-09-06 23:48:59 UTC (rev 6413)
@@ -18,7 +18,7 @@
MAKEINTRESOURCE(IDD_UNINST)
};
-BOOL CALLBACK GenericProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
+INT_PTR CALLBACK GenericProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
static LOGBRUSH b = {BS_SOLID, RGB(255,0,0), 0};
static HBRUSH red;
@@ -27,26 +27,26 @@
switch (uMsg) {
case WM_CTLCOLORSTATIC:
- return (int)red;
+ return (INT_PTR)red;
}
- return 0;
+ return FALSE;
}
-BOOL CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
+INT_PTR CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
static int i = -1;
- switch (uMsg) {
- case WM_INITDIALOG:
- SetWindowText(hwndDlg, _T("NSIS User Interface - Testing"));
- SetWindowText(GetDlgItem(hwndDlg, IDC_VERSTR), _T("NSIS version"));
- SetWindowText(GetDlgItem(hwndDlg, IDC_BACK), _T("< Back"));
- SetWindowText(GetDlgItem(hwndDlg, IDOK), _T("Next >"));
- SetWindowText(GetDlgItem(hwndDlg, IDCANCEL), _T("Cancel"));
- ShowWindow(GetDlgItem(hwndDlg, IDC_BACK), SW_SHOW);
- ShowWindow(GetDlgItem(hwndDlg, IDC_CHILDRECT), SW_SHOW);
+ switch (uMsg) {
+ case WM_INITDIALOG:
+ SetWindowText(hwndDlg, _T("NSIS User Interface - Testing"));
+ SetWindowText(GetDlgItem(hwndDlg, IDC_VERSTR), _T("NSIS version"));
+ SetWindowText(GetDlgItem(hwndDlg, IDC_BACK), _T("< Back"));
+ SetWindowText(GetDlgItem(hwndDlg, IDOK), _T("Next >"));
+ SetWindowText(GetDlgItem(hwndDlg, IDCANCEL), _T("Cancel"));
+ ShowWindow(GetDlgItem(hwndDlg, IDC_BACK), SW_SHOW);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_CHILDRECT), SW_SHOW);
SendMessage(hwndDlg, WM_COMMAND, MAKEWORD(IDOK, 0), 0);
- ShowWindow(hwndDlg, SW_SHOW);
- break;
- case WM_COMMAND:
+ ShowWindow(hwndDlg, SW_SHOW);
+ break;
+ case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
case IDC_BACK:
@@ -77,7 +77,7 @@
}
break;
}
- return 0;
+ return FALSE;
}
NSIS_ENTRYPOINT_SIMPLEGUI
Modified: NSIS/trunk/Contrib/nsDialogs/example.nsi
===================================================================
--- NSIS/trunk/Contrib/nsDialogs/example.nsi 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/nsDialogs/example.nsi 2013-09-06 23:48:59 UTC (rev 6413)
@@ -58,7 +58,7 @@
Pop $0 # HWND
- System::Call user32::GetWindowText(i$EDIT,t.r0,i${NSIS_MAX_STRLEN})
+ System::Call user32::GetWindowText(p$EDIT,t.r0,i${NSIS_MAX_STRLEN})
${If} $0 == "hello there"
MessageBox MB_OK "right back at ya"
Modified: NSIS/trunk/Contrib/nsDialogs/nsDialogs.c
===================================================================
--- NSIS/trunk/Contrib/nsDialogs/nsDialogs.c 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/nsDialogs/nsDialogs.c 2013-09-06 23:48:59 UTC (rev 6413)
@@ -32,9 +32,9 @@
return &g_dialog.controls[id - 1];
}
-BOOL CALLBACK ParentProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK ParentProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- BOOL res;
+ INT_PTR res;
if (message == WM_NOTIFY_OUTER_NEXT)
{
@@ -76,7 +76,7 @@
return CallWindowProc(ctl->oldWndProc, hwnd, message, wParam, lParam);
}
-BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
@@ -93,7 +93,7 @@
{
if (ctl->callbacks.onClick)
{
- pushint((int) hwCtl);
+ pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onClick - 1, 0);
}
}
@@ -101,7 +101,7 @@
{
if (ctl->callbacks.onChange)
{
- pushint((int) hwCtl);
+ pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onChange - 1, 0);
}
}
@@ -109,7 +109,7 @@
{
if (ctl->callbacks.onChange)
{
- pushint((int) hwCtl);
+ pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onChange - 1, 0);
}
}
@@ -118,7 +118,7 @@
{
if (ctl->callbacks.onChange)
{
- pushint((int) hwCtl);
+ pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onChange - 1, 0);
}
}
@@ -126,7 +126,7 @@
{
if (ctl->callbacks.onClick)
{
- pushint((int) hwCtl);
+ pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onClick - 1, 0);
}
}
@@ -145,9 +145,9 @@
if (!ctl->callbacks.onNotify)
break;
- pushint((int) nmhdr);
- pushint(nmhdr->code);
- pushint((int) nmhdr->hwndFrom);
+ pushintptr((INT_PTR) nmhdr);
+ pushintptr(nmhdr->code);
+ pushintptr((INT_PTR) nmhdr->hwndFrom);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onNotify - 1, 0);
}
@@ -287,7 +287,7 @@
g_dialog.callbacks.onBack = 0;
- pushint((int) g_dialog.hwDialog);
+ pushintptr((INT_PTR) g_dialog.hwDialog);
}
void __declspec(dllexport) CreateControl(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters *extra)
@@ -393,7 +393,7 @@
// push back result
- pushint((int) hwItem);
+ pushintptr((INT_PTR) hwItem);
// done
@@ -413,11 +413,11 @@
// get info from stack
- hwCtl = (HWND) popint();
+ hwCtl = (HWND) popintptr();
if (!IsWindow(hwCtl))
{
- popint(); // remove user data from stack
+ popintptr(); // remove user data from stack
return;
}
@@ -440,7 +440,7 @@
// get info from stack
- hwCtl = (HWND) popint();
+ hwCtl = (HWND) popintptr();
if (!IsWindow(hwCtl))
{
@@ -513,7 +513,7 @@
// get info from stack
- hwCtl = (HWND) popint();
+ hwCtl = (HWND) popintptr();
callback = (nsFunction) popint();
if (!IsWindow(hwCtl))
Modified: NSIS/trunk/Contrib/nsDialogs/nsDialogs.nsh
===================================================================
--- NSIS/trunk/Contrib/nsDialogs/nsDialogs.nsh 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/nsDialogs/nsDialogs.nsh 2013-09-06 23:48:59 UTC (rev 6413)
@@ -354,9 +354,9 @@
!macro _NSD_GWLAddFlags GWL HWND DATA
- System::Call "user32::GetWindowLong(i${HWND},i${GWL})i.s"
+ System::Call "user32::GetWindowLong(p${HWND},i${GWL})p.s"
System::Int64Op "${DATA}" |
- System::Call "user32::SetWindowLong(i${HWND},i${GWL},is)"
+ System::Call "user32::SetWindowLong(p${HWND},p${GWL},ps)"
!macroend
@@ -365,7 +365,7 @@
!macro __NSD_GetText CONTROL VAR
- System::Call user32::GetWindowText(i${CONTROL},t.s,i${NSIS_MAX_STRLEN})
+ System::Call user32::GetWindowText(p${CONTROL},t.s,i${NSIS_MAX_STRLEN})
Pop ${VAR}
!macroend
@@ -422,7 +422,7 @@
!macro __NSD_SetFocus HWND
- System::Call "user32::SetFocus(i${HWND})"
+ System::Call "user32::SetFocus(p${HWND})"
!macroend
@@ -492,7 +492,7 @@
!macro __NSD_LB_GetSelection CONTROL VAR
SendMessage ${CONTROL} ${LB_GETCURSEL} 0 0 ${VAR}
- System::Call 'user32::SendMessage(i ${CONTROL}, i ${LB_GETTEXT}, i ${VAR}, t .s)'
+ System::Call 'user32::SendMessage(p ${CONTROL}, i ${LB_GETTEXT}, p ${VAR}, t .s)'
Pop ${VAR}
!macroend
@@ -511,10 +511,10 @@
!if "${_LIHINSTMODE}" == "exeresource"
!undef _LIHINSTSRC # If (internal?) _* macro params starts using $0,
!define _LIHINSTSRC r0 # _LIHINSTSRC can be changed to s
- System::Call 'kernel32::GetModuleHandle(i0)i.${_LIHINSTSRC}'
+ System::Call 'kernel32::GetModuleHandle(p0)p.${_LIHINSTSRC}'
!endif
- System::Call 'user32::LoadImage(i ${_LIHINSTSRC}, ts, i ${_IMGTYPE}, i0, i0, i${_LIFLAGS}) i.r0'
+ System::Call 'user32::LoadImage(p ${_LIHINSTSRC}, ts, i ${_IMGTYPE}, i0, i0, i${_LIFLAGS})p.r0'
SendMessage $R0 ${STM_SETIMAGE} ${_IMGTYPE} $0
Pop $R0
@@ -549,25 +549,19 @@
StrCpy $R0 ${CONTROL} # in case ${CONTROL} is $0
- StrCpy $1 ""
- StrCpy $2 ""
-
- System::Call '*(i, i, i, i) i.s'
- Pop $0
-
+ # Allocate a RECT in $0 and initialize $1 and $2 to 0
+ System::Call '*(i0r1, i0r2, i, i)p.r0'
${If} $0 <> 0
-
- System::Call 'user32::GetClientRect(iR0, ir0)'
+ System::Call 'user32::GetClientRect(pR0, pr0)'
System::Call '*$0(i, i, i .s, i .s)'
System::Free $0
Pop $1
Pop $2
-
${EndIf}
- System::Call 'user32::LoadImage(i0, ts, i ${IMAGE_BITMAP}, ir1, ir2, i${LR_LOADFROMFILE}) i.s' "${IMAGE}"
+ System::Call 'user32::LoadImage(p0, ts, i ${IMAGE_BITMAP}, ir1, ir2, i${LR_LOADFROMFILE}) p.s' "${IMAGE}"
Pop $0
- SendMessage $R0 ${STM_SETIMAGE} ${IMAGE_BITMAP} $0
+ SendMessage $R0 ${STM_SETIMAGE} ${IMAGE_BITMAP} $0
Pop $R0
Pop $2
@@ -583,9 +577,7 @@
!macro __NSD_FreeImage IMAGE
${If} ${IMAGE} <> 0
-
- System::Call gdi32::DeleteObject(is) ${IMAGE}
-
+ System::Call gdi32::DeleteObject(ps) ${IMAGE}
${EndIf}
!macroend
@@ -594,7 +586,7 @@
!define NSD_FreeBitmap `${NSD_FreeImage}`
!macro __NSD_FreeIcon IMAGE
- System::Call user32::DestroyIcon(is) ${IMAGE}
+ System::Call user32::DestroyIcon(ps) ${IMAGE}
!macroend
!define NSD_FreeIcon `!insertmacro __NSD_FreeIcon`
Modified: NSIS/trunk/Contrib/nsDialogs/welcome.nsi
===================================================================
--- NSIS/trunk/Contrib/nsDialogs/welcome.nsi 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/nsDialogs/welcome.nsi 2013-09-06 23:48:59 UTC (rev 6413)
@@ -96,7 +96,7 @@
Pop $IMAGECTL
StrCpy $0 $PLUGINSDIR\welcome.bmp
- System::Call 'user32::LoadImage(i 0, t r0, i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_LOADFROMFILE}) i.s'
+ System::Call 'user32::LoadImage(p 0, t r0, i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_LOADFROMFILE})p.s'
Pop $IMAGE
SendMessage $IMAGECTL ${STM_SETIMAGE} ${IMAGE_BITMAP} $IMAGE
@@ -119,7 +119,7 @@
Call ShowControls
- System::Call gdi32::DeleteObject(i$IMAGE)
+ System::Call gdi32::DeleteObject(p$IMAGE)
FunctionEnd
@@ -198,7 +198,7 @@
GetDlgItem $0 $HWNDPARENT 1
- System::Call user32::GetWindowText(i$DIRECTORY,t.d,i${NSIS_MAX_STRLEN})
+ System::Call user32::GetWindowText(p$DIRECTORY,t.d,i${NSIS_MAX_STRLEN})
${If} ${FileExists} $INSTDIR\makensis.exe
EnableWindow $0 1
Modified: NSIS/trunk/Contrib/zip2exe/main.cpp
===================================================================
--- NSIS/trunk/Contrib/zip2exe/main.cpp 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Contrib/zip2exe/main.cpp 2013-09-06 23:48:59 UTC (rev 6413)
@@ -76,7 +76,7 @@
bool g_made;
-static BOOL CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static INT_PTR CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
NSIS_ENTRYPOINT_SIMPLEGUI
int WINAPI _tWinMain(HINSTANCE hInst,HINSTANCE hOldInst,LPTSTR CmdLineParams,int ShowCmd)
@@ -600,7 +600,7 @@
}
}
-BOOL CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static int ids[]={IDC_INFO,IDC_NSISICON,IDC_SZIPFRAME,IDC_BROWSE,IDC_ZIPFILE,IDC_ZIPINFO_SUMMARY,IDC_ZIPINFO_FILES,IDC_OFRAME,IDC_INAMEST,
IDC_INSTNAME,IDC_INSTPATH,IDC_OEFST,IDC_OUTFILE,IDC_BROWSE2,IDC_COMPRESSOR,IDC_ZLIB,IDC_BZIP2,IDC_LZMA,IDC_SOLID,IDC_INTERFACE,IDC_MODERNUI,IDC_CLASSICUI,IDC_UNICODE};
@@ -783,5 +783,5 @@
}
break;
}
- return 0;
+ return FALSE;
}
Modified: NSIS/trunk/Docs/src/usefulfunc.but
===================================================================
--- NSIS/trunk/Docs/src/usefulfunc.but 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Docs/src/usefulfunc.but 2013-09-06 23:48:59 UTC (rev 6413)
@@ -141,14 +141,14 @@
\H{installerfilename} Get Installer Filename
-\c System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
+\c System::Call 'kernel32::GetModuleFileName(p 0, t .R0, i 1024) i r1'
\c ;$R0 will contain the installer filename
\H{multipleinstances} Prevent Multiple Instances
Put the following code in your \R{oninit}{.onInit function}:
-\c System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
+\c System::Call 'kernel32::CreateMutex(p 0, i 0, t "myMutex") p .r1 ?e'
\c Pop $R0
\c
\c StrCmp $R0 0 +3
Modified: NSIS/trunk/Docs/src/usefulinfos.but
===================================================================
--- NSIS/trunk/Docs/src/usefulinfos.but 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Docs/src/usefulinfos.but 2013-09-06 23:48:59 UTC (rev 6413)
@@ -234,10 +234,10 @@
\c System::StrAlloc ${NSIS_MAX_STRLEN}
\c Pop $3
\c StrCpy $2 0
-\c System::Call "*(i, i, i, i, i, i, i, i, i) i \
+\c System::Call "*(i, i, i, i, i, i, i, i, i) p \
\c (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
\c loop: StrCmp $2 $6 done
-\c System::Call "User32::SendMessage(i, i, i, i) i \
+\c System::Call "User32::SendMessage(p, i, p, p) i \
\c ($0, ${LVM_GETITEMTEXT}, $2, r1)"
\c System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
\c FileWrite $5 "$4$\r$\n"
@@ -286,10 +286,10 @@
\c System::StrAlloc ${NSIS_MAX_STRLEN}
\c Pop $3
\c StrCpy $2 0
-\c System::Call "*(i, i, i, i, i, i, i, i, i) i \
+\c System::Call "*(i, i, i, i, i, i, i, i, i) p \
\c (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
\c loop: StrCmp $2 $6 done
-\c System::Call "User32::SendMessageW(i, i, i, i) i \
+\c System::Call "User32::SendMessageW(p, i, p, p) i \
\c ($0, ${LVM_GETITEMTEXT}, $2, r1)"
\c System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
\c FileWriteUTF16LE $5 "$4$\r$\n"
Modified: NSIS/trunk/Examples/makensis.nsi
===================================================================
--- NSIS/trunk/Examples/makensis.nsi 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Examples/makensis.nsi 2013-09-06 23:48:59 UTC (rev 6413)
@@ -11,12 +11,20 @@
;--------------------------------
;Configuration
-!ifdef OUTFILE
- OutFile "${OUTFILE}"
+!ifdef NSIS_MAKENSIS64
+ !define BITS 64
+ !define NAMESUFFIX " (64 bit)"
!else
- OutFile ..\nsis-${VERSION}-setup.exe
+ !define BITS 32
+ !define NAMESUFFIX ""
!endif
+!ifndef OUTFILE
+ !define OUTFILE "..\nsis${BITS}-${VERSION}-setup.exe"
+ !searchreplace OUTFILE "${OUTFILE}" nsis32 nsis
+!endif
+
+OutFile "${OUTFILE}"
Unicode true
SetCompressor /SOLID lzma
@@ -24,7 +32,7 @@
InstType "Lite"
InstType "Minimal"
-InstallDir $PROGRAMFILES\NSIS
+InstallDir $PROGRAMFILES${BITS}\NSIS
InstallDirRegKey HKLM Software\NSIS ""
RequestExecutionLevel admin
@@ -49,7 +57,7 @@
;Names
Name "NSIS"
-Caption "NSIS ${VERSION} Setup"
+Caption "NSIS ${VERSION}${NAMESUFFIX} Setup"
!define REG_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
@@ -114,11 +122,17 @@
!macro InstallPlugin pi
File "/oname=$InstDir\Plugins\x86-ansi\${pi}.dll" ..\Plugins\x86-ansi\${pi}.dll
File "/oname=$InstDir\Plugins\x86-unicode\${pi}.dll" ..\Plugins\x86-unicode\${pi}.dll
+ !ifdef NSIS_MAKENSIS64
+ File "/oname=$InstDir\Plugins\amd64-unicode\${pi}.dll" ..\Plugins\amd64-unicode\${pi}.dll
+ !endif
!macroend
!macro InstallStub stub
File ..\Stubs\${stub}-x86-ansi
File ..\Stubs\${stub}-x86-unicode
+ !ifdef NSIS_MAKENSIS64
+ File ..\Stubs\${stub}-amd64-unicode
+ !endif
!macroend
${MementoSection} "NSIS Core Files (required)" SecCore
@@ -218,6 +232,9 @@
CreateDirectory $INSTDIR\Plugins\x86-ansi
CreateDirectory $INSTDIR\Plugins\x86-unicode
+ !ifdef NSIS_MAKENSIS64
+ CreateDirectory $INSTDIR\Plugins\amd64-unicode
+ !endif
!insertmacro InstallPlugin TypeLib
ReadRegStr $R0 HKCR ".nsi" ""
@@ -330,10 +347,10 @@
SectionIn 1 2
SetOutPath $INSTDIR
!ifndef NO_STARTMENUSHORTCUTS
- CreateShortCut "$SMPROGRAMS\NSIS.lnk" "$INSTDIR\NSIS.exe"
+ CreateShortCut "$SMPROGRAMS\NSIS${NAMESUFFIX}.lnk" "$INSTDIR\NSIS.exe"
!endif
- CreateShortCut "$DESKTOP\NSIS.lnk" "$INSTDIR\NSIS.exe"
+ CreateShortCut "$DESKTOP\NSIS${NAMESUFFIX}.lnk" "$INSTDIR\NSIS.exe"
${MementoSectionEnd}
@@ -797,7 +814,7 @@
WriteRegExpandStr HKLM "${REG_UNINST_KEY}" "UninstallString" '"$INSTDIR\uninst-nsis.exe"'
WriteRegExpandStr HKLM "${REG_UNINST_KEY}" "InstallLocation" "$INSTDIR"
- WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayName" "Nullsoft Install System"
+ WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayName" "Nullsoft Install System${NAMESUFFIX}"
WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayIcon" "$INSTDIR\NSIS.exe,0"
WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayVersion" "${VERSION}"
!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
@@ -1032,8 +1049,8 @@
DetailPrint "Deleting Files..."
SetDetailsPrint listonly
- Delete $SMPROGRAMS\NSIS.lnk
- Delete $DESKTOP\NSIS.lnk
+ Delete "$SMPROGRAMS\NSIS${NAMESUFFIX}.lnk"
+ Delete "$DESKTOP\NSIS${NAMESUFFIX}.lnk"
Delete $INSTDIR\makensis.exe
Delete $INSTDIR\makensisw.exe
Delete $INSTDIR\NSIS.exe
Modified: NSIS/trunk/Include/FileFunc.nsh
===================================================================
--- NSIS/trunk/Include/FileFunc.nsh 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Include/FileFunc.nsh 2013-09-06 23:48:59 UTC (rev 6413)
@@ -1107,22 +1107,22 @@
FileFunc_GetTime_getfile:
IfFileExists $0 0 FileFunc_GetTime_error
- System::Call '*(i,l,l,l,i,i,i,i,&t260,&t14) i .r6'
- System::Call 'kernel32::FindFirstFile(t,i)i(r0,r6) .r2'
+ System::Call '*(i,l,l,l,i,i,i,i,&t260,&t14) p .r6'
+ System::Call 'kernel32::FindFirstFile(t,p)p(r0,r6) .r2'
System::Call 'kernel32::FindClose(i)i(r2)'
FileFunc_GetTime_gettime:
- System::Call '*(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2) i .r7'
+ System::Call '*(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2) p .r7'
StrCmp $1 'L' 0 FileFunc_GetTime_systemtime
- System::Call 'kernel32::GetLocalTime(i)i(r7)'
+ System::Call 'kernel32::GetLocalTime(p)i(r7)'
goto FileFunc_GetTime_convert
FileFunc_GetTime_systemtime:
StrCmp $1 'LS' 0 FileFunc_GetTime_filetime
- System::Call 'kernel32::GetSystemTime(i)i(r7)'
+ System::Call 'kernel32::GetSystemTime(p)i(r7)'
goto FileFunc_GetTime_convert
FileFunc_GetTime_filetime:
- System::Call '*$6(i,l,l,l,i,i,i,i,&t260,&t14)i(,.r4,.r3,.r2)'
+ System::Call '*$6(i,l,l,l,i,i,i,i,&t260,&t14)p(,.r4,.r3,.r2)'
System::Free $6
StrCmp $1 'A' 0 +3
StrCpy $2 $3
@@ -1146,7 +1146,7 @@
System::Call 'kernel32::FileTimeToSystemTime(*l,i)i(r3,r7)'
FileFunc_GetTime_convert:
- System::Call '*$7(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2)i(.r5,.r6,.r4,.r0,.r3,.r2,.r1,)'
+ System::Call '*$7(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2)p(.r5,.r6,.r4,.r0,.r3,.r2,.r1,)'
System::Free $7
IntCmp $0 9 0 0 +2
@@ -1398,7 +1398,7 @@
Push $0
Push $1
Push $2
- System::Call 'kernel32::GetModuleFileName(i 0, t .r0, i 1024)'
+ System::Call 'kernel32::GetModuleFileName(p 0, t .r0, i 1024)'
System::Call 'kernel32::GetLongPathName(t r0, t .r1, i 1024)i .r2'
StrCmp $2 error +2
StrCpy $0 $1
Modified: NSIS/trunk/Include/StrFunc.nsh
===================================================================
--- NSIS/trunk/Include/StrFunc.nsh 2013-09-02 21:19:45 UTC (rev 6412)
+++ NSIS/trunk/Include/StrFunc.nsh 2013-09-06 23:48:59 UTC (rev 6413)
@@ -285,7 +285,7 @@
; Else convert to lower case.
;Use "IsCharAlpha" for the job
- System::Call "*(&t1 r7) i .r8"
+ System::Call "*(&t1 r7) p .r8"
System::Call "*$8(&i1 .r7)"
System::Free $8
System::Call "user32::IsCharAlpha(i r7) i .r8"
@@ -325,7 +325,7 @@
; Switch all characters cases to their inverse case.
;Use "IsCharUpper" for the job
- System::Call "*(&t1 r6) i .r8"
+ System::Call "*(&t1 r6) p .r8"
System::Call "*$8(&i1 .r7)"
System::Free $8
System::Call "user32::IsCharUpper(i r7) i .r8"
@@ -395,7 +395,7 @@
StrCpy $4 ""
;Open the clipboard to do the operations the user chose (kichik's fix)
- System::Call 'user32::OpenClipboard(i $HWNDPARENT)'
+ System::Call 'user32::OpenClipboard(p $HWNDPARENT)'
${If} $1 == ">" ;Set
@@ -405,44 +405,44 @@
;Step 2: Allocate global heap
StrLen $2 $0
IntOp $2 $2 + 1
- IntOp $2 $2 * ${NSIS_CHAR_SIZE}
- System::Call 'kernel32::GlobalAlloc(i 2, i r2) i.r2'
+ IntOp $2 $2 * ${NSIS_CHAR_SIZE}
+ System::Call 'kernel32::GlobalAlloc(i 2, i r2) p.r2'
;Step 3: Lock the handle
- System::Call 'kernel32::GlobalLock(i r2) i.r3'
+ System::Call 'kernel32::GlobalLock(p r2) i.r3'
;Step 4: Copy the text to locked clipboard buffer
- System::Call 'kernel32::lstrcpy(i r3, t r0)'
+ System::Call 'kernel32::lstrcpy(p r3, t r0)'
;Step 5: Unlock the handle again
- System::Call 'kernel32::GlobalUnlock(i r2)'
+ System::Call 'kernel32::GlobalUnlock(p r2)'
;Step 6: Set the information to the clipboard
- System::Call 'user32::SetClipboardData(i 1, i r2)'
+ System::Call 'user32::SetClipboardData(i 1, p r2)'
StrCpy $0 ""
${ElseIf} $1 == "<" ;Get
;Step 1: Get clipboard data
- System::Call 'user32::GetClipboardData(i 1) i .r2'
+ System::Call 'user32::GetClipboardData(i 1) p .r2'
;Step 2: Lock and copy data (kichik's fix)
- System::Call 'kernel32::GlobalLock(i r2) t .r0'
+ System::Call 'kernel32::GlobalLock(p r2) t .r0'
;Step 3: Unlock...
[truncated message content] |