Piotr Caban : mshtml: Added IObjectSafety stub.

Alexandre Julliard julliard at winehq.org
Thu Jan 20 12:41:20 CST 2011


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Jan 19 21:31:43 2011 +0100

mshtml: Added IObjectSafety stub.

---

 dlls/mshtml/htmldoc.c        |    3 ++
 dlls/mshtml/mshtml.inf       |    1 +
 dlls/mshtml/mshtml_private.h |    2 +
 dlls/mshtml/oleobj.c         |   62 ++++++++++++++++++++++++++++++++++++++++++
 dlls/mshtml/tests/dom.c      |    3 ++
 5 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 12e0947..2b05ab9 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -1827,6 +1827,9 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
     }else if(IsEqualGUID(&IID_IOleContainer, riid)) {
         TRACE("(%p)->(IID_IOleContainer %p)\n", This, ppv);
         *ppv = &This->IOleContainer_iface;
+    }else if(IsEqualGUID(&IID_IObjectSafety, riid)) {
+        TRACE("(%p)->(IID_IObjectSafety %p)\n", This, ppv);
+        *ppv = &This->IObjectSafety_iface;
     }else {
         return FALSE;
     }
diff --git a/dlls/mshtml/mshtml.inf b/dlls/mshtml/mshtml.inf
index b06743a..279b16c 100644
--- a/dlls/mshtml/mshtml.inf
+++ b/dlls/mshtml/mshtml.inf
@@ -66,6 +66,7 @@ HKLM,"Software\Microsoft\Internet Explorer\AboutURLs","PostNotCached",2,"res://m
 HKLM,"Software\Microsoft\Internet Explorer\AboutURLs","mozilla",2,"res://mshtml.dll/about.moz"
 HKLM,"Software\Microsoft\Internet Explorer\Default Behaviors","VML",,  "CLSID:10072CEC-8CC1-11D1-986E-00A0C955B42E"
 HKLM,"Software\Microsoft\Internet Explorer\Default Behaviors","TIME",, "CLSID:476C391C-3E0D-11D2-B948-00C04FA32195"
+HKLM,"Software\Microsoft\Internet Explorer\ActiveX Compatibility","Version",,"6.17"
 
 
 [WineGecko.Reg]
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 520061d..15348d5 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -24,6 +24,7 @@
 #include "hlink.h"
 #include "perhist.h"
 #include "dispex.h"
+#include "objsafe.h"
 
 #include "wine/list.h"
 #include "wine/unicode.h"
@@ -368,6 +369,7 @@ struct HTMLDocument {
     ISupportErrorInfo           ISupportErrorInfo_iface;
     IObjectWithSite             IObjectWithSite_iface;
     IOleContainer               IOleContainer_iface;
+    IObjectSafety               IObjectSafety_iface;
 
     IUnknown *unk_impl;
     IDispatchEx *dispex;
diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c
index 98fbdef..f8a84ac 100644
--- a/dlls/mshtml/oleobj.c
+++ b/dlls/mshtml/oleobj.c
@@ -802,6 +802,10 @@ static const IObjectWithSiteVtbl ObjectWithSiteVtbl = {
     ObjectWithSite_GetSite
 };
 
+/**********************************************************
+ * IOleContainer implementation
+ */
+
 static inline HTMLDocument *impl_from_IOleContainer(IOleContainer *iface)
 {
     return CONTAINING_RECORD(iface, HTMLDocument, IOleContainer_iface);
@@ -856,6 +860,63 @@ static const IOleContainerVtbl OleContainerVtbl = {
     OleContainer_LockContainer
 };
 
+/**********************************************************
+ * IObjectSafety implementation
+ */
+
+static inline HTMLDocument *impl_from_IObjectSafety(IObjectSafety *iface)
+{
+    return CONTAINING_RECORD(iface, HTMLDocument, IObjectSafety_iface);
+}
+
+static HRESULT WINAPI ObjectSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv)
+{
+    HTMLDocument *This = impl_from_IObjectSafety(iface);
+    return htmldoc_query_interface(This, riid, ppv);
+}
+
+static ULONG WINAPI ObjectSafety_AddRef(IObjectSafety *iface)
+{
+    HTMLDocument *This = impl_from_IObjectSafety(iface);
+    return htmldoc_addref(This);
+}
+
+static ULONG WINAPI ObjectSafety_Release(IObjectSafety *iface)
+{
+    HTMLDocument *This = impl_from_IObjectSafety(iface);
+    return htmldoc_release(This);
+}
+
+static HRESULT WINAPI ObjectSafety_GetInterfaceSafetyOptions(IObjectSafety *iface,
+        REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
+{
+    HTMLDocument *This = impl_from_IObjectSafety(iface);
+    FIXME("(%p)->(%s %p %p)\n", This, debugstr_guid(riid), pdwSupportedOptions, pdwEnabledOptions);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ObjectSafety_SetInterfaceSafetyOptions(IObjectSafety *iface,
+        REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
+{
+    HTMLDocument *This = impl_from_IObjectSafety(iface);
+    FIXME("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), dwOptionSetMask, dwEnabledOptions);
+
+    if(IsEqualGUID(&IID_IPersistMoniker, riid) &&
+            dwOptionSetMask==INTERFACESAFE_FOR_UNTRUSTED_DATA &&
+            dwEnabledOptions==INTERFACESAFE_FOR_UNTRUSTED_DATA)
+        return S_OK;
+
+    return E_NOTIMPL;
+}
+
+static const IObjectSafetyVtbl ObjectSafetyVtbl = {
+    ObjectSafety_QueryInterface,
+    ObjectSafety_AddRef,
+    ObjectSafety_Release,
+    ObjectSafety_GetInterfaceSafetyOptions,
+    ObjectSafety_SetInterfaceSafetyOptions
+};
+
 void HTMLDocument_LockContainer(HTMLDocumentObj *This, BOOL fLock)
 {
     IOleContainer *container;
@@ -879,4 +940,5 @@ void HTMLDocument_OleObj_Init(HTMLDocument *This)
     This->IOleControl_iface.lpVtbl = &OleControlVtbl;
     This->IObjectWithSite_iface.lpVtbl = &ObjectWithSiteVtbl;
     This->IOleContainer_iface.lpVtbl = &OleContainerVtbl;
+    This->IObjectSafety_iface.lpVtbl = &ObjectSafetyVtbl;
 }
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 6601d2d..f753b14 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -32,6 +32,7 @@
 #include "docobj.h"
 #include "dispex.h"
 #include "mshtml_test.h"
+#include "objsafe.h"
 
 static const char doc_blank[] = "<html></html>";
 static const char doc_str1[] = "<html><body>test</body></html>";
@@ -126,6 +127,7 @@ static const IID * const doc_node_iids[] = {
     &IID_IConnectionPointContainer,
     &IID_IInternetHostSecurityManager,
     &IID_IOleContainer,
+    &IID_IObjectSafety,
     NULL
 };
 
@@ -139,6 +141,7 @@ static const IID * const doc_obj_iids[] = {
     &IID_IConnectionPointContainer,
     &IID_ICustomDoc,
     &IID_IOleContainer,
+    &IID_IObjectSafety,
     NULL
 };
 




More information about the wine-cvs mailing list