From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.networking.hostname/hostname.c | 58 +++++++++++++++++++++ dlls/windows.networking.hostname/private.h | 39 ++++++++++++++ 2 files changed, 97 insertions(+)
diff --git a/dlls/windows.networking.hostname/hostname.c b/dlls/windows.networking.hostname/hostname.c index 95c6f6387ae..4af9a42211e 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 { IActivationFactory IActivationFactory_iface; + IHostName IHostName_iface; LONG ref; };
@@ -107,9 +108,66 @@ static const struct IActivationFactoryVtbl factory_vtbl = factory_ActivateInstance, };
+DEFINE_IINSPECTABLE( hostname, IHostName, struct hostname, IActivationFactory_iface ) + +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, +}; + static struct hostname hostname_statics = { {&factory_vtbl}, + {&hostname_vtbl}, 1, };
diff --git a/dlls/windows.networking.hostname/private.h b/dlls/windows.networking.hostname/private.h index 98728895b90..a07690911c5 100644 --- a/dlls/windows.networking.hostname/private.h +++ b/dlls/windows.networking.hostname/private.h @@ -33,8 +33,47 @@ #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;
+#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