[vlc-commits] Win64 fix: SetWindowLong -> SetWindowLongPtr

Rafaël Carré git at videolan.org
Sun Nov 6 19:06:06 CET 2011


npapi-vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun Nov  6 13:02:40 2011 -0500| [74289b84e14480949b23ac69907aba550827514a] | committer: Rafaël Carré

Win64 fix: SetWindowLong -> SetWindowLongPtr

http://msdn.microsoft.com/en-us/library/aa384242(v=vs.85).aspx

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=74289b84e14480949b23ac69907aba550827514a
---

 npapi/vlcshell.cpp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/npapi/vlcshell.cpp b/npapi/vlcshell.cpp
index ba61e50..5265ac4 100644
--- a/npapi/vlcshell.cpp
+++ b/npapi/vlcshell.cpp
@@ -328,7 +328,7 @@ NPError NPP_Destroy( NPP instance, NPSavedData** save )
     if( winproc )
     {
         /* reset WNDPROC */
-        SetWindowLong( win, GWL_WNDPROC, (LONG)winproc );
+        SetWindowLongPtr( win, GWLP_WNDPROC, (LONG_PTR)winproc );
     }
 #endif
 
@@ -429,15 +429,15 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
             if( oldproc )
             {
                 /* reset WNDPROC */
-                SetWindowLong( oldwin, GWL_WNDPROC, (LONG)oldproc );
+                SetWindowLongPtr( oldwin, GWLP_WNDPROC, (LONG_PTR)oldproc );
             }
             /* attach our plugin object */
             SetWindowLongPtr((HWND)drawable, GWLP_USERDATA,
                              reinterpret_cast<LONG_PTR>(p_plugin));
 
             /* install our WNDPROC */
-            p_plugin->setWindowProc( (WNDPROC)SetWindowLong( drawable,
-                                             GWL_WNDPROC, (LONG)Manage ) );
+            p_plugin->setWindowProc( (WNDPROC)SetWindowLongPtr( drawable,
+                                             GWLP_WNDPROC, (LONG_PTR)Manage ) );
 
             /* change window style to our liking */
             LONG style = GetWindowLong((HWND)drawable, GWL_STYLE);
@@ -456,7 +456,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     {
         /* reset WNDPROC */
         HWND oldwin = (HWND)curwin.window;
-        SetWindowLong( oldwin, GWL_WNDPROC, (LONG)(p_plugin->getWindowProc()) );
+        SetWindowLongPtr( oldwin, GWLP_WNDPROC, (LONG_PTR)(p_plugin->getWindowProc()) );
         p_plugin->setWindowProc(NULL);
 
         curwin.window = NULL;



More information about the vlc-commits mailing list