1 /* WinRT Windows.Devices.Bluetooth BluetoothAdapter Implementation
3 * Copyright (C) 2023 Mohamad Al-Jaf
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
21 #include "wine/debug.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(bluetooth
);
25 struct bluetoothadapter
27 IActivationFactory IActivationFactory_iface
;
31 static inline struct bluetoothadapter
*impl_from_IActivationFactory( IActivationFactory
*iface
)
33 return CONTAINING_RECORD( iface
, struct bluetoothadapter
, IActivationFactory_iface
);
36 static HRESULT WINAPI
factory_QueryInterface( IActivationFactory
*iface
, REFIID iid
, void **out
)
38 struct bluetoothadapter
*impl
= impl_from_IActivationFactory( iface
);
40 TRACE( "iface %p, iid %s, out %p.\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 *out
= &impl
->IActivationFactory_iface
;
48 IInspectable_AddRef( *out
);
52 FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid
) );
57 static ULONG WINAPI
factory_AddRef( IActivationFactory
*iface
)
59 struct bluetoothadapter
*impl
= impl_from_IActivationFactory( iface
);
60 ULONG ref
= InterlockedIncrement( &impl
->ref
);
61 TRACE( "iface %p increasing refcount to %lu.\n", iface
, ref
);
65 static ULONG WINAPI
factory_Release( IActivationFactory
*iface
)
67 struct bluetoothadapter
*impl
= impl_from_IActivationFactory( iface
);
68 ULONG ref
= InterlockedDecrement( &impl
->ref
);
69 TRACE( "iface %p decreasing refcount to %lu.\n", iface
, ref
);
73 static HRESULT WINAPI
factory_GetIids( IActivationFactory
*iface
, ULONG
*iid_count
, IID
**iids
)
75 FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface
, iid_count
, iids
);
79 static HRESULT WINAPI
factory_GetRuntimeClassName( IActivationFactory
*iface
, HSTRING
*class_name
)
81 FIXME( "iface %p, class_name %p stub!\n", iface
, class_name
);
85 static HRESULT WINAPI
factory_GetTrustLevel( IActivationFactory
*iface
, TrustLevel
*trust_level
)
87 FIXME( "iface %p, trust_level %p stub!\n", iface
, trust_level
);
91 static HRESULT WINAPI
factory_ActivateInstance( IActivationFactory
*iface
, IInspectable
**instance
)
93 FIXME( "iface %p, instance %p stub!\n", iface
, instance
);
97 static const struct IActivationFactoryVtbl factory_vtbl
=
99 factory_QueryInterface
,
102 /* IInspectable methods */
104 factory_GetRuntimeClassName
,
105 factory_GetTrustLevel
,
106 /* IActivationFactory methods */
107 factory_ActivateInstance
,
110 static struct bluetoothadapter bluetoothadapter_statics
=
116 IActivationFactory
*bluetoothadapter_factory
= &bluetoothadapter_statics
.IActivationFactory_iface
;