Commit c2d0b2fd authored by Mohamad Al-Jaf's avatar Mohamad Al-Jaf Committed by Alexandre Julliard

windows.security.credentials.ui.userconsentverifier: Add…

windows.security.credentials.ui.userconsentverifier: Add IUserConsentVerifierStatics stub interface.
parent d7b7114d
......@@ -27,6 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(credentials);
struct user_consent_verifier_statics
{
IActivationFactory IActivationFactory_iface;
IUserConsentVerifierStatics IUserConsentVerifierStatics_iface;
LONG ref;
};
......@@ -50,6 +51,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
return S_OK;
}
if (IsEqualGUID( iid, &IID_IUserConsentVerifierStatics ))
{
*out = &impl->IUserConsentVerifierStatics_iface;
IInspectable_AddRef( *out );
return S_OK;
}
FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) );
*out = NULL;
return E_NOINTERFACE;
......@@ -108,9 +116,39 @@ static const struct IActivationFactoryVtbl factory_vtbl =
factory_ActivateInstance,
};
DEFINE_IINSPECTABLE( user_consent_verifier_statics, IUserConsentVerifierStatics, struct user_consent_verifier_statics, IActivationFactory_iface )
static HRESULT WINAPI user_consent_verifier_statics_CheckAvailabilityAsync( IUserConsentVerifierStatics *iface, IAsyncOperation_UserConsentVerifierAvailability **result )
{
FIXME( "iface %p, result %p stub!\n", iface, result );
return E_NOTIMPL;
}
static HRESULT WINAPI user_consent_verifier_statics_RequestVerificationAsync( IUserConsentVerifierStatics *iface, HSTRING message,
IAsyncOperation_UserConsentVerificationResult **result )
{
FIXME( "iface %p, message %s, result %p stub!\n", iface, debugstr_hstring( message ), result );
return E_NOTIMPL;
}
static const struct IUserConsentVerifierStaticsVtbl user_consent_verifier_statics_vtbl =
{
user_consent_verifier_statics_QueryInterface,
user_consent_verifier_statics_AddRef,
user_consent_verifier_statics_Release,
/* IInspectable methods */
user_consent_verifier_statics_GetIids,
user_consent_verifier_statics_GetRuntimeClassName,
user_consent_verifier_statics_GetTrustLevel,
/* IUserConsentVerifierStatics methods */
user_consent_verifier_statics_CheckAvailabilityAsync,
user_consent_verifier_statics_RequestVerificationAsync,
};
static struct user_consent_verifier_statics user_consent_verifier_statics =
{
{&factory_vtbl},
{&user_consent_verifier_statics_vtbl},
1,
};
......
......@@ -35,4 +35,42 @@
#define WIDL_using_Windows_Security_Credentials_UI
#include "windows.security.credentials.ui.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
......@@ -48,6 +48,7 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid )
static void test_UserConsentVerifierStatics(void)
{
static const WCHAR *user_consent_verifier_statics_name = L"Windows.Security.Credentials.UI.UserConsentVerifier";
IUserConsentVerifierStatics *user_consent_verifier_statics = NULL;
IActivationFactory *factory;
HSTRING str;
HRESULT hr;
......@@ -68,6 +69,11 @@ static void test_UserConsentVerifierStatics(void)
check_interface( factory, &IID_IUnknown );
check_interface( factory, &IID_IInspectable );
hr = IActivationFactory_QueryInterface( factory, &IID_IUserConsentVerifierStatics, (void **)&user_consent_verifier_statics );
ok( hr == S_OK, "got hr %#lx.\n", hr );
ref = IUserConsentVerifierStatics_Release( user_consent_verifier_statics );
ok( ref == 1, "got ref %ld.\n", ref );
ref = IActivationFactory_Release( factory );
ok( ref == 1, "got ref %ld.\n", ref );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment