Detlef Riekenberg : browseui: Add IOleWindow to IProgressDialog.

Alexandre Julliard julliard at winehq.org
Thu Apr 19 13:27:53 CDT 2012


Module: wine
Branch: master
Commit: 744acc1ddd8119560ff97e9c68ffda3e10ca2ecc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=744acc1ddd8119560ff97e9c68ffda3e10ca2ecc

Author: Detlef Riekenberg <wine.dev at web.de>
Date:   Mon Apr 16 23:16:17 2012 +0200

browseui: Add IOleWindow to IProgressDialog.

---

 dlls/browseui/progressdlg.c |   66 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/dlls/browseui/progressdlg.c b/dlls/browseui/progressdlg.c
index 9b970e2..5526854 100644
--- a/dlls/browseui/progressdlg.c
+++ b/dlls/browseui/progressdlg.c
@@ -60,6 +60,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(browseui);
 
 typedef struct tagProgressDialog {
     IProgressDialog IProgressDialog_iface;
+    IOleWindow IOleWindow_iface;
     LONG refCount;
     CRITICAL_SECTION cs;
     HWND hwnd;
@@ -79,6 +80,11 @@ static inline ProgressDialog *impl_from_IProgressDialog(IProgressDialog *iface)
     return CONTAINING_RECORD(iface, ProgressDialog, IProgressDialog_iface);
 }
 
+static inline ProgressDialog *impl_from_IOleWindow(IOleWindow *iface)
+{
+    return CONTAINING_RECORD(iface, ProgressDialog, IOleWindow_iface);
+}
+
 static void set_buffer(LPWSTR *buffer, LPCWSTR string)
 {
     static const WCHAR empty_string[] = {0};
@@ -268,11 +274,19 @@ static void ProgressDialog_Destructor(ProgressDialog *This)
 static HRESULT WINAPI ProgressDialog_QueryInterface(IProgressDialog *iface, REFIID iid, LPVOID *ppvOut)
 {
     ProgressDialog *This = impl_from_IProgressDialog(iface);
-    *ppvOut = NULL;
 
+    TRACE("(%p, %s, %p)\n", iface, debugstr_guid(iid), ppvOut);
+    if (!ppvOut)
+        return E_POINTER;
+
+    *ppvOut = NULL;
     if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IProgressDialog))
     {
-        *ppvOut = This;
+        *ppvOut = iface;
+    }
+    else if (IsEqualIID(iid, &IID_IOleWindow))
+    {
+        *ppvOut = &This->IOleWindow_iface;
     }
 
     if (*ppvOut)
@@ -495,6 +509,53 @@ static const IProgressDialogVtbl ProgressDialogVtbl =
     ProgressDialog_Timer
 };
 
+static HRESULT WINAPI OleWindow_QueryInterface(IOleWindow *iface, REFIID iid, LPVOID *ppvOut)
+{
+    ProgressDialog *This = impl_from_IOleWindow(iface);
+    return ProgressDialog_QueryInterface(&This->IProgressDialog_iface, iid, ppvOut);
+}
+
+static ULONG WINAPI OleWindow_AddRef(IOleWindow *iface)
+{
+    ProgressDialog *This = impl_from_IOleWindow(iface);
+    return ProgressDialog_AddRef(&This->IProgressDialog_iface);
+}
+
+static ULONG WINAPI OleWindow_Release(IOleWindow *iface)
+{
+    ProgressDialog *This = impl_from_IOleWindow(iface);
+    return ProgressDialog_Release(&This->IProgressDialog_iface);
+}
+
+static HRESULT WINAPI OleWindow_GetWindow(IOleWindow* iface, HWND* phwnd)
+{
+    ProgressDialog *This = impl_from_IOleWindow(iface);
+
+    TRACE("(%p, %p)\n", This, phwnd);
+    EnterCriticalSection(&This->cs);
+    *phwnd = This->hwnd;
+    LeaveCriticalSection(&This->cs);
+    return S_OK;
+}
+
+static HRESULT WINAPI OleWindow_ContextSensitiveHelp(IOleWindow* iface, BOOL fEnterMode)
+{
+    ProgressDialog *This = impl_from_IOleWindow(iface);
+
+    FIXME("(%p, %d): stub\n", This, fEnterMode);
+    return E_NOTIMPL;
+}
+
+static const IOleWindowVtbl OleWindowVtbl =
+{
+    OleWindow_QueryInterface,
+    OleWindow_AddRef,
+    OleWindow_Release,
+    OleWindow_GetWindow,
+    OleWindow_ContextSensitiveHelp
+};
+
+
 HRESULT ProgressDialog_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
 {
     ProgressDialog *This;
@@ -506,6 +567,7 @@ HRESULT ProgressDialog_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
         return E_OUTOFMEMORY;
 
     This->IProgressDialog_iface.lpVtbl = &ProgressDialogVtbl;
+    This->IOleWindow_iface.lpVtbl = &OleWindowVtbl;
     This->refCount = 1;
     InitializeCriticalSection(&This->cs);
     This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ProgressDialog.cs");




More information about the wine-cvs mailing list