Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
v2: fixed up includes in main idl.
include/Makefile.in | 4 ++ include/msopc.idl | 89 ++++++++++++++++++++++++++++++++++++++ include/opcbase.idl | 28 ++++++++++++ include/opcobjectmodel.idl | 34 +++++++++++++++ include/opcparturi.idl | 71 ++++++++++++++++++++++++++++++ 5 files changed, 226 insertions(+) create mode 100644 include/msopc.idl create mode 100644 include/opcbase.idl create mode 100644 include/opcobjectmodel.idl create mode 100644 include/opcparturi.idl
diff --git a/include/Makefile.in b/include/Makefile.in index a89fef6eac..ffecb98d9e 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -399,6 +399,7 @@ SOURCES = \ msident.idl \ msinkaut.idl \ msiquery.h \ + msopc.idl \ mssip.h \ msstkppg.h \ mstask.idl \ @@ -493,6 +494,9 @@ SOURCES = \ oledberr.h \ oledlg.h \ oleidl.idl \ + opcbase.idl \ + opcobjectmodel.idl \ + opcparturi.idl \ opnrst.idl \ optary.idl \ patchapi.h \ diff --git a/include/msopc.idl b/include/msopc.idl new file mode 100644 index 0000000000..12404e5a12 --- /dev/null +++ b/include/msopc.idl @@ -0,0 +1,89 @@ +/* + * Copyright 2018 Nikolay Sivov 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 + */ + +import "unknwn.idl"; +import "ocidl.idl"; + +#include "opcbase.idl" +#include "opcobjectmodel.idl" +#include "opcparturi.idl" + +#ifndef __WIDL__ +#define threading(model) +#endif + +interface IOpcUri; +interface IOpcPartUri; +interface IOpcPackage; +interface IOpcDigitalSignatureManager; + +[ + object, + uuid(6d0b4446-cd73-4ab3-94f4-8ccdf6116154), + pointer_default(ref) +] +interface IOpcFactory : IUnknown +{ + HRESULT CreatePackageRootUri( + [out, retval] IOpcUri **uri + ); + + HRESULT CreatePartUri( + [in, string] LPCWSTR uri, + [out, retval] IOpcPartUri **part_uri + ); + + [local] + HRESULT CreateStreamOnFile( + [in, string] LPCWSTR filename, + [in] OPC_STREAM_IO_MODE io_mode, + [in, unique] SECURITY_ATTRIBUTES *sa, + [in] DWORD flags, + [out, retval] IStream **stream + ); + + HRESULT CreatePackage( + [out, retval] IOpcPackage **package + ); + + HRESULT ReadPackageFromStream( + [in] IStream *stream, + [in] OPC_READ_FLAGS flags, + [out, retval] IOpcPackage **package + ); + + HRESULT WritePackageToStream( + [in] IOpcPackage *package, + [in] OPC_WRITE_FLAGS flags, + [in] IStream *stream + ); + + HRESULT CreateDigitalSignatureManager( + [in] IOpcPackage *package, + [out, retval] IOpcDigitalSignatureManager **signature_manager + ); +} + +[ + threading(both), + uuid(6b2d6Ba0-9f3e-4f27-920b-313cc426a39e) +] +coclass OpcFactory +{ + interface IOpcFactory; +}; diff --git a/include/opcbase.idl b/include/opcbase.idl new file mode 100644 index 0000000000..2cfb885c12 --- /dev/null +++ b/include/opcbase.idl @@ -0,0 +1,28 @@ +/* + * Copyright 2018 Nikolay Sivov 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 + */ + +#if 0 +#pragma makedep install +#endif + +typedef [v1_enum] enum +{ + OPC_STREAM_IO_READ = 1, + OPC_STREAM_IO_WRITE = 2, +} OPC_STREAM_IO_MODE; + diff --git a/include/opcobjectmodel.idl b/include/opcobjectmodel.idl new file mode 100644 index 0000000000..e5370d2e54 --- /dev/null +++ b/include/opcobjectmodel.idl @@ -0,0 +1,34 @@ +/* + * Copyright 2018 Nikolay Sivov 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 + */ + +#if 0 +#pragma makedep install +#endif + +typedef [v1_enum] enum +{ + OPC_READ_DEFAULT = 0, + OPC_VALIDATE_ON_LOAD = 1, + OPC_CACHE_ON_ACCESS = 2, +} OPC_READ_FLAGS; + +typedef [v1_enum] enum +{ + OPC_WRITE_DEFAULT = 0, + OPC_WRITE_FORCE_ZIP32 = 1, +} OPC_WRITE_FLAGS; diff --git a/include/opcparturi.idl b/include/opcparturi.idl new file mode 100644 index 0000000000..00b21b9598 --- /dev/null +++ b/include/opcparturi.idl @@ -0,0 +1,71 @@ +/* + * Copyright 2018 Nikolay Sivov 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 + */ + +import "unknwn.idl"; +import "ocidl.idl"; + +#if 0 +#pragma makedep install +#endif + +interface IOpcPartUri; + +[ + object, + uuid(bc9c1b9b-d62c-49eb-aef0-3b4e0b28ebed), + nonextensible, + pointer_default(ref) +] +interface IOpcUri : IUri +{ + HRESULT GetRelationshipsPartUri( + [out, retval] IOpcPartUri **part_uri + ); + + HRESULT GetRelativeUri( + [in] IOpcPartUri *part_uri, + [out, retval] IUri **relative_uri + ); + + HRESULT CombinePartUri( + [in] IUri *relative_uri, + [out, retval] IOpcPartUri **combined + ); +} + +[ + object, + uuid(7d3babe7-88b2-46ba-85cb-4203cb016c87), + nonextensible, + pointer_default(ref) +] +interface IOpcPartUri : IOpcUri +{ + HRESULT ComparePartUri( + [in] IOpcPartUri *part_uri, + [out, retval] INT32 *result + ); + + HRESULT GetSourceUri( + [out, retval] IOpcUri **source_uri + ); + + HRESULT IsRelationshipsPartUri( + [out, retval] BOOL *result + ); +}
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- configure | 2 + configure.ac | 1 + dlls/opcservices/Makefile.in | 8 ++ dlls/opcservices/factory.c | 225 ++++++++++++++++++++++++++++++ dlls/opcservices/opcservices.idl | 21 +++ dlls/opcservices/opcservices.spec | 4 + 6 files changed, 261 insertions(+) create mode 100644 dlls/opcservices/Makefile.in create mode 100644 dlls/opcservices/factory.c create mode 100644 dlls/opcservices/opcservices.idl create mode 100644 dlls/opcservices/opcservices.spec
diff --git a/configure b/configure index 2a611bd00d..023a1640cb 100755 --- a/configure +++ b/configure @@ -1463,6 +1463,7 @@ enable_oledlg enable_olepro32 enable_olesvr32 enable_olethk32 +enable_opcservices enable_openal32 enable_opencl enable_opengl32 @@ -19713,6 +19714,7 @@ wine_fn_config_makefile dlls/olepro32 enable_olepro32 wine_fn_config_makefile dlls/olesvr.dll16 enable_win16 wine_fn_config_makefile dlls/olesvr32 enable_olesvr32 wine_fn_config_makefile dlls/olethk32 enable_olethk32 +wine_fn_config_makefile dlls/opcservices enable_opcservices wine_fn_config_makefile dlls/openal32 enable_openal32 wine_fn_config_makefile dlls/opencl enable_opencl wine_fn_config_makefile dlls/opengl32 enable_opengl32 diff --git a/configure.ac b/configure.ac index ddf7ee3a20..2b63d6ae50 100644 --- a/configure.ac +++ b/configure.ac @@ -3573,6 +3573,7 @@ WINE_CONFIG_MAKEFILE(dlls/olepro32) WINE_CONFIG_MAKEFILE(dlls/olesvr.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/olesvr32) WINE_CONFIG_MAKEFILE(dlls/olethk32) +WINE_CONFIG_MAKEFILE(dlls/opcservices) WINE_CONFIG_MAKEFILE(dlls/openal32) WINE_CONFIG_MAKEFILE(dlls/opencl) WINE_CONFIG_MAKEFILE(dlls/opengl32) diff --git a/dlls/opcservices/Makefile.in b/dlls/opcservices/Makefile.in new file mode 100644 index 0000000000..20d8eb5262 --- /dev/null +++ b/dlls/opcservices/Makefile.in @@ -0,0 +1,8 @@ +MODULE = opcservices.dll +IMPORTS = uuid + +C_SRCS = \ + factory.c + +IDL_SRCS = \ + opcservices.idl diff --git a/dlls/opcservices/factory.c b/dlls/opcservices/factory.c new file mode 100644 index 0000000000..dd6556db8a --- /dev/null +++ b/dlls/opcservices/factory.c @@ -0,0 +1,225 @@ +/* + * Copyright 2018 Nikolay Sivov 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 + */ + +#define COBJMACROS + +#include <stdarg.h> +#include "windef.h" +#include "winbase.h" + +#include "initguid.h" +#include "ole2.h" +#include "rpcproxy.h" +#include "msopc.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msopc); + +static HRESULT WINAPI opc_factory_QueryInterface(IOpcFactory *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IOpcFactory) || + IsEqualIID(iid, &IID_IUnknown)) + { + *out = iface; + IOpcFactory_AddRef(iface); + return S_OK; + } + + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_factory_AddRef(IOpcFactory *iface) +{ + return 2; +} + +static ULONG WINAPI opc_factory_Release(IOpcFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI opc_factory_CreatePackageRootUri(IOpcFactory *iface, IOpcUri **uri) +{ + FIXME("iface %p, uri %p stub!\n", iface, uri); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_factory_CreatePartUri(IOpcFactory *iface, LPCWSTR uri, IOpcPartUri **part_uri) +{ + FIXME("iface %p, uri %s, part_uri %p stub!\n", iface, debugstr_w(uri), part_uri); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_factory_CreateStreamOnFile(IOpcFactory *iface, LPCWSTR filename, + OPC_STREAM_IO_MODE io_mode, SECURITY_ATTRIBUTES *sa, DWORD flags, IStream **stream) +{ + FIXME("iface %p, filename %s, io_mode %d, sa %p, flags %#x, stream %p stub!\n", iface, debugstr_w(filename), + io_mode, sa, flags, stream); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_factory_CreatePackage(IOpcFactory *iface, IOpcPackage **package) +{ + FIXME("iface %p, package %p.\n", iface, package); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_factory_ReadPackageFromStream(IOpcFactory *iface, IStream *stream, + OPC_READ_FLAGS flags, IOpcPackage **package) +{ + FIXME("iface %p, stream %p, flags %#x, package %p stub!\n", iface, stream, flags, package); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_factory_WritePackageToStream(IOpcFactory *iface, IOpcPackage *package, OPC_WRITE_FLAGS flags, + IStream *stream) +{ + FIXME("iface %p, package %p, flags %#x, stream %p stub!\n", iface, package, flags, stream); + + return E_NOTIMPL; +} + +static HRESULT WINAPI opc_factory_CreateDigitalSignatureManager(IOpcFactory *iface, IOpcPackage *package, + IOpcDigitalSignatureManager **signature_manager) +{ + FIXME("iface %p, package %p, signature_manager %p stub!\n", iface, package, signature_manager); + + return E_NOTIMPL; +} + +static const IOpcFactoryVtbl opc_factory_vtbl = +{ + opc_factory_QueryInterface, + opc_factory_AddRef, + opc_factory_Release, + opc_factory_CreatePackageRootUri, + opc_factory_CreatePartUri, + opc_factory_CreateStreamOnFile, + opc_factory_CreatePackage, + opc_factory_ReadPackageFromStream, + opc_factory_WritePackageToStream, + opc_factory_CreateDigitalSignatureManager, +}; + +static IOpcFactory opc_factory = { &opc_factory_vtbl }; + +static HRESULT WINAPI opc_class_factory_QueryInterface(IClassFactory *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IClassFactory) || + IsEqualGUID(iid, &IID_IUnknown)) + { + IClassFactory_AddRef(iface); + *out = iface; + return S_OK; + } + + *out = NULL; + WARN("Unsupported interface %s.\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI opc_class_factory_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI opc_class_factory_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI opc_class_factory_CreateInstance(IClassFactory *iface, + IUnknown *outer, REFIID iid, void **out) +{ + TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out); + + if (outer) + return CLASS_E_NOAGGREGATION; + + return IOpcFactory_QueryInterface(&opc_factory, iid, out); +} + +static HRESULT WINAPI opc_class_factory_LockServer(IClassFactory *iface, BOOL dolock) +{ + FIXME("iface %p, dolock %d stub!\n", iface, dolock); + return S_OK; +} + +static const struct IClassFactoryVtbl opc_class_factory_vtbl = +{ + opc_class_factory_QueryInterface, + opc_class_factory_AddRef, + opc_class_factory_Release, + opc_class_factory_CreateInstance, + opc_class_factory_LockServer +}; + +static IClassFactory opc_class_factory = { &opc_class_factory_vtbl }; + +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) +{ + TRACE("clsid %s, iid %s, out %p\n", debugstr_guid(clsid), debugstr_guid(iid), out); + + if (IsEqualCLSID(clsid, &CLSID_OpcFactory)) + return IClassFactory_QueryInterface(&opc_class_factory, iid, out); + + WARN("Unsupported class %s.\n", debugstr_guid(clsid)); + return E_NOTIMPL; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +static HINSTANCE OPC_hInstance; + +BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD reason, void *reserved) +{ + OPC_hInstance = hInstDLL; + + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hInstDLL); + break; + } + return TRUE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + FIXME("\n"); + return __wine_register_resources( OPC_hInstance ); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources( OPC_hInstance ); +} diff --git a/dlls/opcservices/opcservices.idl b/dlls/opcservices/opcservices.idl new file mode 100644 index 0000000000..689131b308 --- /dev/null +++ b/dlls/opcservices/opcservices.idl @@ -0,0 +1,21 @@ +/* + * Copyright 2018 Nikolay Sivov 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 "msopc.idl" diff --git a/dlls/opcservices/opcservices.spec b/dlls/opcservices/opcservices.spec new file mode 100644 index 0000000000..b16365d0c9 --- /dev/null +++ b/dlls/opcservices/opcservices.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer()