Fix 64-bit Windows issues
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4061 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx
index 49b6c3f..d60ff8f 100644
--- a/win/vncviewer/DesktopWindow.cxx
+++ b/win/vncviewer/DesktopWindow.cxx
@@ -1,4 +1,5 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
+ * Copyright (C) 2010 D. R. Commander. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -63,10 +64,10 @@
LRESULT CALLBACK DesktopWindowProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) {
LRESULT result = 0;
if (msg == WM_CREATE)
- SetWindowLong(wnd, GWL_USERDATA, (long)((CREATESTRUCT*)lParam)->lpCreateParams);
+ SetWindowLongPtr(wnd, GWLP_USERDATA, (LONG_PTR)((CREATESTRUCT*)lParam)->lpCreateParams);
else if (msg == WM_DESTROY)
- SetWindowLong(wnd, GWL_USERDATA, 0);
- DesktopWindow* _this = (DesktopWindow*) GetWindowLong(wnd, GWL_USERDATA);
+ SetWindowLongPtr(wnd, GWLP_USERDATA, 0);
+ DesktopWindow* _this = (DesktopWindow*) GetWindowLongPtr(wnd, GWLP_USERDATA);
if (!_this) {
vlog.info("null _this in %x, message %u", wnd, msg);
return rfb::win32::SafeDefWindowProc(wnd, msg, wParam, lParam);
@@ -133,10 +134,10 @@
LRESULT CALLBACK FrameProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) {
LRESULT result = 0;
if (msg == WM_CREATE)
- SetWindowLong(wnd, GWL_USERDATA, (long)((CREATESTRUCT*)lParam)->lpCreateParams);
+ SetWindowLongPtr(wnd, GWLP_USERDATA, (LONG_PTR)((CREATESTRUCT*)lParam)->lpCreateParams);
else if (msg == WM_DESTROY)
- SetWindowLong(wnd, GWL_USERDATA, 0);
- DesktopWindow* _this = (DesktopWindow*) GetWindowLong(wnd, GWL_USERDATA);
+ SetWindowLongPtr(wnd, GWLP_USERDATA, 0);
+ DesktopWindow* _this = (DesktopWindow*) GetWindowLongPtr(wnd, GWLP_USERDATA);
if (!_this) {
vlog.info("null _this in %x, message %u", wnd, msg);
return rfb::win32::SafeDefWindowProc(wnd, msg, wParam, lParam);