ieframe: Use SHANDLE_PTR in IWebBrowserApp::get_HWND.

Thomas Faber thfabba at gmx.de
Sun Jul 14 05:57:08 CDT 2013


HWNDs are 64 bit on Win64, so they don't fit in a LONG.
PSDK uses SHANDLE_PTR to fix this.
-------------- next part --------------
From c6d82d8f2d59cf80059ca64903dff0fdc722bd91 Mon Sep 17 00:00:00 2001
From: Thomas Faber <thfabba at gmx.de>
Date: Sun, 14 Jul 2013 12:30:38 +0200
Subject: ieframe: Use SHANDLE_PTR in IWebBrowserApp::get_HWND.

---
 dlls/ieframe/ie.c               | 2 +-
 dlls/ieframe/tests/webbrowser.c | 4 ++--
 dlls/ieframe/webbrowser.c       | 2 +-
 dlls/mshtml/tests/htmldoc.c     | 2 +-
 include/exdisp.idl              | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/ieframe/ie.c b/dlls/ieframe/ie.c
index 833cf03..454eb0f 100644
--- a/dlls/ieframe/ie.c
+++ b/dlls/ieframe/ie.c
@@ -355,7 +355,7 @@ static HRESULT WINAPI InternetExplorer_get_Name(IWebBrowser2 *iface, BSTR *Name)
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI InternetExplorer_get_HWND(IWebBrowser2 *iface, LONG *pHWND)
+static HRESULT WINAPI InternetExplorer_get_HWND(IWebBrowser2 *iface, SHANDLE_PTR *pHWND)
 {
     InternetExplorer *This = impl_from_IWebBrowser2(iface);
     FIXME("(%p)->(%p)\n", This, pHWND);
diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c
index 1eb6119..217ff28 100644
--- a/dlls/ieframe/tests/webbrowser.c
+++ b/dlls/ieframe/tests/webbrowser.c
@@ -2052,7 +2052,7 @@ static void test_ie_funcs(IWebBrowser2 *wb)
     IDispatch *disp;
     VARIANT_BOOL b;
     int i;
-    LONG hwnd;
+    SHANDLE_PTR hwnd;
     HRESULT hres;
     BSTR sName;
 
@@ -2061,7 +2061,7 @@ static void test_ie_funcs(IWebBrowser2 *wb)
     hwnd = 0xdeadbeef;
     hres = IWebBrowser2_get_HWND(wb, &hwnd);
     ok(hres == E_FAIL, "get_HWND failed: %08x, expected E_FAIL\n", hres);
-    ok(hwnd == 0, "unexpected hwnd %x\n", hwnd);
+    ok(hwnd == 0, "unexpected hwnd %p\n", (PVOID)hwnd);
 
     /* MenuBar */
 
diff --git a/dlls/ieframe/webbrowser.c b/dlls/ieframe/webbrowser.c
index 02edfd7..55f757f 100644
--- a/dlls/ieframe/webbrowser.c
+++ b/dlls/ieframe/webbrowser.c
@@ -565,7 +565,7 @@ static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name)
     return S_OK;
 }
 
-static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, LONG *pHWND)
+static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, SHANDLE_PTR *pHWND)
 {
     WebBrowser *This = impl_from_IWebBrowser2(iface);
 
diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c
index 535f6cb..079b564 100644
--- a/dlls/mshtml/tests/htmldoc.c
+++ b/dlls/mshtml/tests/htmldoc.c
@@ -4455,7 +4455,7 @@ static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name)
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, LONG *pHWND)
+static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, SHANDLE_PTR *pHWND)
 {
     ok(0, "unexpected call\n");
     return E_NOTIMPL;
diff --git a/include/exdisp.idl b/include/exdisp.idl
index 3e21701..3791acb 100644
--- a/include/exdisp.idl
+++ b/include/exdisp.idl
@@ -230,7 +230,7 @@ interface IWebBrowserApp : IWebBrowser
     [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);
-- 
1.8.1.5


More information about the wine-patches mailing list