Win64 fixes

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6413 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2013-09-06 23:48:59 +00:00
parent e23b3db418
commit e63fa6c53b
38 changed files with 389 additions and 331 deletions

View file

@ -58,7 +58,7 @@ Function OnChange
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"

View file

@ -32,9 +32,9 @@ struct nsControl* NSDFUNC GetControl(HWND hwCtl)
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 @@ LRESULT CALLBACK LinkWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
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 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (ctl->callbacks.onClick)
{
pushint((int) hwCtl);
pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onClick - 1, 0);
}
}
@ -101,7 +101,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (ctl->callbacks.onChange)
{
pushint((int) hwCtl);
pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onChange - 1, 0);
}
}
@ -109,7 +109,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (ctl->callbacks.onChange)
{
pushint((int) hwCtl);
pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onChange - 1, 0);
}
}
@ -118,7 +118,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (ctl->callbacks.onChange)
{
pushint((int) hwCtl);
pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onChange - 1, 0);
}
}
@ -126,7 +126,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (ctl->callbacks.onClick)
{
pushint((int) hwCtl);
pushintptr((INT_PTR) hwCtl);
g_pluginParms->ExecuteCodeSegment(ctl->callbacks.onClick - 1, 0);
}
}
@ -145,9 +145,9 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
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 @@ void __declspec(dllexport) Create(HWND hwndParent, int string_size, TCHAR *varia
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 @@ void __declspec(dllexport) CreateControl(HWND hwndParent, int string_size, TCHAR
// push back result
pushint((int) hwItem);
pushintptr((INT_PTR) hwItem);
// done
@ -413,11 +413,11 @@ void __declspec(dllexport) SetUserData(HWND hwndParent, int string_size, TCHAR *
// 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 @@ void __declspec(dllexport) GetUserData(HWND hwndParent, int string_size, TCHAR *
// get info from stack
hwCtl = (HWND) popint();
hwCtl = (HWND) popintptr();
if (!IsWindow(hwCtl))
{
@ -513,7 +513,7 @@ void NSDFUNC SetControlCallback(size_t callbackIdx)
// get info from stack
hwCtl = (HWND) popint();
hwCtl = (HWND) popintptr();
callback = (nsFunction) popint();
if (!IsWindow(hwCtl))

View file

@ -354,9 +354,9 @@ Header file for creating custom installer pages with nsDialogs
!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 @@ Header file for creating custom installer pages with nsDialogs
!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 @@ Header file for creating custom installer pages with nsDialogs
!macro __NSD_SetFocus HWND
System::Call "user32::SetFocus(i${HWND})"
System::Call "user32::SetFocus(p${HWND})"
!macroend
@ -492,7 +492,7 @@ Header file for creating custom installer pages with nsDialogs
!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 @@ Header file for creating custom installer pages with nsDialogs
!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 @@ Header file for creating custom installer pages with nsDialogs
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 @@ Header file for creating custom installer pages with nsDialogs
!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 @@ Header file for creating custom installer pages with nsDialogs
!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`

View file

@ -96,7 +96,7 @@ Function nsDialogsWelcome
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 @@ Function nsDialogsWelcome
Call ShowControls
System::Call gdi32::DeleteObject(i$IMAGE)
System::Call gdi32::DeleteObject(p$IMAGE)
FunctionEnd
@ -198,7 +198,7 @@ Function DirChange
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