Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/dhtmled.ocx/edit.c | 100 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 15 deletions(-)
diff --git a/dlls/dhtmled.ocx/edit.c b/dlls/dhtmled.ocx/edit.c index 6e37554119..49580f3840 100644 --- a/dlls/dhtmled.ocx/edit.c +++ b/dlls/dhtmled.ocx/edit.c @@ -27,6 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dhtmled); typedef struct { IDHTMLEdit IDHTMLEdit_iface; + IQuickActivate IQuickActivate_iface; LONG ref; } DHTMLEditImpl;
@@ -35,10 +36,22 @@ static inline DHTMLEditImpl *impl_from_IDHTMLEdit(IDHTMLEdit *iface) return CONTAINING_RECORD(iface, DHTMLEditImpl, IDHTMLEdit_iface); }
-static HRESULT WINAPI DHTMLEdit_QueryInterface(IDHTMLEdit *iface, REFIID iid, void **out) +static inline DHTMLEditImpl *impl_from_IQuickActivate(IQuickActivate *iface) { - DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface); + return CONTAINING_RECORD(iface, DHTMLEditImpl, IQuickActivate_iface); +} + +static HRESULT dhtml_edit_addref(DHTMLEditImpl *This) +{ + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref);
+ return ref; +} + +static HRESULT dhtml_edit_qi(DHTMLEditImpl *This, REFIID iid, void **out) +{ TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(iid), out);
if (IsEqualGUID(iid, &IID_IUnknown) || @@ -46,8 +59,14 @@ static HRESULT WINAPI DHTMLEdit_QueryInterface(IDHTMLEdit *iface, REFIID iid, vo IsEqualGUID(iid, &IID_IDHTMLSafe) || IsEqualGUID(iid, &IID_IDHTMLEdit)) { - IUnknown_AddRef(iface); - *out = iface; + dhtml_edit_addref(This); + *out = &This->IDHTMLEdit_iface; + return S_OK; + } + else if (IsEqualGUID(iid, &IID_IQuickActivate)) + { + dhtml_edit_addref(This); + *out = &This->IQuickActivate_iface; return S_OK; }
@@ -56,27 +75,31 @@ static HRESULT WINAPI DHTMLEdit_QueryInterface(IDHTMLEdit *iface, REFIID iid, vo return E_NOINTERFACE; }
-static ULONG WINAPI DHTMLEdit_AddRef(IDHTMLEdit *iface) +static HRESULT dhtml_edit_release(DHTMLEditImpl *This) { - DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface); - LONG ref = InterlockedIncrement(&This->ref); + LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
+ if (!ref) + HeapFree(GetProcessHeap(), 0, This); + return ref; }
-static ULONG WINAPI DHTMLEdit_Release(IDHTMLEdit *iface) +static HRESULT WINAPI DHTMLEdit_QueryInterface(IDHTMLEdit *iface, REFIID iid, void **out) { - DHTMLEditImpl *This = impl_from_IDHTMLEdit(iface); - LONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); + return dhtml_edit_qi(impl_from_IDHTMLEdit(iface), iid, out); +}
- if (!ref) - HeapFree(GetProcessHeap(), 0, This); +static ULONG WINAPI DHTMLEdit_AddRef(IDHTMLEdit *iface) +{ + return dhtml_edit_addref(impl_from_IDHTMLEdit(iface)); +}
- return ref; +static ULONG WINAPI DHTMLEdit_Release(IDHTMLEdit *iface) +{ + return dhtml_edit_release(impl_from_IDHTMLEdit(iface)); }
static HRESULT WINAPI DHTMLEdit_GetTypeInfoCount(IDHTMLEdit *iface, UINT *count) @@ -514,6 +537,52 @@ static const IDHTMLEditVtbl DHTMLEditVtbl = { DHTMLEdit_put_BrowseMode };
+static HRESULT WINAPI QuickActivate_QueryInterface(IQuickActivate *iface, REFIID iid, void **out) +{ + return dhtml_edit_qi(impl_from_IQuickActivate(iface), iid, out); +} + +static ULONG WINAPI QuickActivate_AddRef(IQuickActivate *iface) +{ + return dhtml_edit_addref(impl_from_IQuickActivate(iface)); +} + +static ULONG WINAPI QuickActivate_Release(IQuickActivate *iface) +{ + return dhtml_edit_release(impl_from_IQuickActivate(iface)); +} + +static HRESULT WINAPI QuickActivate_QuickActivate(IQuickActivate *iface, + QACONTAINER *container_info, QACONTROL *control_info) +{ + DHTMLEditImpl *This = impl_from_IQuickActivate(iface); + FIXME("(%p)->(%p, %p) stub\n", This, container_info, control_info); + return S_OK; +} + +static HRESULT WINAPI QuickActivate_GetContentExtent(IQuickActivate *iface, SIZEL *value) +{ + DHTMLEditImpl *This = impl_from_IQuickActivate(iface); + FIXME("(%p)->(%p) stub\n", This, value); + return E_NOTIMPL; +} + +static HRESULT WINAPI QuickActivate_SetContentExtent(IQuickActivate *iface, SIZEL *value) +{ + DHTMLEditImpl *This = impl_from_IQuickActivate(iface); + FIXME("(%p)->(%p) stub\n", This, value); + return E_NOTIMPL; +} + +static const IQuickActivateVtbl QuickActivateVtbl = { + QuickActivate_QueryInterface, + QuickActivate_AddRef, + QuickActivate_Release, + QuickActivate_QuickActivate, + QuickActivate_GetContentExtent, + QuickActivate_SetContentExtent +}; + HRESULT dhtml_edit_create(REFIID iid, void **out) { DHTMLEditImpl *This; @@ -527,6 +596,7 @@ HRESULT dhtml_edit_create(REFIID iid, void **out) return E_OUTOFMEMORY;
This->IDHTMLEdit_iface.lpVtbl = &DHTMLEditVtbl; + This->IQuickActivate_iface.lpVtbl = &QuickActivateVtbl; This->ref = 1;
*out = &This->IDHTMLEdit_iface;