Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/dhtmled.ocx/edit.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+)
diff --git a/dlls/dhtmled.ocx/edit.c b/dlls/dhtmled.ocx/edit.c index 80ec00614d..c68e9d62fd 100644 --- a/dlls/dhtmled.ocx/edit.c +++ b/dlls/dhtmled.ocx/edit.c @@ -31,6 +31,7 @@ typedef struct IViewObject IViewObject_iface; IOleObject IOleObject_iface; IOleControl IOleControl_iface; + IPersistStreamInit IPersistStreamInit_iface; IOleClientSite *client_site; LONG ref; } DHTMLEditImpl; @@ -60,6 +61,11 @@ static inline DHTMLEditImpl *impl_from_IOleControl(IOleControl *iface) return CONTAINING_RECORD(iface, DHTMLEditImpl, IOleControl_iface); }
+static inline DHTMLEditImpl *impl_from_IPersistStreamInit(IPersistStreamInit *iface) +{ + return CONTAINING_RECORD(iface, DHTMLEditImpl, IPersistStreamInit_iface); +} + static HRESULT dhtml_edit_addref(DHTMLEditImpl *This) { LONG ref = InterlockedIncrement(&This->ref); @@ -106,6 +112,13 @@ static HRESULT dhtml_edit_qi(DHTMLEditImpl *This, REFIID iid, void **out) *out = &This->IOleControl_iface; return S_OK; } + else if (IsEqualGUID(iid, &IID_IPersistStreamInit) || + IsEqualGUID(iid, &IID_IPersistStream)) + { + dhtml_edit_addref(This); + *out = &This->IPersistStreamInit_iface; + return S_OK; + }
*out = NULL; ERR("no interface for %s\n", debugstr_guid(iid)); @@ -962,6 +975,76 @@ static const IOleControlVtbl OleControlVtbl = { OleControl_OnAmbientPropertyChange };
+static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, REFIID iid, void **out) +{ + return dhtml_edit_qi(impl_from_IPersistStreamInit(iface), iid, out); +} + +static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface) +{ + return dhtml_edit_addref(impl_from_IPersistStreamInit(iface)); +} + +static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface) +{ + return dhtml_edit_release(impl_from_IPersistStreamInit(iface)); +} + +static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *clsid) +{ + DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface); + FIXME("(%p)->(%p) stub\n", This, clsid); + return E_NOTIMPL; +} + +static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface) +{ + DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface); + FIXME("(%p) stub\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream *stream) +{ + DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface); + FIXME("(%p)->(%p) stub\n", This, stream); + return S_OK; +} + +static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, IStream *stream, BOOL clear_dirty) +{ + DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface); + FIXME("(%p)->(%p, %u) stub\n", This, stream, clear_dirty); + return E_NOTIMPL; +} + +static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, ULARGE_INTEGER *value) +{ + DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface); + FIXME("(%p)->(%p) stub\n", This, value); + value->QuadPart = 0; + return E_NOTIMPL; +} + +static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface) +{ + DHTMLEditImpl *This = impl_from_IPersistStreamInit(iface); + FIXME("(%p) stub\n", This); + return E_NOTIMPL; +} + +static const IPersistStreamInitVtbl PersistStreamInitVtbl = { + PersistStreamInit_QueryInterface, + PersistStreamInit_AddRef, + PersistStreamInit_Release, + PersistStreamInit_GetClassID, + PersistStreamInit_IsDirty, + PersistStreamInit_Load, + PersistStreamInit_Save, + PersistStreamInit_GetSizeMax, + PersistStreamInit_InitNew +}; + HRESULT dhtml_edit_create(REFIID iid, void **out) { DHTMLEditImpl *This; @@ -979,6 +1062,7 @@ HRESULT dhtml_edit_create(REFIID iid, void **out) This->IViewObject_iface.lpVtbl = &ViewObjectVtbl; This->IOleObject_iface.lpVtbl = &OleObjectVtbl; This->IOleControl_iface.lpVtbl = &OleControlVtbl; + This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl; This->ref = 1;
*out = &This->IDHTMLEdit_iface;