[Libreoffice-commits] core.git: vcl/inc

David Ostrovsky david at ostrovsky.org
Sat Jan 10 13:36:59 PST 2015


 vcl/inc/win/saldata.hxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 28deec717c40e04c41f66b094fe2c1e969241525
Author: David Ostrovsky <david at ostrovsky.org>
Date:   Thu Jan 8 00:08:35 2015 +0100

    Fix user data pointer setting on x86_64 platform on windows
    
    Using 0 as index offset to set user data in window handle,
    is failing on x64 platform with:
    
    ERROR_INVALID_INDEX 1413 (0x585)
    
    To find it out GetLastError() can be used:
    
    SetLastError(0);
    LONG_PTR salFrameBack = SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pFrame);
    DWORD status = GetLastError();
    
    Switching to documented GWLP_USERDATA instead, solved the problem.
    
    Change-Id: I496ed2915e44309eaaaa4b576dca30b0051bdbfd
    Reviewed-on: https://gerrit.libreoffice.org/13807
    Reviewed-by: David Ostrovsky <david at ostrovsky.org>
    Tested-by: David Ostrovsky <david at ostrovsky.org>

diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index c850c7e..8151c14 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -200,12 +200,12 @@ OUString ImplSalGetUniString(const sal_Char* pStr, sal_Int32 nLen = -1);
 int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
 
 #define SAL_FRAME_WNDEXTRA          sizeof( DWORD )
-#define SAL_FRAME_THIS              0
+#define SAL_FRAME_THIS              GWLP_USERDATA
 #define SAL_FRAME_CLASSNAMEW        L"SALFRAME"
 #define SAL_SUBFRAME_CLASSNAMEW     L"SALSUBFRAME"
 #define SAL_TMPSUBFRAME_CLASSNAMEW  L"SALTMPSUBFRAME"
 #define SAL_OBJECT_WNDEXTRA         sizeof( DWORD )
-#define SAL_OBJECT_THIS             0
+#define SAL_OBJECT_THIS             GWLP_USERDATA
 #define SAL_OBJECT_CLASSNAMEA       "SALOBJECT"
 #define SAL_OBJECT_CHILDCLASSNAMEA  "SALOBJECTCHILD"
 #define SAL_COM_CLASSNAMEW          L"SALCOMWND"


More information about the Libreoffice-commits mailing list