From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/dataexchange/main.c | 33 ++++++++++++++++++++++++++++ dlls/dataexchange/private.h | 44 +++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+)
diff --git a/dlls/dataexchange/main.c b/dlls/dataexchange/main.c index 22e5f7a6ca9..e9fa3202523 100644 --- a/dlls/dataexchange/main.c +++ b/dlls/dataexchange/main.c @@ -23,6 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dataexchange); struct dataexchange { IActivationFactory IActivationFactory_iface; + ICoreDragDropManagerStatics ICoreDragDropManagerStatics_iface; LONG ref; };
@@ -34,6 +35,8 @@ static inline struct dataexchange *impl_from_IActivationFactory(IActivationFacto static HRESULT STDMETHODCALLTYPE dataexchange_QueryInterface(IActivationFactory *iface, REFIID iid, void **out) { + struct dataexchange *impl = impl_from_IActivationFactory(iface); + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
if (IsEqualGUID(iid, &IID_IUnknown) @@ -45,6 +48,12 @@ static HRESULT STDMETHODCALLTYPE dataexchange_QueryInterface(IActivationFactory *out = iface; return S_OK; } + else if (IsEqualGUID(iid, &IID_ICoreDragDropManagerStatics)) + { + ICoreDragDropManagerStatics_AddRef(&impl->ICoreDragDropManagerStatics_iface); + *out = &impl->ICoreDragDropManagerStatics_iface; + return S_OK; + }
FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); *out = NULL; @@ -108,9 +117,33 @@ static const struct IActivationFactoryVtbl activation_factory_vtbl = dataexchange_ActivateInstance, };
+DEFINE_IINSPECTABLE(core_dragdrop_manager_statics, ICoreDragDropManagerStatics, struct dataexchange, + IActivationFactory_iface) + +static HRESULT STDMETHODCALLTYPE core_dragdrop_manager_statics_GetForCurrentView(ICoreDragDropManagerStatics *iface, + ICoreDragDropManager **value) +{ + FIXME("iface %p, value %p stub!\n", iface, value); + return E_NOTIMPL; +} + +static const struct ICoreDragDropManagerStaticsVtbl core_dragdrop_manager_statics_vtbl = +{ + core_dragdrop_manager_statics_QueryInterface, + core_dragdrop_manager_statics_AddRef, + core_dragdrop_manager_statics_Release, + /* IInspectable methods */ + core_dragdrop_manager_statics_GetIids, + core_dragdrop_manager_statics_GetRuntimeClassName, + core_dragdrop_manager_statics_GetTrustLevel, + /* ICoreDragDropManagerStatics methods */ + core_dragdrop_manager_statics_GetForCurrentView, +}; + static struct dataexchange dataexchange = { {&activation_factory_vtbl}, + {&core_dragdrop_manager_statics_vtbl}, 1 };
diff --git a/dlls/dataexchange/private.h b/dlls/dataexchange/private.h index 595d956fdc8..41d128cc608 100644 --- a/dlls/dataexchange/private.h +++ b/dlls/dataexchange/private.h @@ -30,4 +30,48 @@ #include "objbase.h" #include "activation.h"
+#define WIDL_using_Windows_Networking_Connectivity +#include "windows.networking.connectivity.h" +#define WIDL_using_Windows_ApplicationModel_DataTransfer_DragDrop_Core +#include "windows.applicationmodel.datatransfer.dragdrop.core.h" + +#define DEFINE_IINSPECTABLE_(pfx, iface_type, impl_type, impl_from, iface_mem, expr) \ + static inline impl_type *impl_from(iface_type *iface) \ + { \ + return CONTAINING_RECORD(iface, impl_type, iface_mem); \ + } \ + static HRESULT WINAPI pfx##_QueryInterface(iface_type *iface, REFIID iid, void **out) \ + { \ + impl_type *impl = impl_from(iface); \ + return IInspectable_QueryInterface((IInspectable *)(expr), iid, out); \ + } \ + static ULONG WINAPI pfx##_AddRef(iface_type *iface) \ + { \ + impl_type *impl = impl_from(iface); \ + return IInspectable_AddRef((IInspectable *)(expr)); \ + } \ + static ULONG WINAPI pfx##_Release(iface_type *iface) \ + { \ + impl_type *impl = impl_from(iface); \ + return IInspectable_Release((IInspectable *)(expr)); \ + } \ + static HRESULT WINAPI pfx##_GetIids(iface_type *iface, ULONG *iid_count, IID **iids) \ + { \ + impl_type *impl = impl_from(iface); \ + return IInspectable_GetIids((IInspectable *)(expr), iid_count, iids); \ + } \ + static HRESULT WINAPI pfx##_GetRuntimeClassName(iface_type *iface, HSTRING *class_name) \ + { \ + impl_type *impl = impl_from(iface); \ + return IInspectable_GetRuntimeClassName((IInspectable *)(expr), class_name); \ + } \ + static HRESULT WINAPI pfx##_GetTrustLevel(iface_type *iface, TrustLevel *trust_level) \ + { \ + impl_type *impl = impl_from(iface); \ + return IInspectable_GetTrustLevel((IInspectable *)(expr), trust_level); \ + } + +#define DEFINE_IINSPECTABLE(pfx, iface_type, impl_type, base_iface) \ + DEFINE_IINSPECTABLE_(pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface) + #endif /* __WINE_DATAEXCHANGE_PRIVATE_H */