[ros-diffs] [gedmurphy] 52364: [BROWSEUI] - Set the prototypes to be long instead of LONG. This only worked in rbuild previously because WIDL incorrectly generates a LONG for long types. - define SHANDLE_PTR a...

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Sun Jun 19 12:46:16 UTC 2011


Author: gedmurphy
Date: Sun Jun 19 12:46:15 2011
New Revision: 52364

URL: http://svn.reactos.org/svn/reactos?rev=52364&view=rev
Log:
[BROWSEUI]
- Set the prototypes to be long instead of LONG. This only worked in rbuild previously because WIDL incorrectly generates a LONG for long types.
- define SHANDLE_PTR and use it in IWebBrowserApp::get_HWND
- Along with fixing WIDL, __WINESRC__ and __ROS_LONG64__ should be removed as part of a future fix.
- Should now build with both rbuild and msvc

Modified:
    trunk/reactos/dll/win32/browseui/shellbrowser.cpp
    trunk/reactos/include/psdk/basetsd.h
    trunk/reactos/include/psdk/exdisp.idl

Modified: trunk/reactos/dll/win32/browseui/shellbrowser.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellbrowser.cpp?rev=52364&r1=52363&r2=52364&view=diff
==============================================================================
--- trunk/reactos/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Sun Jun 19 12:46:15 2011
@@ -124,8 +124,6 @@
     "language='*'\"")
 #endif // __GNUC__
 
-#define SHANDLE_PTR LONG
-
 struct categoryCacheHeader
 {
 	long				dwSize;			// size of header only
@@ -154,7 +152,6 @@
 
 // temporary
 extern HRESULT CreateInternetToolbar(REFIID riid, void **ppv);
-
 
 
 #ifdef SetWindowLongPtr
@@ -556,19 +553,29 @@
 	virtual HRESULT STDMETHODCALLTYPE get_Document(IDispatch **ppDisp);
 	virtual HRESULT STDMETHODCALLTYPE get_TopLevelContainer(VARIANT_BOOL *pBool);
 	virtual HRESULT STDMETHODCALLTYPE get_Type(BSTR *Type);
-	virtual HRESULT STDMETHODCALLTYPE get_Left(LONG *pl);
-	virtual HRESULT STDMETHODCALLTYPE put_Left(LONG Left);
-	virtual HRESULT STDMETHODCALLTYPE get_Top(LONG *pl);
-	virtual HRESULT STDMETHODCALLTYPE put_Top(LONG Top);
-	virtual HRESULT STDMETHODCALLTYPE get_Width(LONG *pl);
-	virtual HRESULT STDMETHODCALLTYPE put_Width(LONG Width);
-	virtual HRESULT STDMETHODCALLTYPE get_Height(LONG *pl);
-	virtual HRESULT STDMETHODCALLTYPE put_Height(LONG Height);
+
+// WIDL temp hack : when the interface contains 'long' WIDL writes it out as a 'LONG'
+// Setting the prototype to LONG in this class breaks building with MSVC so we use 
+// the correct 'long' type here and temp hack it for WIDL generated prototypes.
+#ifdef __WIDL_EXDISP_H
+#define long LONG
+#endif
+	virtual HRESULT STDMETHODCALLTYPE get_Left(long *pl);
+	virtual HRESULT STDMETHODCALLTYPE put_Left(long Left);
+	virtual HRESULT STDMETHODCALLTYPE get_Top(long *pl);
+	virtual HRESULT STDMETHODCALLTYPE put_Top(long Top);
+	virtual HRESULT STDMETHODCALLTYPE get_Width(long *pl);
+	virtual HRESULT STDMETHODCALLTYPE put_Width(long Width);
+	virtual HRESULT STDMETHODCALLTYPE get_Height(long *pl);
+	virtual HRESULT STDMETHODCALLTYPE put_Height(long Height);
+#ifdef __WIDL_EXDISP_H
+#undef long
+#endif
 	virtual HRESULT STDMETHODCALLTYPE get_LocationName(BSTR *LocationName);
 	virtual HRESULT STDMETHODCALLTYPE get_LocationURL(BSTR *LocationURL);
 	virtual HRESULT STDMETHODCALLTYPE get_Busy(VARIANT_BOOL *pBool);
 
-	// *** IWebBrowser2 methods ***
+	// *** IWebBrowserApp methods ***
 	virtual HRESULT STDMETHODCALLTYPE Quit();
 	virtual HRESULT STDMETHODCALLTYPE ClientToWindow(int *pcx, int *pcy);
 	virtual HRESULT STDMETHODCALLTYPE PutProperty(BSTR Property, VARIANT vtValue);
@@ -2546,47 +2553,51 @@
 {
 	return E_NOTIMPL;
 }
-
-HRESULT STDMETHODCALLTYPE CShellBrowser::get_Left(LONG *pl)
-{
-	return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CShellBrowser::put_Left(LONG Left)
-{
-	return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CShellBrowser::get_Top(LONG *pl)
-{
-	return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CShellBrowser::put_Top(LONG Top)
-{
-	return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CShellBrowser::get_Width(LONG *pl)
-{
-	return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CShellBrowser::put_Width(LONG Width)
-{
-	return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CShellBrowser::get_Height(LONG *pl)
-{
-	return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CShellBrowser::put_Height(LONG Height)
-{
-	return E_NOTIMPL;
-}
-
+#ifdef __WIDL_EXDISP_H
+#define long LONG
+#endif
+HRESULT STDMETHODCALLTYPE CShellBrowser::get_Left(long *pl)
+{
+	return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CShellBrowser::put_Left(long Left)
+{
+	return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CShellBrowser::get_Top(long *pl)
+{
+	return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CShellBrowser::put_Top(long Top)
+{
+	return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CShellBrowser::get_Width(long *pl)
+{
+	return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CShellBrowser::put_Width(long Width)
+{
+	return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CShellBrowser::get_Height(long *pl)
+{
+	return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CShellBrowser::put_Height(long Height)
+{
+	return E_NOTIMPL;
+}
+#ifdef __WIDL_EXDISP_H
+#undef long
+#endif
 HRESULT STDMETHODCALLTYPE CShellBrowser::get_LocationName(BSTR *LocationName)
 {
 	return E_NOTIMPL;

Modified: trunk/reactos/include/psdk/basetsd.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/basetsd.h?rev=52364&r1=52363&r2=52364&view=diff
==============================================================================
--- trunk/reactos/include/psdk/basetsd.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/basetsd.h [iso-8859-1] Sun Jun 19 12:46:15 2011
@@ -77,10 +77,18 @@
 
 #if defined(_WIN64)
 #define __int3264   __int64
+typedef __int64 SHANDLE_PTR;
+typedef unsigned __int64 HANDLE_PTR;
+typedef unsigned int UHALF_PTR, *PUHALF_PTR;
+typedef int HALF_PTR, *PHALF_PTR;
 #define ADDRESS_TAG_BIT 0x40000000000UI64
 #else /*  !_WIN64 */
 #define __int3264   __int32
 #define ADDRESS_TAG_BIT 0x80000000UL
+typedef unsigned short UHALF_PTR, *PUHALF_PTR;
+typedef short HALF_PTR, *PHALF_PTR;
+typedef long SHANDLE_PTR;
+typedef unsigned long HANDLE_PTR;
 #define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
 #define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
 #define ULongToHandle( h) ((HANDLE)(ULONG_PTR) (h))
@@ -183,14 +191,6 @@
 	typedef unsigned long ULONG_PTR, *PULONG_PTR;
 #endif
 
-typedef unsigned short UHALF_PTR, *PUHALF_PTR;
-typedef short HALF_PTR, *PHALF_PTR;
-
-#ifndef HANDLE_PTR_DEFINED
-#define HANDLE_PTR_DEFINED
-	typedef unsigned long HANDLE_PTR;
-#endif
-
 #endif /* !_WIN64 */
 
 typedef ULONG_PTR SIZE_T, *PSIZE_T;

Modified: trunk/reactos/include/psdk/exdisp.idl
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/exdisp.idl?rev=52364&r1=52363&r2=52364&view=diff
==============================================================================
--- trunk/reactos/include/psdk/exdisp.idl [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/exdisp.idl [iso-8859-1] Sun Jun 19 12:46:15 2011
@@ -224,7 +224,7 @@
     [id(302)] HRESULT PutProperty([in] BSTR Property, [in] VARIANT vtValue);
     [id(303)] HRESULT GetProperty([in] BSTR Property, [out, retval] VARIANT *pvtValue);
     [id(0), propget] HRESULT Name([out, retval] BSTR* Name);
-    [id(DISPID_HWND), propget] HRESULT HWND([out, retval] long *pHWND);
+    [id(DISPID_HWND), propget] HRESULT HWND([out, retval] SHANDLE_PTR *pHWND);
     [id(400), propget] HRESULT FullName([out, retval] BSTR* FullName);
     [id(401), propget] HRESULT Path([out, retval] BSTR* Path);
     [id(402), propget] HRESULT Visible([out, retval] VARIANT_BOOL* pBool);




More information about the Ros-diffs mailing list