include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / windows.globalization / private.h
blob5d8e4e900459763c693cc2a4da31fc44f280a559
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
20 #include <stdarg.h>
21 #include <stddef.h>
23 #include "windef.h"
24 #include "winbase.h"
26 #define COBJMACROS
27 #include "winstring.h"
28 #include "activation.h"
30 #define WIDL_using_Windows_Foundation
31 #define WIDL_using_Windows_Foundation_Collections
32 #define WIDL_using_Windows_Foundation_Numerics
33 #include "windows.foundation.h"
35 #define WIDL_using_Windows_Globalization
36 #define WIDL_using_Windows_System_UserProfile
37 #include "windows.globalization.h"
38 #include "windows.system.userprofile.h"
40 extern IActivationFactory *geographic_region_factory;
42 #include "wine/debug.h"
43 #include "wine/list.h"
45 #define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \
46 static inline impl_type *impl_from( iface_type *iface ) \
47 { \
48 return CONTAINING_RECORD( iface, impl_type, iface_mem ); \
49 } \
50 static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \
51 { \
52 impl_type *impl = impl_from( iface ); \
53 return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \
54 } \
55 static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \
56 { \
57 impl_type *impl = impl_from( iface ); \
58 return IInspectable_AddRef( (IInspectable *)(expr) ); \
59 } \
60 static ULONG WINAPI pfx##_Release( iface_type *iface ) \
61 { \
62 impl_type *impl = impl_from( iface ); \
63 return IInspectable_Release( (IInspectable *)(expr) ); \
64 } \
65 static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \
66 { \
67 impl_type *impl = impl_from( iface ); \
68 return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \
69 } \
70 static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \
71 { \
72 impl_type *impl = impl_from( iface ); \
73 return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \
74 } \
75 static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \
76 { \
77 impl_type *impl = impl_from( iface ); \
78 return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \
80 #define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \
81 DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface )
82 #define DEFINE_IINSPECTABLE_OUTER( pfx, iface_type, impl_type, outer_iface ) \
83 DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, impl->outer_iface )