Dan Hipschman dsh@linux.ucla.edu writes:
@@ -532,6 +538,709 @@ static const ITextDocumentVtbl tdvt = { ITextDocument_fnRangeFromPoint };
+/*** IUnknown methods ***/ +static HRESULT WINAPI ITextSelection_fnQueryInterface(
- ITextSelection *me,
- REFIID riid,
- void **ppvObj)
+{
- ITextSelectionImpl *This = (ITextSelectionImpl *) me;
- TRACE("%p %s\n", This, debugstr_guid(riid));
- *ppvObj = NULL;
- if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ITextSelection))
- {
*ppvObj = me;
return S_OK;
- }
- return E_NOINTERFACE;
+}
+static ULONG WINAPI ITextSelection_fnAddRef(
- ITextSelection *me)
+{
- return 2;
+}
+static ULONG WINAPI ITextSelection_fnRelease(
- ITextSelection *me)
+{
- return 1;
+}
The ref counting isn't correct. Most likely ITextSelection should be implemented directly by the main object, and share its ref count.