From 30dcad4b95d355e07f0807360f2e5f65b0460fe3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Fri, 22 Apr 2016 14:55:19 +0200 Subject: Windows: 1. GWL_USERDATA must be GWLP_USERDATA to be compatible with x86 and x64. (GWL_USERDATA is deprecated anyway). 3. Replace Get/SetWindowLong with Get/SetWindoeLongPtr or placing this into GWLP_USERDATA will truncate the pointer. (transplanted from 5f50745bff03700d3862a6bb1eb5936be0fdc6cd) --- indra/llwindow/llwindowwin32.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llwindow/llwindowwin32.cpp') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 875ffe4cd4..d111bea3fd 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -759,7 +759,7 @@ void LLWindowWin32::close() LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL; // Don't process events in our mainWindowProc any longer. - SetWindowLong(mWindowHandle, GWL_USERDATA, NULL); + SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL); // Make sure we don't leave a blank toolbar button. ShowWindow(mWindowHandle, SW_HIDE); @@ -1538,7 +1538,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO LL_DEBUGS("Window") << "Keeping vertical sync" << LL_ENDL; } - SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this); + SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, (LONG_PTR)this); // register this window as handling drag/drop events from the OS DragAcceptFiles( mWindowHandle, TRUE ); @@ -1850,7 +1850,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // This is to avoid triggering double click teleport after returning focus (see MAINT-3786). static bool sHandleDoubleClick = true; - LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(h_wnd, GWL_USERDATA); + LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( h_wnd, GWLP_USERDATA ); if (NULL != window_imp) -- cgit v1.2.3 From 09003cf4055fc336cf12e075636f1dfe8ce035d2 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 27 Mar 2017 10:59:19 -0700 Subject: Fix for MAINT-7054 Viewer Crashed when I used Japanese IM. --- indra/llwindow/llwindowwin32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llwindow/llwindowwin32.cpp') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 301ae7f9c4..47441db669 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2201,7 +2201,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ if (LLWinImm::isAvailable() && window_imp->mPreeditor) { LRESULT result = 0; - if (window_imp->handleImeRequests(w_param, l_param, &result)) + if (window_imp->handleImeRequests(w_param, (LONG_PTR)l_param, &result)) { return result; } @@ -3800,7 +3800,7 @@ LLWindowCallbacks::DragNDropResult LLWindowWin32::completeDragNDropRequest( cons // When it handled the message, the value to be returned from // the Window Procedure is set to *result. -BOOL LLWindowWin32::handleImeRequests(U32 request, U32 param, LRESULT *result) +BOOL LLWindowWin32::handleImeRequests(U32 request, LONG_PTR param, LRESULT *result) { if ( mPreeditor ) { -- cgit v1.2.3 From 6d4c737b789714aaff44b7231dd923bb7b99b702 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 27 Mar 2017 16:20:51 -0700 Subject: Additional work on : Fix for MAINT-7054 Viewer Crashed when I used Japanese IM. (Drake and Appurist convinced me my initial solution was non-optimal) --- indra/llwindow/llwindowwin32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llwindow/llwindowwin32.cpp') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 47441db669..5ec0ada6eb 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2201,7 +2201,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ if (LLWinImm::isAvailable() && window_imp->mPreeditor) { LRESULT result = 0; - if (window_imp->handleImeRequests(w_param, (LONG_PTR)l_param, &result)) + if (window_imp->handleImeRequests(w_param, l_param, &result)) { return result; } @@ -3800,7 +3800,7 @@ LLWindowCallbacks::DragNDropResult LLWindowWin32::completeDragNDropRequest( cons // When it handled the message, the value to be returned from // the Window Procedure is set to *result. -BOOL LLWindowWin32::handleImeRequests(U32 request, LONG_PTR param, LRESULT *result) +BOOL LLWindowWin32::handleImeRequests(WPARAM request, LPARAM param, LRESULT *result) { if ( mPreeditor ) { -- cgit v1.2.3