[PATCH v4 0/8] MR3249: windows.networking.hostname: Implement IHostNameFactory::CreateHostName().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54699 I added the complete `windows.networking.idl` file since it was small and in case it's needed for mingw build. -- v4: windows.networking.hostname: Implement IHostName::get_RawName(). windows.networking.hostname: Implement IHostNameFactory::CreateHostName(). windows.networking.hostname/tests: Add IHostNameFactory::CreateHostName() tests. windows.networking.hostname: Add IHostNameFactory stub interface. windows.networking.hostname: Add stub DLL. include: Add windows.networking.idl file. include: Add windows.networking.connectivity.idl file. include: Add support for BYTE IReference. https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
From: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Needed by Windows.Networking.Connectivity.IPInformation. --- include/windows.foundation.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl index 281b51d0d6c..9be302515a4 100644 --- a/include/windows.foundation.idl +++ b/include/windows.foundation.idl @@ -86,6 +86,7 @@ namespace Windows.Foundation { interface Windows.Foundation.AsyncOperationCompletedHandler<boolean>; interface Windows.Foundation.IAsyncOperation<IInspectable *>; interface Windows.Foundation.IAsyncOperation<boolean>; + interface Windows.Foundation.IReference<BYTE>; interface Windows.Foundation.IReference<INT32>; interface Windows.Foundation.IReference<DOUBLE>; interface Windows.Foundation.TypedEventHandler<IInspectable *, IInspectable *>; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
From: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Needed by Windows.Networking.HostName. --- include/Makefile.in | 1 + include/windows.networking.connectivity.idl | 66 +++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 include/windows.networking.connectivity.idl diff --git a/include/Makefile.in b/include/Makefile.in index 1f28524adc2..80ba168dc86 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -834,6 +834,7 @@ SOURCES = \ windows.media.idl \ windows.media.speechrecognition.idl \ windows.media.speechsynthesis.idl \ + windows.networking.connectivity.idl \ windows.perception.spatial.idl \ windows.perception.spatial.surfaces.idl \ windows.security.credentials.idl \ diff --git a/include/windows.networking.connectivity.idl b/include/windows.networking.connectivity.idl new file mode 100644 index 00000000000..8c6489ba13b --- /dev/null +++ b/include/windows.networking.connectivity.idl @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; +/* import "windows.networking.idl"; */ +import "windows.storage.streams.idl"; + +namespace Windows.Networking.Connectivity { + interface IIPInformation; + interface INetworkAdapter; + + runtimeclass IPInformation; + runtimeclass NetworkAdapter; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Networking.Connectivity.IPInformation), + uuid(d85145e0-138f-47d7-9b3a-36bb488cef33) + ] + interface IIPInformation : IInspectable + { + [propget] HRESULT NetworkAdapter([out, retval] Windows.Networking.Connectivity.NetworkAdapter **value); + [propget] HRESULT PrefixLength([out, retval] Windows.Foundation.IReference<BYTE> **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass IPInformation + { + [default] interface Windows.Networking.Connectivity.IIPInformation; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + ] + runtimeclass NetworkAdapter + { + [default] interface Windows.Networking.Connectivity.INetworkAdapter; + } +} -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
From: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> --- include/Makefile.in | 1 + include/windows.networking.idl | 173 +++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 include/windows.networking.idl diff --git a/include/Makefile.in b/include/Makefile.in index 80ba168dc86..b1b582ff4d6 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -835,6 +835,7 @@ SOURCES = \ windows.media.speechrecognition.idl \ windows.media.speechsynthesis.idl \ windows.networking.connectivity.idl \ + windows.networking.idl \ windows.perception.spatial.idl \ windows.perception.spatial.surfaces.idl \ windows.security.credentials.idl \ diff --git a/include/windows.networking.idl b/include/windows.networking.idl new file mode 100644 index 00000000000..e864a3bb1ad --- /dev/null +++ b/include/windows.networking.idl @@ -0,0 +1,173 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; +import "windows.networking.connectivity.idl"; + +namespace Windows.Networking { + typedef enum DomainNameType DomainNameType; + typedef enum HostNameSortOptions HostNameSortOptions; + typedef enum HostNameType HostNameType; + + interface IEndpointPair; + interface IEndpointPairFactory; + interface IHostName; + interface IHostNameFactory; + interface IHostNameStatics; + + runtimeclass EndpointPair; + runtimeclass HostName; + + declare { + interface Windows.Foundation.Collections.IIterable<Windows.Networking.EndpointPair *>; + interface Windows.Foundation.Collections.IIterable<Windows.Networking.HostName *>; + interface Windows.Foundation.Collections.IIterator<Windows.Networking.EndpointPair *>; + interface Windows.Foundation.Collections.IIterator<Windows.Networking.HostName *>; + interface Windows.Foundation.Collections.IVectorView<Windows.Networking.EndpointPair *>; + interface Windows.Foundation.Collections.IVectorView<Windows.Networking.HostName *>; + interface Windows.Foundation.Collections.IVector<Windows.Networking.HostName *>; + interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Foundation.Collections.IVectorView<Windows.Networking.EndpointPair *> *>; + interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Networking.EndpointPair *> *>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum DomainNameType + { + Suffix = 0, + FullyQualified = 1, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + flags + ] + enum HostNameSortOptions + { + None = 0x0, + OptimizeForLongConnections = 0x2, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum HostNameType + { + DomainName = 0, + Ipv4 = 1, + Ipv6 = 2, + Bluetooth = 3, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Networking.EndpointPair), + uuid(33a0aa36-f8fa-4b30-b856-76517c3bd06d) + ] + interface IEndpointPair : IInspectable + { + [propget] HRESULT LocalHostName([out, retval] Windows.Networking.HostName **value); + [propput] HRESULT LocalHostName([in] Windows.Networking.HostName *value); + [propget] HRESULT LocalServiceName([out, retval] HSTRING *value); + [propput] HRESULT LocalServiceName([in] HSTRING value); + [propget] HRESULT RemoteHostName([out, retval] Windows.Networking.HostName **value); + [propput] HRESULT RemoteHostName([in] Windows.Networking.HostName *value); + [propget] HRESULT RemoteServiceName([out, retval] HSTRING *value); + [propput] HRESULT RemoteServiceName([in] HSTRING value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Networking.EndpointPair), + uuid(b609d971-64e0-442b-aa6f-cc8c8f181f78) + ] + interface IEndpointPairFactory : IInspectable + { + HRESULT CreateEndpointPair([in] Windows.Networking.HostName *host, [in] HSTRING service, + [in] Windows.Networking.HostName *remote_host, [in] HSTRING remote_service, + [out, retval] Windows.Networking.EndpointPair **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Networking.HostName), + uuid(bf8ecaad-ed96-49a7-9084-d416cae88dcb) + ] + interface IHostName : IInspectable + { + [propget] HRESULT IPInformation([out, retval] Windows.Networking.Connectivity.IPInformation **value); + [propget] HRESULT RawName([out, retval] HSTRING *value); + [propget] HRESULT DisplayName([out, retval] HSTRING *value); + [propget] HRESULT CanonicalName([out, retval] HSTRING *value); + [propget] HRESULT Type([out, retval] Windows.Networking.HostNameType *value); + HRESULT IsEqual([in] Windows.Networking.HostName *name, [out, retval] boolean *equal); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Networking.HostName), + uuid(458c23ed-712f-4576-adf1-c20b2c643558) + ] + interface IHostNameFactory : IInspectable + { + HRESULT CreateHostName([in] HSTRING name, [out, retval] Windows.Networking.HostName **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Networking.HostName), + uuid(f68cd4bf-a388-4e8b-91ea-54dd6dd901c0) + ] + interface IHostNameStatics : IInspectable + { + HRESULT Compare([in] HSTRING value1, [in] HSTRING value2, [out, retval] INT32 *result); + } + + [ + activatable(Windows.Networking.IEndpointPairFactory, Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass EndpointPair + { + [default] interface Windows.Networking.IEndpointPair; + } + + [ + activatable(Windows.Networking.IHostNameFactory, Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.Networking.IHostNameStatics, Windows.Foundation.UniversalApiContract, 1.0), + threading(both) + ] + runtimeclass HostName + { + [default] interface Windows.Networking.IHostName; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Foundation.IStringable; + } +} -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
From: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> --- configure.ac | 2 + dlls/windows.networking.hostname/Makefile.in | 9 ++ dlls/windows.networking.hostname/classes.idl | 23 ++++ dlls/windows.networking.hostname/hostname.c | 116 ++++++++++++++++++ dlls/windows.networking.hostname/main.c | 46 +++++++ dlls/windows.networking.hostname/private.h | 40 ++++++ .../tests/Makefile.in | 5 + .../tests/hostname.c | 86 +++++++++++++ .../windows.networking.hostname.spec | 12 ++ 9 files changed, 339 insertions(+) create mode 100644 dlls/windows.networking.hostname/Makefile.in create mode 100644 dlls/windows.networking.hostname/classes.idl create mode 100644 dlls/windows.networking.hostname/hostname.c create mode 100644 dlls/windows.networking.hostname/main.c create mode 100644 dlls/windows.networking.hostname/private.h create mode 100644 dlls/windows.networking.hostname/tests/Makefile.in create mode 100644 dlls/windows.networking.hostname/tests/hostname.c create mode 100644 dlls/windows.networking.hostname/windows.networking.hostname.spec diff --git a/configure.ac b/configure.ac index 2dd37764a6e..87a05fa903d 100644 --- a/configure.ac +++ b/configure.ac @@ -3154,6 +3154,8 @@ WINE_CONFIG_MAKEFILE(dlls/windows.media.speech) WINE_CONFIG_MAKEFILE(dlls/windows.media.speech/tests) WINE_CONFIG_MAKEFILE(dlls/windows.media) WINE_CONFIG_MAKEFILE(dlls/windows.media/tests) +WINE_CONFIG_MAKEFILE(dlls/windows.networking.hostname) +WINE_CONFIG_MAKEFILE(dlls/windows.networking.hostname/tests) WINE_CONFIG_MAKEFILE(dlls/windows.networking) WINE_CONFIG_MAKEFILE(dlls/windows.perception.stub) WINE_CONFIG_MAKEFILE(dlls/windows.perception.stub/tests) diff --git a/dlls/windows.networking.hostname/Makefile.in b/dlls/windows.networking.hostname/Makefile.in new file mode 100644 index 00000000000..72ef78cc716 --- /dev/null +++ b/dlls/windows.networking.hostname/Makefile.in @@ -0,0 +1,9 @@ +MODULE = windows.networking.hostname.dll +IMPORTS = combase + +C_SRCS = \ + hostname.c \ + main.c + +IDL_SRCS = \ + classes.idl diff --git a/dlls/windows.networking.hostname/classes.idl b/dlls/windows.networking.hostname/classes.idl new file mode 100644 index 00000000000..bf04d3e88bc --- /dev/null +++ b/dlls/windows.networking.hostname/classes.idl @@ -0,0 +1,23 @@ +/* + * Runtime Classes for windows.networking.hostname.dll + * + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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.networking.idl" diff --git a/dlls/windows.networking.hostname/hostname.c b/dlls/windows.networking.hostname/hostname.c new file mode 100644 index 00000000000..7a914f4ded4 --- /dev/null +++ b/dlls/windows.networking.hostname/hostname.c @@ -0,0 +1,116 @@ +/* WinRT Windows.Networking.Hostname Hostname Implementation + * + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(hostname); + +struct hostname_statics +{ + IActivationFactory IActivationFactory_iface; + LONG ref; +}; + +static inline struct hostname_statics *impl_from_IActivationFactory( IActivationFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct hostname_statics, IActivationFactory_iface ); +} + +static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID iid, void **out ) +{ + struct hostname_statics *impl = impl_from_IActivationFactory( iface ); + + 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 )) + { + *out = &impl->IActivationFactory_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI factory_AddRef( IActivationFactory *iface ) +{ + struct hostname_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p increasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI factory_Release( IActivationFactory *iface ) +{ + struct hostname_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static HRESULT WINAPI factory_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 WINAPI factory_GetRuntimeClassName( IActivationFactory *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_GetTrustLevel( IActivationFactory *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInspectable **instance ) +{ + FIXME( "iface %p, instance %p stub!\n", iface, instance ); + return E_NOTIMPL; +} + +static const struct IActivationFactoryVtbl factory_vtbl = +{ + factory_QueryInterface, + factory_AddRef, + factory_Release, + /* IInspectable methods */ + factory_GetIids, + factory_GetRuntimeClassName, + factory_GetTrustLevel, + /* IActivationFactory methods */ + factory_ActivateInstance, +}; + +static struct hostname_statics hostname_statics = +{ + {&factory_vtbl}, + 1, +}; + +IActivationFactory *hostname_factory = &hostname_statics.IActivationFactory_iface; diff --git a/dlls/windows.networking.hostname/main.c b/dlls/windows.networking.hostname/main.c new file mode 100644 index 00000000000..72ef6517b3d --- /dev/null +++ b/dlls/windows.networking.hostname/main.c @@ -0,0 +1,46 @@ +/* WinRT Windows.Networking.Hostname Implementation + * + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 "initguid.h" +#include "private.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(hostname); + +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 ) +{ + const WCHAR *buffer = WindowsGetStringRawBuffer( classid, NULL ); + + TRACE( "class %s, factory %p.\n", debugstr_hstring(classid), factory ); + + *factory = NULL; + + if (!wcscmp( buffer, RuntimeClass_Windows_Networking_HostName )) + IActivationFactory_QueryInterface( hostname_factory, &IID_IActivationFactory, (void **)factory ); + + if (*factory) return S_OK; + return CLASS_E_CLASSNOTAVAILABLE; +} diff --git a/dlls/windows.networking.hostname/private.h b/dlls/windows.networking.hostname/private.h new file mode 100644 index 00000000000..98728895b90 --- /dev/null +++ b/dlls/windows.networking.hostname/private.h @@ -0,0 +1,40 @@ +/* WinRT Windows.Networking.Hostname Implementation + * + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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_WINDOWS_NETWORKING_HOSTNAME_PRIVATE_H +#define __WINE_WINDOWS_NETWORKING_HOSTNAME_PRIVATE_H + +#include <stdarg.h> + +#define COBJMACROS +#include "windef.h" +#include "winbase.h" +#include "winstring.h" + +#include "activation.h" + +#define WIDL_using_Windows_Foundation +#define WIDL_using_Windows_Foundation_Collections +#include "windows.foundation.h" +#define WIDL_using_Windows_Networking +#include "windows.networking.h" + +extern IActivationFactory *hostname_factory; + +#endif diff --git a/dlls/windows.networking.hostname/tests/Makefile.in b/dlls/windows.networking.hostname/tests/Makefile.in new file mode 100644 index 00000000000..62c923a32aa --- /dev/null +++ b/dlls/windows.networking.hostname/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = windows.networking.hostname.dll +IMPORTS = combase + +C_SRCS = \ + hostname.c diff --git a/dlls/windows.networking.hostname/tests/hostname.c b/dlls/windows.networking.hostname/tests/hostname.c new file mode 100644 index 00000000000..1e1a7de94af --- /dev/null +++ b/dlls/windows.networking.hostname/tests/hostname.c @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 "initguid.h" +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winstring.h" + +#include "roapi.h" + +#define WIDL_using_Windows_Foundation +#define WIDL_using_Windows_Foundation_Collections +#include "windows.foundation.h" +#define WIDL_using_Windows_Networking +#include "windows.networking.h" + +#include "wine/test.h" + +#define check_interface( obj, iid ) check_interface_( __LINE__, obj, iid ) +static void check_interface_( unsigned int line, void *obj, const IID *iid ) +{ + IUnknown *iface = obj; + IUnknown *unk; + HRESULT hr; + + hr = IUnknown_QueryInterface( iface, iid, (void **)&unk ); + ok_(__FILE__, line)( hr == S_OK, "got hr %#lx.\n", hr ); + IUnknown_Release( unk ); +} + +static void test_HostnameStatics(void) +{ + static const WCHAR *hostname_statics_name = L"Windows.Networking.HostName"; + IActivationFactory *factory; + HSTRING str; + HRESULT hr; + LONG ref; + + hr = WindowsCreateString( hostname_statics_name, wcslen( hostname_statics_name ), &str ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + hr = RoGetActivationFactory( str, &IID_IActivationFactory, (void **)&factory ); + WindowsDeleteString( str ); + ok( hr == S_OK || broken( hr == REGDB_E_CLASSNOTREG ), "got hr %#lx.\n", hr ); + if (hr == REGDB_E_CLASSNOTREG) + { + win_skip( "%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w( hostname_statics_name ) ); + return; + } + + check_interface( factory, &IID_IUnknown ); + check_interface( factory, &IID_IInspectable ); + check_interface( factory, &IID_IAgileObject ); + + ref = IActivationFactory_Release( factory ); + ok( ref == 1, "got ref %ld.\n", ref ); +} + +START_TEST(hostname) +{ + HRESULT hr; + + hr = RoInitialize( RO_INIT_MULTITHREADED ); + ok( hr == S_OK, "RoInitialize failed, hr %#lx\n", hr ); + + test_HostnameStatics(); + + RoUninitialize(); +} diff --git a/dlls/windows.networking.hostname/windows.networking.hostname.spec b/dlls/windows.networking.hostname/windows.networking.hostname.spec new file mode 100644 index 00000000000..4be1deb9e48 --- /dev/null +++ b/dlls/windows.networking.hostname/windows.networking.hostname.spec @@ -0,0 +1,12 @@ +@ stub CreateEndpointPairFromSockAddrs +@ stub CreateHostNameFromSockAddr +@ stub CreateHostNameFromString +@ stub CreateNetworkAdapterFromGuid +@ stub GetAllHostNames +@ stub GetSortedEndpointPairs +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetActivationFactory(ptr ptr) +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllMain(long long ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
From: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> --- dlls/windows.networking.hostname/hostname.c | 30 ++++++++++++++ dlls/windows.networking.hostname/private.h | 39 +++++++++++++++++++ .../tests/hostname.c | 6 +++ 3 files changed, 75 insertions(+) diff --git a/dlls/windows.networking.hostname/hostname.c b/dlls/windows.networking.hostname/hostname.c index 7a914f4ded4..538e897963f 100644 --- a/dlls/windows.networking.hostname/hostname.c +++ b/dlls/windows.networking.hostname/hostname.c @@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(hostname); struct hostname_statics { IActivationFactory IActivationFactory_iface; + IHostNameFactory IHostNameFactory_iface; LONG ref; }; @@ -49,6 +50,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; } + if (IsEqualGUID( iid, &IID_IHostNameFactory )) + { + *out = &impl->IHostNameFactory_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -107,9 +115,31 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; +DEFINE_IINSPECTABLE( hostname_factory, IHostNameFactory, struct hostname_statics, IActivationFactory_iface ) + +static HRESULT WINAPI hostname_factory_CreateHostName( IHostNameFactory *iface, HSTRING name, IHostName **value ) +{ + FIXME( "iface %p, name %s, value %p stub!\n", iface, debugstr_hstring(name), value ); + return E_NOTIMPL; +} + +static const struct IHostNameFactoryVtbl hostname_factory_vtbl = +{ + hostname_factory_QueryInterface, + hostname_factory_AddRef, + hostname_factory_Release, + /* IInspectable methods */ + hostname_factory_GetIids, + hostname_factory_GetRuntimeClassName, + hostname_factory_GetTrustLevel, + /* IHostNameFactory methods */ + hostname_factory_CreateHostName, +}; + static struct hostname_statics hostname_statics = { {&factory_vtbl}, + {&hostname_factory_vtbl}, 1, }; diff --git a/dlls/windows.networking.hostname/private.h b/dlls/windows.networking.hostname/private.h index 98728895b90..55faba8cc96 100644 --- a/dlls/windows.networking.hostname/private.h +++ b/dlls/windows.networking.hostname/private.h @@ -37,4 +37,43 @@ extern IActivationFactory *hostname_factory; +#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 diff --git a/dlls/windows.networking.hostname/tests/hostname.c b/dlls/windows.networking.hostname/tests/hostname.c index 1e1a7de94af..edb20f1fa44 100644 --- a/dlls/windows.networking.hostname/tests/hostname.c +++ b/dlls/windows.networking.hostname/tests/hostname.c @@ -48,6 +48,7 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid ) static void test_HostnameStatics(void) { static const WCHAR *hostname_statics_name = L"Windows.Networking.HostName"; + IHostNameFactory *hostnamefactory; IActivationFactory *factory; HSTRING str; HRESULT hr; @@ -69,6 +70,11 @@ static void test_HostnameStatics(void) check_interface( factory, &IID_IInspectable ); check_interface( factory, &IID_IAgileObject ); + hr = IActivationFactory_QueryInterface( factory, &IID_IHostNameFactory, (void **)&hostnamefactory ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + ref = IHostNameFactory_Release( hostnamefactory ); + ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory ); ok( ref == 1, "got ref %ld.\n", ref ); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
On Thu Jul 6 08:19:31 2023 +0000, Rémi Bernon wrote:
If you add a test you will see that the `IActivationFactory` object doesn't implement `IHostName`, so it would be a separate struct. I think it should be added at the same time you implement `CreateHostName` as it is what will create instances of it. Yeah, I had a test but omitted it since the interface wasn't supported. I readded it and added checks for `IHostName`.
Thanks for the review. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3249#note_38251
From: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> --- .../tests/hostname.c | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/dlls/windows.networking.hostname/tests/hostname.c b/dlls/windows.networking.hostname/tests/hostname.c index edb20f1fa44..0d9ea85bdef 100644 --- a/dlls/windows.networking.hostname/tests/hostname.c +++ b/dlls/windows.networking.hostname/tests/hostname.c @@ -48,10 +48,13 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid ) static void test_HostnameStatics(void) { static const WCHAR *hostname_statics_name = L"Windows.Networking.HostName"; + static const WCHAR *ip = L"192.168.0.0"; IHostNameFactory *hostnamefactory; IActivationFactory *factory; - HSTRING str; + HSTRING str, rawname; + IHostName *hostname; HRESULT hr; + INT32 res; LONG ref; hr = WindowsCreateString( hostname_statics_name, wcslen( hostname_statics_name ), &str ); @@ -72,7 +75,29 @@ static void test_HostnameStatics(void) hr = IActivationFactory_QueryInterface( factory, &IID_IHostNameFactory, (void **)&hostnamefactory ); ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = WindowsCreateString( ip, wcslen( ip ), &str ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + hr = IHostNameFactory_CreateHostName( hostnamefactory, NULL, &hostname ); + todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + hr = IHostNameFactory_CreateHostName( hostnamefactory, str, NULL ); + todo_wine ok( hr == E_POINTER, "got hr %#lx.\n", hr ); + hr = IHostNameFactory_CreateHostName( hostnamefactory, NULL, NULL ); + todo_wine ok( hr == E_POINTER, "got hr %#lx.\n", hr ); + hr = IHostNameFactory_CreateHostName( hostnamefactory, str, &hostname ); + todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + todo_wine ok( hostname != NULL, "got NULL hostname %p.\n", hostname ); + + hr = IHostName_get_RawName( hostname, NULL ); + todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + hr = IHostName_get_RawName( hostname, &rawname ); + todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = WindowsCompareStringOrdinal( str, rawname, &res ); + todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + todo_wine ok( !res, "got unexpected string %s.\n", debugstr_hstring(rawname) ); + WindowsDeleteString( str ); + WindowsDeleteString( rawname ); ref = IHostNameFactory_Release( hostnamefactory ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
From: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54699 --- dlls/windows.networking.hostname/hostname.c | 139 +++++++++++++++++- dlls/windows.networking.hostname/private.h | 2 +- .../tests/hostname.c | 17 ++- 3 files changed, 150 insertions(+), 8 deletions(-) diff --git a/dlls/windows.networking.hostname/hostname.c b/dlls/windows.networking.hostname/hostname.c index 538e897963f..f3ba7b5b20c 100644 --- a/dlls/windows.networking.hostname/hostname.c +++ b/dlls/windows.networking.hostname/hostname.c @@ -115,12 +115,147 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, }; +struct hostname +{ + IHostName IHostName_iface; + LONG ref; + + HSTRING rawname; +}; + +static inline struct hostname *impl_from_IHostName( IHostName *iface ) +{ + return CONTAINING_RECORD( iface, struct hostname, IHostName_iface ); +} + +static HRESULT WINAPI hostname_QueryInterface( IHostName *iface, REFIID iid, void **out ) +{ + struct hostname *impl = impl_from_IHostName( iface ); + + 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_IHostName )) + { + *out = &impl->IHostName_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI hostname_AddRef( IHostName *iface ) +{ + struct hostname *impl = impl_from_IHostName( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p increasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI hostname_Release( IHostName *iface ) +{ + struct hostname *impl = impl_from_IHostName( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static HRESULT WINAPI hostname_GetIids( IHostName *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 WINAPI hostname_GetRuntimeClassName( IHostName *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI hostname_GetTrustLevel( IHostName *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI hostname_get_IPInformation( IHostName *iface, IIPInformation **value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI hostname_get_RawName( IHostName *iface, HSTRING *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI hostname_get_DisplayName( IHostName *iface, HSTRING *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI hostname_get_CanonicalName( IHostName *iface, HSTRING *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI hostname_get_Type( IHostName *iface, HostNameType *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI hostname_IsEqual( IHostName *iface, IHostName *name, boolean *equal ) +{ + FIXME( "iface %p, name %p, equal %p stub!\n", iface, name, equal ); + return E_NOTIMPL; +} + +static const struct IHostNameVtbl hostname_vtbl = +{ + hostname_QueryInterface, + hostname_AddRef, + hostname_Release, + /* IInspectable methods */ + hostname_GetIids, + hostname_GetRuntimeClassName, + hostname_GetTrustLevel, + /* IHostName methods */ + hostname_get_IPInformation, + hostname_get_RawName, + hostname_get_DisplayName, + hostname_get_CanonicalName, + hostname_get_Type, + hostname_IsEqual, +}; + DEFINE_IINSPECTABLE( hostname_factory, IHostNameFactory, struct hostname_statics, IActivationFactory_iface ) static HRESULT WINAPI hostname_factory_CreateHostName( IHostNameFactory *iface, HSTRING name, IHostName **value ) { - FIXME( "iface %p, name %s, value %p stub!\n", iface, debugstr_hstring(name), value ); - return E_NOTIMPL; + struct hostname *impl; + + TRACE( "iface %p, name %s, value %p\n", iface, debugstr_hstring(name), value ); + + if (!value) return E_POINTER; + if (!name) return E_INVALIDARG; + if (!(impl = calloc( 1, sizeof(*impl) ))) return E_OUTOFMEMORY; + + impl->IHostName_iface.lpVtbl = &hostname_vtbl; + impl->ref = 1; + impl->rawname = name; + + *value = &impl->IHostName_iface; + TRACE( "created IHostName %p.\n", *value ); + return S_OK; } static const struct IHostNameFactoryVtbl hostname_factory_vtbl = diff --git a/dlls/windows.networking.hostname/private.h b/dlls/windows.networking.hostname/private.h index 55faba8cc96..a07690911c5 100644 --- a/dlls/windows.networking.hostname/private.h +++ b/dlls/windows.networking.hostname/private.h @@ -33,6 +33,7 @@ #define WIDL_using_Windows_Foundation_Collections #include "windows.foundation.h" #define WIDL_using_Windows_Networking +#define WIDL_using_Windows_Networking_Connectivity #include "windows.networking.h" extern IActivationFactory *hostname_factory; @@ -75,5 +76,4 @@ extern IActivationFactory *hostname_factory; #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 diff --git a/dlls/windows.networking.hostname/tests/hostname.c b/dlls/windows.networking.hostname/tests/hostname.c index 0d9ea85bdef..18cdec840ef 100644 --- a/dlls/windows.networking.hostname/tests/hostname.c +++ b/dlls/windows.networking.hostname/tests/hostname.c @@ -79,14 +79,19 @@ static void test_HostnameStatics(void) ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IHostNameFactory_CreateHostName( hostnamefactory, NULL, &hostname ); - todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); hr = IHostNameFactory_CreateHostName( hostnamefactory, str, NULL ); - todo_wine ok( hr == E_POINTER, "got hr %#lx.\n", hr ); + ok( hr == E_POINTER, "got hr %#lx.\n", hr ); hr = IHostNameFactory_CreateHostName( hostnamefactory, NULL, NULL ); - todo_wine ok( hr == E_POINTER, "got hr %#lx.\n", hr ); + ok( hr == E_POINTER, "got hr %#lx.\n", hr ); hr = IHostNameFactory_CreateHostName( hostnamefactory, str, &hostname ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); - todo_wine ok( hostname != NULL, "got NULL hostname %p.\n", hostname ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hostname != NULL, "got NULL hostname %p.\n", hostname ); + + check_interface( hostname, &IID_IUnknown ); + check_interface( hostname, &IID_IInspectable ); + check_interface( hostname, &IID_IAgileObject ); + check_interface( hostname, &IID_IHostName ); hr = IHostName_get_RawName( hostname, NULL ); todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); @@ -98,6 +103,8 @@ static void test_HostnameStatics(void) WindowsDeleteString( str ); WindowsDeleteString( rawname ); + ref = IHostName_Release( hostname ); + ok( !ref, "got ref %ld.\n", ref ); ref = IHostNameFactory_Release( hostnamefactory ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
From: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com> --- dlls/windows.networking.hostname/hostname.c | 8 ++++++-- dlls/windows.networking.hostname/tests/hostname.c | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/windows.networking.hostname/hostname.c b/dlls/windows.networking.hostname/hostname.c index f3ba7b5b20c..c941e7ada89 100644 --- a/dlls/windows.networking.hostname/hostname.c +++ b/dlls/windows.networking.hostname/hostname.c @@ -191,8 +191,12 @@ static HRESULT WINAPI hostname_get_IPInformation( IHostName *iface, IIPInformati static HRESULT WINAPI hostname_get_RawName( IHostName *iface, HSTRING *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + struct hostname *impl = impl_from_IHostName( iface ); + + TRACE( "iface %p, value %p.\n", iface, value ); + + if (!value) return E_INVALIDARG; + return WindowsDuplicateString( impl->rawname, value ); } static HRESULT WINAPI hostname_get_DisplayName( IHostName *iface, HSTRING *value ) diff --git a/dlls/windows.networking.hostname/tests/hostname.c b/dlls/windows.networking.hostname/tests/hostname.c index 18cdec840ef..7c6cfd559ea 100644 --- a/dlls/windows.networking.hostname/tests/hostname.c +++ b/dlls/windows.networking.hostname/tests/hostname.c @@ -94,12 +94,12 @@ static void test_HostnameStatics(void) check_interface( hostname, &IID_IHostName ); hr = IHostName_get_RawName( hostname, NULL ); - todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); hr = IHostName_get_RawName( hostname, &rawname ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = WindowsCompareStringOrdinal( str, rawname, &res ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); - todo_wine ok( !res, "got unexpected string %s.\n", debugstr_hstring(rawname) ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( !res, "got unexpected string %s.\n", debugstr_hstring(rawname) ); WindowsDeleteString( str ); WindowsDeleteString( rawname ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=134549 Your paranoid android. === build (build log) === error: patch failed: include/windows.foundation.idl:86 Task: Patch failed to apply === debian11 (build log) === error: patch failed: include/windows.foundation.idl:86 Task: Patch failed to apply === debian11b (build log) === error: patch failed: include/windows.foundation.idl:86 Task: Patch failed to apply
On Thu Jul 6 08:19:31 2023 +0000, Rémi Bernon wrote:
This would be the `statics` part of the class, so it should be named `<class>_statics` and will only include the static interfaces. I'm a bit unclear on this, but I hope this is how you wanted it.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3249#note_38252
On Thu Jul 6 22:09:22 2023 +0000, Mohamad Al-Jaf wrote:
changed this line in [version 4 of the diff](/wine/wine/-/merge_requests/3249/diffs?diff_id=56122&start_sha=b07d919434e433af75f556171d3453801107086d#e446ce8161e275145016ecbb8c1dde68b4ac6138_181_244) Updated with snake case, though I believe that `hostname` is a single word
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3249#note_38253
On Thu Jul 6 22:15:48 2023 +0000, **** wrote:
Marvin replied on the mailing list: ``` Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=134549 Your paranoid android. === build (build log) === error: patch failed: include/windows.foundation.idl:86 Task: Patch failed to apply === debian11 (build log) === error: patch failed: include/windows.foundation.idl:86 Task: Patch failed to apply === debian11b (build log) === error: patch failed: include/windows.foundation.idl:86 Task: Patch failed to apply ``` Looks like the testbot wasn't updated yet. The pipeline seems to be building. I made sure to rebase with today's changes prior to pushing.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3249#note_38257
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3249
participants (4)
-
Marvin -
Mohamad Al-Jaf -
Mohamad Al-Jaf (@maljaf) -
Rémi Bernon