mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-16 03:53:01 -05:00
Cast return value of ShellExecute to INT_PTR.
ShellExecute returns HINSTANCE which is a typedef for void*. Cast the return value to INT_PTR instead of int to avoid truncation on 64bit builds.
This commit is contained in:
parent
3ca54e45e3
commit
44c107d56a
@ -789,7 +789,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
switch (wParam & ~0xF) { /* low 4 bits reserved to Windows */
|
switch (wParam & ~0xF) { /* low 4 bits reserved to Windows */
|
||||||
case IDM_PUTTY:
|
case IDM_PUTTY:
|
||||||
if((int)ShellExecute(hwnd, NULL, putty_path, _T(""), _T(""),
|
if((INT_PTR)ShellExecute(hwnd, NULL, putty_path, _T(""), _T(""),
|
||||||
SW_SHOW) <= 32) {
|
SW_SHOW) <= 32) {
|
||||||
MessageBox(NULL, "Unable to execute PuTTY!",
|
MessageBox(NULL, "Unable to execute PuTTY!",
|
||||||
"Error", MB_OK | MB_ICONERROR);
|
"Error", MB_OK | MB_ICONERROR);
|
||||||
@ -856,7 +856,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
GetMenuItemInfo(session_menu, wParam, FALSE, &mii);
|
GetMenuItemInfo(session_menu, wParam, FALSE, &mii);
|
||||||
strcpy(param, "@");
|
strcpy(param, "@");
|
||||||
strcat(param, mii.dwTypeData);
|
strcat(param, mii.dwTypeData);
|
||||||
if((int)ShellExecute(hwnd, NULL, putty_path, param,
|
if((INT_PTR)ShellExecute(hwnd, NULL, putty_path, param,
|
||||||
_T(""), SW_SHOW) <= 32) {
|
_T(""), SW_SHOW) <= 32) {
|
||||||
MessageBox(NULL, "Unable to execute PuTTY!", "Error",
|
MessageBox(NULL, "Unable to execute PuTTY!", "Error",
|
||||||
MB_OK | MB_ICONERROR);
|
MB_OK | MB_ICONERROR);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user