1 /* WinRT Windows.Globalization implementation
3 * Copyright 2021 RĂ©mi Bernon for CodeWeavers
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 WINE_DEFAULT_DEBUG_CHANNEL(twinapi
);
26 IActivationFactory IActivationFactory_iface
;
27 IAdvertisingManagerStatics IAdvertisingManagerStatics_iface
;
31 static inline struct factory
*impl_from_IActivationFactory( IActivationFactory
*iface
)
33 return CONTAINING_RECORD( iface
, struct factory
, IActivationFactory_iface
);
36 static HRESULT WINAPI
activation_factory_QueryInterface( IActivationFactory
*iface
, REFIID iid
, void **out
)
38 struct factory
*impl
= impl_from_IActivationFactory( iface
);
40 TRACE( "iface %p, iid %s, out %p stub!\n", iface
, debugstr_guid( iid
), out
);
42 if (IsEqualGUID( iid
, &IID_IUnknown
) ||
43 IsEqualGUID( iid
, &IID_IInspectable
) ||
44 IsEqualGUID( iid
, &IID_IAgileObject
) ||
45 IsEqualGUID( iid
, &IID_IActivationFactory
))
47 IActivationFactory_AddRef( (*out
= &impl
->IActivationFactory_iface
) );
51 if (IsEqualGUID( iid
, &IID_IAdvertisingManagerStatics
))
53 IAdvertisingManagerStatics_AddRef( (*out
= &impl
->IAdvertisingManagerStatics_iface
) );
57 FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid
) );
62 static ULONG WINAPI
activation_factory_AddRef( IActivationFactory
*iface
)
64 struct factory
*impl
= impl_from_IActivationFactory( iface
);
65 ULONG ref
= InterlockedIncrement( &impl
->ref
);
66 TRACE( "iface %p, ref %lu.\n", iface
, ref
);
70 static ULONG WINAPI
activation_factory_Release( IActivationFactory
*iface
)
72 struct factory
*impl
= impl_from_IActivationFactory( iface
);
73 ULONG ref
= InterlockedDecrement( &impl
->ref
);
74 TRACE( "iface %p, ref %lu.\n", iface
, ref
);
78 static HRESULT WINAPI
activation_factory_GetIids( IActivationFactory
*iface
, ULONG
*iid_count
, IID
**iids
)
80 FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface
, iid_count
, iids
);
84 static HRESULT WINAPI
activation_factory_GetRuntimeClassName( IActivationFactory
*iface
, HSTRING
*class_name
)
86 FIXME( "iface %p, class_name %p stub!\n", iface
, class_name
);
90 static HRESULT WINAPI
activation_factory_GetTrustLevel( IActivationFactory
*iface
, TrustLevel
*trust_level
)
92 FIXME( "iface %p, trust_level %p stub!\n", iface
, trust_level
);
96 static HRESULT WINAPI
activation_factory_ActivateInstance( IActivationFactory
*iface
, IInspectable
**instance
)
98 FIXME( "iface %p, instance %p stub!\n", iface
, instance
);
102 static const struct IActivationFactoryVtbl activation_factory_vtbl
=
104 activation_factory_QueryInterface
,
105 activation_factory_AddRef
,
106 activation_factory_Release
,
107 /* IInspectable methods */
108 activation_factory_GetIids
,
109 activation_factory_GetRuntimeClassName
,
110 activation_factory_GetTrustLevel
,
111 /* IActivationFactory methods */
112 activation_factory_ActivateInstance
,
115 DEFINE_IINSPECTABLE( statics
, IAdvertisingManagerStatics
, struct factory
, IActivationFactory_iface
)
117 static HRESULT WINAPI
statics_get_AdvertisingId( IAdvertisingManagerStatics
*iface
, HSTRING
*out
)
119 FIXME( "iface %p, out %p stub!\n", iface
, out
);
120 return WindowsCreateString( NULL
, 0, out
);
123 static const struct IAdvertisingManagerStaticsVtbl statics_vtbl
=
125 statics_QueryInterface
,
128 /* IInspectable methods */
130 statics_GetRuntimeClassName
,
131 statics_GetTrustLevel
,
132 /* IAdvertisingManagerStatics methods */
133 statics_get_AdvertisingId
,
136 static struct factory factory
=
138 {&activation_factory_vtbl
},
143 IActivationFactory
*advertising_manager_factory
= &factory
.IActivationFactory_iface
;