[PATCH 5/7] comsvcs: Add IROTData stub for "new" moniker.
Nikolay Sivov
nsivov at codeweavers.com
Mon Nov 11 01:36:55 CST 2019
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/comsvcs/main.c | 46 ++++++++++++++++++++++++++++++++++++
dlls/comsvcs/tests/comsvcs.c | 5 ++++
2 files changed, 51 insertions(+)
diff --git a/dlls/comsvcs/main.c b/dlls/comsvcs/main.c
index 0f287a681f..7bfde03b34 100644
--- a/dlls/comsvcs/main.c
+++ b/dlls/comsvcs/main.c
@@ -54,6 +54,7 @@ typedef struct holder
struct new_moniker
{
IMoniker IMoniker_iface;
+ IROTData IROTData_iface;
LONG refcount;
CLSID clsid;
};
@@ -75,6 +76,11 @@ static struct new_moniker *impl_from_IMoniker(IMoniker *iface)
return CONTAINING_RECORD(iface, struct new_moniker, IMoniker_iface);
}
+static struct new_moniker *impl_from_IROTData(IROTData *iface)
+{
+ return CONTAINING_RECORD(iface, struct new_moniker, IROTData_iface);
+}
+
static HRESULT WINAPI holder_QueryInterface(IHolder *iface, REFIID riid, void **object)
{
holder *This = impl_from_IHolder(iface);
@@ -429,6 +435,8 @@ static const IClassFactoryVtbl comsvcscf_vtbl =
static HRESULT WINAPI new_moniker_QueryInterface(IMoniker* iface, REFIID riid, void **obj)
{
+ struct new_moniker *moniker = impl_from_IMoniker(iface);
+
TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
*obj = NULL;
@@ -440,6 +448,10 @@ static HRESULT WINAPI new_moniker_QueryInterface(IMoniker* iface, REFIID riid, v
{
*obj = iface;
}
+ else if (IsEqualIID(&IID_IROTData, riid))
+ {
+ *obj = &moniker->IROTData_iface;
+ }
if (*obj)
{
@@ -738,6 +750,39 @@ static const IMonikerVtbl new_moniker_vtbl =
new_moniker_IsSystemMoniker
};
+static HRESULT WINAPI new_moniker_rotdata_QueryInterface(IROTData *iface, REFIID riid, void **obj)
+{
+ struct new_moniker *moniker = impl_from_IROTData(iface);
+ return IMoniker_QueryInterface(&moniker->IMoniker_iface, riid, obj);
+}
+
+static ULONG WINAPI new_moniker_rotdata_AddRef(IROTData *iface)
+{
+ struct new_moniker *moniker = impl_from_IROTData(iface);
+ return IMoniker_AddRef(&moniker->IMoniker_iface);
+}
+
+static ULONG WINAPI new_moniker_rotdata_Release(IROTData *iface)
+{
+ struct new_moniker *moniker = impl_from_IROTData(iface);
+ return IMoniker_Release(&moniker->IMoniker_iface);
+}
+
+static HRESULT WINAPI new_moniker_rotdata_GetComparisonData(IROTData *iface, byte *data, ULONG data_len, ULONG *length)
+{
+ FIXME("%p, %p, %u, %p.\n", iface, data, data_len, length);
+
+ return E_NOTIMPL;
+}
+
+static const IROTDataVtbl new_moniker_rotdata_vtbl =
+{
+ new_moniker_rotdata_QueryInterface,
+ new_moniker_rotdata_AddRef,
+ new_moniker_rotdata_Release,
+ new_moniker_rotdata_GetComparisonData,
+};
+
static const BYTE guid_conv_table[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
@@ -837,6 +882,7 @@ static HRESULT new_moniker_parse_displayname(IBindCtx *pbc, LPOLESTR name, ULONG
return E_OUTOFMEMORY;
moniker->IMoniker_iface.lpVtbl = &new_moniker_vtbl;
+ moniker->IROTData_iface.lpVtbl = &new_moniker_rotdata_vtbl;
moniker->refcount = 1;
moniker->clsid = guid;
diff --git a/dlls/comsvcs/tests/comsvcs.c b/dlls/comsvcs/tests/comsvcs.c
index 4d37b60eb9..3b15a1f7e6 100644
--- a/dlls/comsvcs/tests/comsvcs.c
+++ b/dlls/comsvcs/tests/comsvcs.c
@@ -301,6 +301,7 @@ static void test_new_moniker(void)
BIND_OPTS2 bind_opts;
ULARGE_INTEGER size;
DWORD moniker_type;
+ IROTData *rot_data;
IBindCtx *bindctx;
FILETIME filetime;
DWORD hash, eaten;
@@ -318,6 +319,10 @@ static void test_new_moniker(void)
ok(hr == S_OK, "Failed to parse display name, hr %#x.\n", hr);
ok(eaten == 40, "Unexpected eaten length %u.\n", eaten);
+ hr = IMoniker_QueryInterface(moniker, &IID_IROTData, (void **)&rot_data);
+ ok(hr == S_OK, "Failed to get IROTData, hr %#x.\n", hr);
+ IROTData_Release(rot_data);
+
eaten = 0;
hr = IMoniker_ParseDisplayName(moniker, bindctx, NULL, (WCHAR *)L"new:20d04fe0-3aea-1069-a2d8-08002b30309d",
&eaten, &moniker2);
--
2.24.0
More information about the wine-devel
mailing list