windows.devices.enumeration: Create stub DeviceAccessInformation class.
[wine.git] / dlls / windows.devices.enumeration / private.h
blobdd06b25926e15469e54bebb663b42c62b77a0236
1 /* WinRT Windows.Devices.Enumeration implementation
3 * Copyright 2021 Gijs Vermeulen
4 * Copyright 2022 Julian Klemann for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINDOWS_DEVICES_ENUMERATION_PRIVATE_H
22 #define __WINE_WINDOWS_DEVICES_ENUMERATION_PRIVATE_H
24 #include <stdarg.h>
26 #define COBJMACROS
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winstring.h"
30 #include "objbase.h"
32 #include "activation.h"
34 #define WIDL_using_Windows_Foundation
35 #define WIDL_using_Windows_Foundation_Collections
36 #include "windows.foundation.h"
37 #define WIDL_using_Windows_Devices_Enumeration
38 #include "windows.devices.enumeration.h"
40 #include "wine/list.h"
42 extern IActivationFactory *device_access_factory;
44 extern const char *debugstr_hstring( HSTRING hstr );
46 HRESULT typed_event_handlers_append( struct list *list, ITypedEventHandler_IInspectable_IInspectable *handler, EventRegistrationToken *token );
47 HRESULT typed_event_handlers_remove( struct list *list, EventRegistrationToken *token );
48 HRESULT typed_event_handlers_notify( struct list *list, IInspectable *sender, IInspectable *args );
49 HRESULT typed_event_handlers_clear( struct list *list );
51 #define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \
52 static inline impl_type *impl_from( iface_type *iface ) \
53 { \
54 return CONTAINING_RECORD( iface, impl_type, iface_mem ); \
55 } \
56 static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \
57 { \
58 impl_type *impl = impl_from( iface ); \
59 return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \
60 } \
61 static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \
62 { \
63 impl_type *impl = impl_from( iface ); \
64 return IInspectable_AddRef( (IInspectable *)(expr) ); \
65 } \
66 static ULONG WINAPI pfx##_Release( iface_type *iface ) \
67 { \
68 impl_type *impl = impl_from( iface ); \
69 return IInspectable_Release( (IInspectable *)(expr) ); \
70 } \
71 static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \
72 { \
73 impl_type *impl = impl_from( iface ); \
74 return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \
75 } \
76 static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \
77 { \
78 impl_type *impl = impl_from( iface ); \
79 return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \
80 } \
81 static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \
82 { \
83 impl_type *impl = impl_from( iface ); \
84 return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \
86 #define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \
87 DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface )
88 #define DEFINE_IINSPECTABLE_OUTER( pfx, iface_type, impl_type, outer_iface ) \
89 DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, impl->outer_iface )
91 #endif