From: Zhiyi Zhang zzhang@codeweavers.com
--- configure.ac | 1 + dlls/dataexchange/Makefile.in | 7 ++ dlls/dataexchange/classes.idl | 23 +++++ dlls/dataexchange/dataexchange.spec | 3 + dlls/dataexchange/main.c | 129 ++++++++++++++++++++++++++++ dlls/dataexchange/private.h | 33 +++++++ 6 files changed, 196 insertions(+) create mode 100644 dlls/dataexchange/Makefile.in create mode 100644 dlls/dataexchange/classes.idl create mode 100644 dlls/dataexchange/dataexchange.spec create mode 100644 dlls/dataexchange/main.c create mode 100644 dlls/dataexchange/private.h
diff --git a/configure.ac b/configure.ac index 0f5b89d1b47..88734bd89cd 100644 --- a/configure.ac +++ b/configure.ac @@ -2560,6 +2560,7 @@ WINE_CONFIG_MAKEFILE(dlls/d3dx9_42) WINE_CONFIG_MAKEFILE(dlls/d3dx9_43) WINE_CONFIG_MAKEFILE(dlls/d3dxof) WINE_CONFIG_MAKEFILE(dlls/d3dxof/tests) +WINE_CONFIG_MAKEFILE(dlls/dataexchange) WINE_CONFIG_MAKEFILE(dlls/davclnt) WINE_CONFIG_MAKEFILE(dlls/dbgeng) WINE_CONFIG_MAKEFILE(dlls/dbgeng/tests) diff --git a/dlls/dataexchange/Makefile.in b/dlls/dataexchange/Makefile.in new file mode 100644 index 00000000000..b4b37a841e4 --- /dev/null +++ b/dlls/dataexchange/Makefile.in @@ -0,0 +1,7 @@ +MODULE = dataexchange.dll +IMPORTLIB = dataexchange +IMPORTS = combase + +SOURCES = \ + classes.idl \ + main.c diff --git a/dlls/dataexchange/classes.idl b/dlls/dataexchange/classes.idl new file mode 100644 index 00000000000..06f6dd3e545 --- /dev/null +++ b/dlls/dataexchange/classes.idl @@ -0,0 +1,23 @@ +/* + * Runtime Classes for dataexchange.dll + * + * Copyright 2024 Zhiyi Zhang for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +#include "windows.applicationmodel.datatransfer.dragdrop.core.idl" diff --git a/dlls/dataexchange/dataexchange.spec b/dlls/dataexchange/dataexchange.spec new file mode 100644 index 00000000000..20a8bfa98ea --- /dev/null +++ b/dlls/dataexchange/dataexchange.spec @@ -0,0 +1,3 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetActivationFactory(ptr ptr) +@ stdcall -private DllGetClassObject(ptr ptr ptr) diff --git a/dlls/dataexchange/main.c b/dlls/dataexchange/main.c new file mode 100644 index 00000000000..22e5f7a6ca9 --- /dev/null +++ b/dlls/dataexchange/main.c @@ -0,0 +1,129 @@ +/* + * Copyright 2024 Zhiyi Zhang for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dataexchange); + +struct dataexchange +{ + IActivationFactory IActivationFactory_iface; + LONG ref; +}; + +static inline struct dataexchange *impl_from_IActivationFactory(IActivationFactory *iface) +{ + return CONTAINING_RECORD(iface, struct dataexchange, IActivationFactory_iface); +} + +static HRESULT STDMETHODCALLTYPE dataexchange_QueryInterface(IActivationFactory *iface, REFIID iid, + void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) + || IsEqualGUID(iid, &IID_IInspectable) + || IsEqualGUID(iid, &IID_IAgileObject) + || IsEqualGUID(iid, &IID_IActivationFactory)) + { + IUnknown_AddRef(iface); + *out = iface; + return S_OK; + } + + FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE dataexchange_AddRef(IActivationFactory *iface) +{ + struct dataexchange *impl = impl_from_IActivationFactory(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static ULONG STDMETHODCALLTYPE dataexchange_Release(IActivationFactory *iface) +{ + struct dataexchange *impl = impl_from_IActivationFactory(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static HRESULT STDMETHODCALLTYPE dataexchange_GetIids(IActivationFactory *iface, ULONG *iid_count, + IID **iids) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE dataexchange_GetRuntimeClassName(IActivationFactory *iface, + HSTRING *class_name) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE dataexchange_GetTrustLevel(IActivationFactory *iface, + TrustLevel *trust_level) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE dataexchange_ActivateInstance(IActivationFactory *iface, + IInspectable **instance) +{ + FIXME("iface %p, instance %p stub!\n", iface, instance); + return E_NOTIMPL; +} + +static const struct IActivationFactoryVtbl activation_factory_vtbl = +{ + dataexchange_QueryInterface, + dataexchange_AddRef, + dataexchange_Release, + /* IInspectable methods */ + dataexchange_GetIids, + dataexchange_GetRuntimeClassName, + dataexchange_GetTrustLevel, + /* IActivationFactory methods */ + dataexchange_ActivateInstance, +}; + +static struct dataexchange dataexchange = +{ + {&activation_factory_vtbl}, + 1 +}; + +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + FIXME("clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out); + return CLASS_E_CLASSNOTAVAILABLE; +} + +HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory) +{ + TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory); + *factory = &dataexchange.IActivationFactory_iface; + IUnknown_AddRef(*factory); + return S_OK; +} diff --git a/dlls/dataexchange/private.h b/dlls/dataexchange/private.h new file mode 100644 index 00000000000..595d956fdc8 --- /dev/null +++ b/dlls/dataexchange/private.h @@ -0,0 +1,33 @@ +/* + * Copyright 2024 Zhiyi Zhang for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_DATAEXCHANGE_PRIVATE_H +#define __WINE_DATAEXCHANGE_PRIVATE_H + +#include <stdarg.h> + +#define COBJMACROS +#include "initguid.h" +#include "windef.h" +#include "winbase.h" +#include "winstring.h" +#include "wine/debug.h" +#include "objbase.h" +#include "activation.h" + +#endif /* __WINE_DATAEXCHANGE_PRIVATE_H */