riched20: Fix some Win64 compiler warnings.

Michael Stefaniuc mstefani at redhat.de
Fri Feb 6 16:46:59 CST 2009


- A HWND can be safely marshaled over a LONG as its payload is not
  a pointer but a user handle.
- Use GetWindowLongPtr instead of GetWindowLong to retrieve a pointer.
---
 dlls/riched20/txthost.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c
index 5b52b9f..7fc0e5a 100644
--- a/dlls/riched20/txthost.c
+++ b/dlls/riched20/txthost.c
@@ -258,14 +258,14 @@ HRESULT WINAPI ITextHostImpl_TxActivate(ITextHost *iface,
                                         LONG *plOldState)
 {
     ITextHostImpl *This = (ITextHostImpl *)iface;
-    *plOldState = (LONG)SetActiveWindow(This->hWnd);
+    *plOldState = HandleToLong(SetActiveWindow(This->hWnd));
     return (*plOldState ? S_OK : E_FAIL);
 }
 
 HRESULT WINAPI ITextHostImpl_TxDeactivate(ITextHost *iface,
                                           LONG lNewState)
 {
-    HWND ret = SetActiveWindow((HWND)lNewState);
+    HWND ret = SetActiveWindow(LongToHandle(lNewState));
     return (ret ? S_OK : E_FAIL);
 }
 
@@ -323,7 +323,7 @@ HRESULT WINAPI ITextHostImpl_TxGetScrollBars(ITextHost *iface,
                                              DWORD *pdwScrollBar)
 {
     ITextHostImpl *This = (ITextHostImpl *)iface;
-    ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongW(This->hWnd, 0);
+    ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0);
     const DWORD mask = WS_VSCROLL|
                        WS_HSCROLL|
                        ES_AUTOVSCROLL|
-- 
1.6.1.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20090206/0b0ca686/attachment-0001.pgp 


More information about the wine-patches mailing list