This is an automated email from the ASF dual-hosted git repository.

leginee pushed a commit to branch bazel-migration
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 17240581f27210adc4cba99455529d84138ef27d
Author: Damjan Jovanovic <[email protected]>
AuthorDate: Mon Jan 20 18:20:18 2025 +0200

    Windows/amd64 compatibility fixes for winaccessibility.
    
    Patch by: me
    
    (cherry picked from commit 1a3e085a5d8dd98130f9986ce05a96232f54c559)
    (cherry picked from commit 7d7b15ea9ece615031b647073cdc3b788e91033e)
---
 .../com/sun/star/accessibility/XMSAAService.idl    |  4 +--
 main/vcl/source/app/svdata.cxx                     |  2 +-
 main/vcl/win/source/window/salframe.cxx            |  4 +--
 .../winaccessibility/inc/AccObjectManagerAgent.hxx |  6 ++--
 main/winaccessibility/inc/AccObjectWinManager.hxx  | 10 +++----
 main/winaccessibility/source/UAccCOM/AccAction.cpp |  4 +--
 main/winaccessibility/source/UAccCOM/AccAction.h   |  6 ++--
 .../source/UAccCOM/AccActionBase.cpp               |  2 +-
 .../source/UAccCOM/AccActionBase.h                 |  2 +-
 .../source/UAccCOM/AccComponent.cpp                |  2 +-
 .../winaccessibility/source/UAccCOM/AccComponent.h |  4 +--
 .../source/UAccCOM/AccComponentBase.cpp            |  2 +-
 .../source/UAccCOM/AccComponentBase.h              |  2 +-
 .../source/UAccCOM/AccEditableText.cpp             |  2 +-
 .../source/UAccCOM/AccEditableText.h               |  4 +--
 .../source/UAccCOM/AccHyperLink.cpp                |  4 +--
 .../winaccessibility/source/UAccCOM/AccHyperLink.h |  6 ++--
 .../source/UAccCOM/AccHypertext.cpp                |  4 +--
 .../winaccessibility/source/UAccCOM/AccHypertext.h |  4 +--
 main/winaccessibility/source/UAccCOM/AccImage.cpp  |  2 +-
 main/winaccessibility/source/UAccCOM/AccImage.h    |  4 +--
 .../source/UAccCOM/AccRelation.cpp                 |  4 +--
 main/winaccessibility/source/UAccCOM/AccRelation.h |  2 +-
 main/winaccessibility/source/UAccCOM/AccTable.cpp  | 12 ++++----
 main/winaccessibility/source/UAccCOM/AccTable.h    |  4 +--
 main/winaccessibility/source/UAccCOM/AccText.cpp   |  2 +-
 main/winaccessibility/source/UAccCOM/AccText.h     |  4 +--
 .../source/UAccCOM/AccTextBase.cpp                 |  2 +-
 main/winaccessibility/source/UAccCOM/AccTextBase.h |  2 +-
 main/winaccessibility/source/UAccCOM/AccValue.cpp  |  2 +-
 main/winaccessibility/source/UAccCOM/AccValue.h    |  4 +--
 .../source/UAccCOM/EnumVariant.cpp                 |  8 ++---
 main/winaccessibility/source/UAccCOM/EnumVariant.h |  2 +-
 .../source/UAccCOM/MAccessible.cpp                 | 34 +++++++++++-----------
 main/winaccessibility/source/UAccCOM/MAccessible.h | 12 ++++----
 main/winaccessibility/source/UAccCOM/UNOXWrapper.h | 10 +++----
 .../winaccessibility/source/UAccCOMIDL/UAccCOM.idl | 18 ++++++------
 .../source/service/AccEventListener.cxx            |  2 +-
 .../source/service/AccFrameEventListener.cxx       |  2 +-
 main/winaccessibility/source/service/AccObject.cxx |  8 ++---
 .../source/service/AccObjectManagerAgent.cxx       | 12 ++++----
 .../source/service/AccObjectWinManager.cxx         | 17 +++++------
 .../source/service/AccTopWindowListener.cxx        |  6 ++--
 .../source/service/msaaservice_impl.cxx            | 16 +++++-----
 44 files changed, 132 insertions(+), 133 deletions(-)

diff --git a/main/offapi/com/sun/star/accessibility/XMSAAService.idl 
b/main/offapi/com/sun/star/accessibility/XMSAAService.idl
index e1ad330715..4451594f6e 100644
--- a/main/offapi/com/sun/star/accessibility/XMSAAService.idl
+++ b/main/offapi/com/sun/star/accessibility/XMSAAService.idl
@@ -39,9 +39,9 @@ interface XMSAAService : ::com::sun::star::uno::XInterface
 
         @see AccessibleContext
        */
-    long getAccObjectPtr ([in] long hWnd, [in] long lParam, [in] long wParam);
+    hyper getAccObjectPtr ([in] hyper hWnd, [in] hyper lParam, [in] hyper 
wParam);
 
-    [oneway] void handleWindowOpened ([in] long i);
+    [oneway] void handleWindowOpened ([in] hyper i);
 };
 
 }; }; }; };
diff --git a/main/vcl/source/app/svdata.cxx b/main/vcl/source/app/svdata.cxx
index 534032cb70..6d26eab82f 100644
--- a/main/vcl/source/app/svdata.cxx
+++ b/main/vcl/source/app/svdata.cxx
@@ -412,7 +412,7 @@ void AccessBridgehandleExistingWindow(Window * pWindow, 
bool bShow)
 
                if ( xAccessible.is() && g_acc_manager1 )
                {
-                       g_acc_manager1->handleWindowOpened( 
(long)(xAccessible.get()));
+                       g_acc_manager1->handleWindowOpened( 
(sal_Int64)(xAccessible.get()));
                }
        }
 }
diff --git a/main/vcl/win/source/window/salframe.cxx 
b/main/vcl/win/source/window/salframe.cxx
index 703fd76bef..f89993b898 100644
--- a/main/vcl/win/source/window/salframe.cxx
+++ b/main/vcl/win/source/window/salframe.cxx
@@ -6226,11 +6226,11 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, 
WPARAM wParam, LPARAM lP
                                                        */
                                                        if ( (lParam == 
OBJID_CLIENT ) /* && !bSkipSetTitleClient */ )
                                                        {
-                                                               long RetResult 
= g_acc_manager1->getAccObjectPtr((long)hWnd, lParam, wParam);
+                                                               sal_Int64 
RetResult = g_acc_manager1->getAccObjectPtr((sal_Int64)hWnd, lParam, 
(sal_Int64)wParam);
                                                                if(RetResult != 
0)
                                                                {
                                                                        rDef = 
FALSE;
-                                                                       return 
(HRESULT)RetResult;
+                                                                       return 
(LRESULT)RetResult;
                                                                }
                                                        }
                                                }
diff --git a/main/winaccessibility/inc/AccObjectManagerAgent.hxx 
b/main/winaccessibility/inc/AccObjectManagerAgent.hxx
index 8ea55c728e..87478f72c4 100644
--- a/main/winaccessibility/inc/AccObjectManagerAgent.hxx
+++ b/main/winaccessibility/inc/AccObjectManagerAgent.hxx
@@ -48,7 +48,7 @@ public:
 
     virtual unsigned char InsertAccObj( 
com::sun::star::accessibility::XAccessible* pXAcc,
                                         
com::sun::star::accessibility::XAccessible* pParentXAcc,
-                                        long pWnd=0);
+                                        void* pWnd=0);
     virtual void GetIAccessibleFromResID(long childID,IMAccessible**);
     virtual unsigned char 
GetIAccessibleFromXAccessible(com::sun::star::accessibility::XAccessible* 
pXAcc, IAccessible** ppIA);
 
@@ -58,7 +58,7 @@ public:
     unsigned char NotifyAccEvent( short pEvent = 0, 
com::sun::star::accessibility::XAccessible* pXAcc = 0 );
 
     unsigned char InsertChildrenAccObj( 
com::sun::star::accessibility::XAccessible* pXAcc,
-                                        long pWnd=0);
+                                        void* pWnd=0);
     void DeleteChildrenAccObj( com::sun::star::accessibility::XAccessible* 
pXAcc );
 
     void  DecreaseState( com::sun::star::accessibility::XAccessible* 
pXAcc,unsigned short pState );
@@ -85,7 +85,7 @@ public:
     short GetParentRole(com::sun::star::accessibility::XAccessible* pXAcc );
     unsigned short IsContainer(com::sun::star::accessibility::XAccessible* 
pXAcc);
 
-    void SaveTopWindowHandle(long hWnd, 
com::sun::star::accessibility::XAccessible* pXAcc);
+    void SaveTopWindowHandle(void* hwnd, 
com::sun::star::accessibility::XAccessible* pXAcc);
 
     void UpdateChildState(com::sun::star::accessibility::XAccessible* pXAcc);
 
diff --git a/main/winaccessibility/inc/AccObjectWinManager.hxx 
b/main/winaccessibility/inc/AccObjectWinManager.hxx
index 824e738feb..5f173473a9 100644
--- a/main/winaccessibility/inc/AccObjectWinManager.hxx
+++ b/main/winaccessibility/inc/AccObjectWinManager.hxx
@@ -54,14 +54,14 @@ private:
     {
         bool operator()(const void*  s1, const void*  s2) const
         {
-            return long(s1)<long(s2);
+            return LONG_PTR(s1)<LONG_PTR(s2);
         }
     };
     struct ltstr2
     {
         bool operator()(const HWND  s1, const HWND  s2) const
         {
-            return long(s1)<long(s2);
+            return LONG_PTR(s1)<LONG_PTR(s2);
         }
     };
     struct ltstr3
@@ -75,7 +75,7 @@ private:
     typedef std::map< HWND,void*,ltstr2 > XHWNDToXAccHash;
     typedef std::map< const long, AccObject*,ltstr3 > XResIdToAccObjHash;
 
-    typedef std::map< const long, 
com::sun::star::accessibility::XAccessible*,ltstr3 > XHWNDToDocumentHash;
+    typedef std::map< HWND, com::sun::star::accessibility::XAccessible*,ltstr2 
> XHWNDToDocumentHash;
 
 
     //XAccessible to AccObject
@@ -109,7 +109,7 @@ private:
 
     AccObject* GetTopWindowAccObj(HWND hWnd);
 
-    com::sun::star::accessibility::XAccessible* GetAccDocByHWND( long pWnd );
+    com::sun::star::accessibility::XAccessible* GetAccDocByHWND( HWND pWnd );
 
     void       DeleteAccListener( AccObject* pAccObj );
     void       InsertAccChildNode(AccObject* pCurObj,AccObject* 
pParentObj,HWND pWnd);
@@ -129,7 +129,7 @@ public:
 
     sal_Bool NotifyAccEvent( com::sun::star::accessibility::XAccessible* 
pXAcc,short state = 0 );
 
-    long Get_ToATInterface( HWND hWnd, long lParam, long wParam);
+    LRESULT Get_ToATInterface( HWND hWnd, LPARAM lParam, WPARAM wParam);
 
     void  DecreaseState( com::sun::star::accessibility::XAccessible* 
pXAcc,unsigned short pState );
     void  IncreaseState( com::sun::star::accessibility::XAccessible* 
pXAcc,unsigned short pState );
diff --git a/main/winaccessibility/source/UAccCOM/AccAction.cpp 
b/main/winaccessibility/source/UAccCOM/AccAction.cpp
index 9c5bf54f96..c2d779aec6 100644
--- a/main/winaccessibility/source/UAccCOM/AccAction.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccAction.cpp
@@ -100,7 +100,7 @@ STDMETHODIMP CAccAction::get_keyBinding(
  *
  * @param    pXInterface    the pointer of UNO interface.
  */
-STDMETHODIMP CAccAction::put_XInterface(long pXInterface)
+STDMETHODIMP CAccAction::put_XInterface(LONG_PTR pXInterface)
 {
 
     return CAccActionBase::put_XInterface(pXInterface);
@@ -110,7 +110,7 @@ STDMETHODIMP CAccAction::put_XInterface(long pXInterface)
    * @param pXSubInterface XAccessibleHyperlink interface.
    * @return Result.
 */
-STDMETHODIMP CAccAction::put_XSubInterface(long pXSubInterface)
+STDMETHODIMP CAccAction::put_XSubInterface(LONG_PTR pXSubInterface)
 {
 
 
diff --git a/main/winaccessibility/source/UAccCOM/AccAction.h 
b/main/winaccessibility/source/UAccCOM/AccAction.h
index 01488b1dfb..bfdea0d457 100644
--- a/main/winaccessibility/source/UAccCOM/AccAction.h
+++ b/main/winaccessibility/source/UAccCOM/AccAction.h
@@ -53,7 +53,7 @@ public:
     END_COM_MAP()
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CAccAction*)pv)->SmartQI(iid,ppvObject);
     }
@@ -95,10 +95,10 @@ public:
         /* [retval][out] */ long __RPC_FAR *nBinding);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XSubInterface)(long pXSubInterface);
+    STDMETHOD(put_XSubInterface)(LONG_PTR pXSubInterface);
 
 };
 
diff --git a/main/winaccessibility/source/UAccCOM/AccActionBase.cpp 
b/main/winaccessibility/source/UAccCOM/AccActionBase.cpp
index 372366758b..eae11e6dc6 100644
--- a/main/winaccessibility/source/UAccCOM/AccActionBase.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccActionBase.cpp
@@ -250,7 +250,7 @@ STDMETHODIMP CAccActionBase::get_keyBinding(
  *
  * @param    pXInterface    the pointer of UNO interface.
  */
-STDMETHODIMP CAccActionBase::put_XInterface(long pXInterface)
+STDMETHODIMP CAccActionBase::put_XInterface(LONG_PTR pXInterface)
 {
 
 
diff --git a/main/winaccessibility/source/UAccCOM/AccActionBase.h 
b/main/winaccessibility/source/UAccCOM/AccActionBase.h
index 349bd49ad6..ca03bb2687 100644
--- a/main/winaccessibility/source/UAccCOM/AccActionBase.h
+++ b/main/winaccessibility/source/UAccCOM/AccActionBase.h
@@ -72,7 +72,7 @@ public:
         /* [retval][out] */ long __RPC_FAR *nBinding);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
     static void GetkeyBindingStrByXkeyBinding( const 
com::sun::star::uno::Sequence< com::sun::star::awt::KeyStroke > &keySet, 
OLECHAR* pString );
 
diff --git a/main/winaccessibility/source/UAccCOM/AccComponent.cpp 
b/main/winaccessibility/source/UAccCOM/AccComponent.cpp
index b209ea5006..3b78c1d856 100644
--- a/main/winaccessibility/source/UAccCOM/AccComponent.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccComponent.cpp
@@ -65,7 +65,7 @@ STDMETHODIMP CAccComponent::get_background(IA2Color * 
background)
  *
  * @param    pXInterface    the pointer of UNO interface.
  */
-STDMETHODIMP CAccComponent::put_XInterface(long pXInterface)
+STDMETHODIMP CAccComponent::put_XInterface(LONG_PTR pXInterface)
 {
 
     return CAccComponentBase::put_XInterface(pXInterface);
diff --git a/main/winaccessibility/source/UAccCOM/AccComponent.h 
b/main/winaccessibility/source/UAccCOM/AccComponent.h
index 6544bbf273..b8204c4011 100644
--- a/main/winaccessibility/source/UAccCOM/AccComponent.h
+++ b/main/winaccessibility/source/UAccCOM/AccComponent.h
@@ -61,7 +61,7 @@ public:
     END_COM_MAP()
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CAccComponent*)pv)->SmartQI(iid,ppvObject);
     }
@@ -90,7 +90,7 @@ public:
     STDMETHOD(get_background)(IA2Color * background);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
 };
 
diff --git a/main/winaccessibility/source/UAccCOM/AccComponentBase.cpp 
b/main/winaccessibility/source/UAccCOM/AccComponentBase.cpp
index 657fe1096b..86d1d7733d 100644
--- a/main/winaccessibility/source/UAccCOM/AccComponentBase.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccComponentBase.cpp
@@ -185,7 +185,7 @@ STDMETHODIMP CAccComponentBase::get_background(IA2Color * 
background)
  *
  * @param    pXInterface    the pointer of UNO interface.
  */
-STDMETHODIMP CAccComponentBase::put_XInterface(long pXInterface)
+STDMETHODIMP CAccComponentBase::put_XInterface(LONG_PTR pXInterface)
 {
 
        CHECK_ENABLE_INF
diff --git a/main/winaccessibility/source/UAccCOM/AccComponentBase.h 
b/main/winaccessibility/source/UAccCOM/AccComponentBase.h
index 6eed5782be..ac592a707e 100644
--- a/main/winaccessibility/source/UAccCOM/AccComponentBase.h
+++ b/main/winaccessibility/source/UAccCOM/AccComponentBase.h
@@ -63,7 +63,7 @@ public:
     STDMETHOD(get_background)(IA2Color * background);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
 protected:
 
diff --git a/main/winaccessibility/source/UAccCOM/AccEditableText.cpp 
b/main/winaccessibility/source/UAccCOM/AccEditableText.cpp
index 20af75947b..909e799997 100644
--- a/main/winaccessibility/source/UAccCOM/AccEditableText.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccEditableText.cpp
@@ -482,7 +482,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const 
::rtl::OUString &ouName, const :
  *
  * @param    pXInterface    the pointer of UNO interface.
  */
-STDMETHODIMP CAccEditableText::put_XInterface(long pXInterface)
+STDMETHODIMP CAccEditableText::put_XInterface(LONG_PTR pXInterface)
 {
 
 
diff --git a/main/winaccessibility/source/UAccCOM/AccEditableText.h 
b/main/winaccessibility/source/UAccCOM/AccEditableText.h
index 8542a740a5..63c57b24c5 100644
--- a/main/winaccessibility/source/UAccCOM/AccEditableText.h
+++ b/main/winaccessibility/source/UAccCOM/AccEditableText.h
@@ -57,7 +57,7 @@ public:
     END_COM_MAP()
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CAccEditableText*)pv)->SmartQI(iid,ppvObject);
     }
@@ -98,7 +98,7 @@ public:
     STDMETHOD(setAttributes)(long startOffset, long endOffset, BSTR * 
attributes);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
 private:
 
diff --git a/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp 
b/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp
index f077ab9da4..933df99aa4 100644
--- a/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp
@@ -250,7 +250,7 @@ STDMETHODIMP CAccHyperLink::get_valid(/* [retval][out] */ 
boolean __RPC_FAR *val
    * @param pXInterface XAccessibleContext interface.
    * @return Result.
 */
-STDMETHODIMP CAccHyperLink::put_XInterface(long pXInterface)
+STDMETHODIMP CAccHyperLink::put_XInterface(LONG_PTR pXInterface)
 {
 
        CHECK_ENABLE_INF
@@ -284,7 +284,7 @@ STDMETHODIMP CAccHyperLink::put_XInterface(long pXInterface)
    * @param pXSubInterface XAccessibleHyperlink interface.
    * @return Result.
 */
-STDMETHODIMP CAccHyperLink::put_XSubInterface(long pXSubInterface)
+STDMETHODIMP CAccHyperLink::put_XSubInterface(LONG_PTR pXSubInterface)
 {
 
        CHECK_ENABLE_INF
diff --git a/main/winaccessibility/source/UAccCOM/AccHyperLink.h 
b/main/winaccessibility/source/UAccCOM/AccHyperLink.h
index 56415c225c..f6b09f5873 100644
--- a/main/winaccessibility/source/UAccCOM/AccHyperLink.h
+++ b/main/winaccessibility/source/UAccCOM/AccHyperLink.h
@@ -59,7 +59,7 @@ public:
     DECLARE_REGISTRY_RESOURCEID(IDR_AccHyperLink)
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CAccHyperLink*)pv)->SmartQI(iid,ppvObject);
     }
@@ -121,10 +121,10 @@ public:
     STDMETHOD(get_valid)(/* [retval][out] */ boolean __RPC_FAR *valid);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XSubInterface)(long pXSubInterface);
+    STDMETHOD(put_XSubInterface)(LONG_PTR pXSubInterface);
 
 private:
 
diff --git a/main/winaccessibility/source/UAccCOM/AccHypertext.cpp 
b/main/winaccessibility/source/UAccCOM/AccHypertext.cpp
index 1baa0ed626..ca3b3231f7 100644
--- a/main/winaccessibility/source/UAccCOM/AccHypertext.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccHypertext.cpp
@@ -338,7 +338,7 @@ STDMETHODIMP CAccHypertext::get_hyperlink(long 
index,IAccessibleHyperlink **hype
         plink->QueryInterface(IID_IUNOXWrapper, (void**)&wrapper);
         if(wrapper)
         {
-            wrapper->put_XSubInterface((long)pRLink.get()/*pXI*/);
+            wrapper->put_XSubInterface((LONG_PTR)pRLink.get()/*pXI*/);
             wrapper->Release();
         }
         *hyperlink = plink;
@@ -383,7 +383,7 @@ STDMETHODIMP CAccHypertext::get_hyperlinkIndex(long 
charIndex, long *hyperlinkIn
    * @param pXInterface UNO interface.
    * @return Result.
 */
-STDMETHODIMP CAccHypertext::put_XInterface(long pXInterface)
+STDMETHODIMP CAccHypertext::put_XInterface(LONG_PTR pXInterface)
 {
 
 
diff --git a/main/winaccessibility/source/UAccCOM/AccHypertext.h 
b/main/winaccessibility/source/UAccCOM/AccHypertext.h
index 5a817d20f4..7f93335685 100644
--- a/main/winaccessibility/source/UAccCOM/AccHypertext.h
+++ b/main/winaccessibility/source/UAccCOM/AccHypertext.h
@@ -58,7 +58,7 @@ public:
     END_COM_MAP()
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CAccHypertext*)pv)->SmartQI(iid,ppvObject);
     }
@@ -150,7 +150,7 @@ public:
     STDMETHOD(get_hyperlinkIndex)(long charIndex, long *hyperlinkIndex);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
 private:
 
diff --git a/main/winaccessibility/source/UAccCOM/AccImage.cpp 
b/main/winaccessibility/source/UAccCOM/AccImage.cpp
index b8c065ab74..079ebf2d29 100644
--- a/main/winaccessibility/source/UAccCOM/AccImage.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccImage.cpp
@@ -75,7 +75,7 @@ STDMETHODIMP CAccImage::get_imageSize(
    * @param pXInterface UNO interface.
    * @return Result.
 */
-STDMETHODIMP CAccImage::put_XInterface(long pXInterface)
+STDMETHODIMP CAccImage::put_XInterface(LONG_PTR pXInterface)
 {
 
 
diff --git a/main/winaccessibility/source/UAccCOM/AccImage.h 
b/main/winaccessibility/source/UAccCOM/AccImage.h
index 41921f9480..3c9a23336f 100644
--- a/main/winaccessibility/source/UAccCOM/AccImage.h
+++ b/main/winaccessibility/source/UAccCOM/AccImage.h
@@ -56,7 +56,7 @@ public:
     END_COM_MAP()
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CAccImage*)pv)->SmartQI(iid,ppvObject);
     }
@@ -86,7 +86,7 @@ public:
         long __RPC_FAR *width);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
 private:
 
diff --git a/main/winaccessibility/source/UAccCOM/AccRelation.cpp 
b/main/winaccessibility/source/UAccCOM/AccRelation.cpp
index 04cb266fe8..94a7e485f2 100644
--- a/main/winaccessibility/source/UAccCOM/AccRelation.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccRelation.cpp
@@ -111,7 +111,7 @@ STDMETHODIMP CAccRelation::get_target(long targetIndex, 
IUnknown * * target)
     Reference<XInterface> pRAcc = xTargets[targetIndex];
     IAccessible* pRet = NULL;
 
-    BOOL isGet = 
CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet);
+    BOOL isGet = 
CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRAcc.get(),&pRet);
     if(isGet)
     {
         *target = /*(IAccessible2 *)*/(IUnknown*)pRet;
@@ -174,7 +174,7 @@ STDMETHODIMP CAccRelation::get_targets(long, IUnknown * * 
target, long * nTarget
    * @param pXSubInterface AccessibleRelation pointer.
    * @return Result.
 */
-STDMETHODIMP CAccRelation::put_XSubInterface(long pXSubInterface)
+STDMETHODIMP CAccRelation::put_XSubInterface(LONG_PTR pXSubInterface)
 {
 
     relation = *((AccessibleRelation*)pXSubInterface);
diff --git a/main/winaccessibility/source/UAccCOM/AccRelation.h 
b/main/winaccessibility/source/UAccCOM/AccRelation.h
index a7903f7dc5..b8a1dce010 100644
--- a/main/winaccessibility/source/UAccCOM/AccRelation.h
+++ b/main/winaccessibility/source/UAccCOM/AccRelation.h
@@ -75,7 +75,7 @@ public:
     STDMETHOD(get_targets)(long maxTargets, IUnknown * * target, long * 
nTargets);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XSubInterface)(long pXSubInterface);
+    STDMETHOD(put_XSubInterface)(LONG_PTR pXSubInterface);
 
     //static OLECHAR* getRelationTypeOLECHAR(int type);
     static BSTR getRelationTypeBSTR(int type);
diff --git a/main/winaccessibility/source/UAccCOM/AccTable.cpp 
b/main/winaccessibility/source/UAccCOM/AccTable.cpp
index 9dd13b1e47..3da76a732d 100644
--- a/main/winaccessibility/source/UAccCOM/AccTable.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccTable.cpp
@@ -68,7 +68,7 @@ STDMETHODIMP CAccTable::get_accessibleAt(long row, long 
column, IUnknown * * acc
 
     IAccessible* pRet = NULL;
 
-    BOOL isTRUE = 
CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet);
+    BOOL isTRUE = 
CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRAcc.get(),&pRet);
     if(isTRUE)
     {
         *accessible = (IAccessible2 *)pRet;
@@ -80,7 +80,7 @@ STDMETHODIMP CAccTable::get_accessibleAt(long row, long 
column, IUnknown * * acc
         Reference<XAccessible> pxTable(GetXInterface(),UNO_QUERY);
 
         CMAccessible::g_pAgent->InsertAccObj(pRAcc.get(),pxTable.get());
-        isTRUE = 
CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet);
+        isTRUE = 
CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRAcc.get(),&pRet);
 
         if(isTRUE)
         {
@@ -222,7 +222,7 @@ STDMETHODIMP CAccTable::get_columnHeader(IAccessibleTable 
__RPC_FAR *__RPC_FAR *
                                     (void **)&m_pIMacc
                                   );
        DeactivateActContext();
-    ((CMAccessible*)m_pIMacc)->SetXAccessible((long)pRXColumnHeader.get());
+    ((CMAccessible*)m_pIMacc)->SetXAccessible((LONG_PTR)pRXColumnHeader.get());
     m_pIMacc->QueryInterface(IID_IAccessibleTable,(void **)accessibleTable);
     if( SUCCEEDED(hr) )
     {
@@ -454,7 +454,7 @@ STDMETHODIMP CAccTable::get_rowHeader(IAccessibleTable 
__RPC_FAR *__RPC_FAR *acc
                                     (void **)&m_pIMacc
                                   );
        DeactivateActContext();
-    ((CMAccessible*)m_pIMacc)->SetXAccessible((long)pRXRowHeader.get());
+    ((CMAccessible*)m_pIMacc)->SetXAccessible((LONG_PTR)pRXRowHeader.get());
     m_pIMacc->QueryInterface(IID_IAccessibleTable,(void **)accessibleTable);
     if( SUCCEEDED(hr) )
     {
@@ -570,7 +570,7 @@ STDMETHODIMP CAccTable::get_summary(IUnknown * * accessible)
     Reference<XAccessible> pRAcc = GetXInterface()->getAccessibleSummary();
 
     IAccessible* pRet = NULL;
-    BOOL isTRUE = 
CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet);
+    BOOL isTRUE = 
CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRAcc.get(),&pRet);
 
     if(pRet)
     {
@@ -863,7 +863,7 @@ STDMETHODIMP CAccTable::unselectColumn(long column)
  *
  * @param    pXInterface    the pointer of UNO interface.
  */
-STDMETHODIMP CAccTable::put_XInterface(long pXInterface)
+STDMETHODIMP CAccTable::put_XInterface(LONG_PTR pXInterface)
 {
 
        CHECK_ENABLE_INF
diff --git a/main/winaccessibility/source/UAccCOM/AccTable.h 
b/main/winaccessibility/source/UAccCOM/AccTable.h
index 245c547205..43a45a940d 100644
--- a/main/winaccessibility/source/UAccCOM/AccTable.h
+++ b/main/winaccessibility/source/UAccCOM/AccTable.h
@@ -53,7 +53,7 @@ public:
     END_COM_MAP()
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CAccTable*)pv)->SmartQI(iid,ppvObject);
     }
@@ -160,7 +160,7 @@ public:
     STDMETHOD(get_modelChange)(IA2TableModelChange  *modelChange);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
 private:
 
diff --git a/main/winaccessibility/source/UAccCOM/AccText.cpp 
b/main/winaccessibility/source/UAccCOM/AccText.cpp
index d22e7cdca1..c8adc397ef 100644
--- a/main/winaccessibility/source/UAccCOM/AccText.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccText.cpp
@@ -274,7 +274,7 @@ STDMETHODIMP CAccText::scrollSubstringTo(long startIndex, 
long endIndex,enum IA2
    * @param pXInterface UNO interface.
    * @return Result.
 */
-STDMETHODIMP CAccText::put_XInterface(long pXInterface)
+STDMETHODIMP CAccText::put_XInterface(LONG_PTR pXInterface)
 {
 
     return CAccTextBase::put_XInterface(pXInterface);
diff --git a/main/winaccessibility/source/UAccCOM/AccText.h 
b/main/winaccessibility/source/UAccCOM/AccText.h
index 7eb1c33f50..7fa574b178 100644
--- a/main/winaccessibility/source/UAccCOM/AccText.h
+++ b/main/winaccessibility/source/UAccCOM/AccText.h
@@ -54,7 +54,7 @@ public:
     END_COM_MAP()
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CAccText*)pv)->SmartQI(iid,ppvObject);
     }
@@ -133,7 +133,7 @@ public:
     STDMETHOD(get_oldText)( IA2TextSegment *oldText);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
 };
 
diff --git a/main/winaccessibility/source/UAccCOM/AccTextBase.cpp 
b/main/winaccessibility/source/UAccCOM/AccTextBase.cpp
index 2f1843c719..dc6204efea 100644
--- a/main/winaccessibility/source/UAccCOM/AccTextBase.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccTextBase.cpp
@@ -943,7 +943,7 @@ STDMETHODIMP CAccTextBase::scrollSubstringTo(long, long, 
IA2ScrollType)
    * @param pXInterface UNO interface.
    * @return Result.
 */
-STDMETHODIMP CAccTextBase::put_XInterface(long pXInterface)
+STDMETHODIMP CAccTextBase::put_XInterface(LONG_PTR pXInterface)
 {
 
        CHECK_ENABLE_INF
diff --git a/main/winaccessibility/source/UAccCOM/AccTextBase.h 
b/main/winaccessibility/source/UAccCOM/AccTextBase.h
index 3e22ba013e..e33343067e 100644
--- a/main/winaccessibility/source/UAccCOM/AccTextBase.h
+++ b/main/winaccessibility/source/UAccCOM/AccTextBase.h
@@ -107,7 +107,7 @@ public:
     STDMETHOD(scrollSubstringToPoint)(long startIndex, long endIndex,enum 
IA2CoordinateType coordinateType, long x, long y );
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
 private:
 
diff --git a/main/winaccessibility/source/UAccCOM/AccValue.cpp 
b/main/winaccessibility/source/UAccCOM/AccValue.cpp
index 48e759a372..09fd5e93e7 100644
--- a/main/winaccessibility/source/UAccCOM/AccValue.cpp
+++ b/main/winaccessibility/source/UAccCOM/AccValue.cpp
@@ -198,7 +198,7 @@ STDMETHODIMP CAccValue::get_minimumValue(VARIANT 
*mininumValue)
    * @param  pXInterface UNO interface.
    * @return Result.
    */
-STDMETHODIMP CAccValue::put_XInterface(long pXInterface)
+STDMETHODIMP CAccValue::put_XInterface(LONG_PTR pXInterface)
 {
 
 
diff --git a/main/winaccessibility/source/UAccCOM/AccValue.h 
b/main/winaccessibility/source/UAccCOM/AccValue.h
index 674f1e70d1..334c3465c7 100644
--- a/main/winaccessibility/source/UAccCOM/AccValue.h
+++ b/main/winaccessibility/source/UAccCOM/AccValue.h
@@ -57,7 +57,7 @@ public:
     END_COM_MAP()
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CAccValue*)pv)->SmartQI(iid,ppvObject);
     }
@@ -88,7 +88,7 @@ public:
     STDMETHOD(get_minimumValue)(VARIANT *mininumValue);
 
     // Overide of IUNOXWrapper.
-    STDMETHOD(put_XInterface)(long pXInterface);
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface);
 
 private:
 
diff --git a/main/winaccessibility/source/UAccCOM/EnumVariant.cpp 
b/main/winaccessibility/source/UAccCOM/EnumVariant.cpp
index d13b18cdb0..f6a9e101fa 100644
--- a/main/winaccessibility/source/UAccCOM/EnumVariant.cpp
+++ b/main/winaccessibility/source/UAccCOM/EnumVariant.cpp
@@ -56,7 +56,7 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG 
cElements,VARIANT __RPC_FAR *
     {
         Reference< XAccessible > pRXAcc = 
m_pXAccessibleSelection->getSelectedAccessibleChild(l1);
         IAccessible* pChild = NULL;
-        BOOL isGet = 
CMAccessible::get_IAccessibleFromXAccessible((long)pRXAcc.get(),&pChild);
+        BOOL isGet = 
CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRXAcc.get(),&pChild);
         if(isGet)
         {
             pvar[l2].vt = VT_I4;
@@ -66,7 +66,7 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG 
cElements,VARIANT __RPC_FAR *
         {
             if(CMAccessible::g_pAgent)
                 
CMAccessible::g_pAgent->InsertAccObj(pRXAcc.get(),pUNOInterface,NULL);
-            BOOL isGet = 
CMAccessible::get_IAccessibleFromXAccessible((long)pRXAcc.get(),&pChild);
+            BOOL isGet = 
CMAccessible::get_IAccessibleFromXAccessible((LONG_PTR)pRXAcc.get(),&pChild);
             if(isGet)
             {
                 pvar[l2].vt = VT_I4;
@@ -133,7 +133,7 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Clone(IEnumVARIANT 
__RPC_FAR *__RPC_FAR
     hr = Create(&penum);
     if( hr == S_OK )
     {
-        penum->PutSelection((long)pUNOInterface);
+        penum->PutSelection((LONG_PTR)pUNOInterface);
         *ppenum = penum;
     }
     else
@@ -219,7 +219,7 @@ static Reference<XAccessibleSelection> 
GetXAccessibleSelection(XAccessible* pXAc
    * @param pXSelection XAccessible interface.
    * @return Result..
    */
-STDMETHODIMP CEnumVariant::PutSelection(long pXSelection)
+STDMETHODIMP CEnumVariant::PutSelection(LONG_PTR pXSelection)
 {
     pUNOInterface = (XAccessible*)pXSelection;
     m_pXAccessibleSelection = GetXAccessibleSelection(pUNOInterface);
diff --git a/main/winaccessibility/source/UAccCOM/EnumVariant.h 
b/main/winaccessibility/source/UAccCOM/EnumVariant.h
index 067fe50ab6..f49c2f785c 100644
--- a/main/winaccessibility/source/UAccCOM/EnumVariant.h
+++ b/main/winaccessibility/source/UAccCOM/EnumVariant.h
@@ -87,7 +87,7 @@ public:
     // IEnumVariant
 
     //
-    HRESULT STDMETHODCALLTYPE PutSelection(long pXSelection);
+    HRESULT STDMETHODCALLTYPE PutSelection(LONG_PTR pXSelection);
 
     //
     static HRESULT STDMETHODCALLTYPE Create(CEnumVariant __RPC_FAR *__RPC_FAR 
*ppenum);
diff --git a/main/winaccessibility/source/UAccCOM/MAccessible.cpp 
b/main/winaccessibility/source/UAccCOM/MAccessible.cpp
index ee0029b696..6c398c350f 100644
--- a/main/winaccessibility/source/UAccCOM/MAccessible.cpp
+++ b/main/winaccessibility/source/UAccCOM/MAccessible.cpp
@@ -1338,7 +1338,7 @@ STDMETHODIMP CMAccessible::Put_XAccChildID(long dChildID)
 * @param       pAgent, the AccObjectManagerAgent point.
 * @return   S_OK if successful and E_FAIL if failure.
 */
-STDMETHODIMP CMAccessible::Put_XAccAgent(long pAgent)
+STDMETHODIMP CMAccessible::Put_XAccAgent(LONG_PTR pAgent)
 {
        g_pAgent = (AccObjectManagerAgent*)pAgent;
        return S_OK;
@@ -1393,12 +1393,12 @@ IMAccessible* CMAccessible::GetChildInterface(long 
dChildID)//for test
 
                IAccessible* pChild = NULL;
                Reference< XAccessible > pXChild = 
pRContext->getAccessibleChild(dChildID-1);
-               BOOL isGet = 
get_IAccessibleFromXAccessible((long)pXChild.get(),&pChild);
+               BOOL isGet = 
get_IAccessibleFromXAccessible((LONG_PTR)pXChild.get(),&pChild);
 
                if(!isGet)
                {
-                       
g_pAgent->InsertAccObj(pXChild.get(),pUNOInterface,(long)m_hwnd);
-                       isGet = 
get_IAccessibleFromXAccessible((long)pXChild.get(),&pChild);
+                       
g_pAgent->InsertAccObj(pXChild.get(),pUNOInterface,m_hwnd);
+                       isGet = 
get_IAccessibleFromXAccessible((LONG_PTR)pXChild.get(),&pChild);
                }
 
                if(isGet)
@@ -1463,7 +1463,7 @@ IMAccessible* CMAccessible::GetNavigateChildForDM(VARIANT 
varCur, short flags)
                {
                        return NULL;
                }
-               pCurChild->GetUNOInterface((long*)&pChildXAcc);
+               pCurChild->GetUNOInterface((LONG_PTR*)&pChildXAcc);
                if(pChildXAcc==NULL)
                {
                        return NULL;
@@ -1732,7 +1732,7 @@ STDMETHODIMP CMAccessible::get_relation( long 
relationIndex, IAccessibleRelation
                                if(SUCCEEDED(hr))
                                {
                                        AccessibleRelation accRelation = 
pRrelationSet->getRelation(relationIndex);
-                                       
wrapper->put_XSubInterface((long)&accRelation);
+                                       
wrapper->put_XSubInterface((LONG_PTR)&accRelation);
                                        wrapper->Release();
                                        *relation = pRelation;
                                        return S_OK;
@@ -1795,7 +1795,7 @@ STDMETHODIMP CMAccessible::get_relations( long, 
IAccessibleRelation __RPC_FAR *_
                                if(SUCCEEDED(hr))
                                {
                                        AccessibleRelation accRelation = 
pRrelationSet->getRelation(i);
-                                       
wrapper->put_XSubInterface((long)&accRelation);
+                                       
wrapper->put_XSubInterface((LONG_PTR)&accRelation);
                                        wrapper->Release();
                                }
                                (relation)[i] = pRelation;
@@ -2273,11 +2273,11 @@ HRESULT CMAccessible::DeSelectMultipleChildren( 
XAccessible** pItem,int size )
 * @param       pXAcc, the XAccessible object of current object.
 * @return  S_OK if successful.
 */
-STDMETHODIMP CMAccessible::SetXAccessible(long pXAcc)
+STDMETHODIMP CMAccessible::SetXAccessible(LONG_PTR pXAcc)
 {
        pUNOInterface = (XAccessible*)pXAcc;
        pRef = pUNOInterface;
-       m_pEnumVar->PutSelection(/*XAccessibleSelection*/(long)pUNOInterface);
+       
m_pEnumVar->PutSelection(/*XAccessibleSelection*/(LONG_PTR)pUNOInterface);
 
        pRContext = pUNOInterface->getAccessibleContext();
        pRContextInterface = (XAccessibleContext*)pRContext.is();
@@ -2332,7 +2332,7 @@ STDMETHODIMP CMAccessible::accSelect(long flagsSelect, 
VARIANT varChild)
 
        if( flagsSelect&SELFLAG_TAKEFOCUS )
        {
-               long pTempUNO = 0;
+               LONG_PTR pTempUNO = 0;
                pSelectAcc->GetUNOInterface( &pTempUNO);
 
                if( pTempUNO == NULL )
@@ -2388,13 +2388,13 @@ STDMETHODIMP CMAccessible::accSelect(long flagsSelect, 
VARIANT varChild)
 * @param pXAcc, [in, out] the Uno interface of the current object.
 * @return S_OK if successful.
 */
-STDMETHODIMP CMAccessible::GetUNOInterface(long* pXAcc)
+STDMETHODIMP CMAccessible::GetUNOInterface(LONG_PTR* pXAcc)
 {
        // #CHECK#
        if(pXAcc == NULL)
                return E_INVALIDARG;
 
-       *pXAcc = (long)pUNOInterface;
+       *pXAcc = (LONG_PTR)pUNOInterface;
        return S_OK;
 }
 
@@ -2403,7 +2403,7 @@ STDMETHODIMP CMAccessible::GetUNOInterface(long* pXAcc)
 * @param pAction, the default action point of the current object.
 * @return S_OK if successful.
 */
-STDMETHODIMP CMAccessible::SetDefaultAction(long pAction)
+STDMETHODIMP CMAccessible::SetDefaultAction(LONG_PTR pAction)
 {
        m_pXAction = (XAccessibleAction*)pAction;
        return S_OK;
@@ -2595,7 +2595,7 @@ HRESULT WINAPI CMAccessible::SmartQI(void* pv, REFIID 
iid, void** ppvObject)
                                        
((IUnknown*)*ppvObject)->QueryInterface(IID_IUNOXWrapper, (void**)&wrapper);
                                        if(wrapper)
                                        {
-                                               
wrapper->put_XInterface((long)pUNOInterface);
+                                               
wrapper->put_XInterface((LONG_PTR)pUNOInterface);
                                                wrapper->Release();
                                        }
                                        return S_OK;
@@ -2610,7 +2610,7 @@ HRESULT WINAPI CMAccessible::SmartQI(void* pv, REFIID 
iid, void** ppvObject)
        LEAVE_PROTECTED_BLOCK
 }
 
-BOOL CMAccessible::get_IAccessibleFromXAccessible(long pXAcc, IAccessible 
**ppIA)
+BOOL CMAccessible::get_IAccessibleFromXAccessible(LONG_PTR pXAcc, IAccessible 
**ppIA)
 {
 
        ENTER_PROTECTED_BLOCK
@@ -2963,12 +2963,12 @@ void CMAccessible::ConvertAnyToVariant(const 
::com::sun::star::uno::Any &rAnyVal
                                        if(pXAcc.is())
                                        {
                                                IAccessible* pIAcc = NULL;
-                                               
get_IAccessibleFromXAccessible((long)pXAcc.get(), &pIAcc);
+                                               
get_IAccessibleFromXAccessible((LONG_PTR)pXAcc.get(), &pIAcc);
                                                if(pIAcc == NULL)
                                                {
                                                        Reference< 
XAccessibleContext > pXAccContext = pXAcc->getAccessibleContext();
                                                        
g_pAgent->InsertAccObj(pXAcc.get(),pXAccContext->getAccessibleParent().get());
-                                                       
get_IAccessibleFromXAccessible((long)pXAcc.get(), &pIAcc);
+                                                       
get_IAccessibleFromXAccessible((LONG_PTR)pXAcc.get(), &pIAcc);
                                                }
                                                if(pIAcc)
                                                {
diff --git a/main/winaccessibility/source/UAccCOM/MAccessible.h 
b/main/winaccessibility/source/UAccCOM/MAccessible.h
index 8da6f65c50..c2862ef3e5 100644
--- a/main/winaccessibility/source/UAccCOM/MAccessible.h
+++ b/main/winaccessibility/source/UAccCOM/MAccessible.h
@@ -200,12 +200,12 @@ public:
     STDMETHOD(Put_XAccParent)(IMAccessible __RPC_FAR *pIParent);
     STDMETHOD(Put_XAccWindowHandle)(HWND hwnd);
     STDMETHOD(Put_XAccChildID)(long dChildID);
-    STDMETHOD(Put_XAccAgent)(long pAgent);
+    STDMETHOD(Put_XAccAgent)(LONG_PTR pAgent);
     STDMETHOD(NotifyDestroy)(BOOL isDestroy);
     STDMETHOD(Put_ActionDescription)( const OLECHAR* szAction);
-    STDMETHOD(SetDefaultAction)(long pAction);
-    STDMETHOD(GetUNOInterface)(long*);
-    STDMETHOD(SetXAccessible)(long);
+    STDMETHOD(SetDefaultAction)(LONG_PTR pAction);
+    STDMETHOD(GetUNOInterface)(LONG_PTR*);
+    STDMETHOD(SetXAccessible)(LONG_PTR);
 
 private:
     OLECHAR* m_pszName;
@@ -271,12 +271,12 @@ public:
     // implement some specific MSAA methods,such as accSelection,accNavigate
     static AccObjectManagerAgent* g_pAgent;
 
-    static BOOL get_IAccessibleFromXAccessible(long pXAcc,IAccessible** ppIA);
+    static BOOL get_IAccessibleFromXAccessible(LONG_PTR pXAcc,IAccessible** 
ppIA);
     BOOL m_bRequiresSave;
     XGUIDToComObjHash m_containedObjects;
 
     static HRESULT WINAPI _SmartQI(void* pv,
-                                   REFIID iid, void** ppvObject, DWORD)
+                                   REFIID iid, void** ppvObject, DWORD_PTR)
     {
         return ((CMAccessible*)pv)->SmartQI(pv,iid,ppvObject);
     }
diff --git a/main/winaccessibility/source/UAccCOM/UNOXWrapper.h 
b/main/winaccessibility/source/UAccCOM/UNOXWrapper.h
index e02fd59580..926b336d8a 100644
--- a/main/winaccessibility/source/UAccCOM/UNOXWrapper.h
+++ b/main/winaccessibility/source/UAccCOM/UNOXWrapper.h
@@ -42,24 +42,24 @@ public:
 public:
     // IUNOXWrapper
 
-    STDMETHOD(put_XInterface)(long pXInterface)
+    STDMETHOD(put_XInterface)(LONG_PTR pXInterface)
     {
         pUNOInterface = 
(com::sun::star::accessibility::XAccessible*)pXInterface;
         return S_OK;
     }
 
-    STDMETHOD(put_XSubInterface)(long)
+    STDMETHOD(put_XSubInterface)(LONG_PTR)
     {
         return S_OK;
     }
 
-    STDMETHOD(get_XInterface)(/*[out,retval]*/long *pXInterface)
+    STDMETHOD(get_XInterface)(/*[out,retval]*/LONG_PTR *pXInterface)
     {
-        *pXInterface = (long)pUNOInterface;//.get();
+        *pXInterface = (LONG_PTR)pUNOInterface;//.get();
         return S_OK;
     }
 
-    STDMETHOD(get_XSubInterface)(/*[out,retval]*/long *)
+    STDMETHOD(get_XSubInterface)(/*[out,retval]*/LONG_PTR *)
     {
         return S_OK;
     }
diff --git a/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl 
b/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl
index 670b5eb30e..25528a5cb7 100644
--- a/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl
+++ b/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl
@@ -46,11 +46,11 @@ import "defines.idl";
                [id(10), helpstring("method Put_XAccParent")] HRESULT 
Put_XAccParent(IMAccessible* pIParent);
                [id(13), helpstring("method Put_XAccWindowHandle")] HRESULT 
Put_XAccWindowHandle(HWND hwnd);
                [id(14), helpstring("method Put_XAccChildID")] HRESULT 
Put_XAccChildID(long dChildID);
-               [id(19), helpstring("method SetXAccessible")] HRESULT 
SetXAccessible( long XAccessible);
-               [id(20), helpstring("method GetUNOInterface")] HRESULT 
GetUNOInterface(long* UNOInterface);
-               [id(23), helpstring("method SetDefaultAction")] HRESULT 
SetDefaultAction(long pAction);
+               [id(19), helpstring("method SetXAccessible")] HRESULT 
SetXAccessible( LONG_PTR XAccessible);
+               [id(20), helpstring("method GetUNOInterface")] HRESULT 
GetUNOInterface(LONG_PTR* UNOInterface);
+               [id(23), helpstring("method SetDefaultAction")] HRESULT 
SetDefaultAction(LONG_PTR pAction);
                [id(24), helpstring("method Put_ActionDescription")] HRESULT 
Put_ActionDescription( const OLECHAR* szAction);
-               [id(25), helpstring("method Put_XAccAgent")] HRESULT 
Put_XAccAgent(long pAgent);
+               [id(25), helpstring("method Put_XAccAgent")] HRESULT 
Put_XAccAgent(LONG_PTR pAgent);
                [id(26), helpstring("method NotifyDestroy")] HRESULT 
NotifyDestroy(BOOL isDestroy);
                [id(30), helpstring("method Get_XAccChildID")] HRESULT 
Get_XAccChildID([out,retval] long* childID);
        };
@@ -64,7 +64,7 @@ import "defines.idl";
        interface IEnumVariant : IEnumVARIANT
        {
                [id(1), helpstring("method ClearEnumeration")] HRESULT 
ClearEnumeration();
-               [id(2), helpstring("method PutSelection")] HRESULT 
PutSelection(long pXSeletion);
+               [id(2), helpstring("method PutSelection")] HRESULT 
PutSelection(LONG_PTR pXSeletion);
        };
        [
                object,
@@ -75,10 +75,10 @@ import "defines.idl";
        ]
        interface IUNOXWrapper : IUnknown
        {
-               [id(1), helpstring("method put_XInterface")] HRESULT 
put_XInterface(long pXInterface);
-               [id(2), helpstring("method put_XSubInterface")] HRESULT 
put_XSubInterface(long pXSubInterface);
-               [id(3), helpstring("method get_XInterface")] HRESULT 
get_XInterface([out,retval]long* pXInterface);
-               [id(4), helpstring("method get_XSubInterface")] HRESULT 
get_XSubInterface([out,retval]long* pXSubInterface);
+               [id(1), helpstring("method put_XInterface")] HRESULT 
put_XInterface(LONG_PTR pXInterface);
+               [id(2), helpstring("method put_XSubInterface")] HRESULT 
put_XSubInterface(LONG_PTR pXSubInterface);
+               [id(3), helpstring("method get_XInterface")] HRESULT 
get_XInterface([out,retval]LONG_PTR* pXInterface);
+               [id(4), helpstring("method get_XSubInterface")] HRESULT 
get_XSubInterface([out,retval]LONG_PTR* pXSubInterface);
        };
 
 [
diff --git a/main/winaccessibility/source/service/AccEventListener.cxx 
b/main/winaccessibility/source/service/AccEventListener.cxx
index 80df63cee8..21c96e1095 100644
--- a/main/winaccessibility/source/service/AccEventListener.cxx
+++ b/main/winaccessibility/source/service/AccEventListener.cxx
@@ -26,7 +26,7 @@
 
 #ifndef _SV_SYSDATA_HXX
 #if defined( WIN ) || defined( WNT ) || defined( OS2 )
-typedef sal_Int32 HWND;
+typedef void* HWND;
 #endif
 #endif
 #include "AccEventListener.hxx"
diff --git a/main/winaccessibility/source/service/AccFrameEventListener.cxx 
b/main/winaccessibility/source/service/AccFrameEventListener.cxx
index 88c55f3431..657565602f 100644
--- a/main/winaccessibility/source/service/AccFrameEventListener.cxx
+++ b/main/winaccessibility/source/service/AccFrameEventListener.cxx
@@ -37,7 +37,7 @@ using namespace com::sun::star::accessibility;
 
 #ifndef _SV_SYSDATA_HXX
 #if defined( WIN ) || defined( WNT ) || defined( OS2 )
-typedef sal_Int32 HWND;
+typedef void* HWND;
 typedef sal_Int32 HMENU;
 typedef sal_Int32 HDC;
 typedef void *PVOID;
diff --git a/main/winaccessibility/source/service/AccObject.cxx 
b/main/winaccessibility/source/service/AccObject.cxx
index 4b0a2e1ecb..197a3d2013 100644
--- a/main/winaccessibility/source/service/AccObject.cxx
+++ b/main/winaccessibility/source/service/AccObject.cxx
@@ -71,9 +71,9 @@ AccObject::AccObject(XAccessible* pAcc,AccObjectManagerAgent* 
pAgent ,AccEventLi
     m_accRole = m_xAccContextRef -> getAccessibleRole();
     if( m_pIMAcc )
     {
-        m_pIMAcc->SetXAccessible((long) m_xAccRef.get());
-        m_pIMAcc->Put_XAccAgent((long)pAgent);
-        m_pIMAcc->SetDefaultAction((long)m_xAccActionRef.get());
+        m_pIMAcc->SetXAccessible((LONG_PTR) m_xAccRef.get());
+        m_pIMAcc->Put_XAccAgent((LONG_PTR)pAgent);
+        m_pIMAcc->SetDefaultAction((LONG_PTR)m_xAccActionRef.get());
     }
 }
 /**
@@ -223,7 +223,7 @@ void  AccObject::UpdateAction()
         if( m_xAccActionRef->getAccessibleActionCount() > 0 )
         {
             UpdateDefaultAction( );
-            m_pIMAcc->SetDefaultAction((long)m_xAccActionRef.get());
+            m_pIMAcc->SetDefaultAction((LONG_PTR)m_xAccActionRef.get());
         }
     }
 }
diff --git a/main/winaccessibility/source/service/AccObjectManagerAgent.cxx 
b/main/winaccessibility/source/service/AccObjectManagerAgent.cxx
index 10306c2d58..4fa5bca5a8 100644
--- a/main/winaccessibility/source/service/AccObjectManagerAgent.cxx
+++ b/main/winaccessibility/source/service/AccObjectManagerAgent.cxx
@@ -142,10 +142,10 @@ void  AccObjectManagerAgent::UpdateDescription( 
XAccessible* pXAcc, Any newDesc
    * @param pWnd The top window handle containing control.
    * @return If the method is correctly processed.
    */
-unsigned char AccObjectManagerAgent::InsertAccObj( XAccessible* 
pXAcc,XAccessible* pParentXAcc,long pWnd)
+unsigned char AccObjectManagerAgent::InsertAccObj( XAccessible* 
pXAcc,XAccessible* pParentXAcc,void *pWnd)
 {
     if( pWinManager )
-        return (unsigned char)pWinManager->InsertAccObj( pXAcc, 
pParentXAcc,HWND((void*)pWnd) );
+        return (unsigned char)pWinManager->InsertAccObj( pXAcc, pParentXAcc, 
(HWND)pWnd );
 
     return sal_False;
 }
@@ -156,10 +156,10 @@ unsigned char AccObjectManagerAgent::InsertAccObj( 
XAccessible* pXAcc,XAccessibl
    * @param pXAcc XAccessible interface for top window
    * @return void
    */
-void AccObjectManagerAgent::SaveTopWindowHandle(long hWnd, 
com::sun::star::accessibility::XAccessible* pXAcc)
+void AccObjectManagerAgent::SaveTopWindowHandle(void *hWnd, 
com::sun::star::accessibility::XAccessible* pXAcc)
 {
     if( pWinManager )
-        pWinManager->SaveTopWindowHandle( HWND((void*)hWnd), pXAcc );
+        pWinManager->SaveTopWindowHandle( (HWND)hWnd, pXAcc );
 }
 
 
@@ -171,10 +171,10 @@ void AccObjectManagerAgent::SaveTopWindowHandle(long 
hWnd, com::sun::star::acces
    * @return If the method is correctly processed.
    */
 unsigned char AccObjectManagerAgent::InsertChildrenAccObj( XAccessible* pXAcc,
-        long pWnd)
+        void *pWnd)
 {
     if( pWinManager )
-        return (unsigned char)pWinManager->InsertChildrenAccObj( pXAcc, 
HWND((void*)pWnd) );
+        return (unsigned char)pWinManager->InsertChildrenAccObj( pXAcc, 
(HWND)pWnd );
 
     return sal_False;
 }
diff --git a/main/winaccessibility/source/service/AccObjectWinManager.cxx 
b/main/winaccessibility/source/service/AccObjectWinManager.cxx
index ffe8a2e7e3..8d8147c8e4 100644
--- a/main/winaccessibility/source/service/AccObjectWinManager.cxx
+++ b/main/winaccessibility/source/service/AccObjectWinManager.cxx
@@ -64,10 +64,10 @@ AccObjectWinManager* AccObjectWinManager::me = NULL;
    * @param
    * @return  Com interface.
    */
-long GetMSComPtr(long hWnd, long lParam, long wParam)
+sal_IntPtr GetMSComPtr(sal_IntPtr hWnd, sal_IntPtr lParam, sal_IntPtr wParam)
 {
     if( g_acc_manager )
-        return 
(long)g_acc_manager->Get_ToATInterface(HWND((void*)hWnd),lParam,wParam );
+        return (sal_IntPtr)g_acc_manager->Get_ToATInterface(HWND((void*)hWnd), 
(LPARAM)lParam, (WPARAM)wParam );
     return NULL;
 }
 
@@ -133,7 +133,7 @@ AccObjectWinManager::~AccObjectWinManager()
    * @return Com interface with event.
    */
 
-long AccObjectWinManager::Get_ToATInterface( HWND hWnd, long lParam, long 
wParam)
+LRESULT AccObjectWinManager::Get_ToATInterface( HWND hWnd, LPARAM lParam, 
WPARAM wParam)
 {
     vos::OGuard localGuard(maATInterfaceMutex);//
 
@@ -153,7 +153,7 @@ long AccObjectWinManager::Get_ToATInterface( HWND hWnd, 
long lParam, long wParam
     if ( pRetIMAcc && lParam == OBJID_CLIENT )
     {
         IAccessible* pTemp = dynamic_cast<IAccessible*>( pRetIMAcc );
-        HRESULT result = LresultFromObject(IID_IAccessible, wParam, pTemp);
+        LRESULT result = LresultFromObject(IID_IAccessible, wParam, pTemp);
         pTemp->Release();
         return result;
     }
@@ -773,12 +773,12 @@ sal_Bool AccObjectWinManager::InsertAccObj( XAccessible* 
pXAcc,XAccessible* pPar
     //for file name support
     if ( pObj.GetRole() == DOCUMENT )
     {
-        XHWNDToDocumentHash::iterator aIter = XHWNDDocList.find( (long)pWnd );
+        XHWNDToDocumentHash::iterator aIter = XHWNDDocList.find( pWnd );
         if ( aIter != XHWNDDocList.end() )
         {
             XHWNDDocList.erase( aIter );
         }
-        XHWNDDocList.insert( XHWNDToDocumentHash::value_type( (long)pWnd, 
pXAcc ) );
+        XHWNDDocList.insert( XHWNDToDocumentHash::value_type( pWnd, pXAcc ) );
 
     }
     //end of file name
@@ -1290,7 +1290,7 @@ short 
AccObjectWinManager::GetRole(com::sun::star::accessibility::XAccessible* p
     return -1;
 }
 
-XAccessible* AccObjectWinManager::GetAccDocByHWND( long pWnd )
+XAccessible* AccObjectWinManager::GetAccDocByHWND( HWND pWnd )
 {
     XHWNDToDocumentHash::iterator aIter;
     aIter = XHWNDDocList.find( pWnd );
@@ -1305,8 +1305,7 @@ XAccessible* AccObjectWinManager::GetAccDocByHWND( long 
pWnd )
 XAccessible* AccObjectWinManager::GetAccDocByAccTopWin( XAccessible* pXAcc )
 {
     AccObject* pAccObj = GetAccObjByXAcc( pXAcc );
-    long pWnd = (long)( pAccObj->GetParentHWND() );
-    return GetAccDocByHWND( pWnd );
+    return GetAccDocByHWND( pAccObj->GetParentHWND() );
 }
 
 bool AccObjectWinManager::IsTopWinAcc( 
com::sun::star::accessibility::XAccessible* pXAcc )
diff --git a/main/winaccessibility/source/service/AccTopWindowListener.cxx 
b/main/winaccessibility/source/service/AccTopWindowListener.cxx
index eacdd0201f..2cdc8ad278 100644
--- a/main/winaccessibility/source/service/AccTopWindowListener.cxx
+++ b/main/winaccessibility/source/service/AccTopWindowListener.cxx
@@ -27,7 +27,7 @@
 
 #ifndef _SV_SYSDATA_HXX
 #if defined( WIN ) || defined( WNT ) || defined( OS2 )
-typedef sal_Int32 HWND;
+typedef void* HWND;
 typedef sal_Int32 HMENU;
 typedef sal_Int32 HDC;
 typedef void *PVOID;
@@ -72,10 +72,10 @@ void FreeTopWindowListener()
 /**
  *     As a global method to invoke the handleWindowOpened() method
  */
-void handleWindowOpened_impl(long pAcc)
+void handleWindowOpened_impl(sal_Int64 pAcc)
 {
     if( g_pTop && pAcc != NULL )
-        g_pTop->handleWindowOpened( 
(com::sun::star::accessibility::XAccessible*)((void*)pAcc) );
+        g_pTop->handleWindowOpened( 
(com::sun::star::accessibility::XAccessible*)((void*)(sal_IntPtr)pAcc) );
 }
 
 /**
diff --git a/main/winaccessibility/source/service/msaaservice_impl.cxx 
b/main/winaccessibility/source/service/msaaservice_impl.cxx
index 87a1213803..88dbd24042 100644
--- a/main/winaccessibility/source/service/msaaservice_impl.cxx
+++ b/main/winaccessibility/source/service/msaaservice_impl.cxx
@@ -38,14 +38,14 @@ using namespace ::com::sun::star::accessibility;
 
 using namespace ::com::sun::star::awt;
 
-typedef sal_Int32 HWND;
+typedef void* HWND;
 
 #include "AccTopWindowListener.hxx"
 #include "g_msacc.hxx"
 
 extern void FreeTopWindowListener();
-extern long GetMSComPtr(long hWnd, long lParam, long wParam);
-extern void handleWindowOpened_impl( long pAcc);
+extern sal_IntPtr GetMSComPtr( sal_IntPtr hWnd, sal_IntPtr lParam, sal_IntPtr 
wParam);
+extern void handleWindowOpened_impl( sal_Int64 pAcc);
 
 
 namespace my_sc_impl
@@ -110,9 +110,9 @@ public:
     virtual void SAL_CALL initialize( Sequence< Any > const & args )
     throw (Exception);
     // XMSAAService
-    virtual sal_Int32 SAL_CALL getAccObjectPtr (long hWnd, long lParam, long 
wParam)
+    virtual sal_Int64 SAL_CALL getAccObjectPtr (sal_Int64 hWnd, sal_Int64 
lParam, sal_Int64 wParam)
     throw (RuntimeException);
-    virtual void SAL_CALL handleWindowOpened(sal_Int32)
+    virtual void SAL_CALL handleWindowOpened(sal_Int64)
     throw (RuntimeException);
     // XServiceInfo
     virtual OUString SAL_CALL getImplementationName()
@@ -151,9 +151,9 @@ void MSAAServiceImpl::initialize( Sequence< Any > const & 
args ) throw (Exceptio
    * @param
    * @return Com interface.
    */
-sal_Int32 MSAAServiceImpl::getAccObjectPtr ( long hWnd, long lParam, long 
wParam) throw (RuntimeException)
+sal_Int64 MSAAServiceImpl::getAccObjectPtr ( sal_Int64 hWnd, sal_Int64 lParam, 
sal_Int64 wParam) throw (RuntimeException)
 {
-    return GetMSComPtr(hWnd, lParam, wParam);
+    return (sal_Int64)GetMSComPtr((sal_IntPtr)hWnd, (sal_IntPtr)lParam, 
(sal_IntPtr)wParam);
 }
 
 /**
@@ -162,7 +162,7 @@ sal_Int32 MSAAServiceImpl::getAccObjectPtr ( long hWnd, 
long lParam, long wParam
    * @param
    * @return
    */
-void MSAAServiceImpl::handleWindowOpened( sal_Int32 pAcc)
+void MSAAServiceImpl::handleWindowOpened( sal_Int64 pAcc)
 {
     handleWindowOpened_impl(pAcc);
 }

Reply via email to