headers: Import windows.foundation.collections.idl from Wine.

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
diff --git a/mingw-w64-headers/Makefile.am b/mingw-w64-headers/Makefile.am
index 2ddd726..09b6572 100644
--- a/mingw-w64-headers/Makefile.am
+++ b/mingw-w64-headers/Makefile.am
@@ -242,6 +242,7 @@
   include/wsmandisp.idl \
   include/wtypesbase.idl \
   include/windows.foundation.idl \
+  include/windows.foundation.collections.idl \
   include/windows.security.cryptography.idl \
   include/windows.storage.idl \
   include/windows.storage.streams.idl \
diff --git a/mingw-w64-headers/Makefile.in b/mingw-w64-headers/Makefile.in
index d1ad190..c90c1c2 100644
--- a/mingw-w64-headers/Makefile.in
+++ b/mingw-w64-headers/Makefile.in
@@ -544,6 +544,7 @@
 @HAVE_WIDL_TRUE@  include/wsmandisp.idl \
 @HAVE_WIDL_TRUE@  include/wtypesbase.idl \
 @HAVE_WIDL_TRUE@  include/windows.foundation.idl \
+@HAVE_WIDL_TRUE@  include/windows.foundation.collections.idl \
 @HAVE_WIDL_TRUE@  include/windows.security.cryptography.idl \
 @HAVE_WIDL_TRUE@  include/windows.storage.idl \
 @HAVE_WIDL_TRUE@  include/windows.storage.streams.idl \
diff --git a/mingw-w64-headers/include/dxva2api.h b/mingw-w64-headers/include/dxva2api.h
index 3388a8d..f7d79c8 100644
--- a/mingw-w64-headers/include/dxva2api.h
+++ b/mingw-w64-headers/include/dxva2api.h
@@ -1567,15 +1567,13 @@
 }
 
 static inline float DXVA2FixedToFloat(DXVA2_Fixed32 f32) {
-  typedef struct { USHORT Fraction; SHORT Value; } fields;
-  fields *_f32 = (fields *)(void *)&f32;
+  struct { USHORT Fraction; SHORT Value; } *_f32 = (void *)&f32;
   return (float)_f32->Value + (float)_f32->Fraction / (1 << 16);
 }
 
 static inline DXVA2_Fixed32 DXVA2FloatToFixed(float f) {
   DXVA2_Fixed32 f32;
-  typedef struct { USHORT Fraction; SHORT Value; } fields;
-  fields *_f32 = (fields *)(void *)&f32;
+  struct { USHORT Fraction; SHORT Value; } *_f32 = (void *)&f32;
   _f32->Value    = ((ULONG) (f * (1 << 16))) >> 16;
   _f32->Fraction = ((ULONG) (f * (1 << 16))) & 0xFFFF;
   return f32;
diff --git a/mingw-w64-headers/include/dxva2api.idl b/mingw-w64-headers/include/dxva2api.idl
index 31cacbd..99c9351 100644
--- a/mingw-w64-headers/include/dxva2api.idl
+++ b/mingw-w64-headers/include/dxva2api.idl
@@ -815,15 +815,13 @@
 cpp_quote("}")
 cpp_quote("")
 cpp_quote("static inline float DXVA2FixedToFloat(DXVA2_Fixed32 f32) {")
-cpp_quote("  typedef struct { USHORT Fraction; SHORT Value; } fields;")
-cpp_quote("  fields *_f32 = (fields *)(void *)&f32;")
+cpp_quote("  struct { USHORT Fraction; SHORT Value; } *_f32 = (void *)&f32;")
 cpp_quote("  return (float)_f32->Value + (float)_f32->Fraction / (1 << 16);")
 cpp_quote("}")
 cpp_quote("")
 cpp_quote("static inline DXVA2_Fixed32 DXVA2FloatToFixed(float f) {")
 cpp_quote("  DXVA2_Fixed32 f32;")
-cpp_quote("  typedef struct { USHORT Fraction; SHORT Value; } fields;")
-cpp_quote("  fields *_f32 = (fields *)(void *)&f32;")
+cpp_quote("  struct { USHORT Fraction; SHORT Value; } *_f32 = (void *)&f32;")
 cpp_quote("  _f32->Value    = ((ULONG) (f * (1 << 16))) >> 16;")
 cpp_quote("  _f32->Fraction = ((ULONG) (f * (1 << 16))) & 0xFFFF;")
 cpp_quote("  return f32;")
diff --git a/mingw-w64-headers/include/windows.foundation.collections.h b/mingw-w64-headers/include/windows.foundation.collections.h
new file mode 100644
index 0000000..cb37f40
--- /dev/null
+++ b/mingw-w64-headers/include/windows.foundation.collections.h
@@ -0,0 +1,208 @@
+/*** Autogenerated by WIDL 6.3 from include/windows.foundation.collections.idl - Do not edit ***/
+
+#ifdef _WIN32
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#endif
+#include <rpc.h>
+#include <rpcndr.h>
+#endif
+
+#ifndef COM_NO_WINDOWS_H
+#include <windows.h>
+#include <ole2.h>
+#endif
+
+#ifndef __windows_foundation_collections_h__
+#define __windows_foundation_collections_h__
+
+/* Forward declarations */
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+namespace ABI {
+    namespace Windows {
+        namespace Foundation {
+            template <class T>
+            struct IEventHandler_impl;
+
+            template <class T>
+            struct IEventHandler : IEventHandler_impl<T> {};
+        }
+    }
+}
+#endif
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+namespace ABI {
+    namespace Windows {
+        namespace Foundation {
+            namespace Collections {
+                template <class T>
+                struct IIterator_impl;
+
+                template <class T>
+                struct IIterator : IIterator_impl<T> {};
+            }
+        }
+    }
+}
+#endif
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+namespace ABI {
+    namespace Windows {
+        namespace Foundation {
+            namespace Collections {
+                template <class T>
+                struct IIterable_impl;
+
+                template <class T>
+                struct IIterable : IIterable_impl<T> {};
+            }
+        }
+    }
+}
+#endif
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+namespace ABI {
+    namespace Windows {
+        namespace Foundation {
+            namespace Collections {
+                template <class T>
+                struct IVectorView_impl;
+
+                template <class T>
+                struct IVectorView : IVectorView_impl<T> {};
+            }
+        }
+    }
+}
+#endif
+
+/* Headers for imported files */
+
+#include <inspectable.h>
+#include <windowscontracts.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+namespace ABI { namespace Windows { namespace Foundation { namespace Internal {
+template <class T> struct GetAbiType { typedef T type; };
+template <class T> struct GetLogicalType { typedef T type; };
+template <class L, class A> struct AggregateType {};
+template <class L, class A> struct GetAbiType<AggregateType<L, A> > { typedef A type; };
+template <class L, class A> struct GetLogicalType<AggregateType<L, A> > { typedef L type; };
+}}}}
+extern "C" {
+#endif
+#if defined(__cplusplus) && !defined(CINTERFACE)
+} /* extern "C" */
+namespace ABI {
+    namespace Windows {
+        namespace Foundation {
+            template <class T>
+            struct IEventHandler_impl : IUnknown
+            {
+            private:
+                typedef typename Windows::Foundation::Internal::GetAbiType<T>::type     T_abi;
+                typedef typename Windows::Foundation::Internal::GetLogicalType<T>::type T_logical;
+            public:
+                typedef T T_complex;
+                virtual HRESULT STDMETHODCALLTYPE Invoke(IInspectable *sender,T_abi args) = 0;
+            };
+        }
+    }
+}
+extern "C" {
+#endif
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+} /* extern "C" */
+namespace ABI {
+    namespace Windows {
+        namespace Foundation {
+            namespace Collections {
+                template <class T>
+                struct IIterator_impl : IInspectable
+                {
+                private:
+                    typedef typename Windows::Foundation::Internal::GetAbiType<T>::type     T_abi;
+                    typedef typename Windows::Foundation::Internal::GetLogicalType<T>::type T_logical;
+                public:
+                    typedef T T_complex;
+                    virtual HRESULT STDMETHODCALLTYPE get_Current(T_abi *value) = 0;
+                    virtual HRESULT STDMETHODCALLTYPE get_HasCurrent(WINBOOL *value) = 0;
+                    virtual HRESULT STDMETHODCALLTYPE MoveNext(WINBOOL *value) = 0;
+                    virtual HRESULT STDMETHODCALLTYPE GetMany(UINT32 count,T_abi *items,UINT32 *value) = 0;
+                };
+            }
+        }
+    }
+}
+extern "C" {
+#endif
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+} /* extern "C" */
+namespace ABI {
+    namespace Windows {
+        namespace Foundation {
+            namespace Collections {
+                template <class T>
+                struct IIterable_impl : IInspectable
+                {
+                private:
+                    typedef typename Windows::Foundation::Internal::GetAbiType<T>::type     T_abi;
+                    typedef typename Windows::Foundation::Internal::GetLogicalType<T>::type T_logical;
+                public:
+                    typedef T T_complex;
+                    virtual HRESULT STDMETHODCALLTYPE First(IIterator<T_logical> **value) = 0;
+                };
+            }
+        }
+    }
+}
+extern "C" {
+#endif
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+} /* extern "C" */
+namespace ABI {
+    namespace Windows {
+        namespace Foundation {
+            namespace Collections {
+                template <class T>
+                struct IVectorView_impl : IInspectable
+                {
+                private:
+                    typedef typename Windows::Foundation::Internal::GetAbiType<T>::type     T_abi;
+                    typedef typename Windows::Foundation::Internal::GetLogicalType<T>::type T_logical;
+                public:
+                    typedef T T_complex;
+                    virtual HRESULT STDMETHODCALLTYPE GetAt(ULONG index,T_abi *value) = 0;
+                    virtual HRESULT STDMETHODCALLTYPE get_Size(ULONG *value) = 0;
+                    virtual HRESULT STDMETHODCALLTYPE IndexOf(T_abi element,ULONG *index,BOOLEAN *value) = 0;
+                    virtual HRESULT STDMETHODCALLTYPE GetMany(ULONG start_index,T_abi *items,ULONG *value) = 0;
+                };
+            }
+        }
+    }
+}
+extern "C" {
+#endif
+
+/* Begin additional prototypes for all interfaces */
+
+
+/* End additional prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __windows_foundation_collections_h__ */
diff --git a/mingw-w64-headers/include/windows.foundation.collections.idl b/mingw-w64-headers/include/windows.foundation.collections.idl
new file mode 100644
index 0000000..ed05016
--- /dev/null
+++ b/mingw-w64-headers/include/windows.foundation.collections.idl
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2021 Rémi Bernon for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef __WIDL__
+#pragma winrt ns_prefix
+#endif
+
+import "inspectable.idl";
+/* import "asyncinfo.idl"; */
+import "windowscontracts.idl";
+/* import "eventtoken.idl"; */
+
+namespace Windows {
+    namespace Foundation {
+
+cpp_quote("#ifdef __cplusplus")
+cpp_quote("} /* extern \"C\" */")
+cpp_quote("namespace ABI { namespace Windows { namespace Foundation { namespace Internal {")
+cpp_quote("template <class T> struct GetAbiType { typedef T type; };")
+cpp_quote("template <class T> struct GetLogicalType { typedef T type; };")
+cpp_quote("template <class L, class A> struct AggregateType {};")
+cpp_quote("template <class L, class A> struct GetAbiType<AggregateType<L, A> > { typedef A type; };")
+cpp_quote("template <class L, class A> struct GetLogicalType<AggregateType<L, A> > { typedef L type; };")
+cpp_quote("}}}}")
+cpp_quote("extern \"C\" {")
+cpp_quote("#endif")
+
+#ifdef __WIDL__
+        [
+            contract(Windows.Foundation.FoundationContract, 1.0),
+            uuid(9de1c535-6ae1-11e0-84e1-18a905bcc53f)
+        ]
+        delegate HRESULT EventHandler<T>([in] IInspectable *sender, [in] T args);
+
+        namespace Collections
+        {
+            [
+                contract(Windows.Foundation.FoundationContract, 1.0),
+                uuid(6a79e863-4300-459a-9966-cbb660963ee1)
+            ]
+            interface IIterator<T> : IInspectable
+            {
+                [propget] HRESULT Current([out, retval] T *value);
+                [propget] HRESULT HasCurrent([out, retval] BOOL *value);
+                HRESULT MoveNext([out, retval] BOOL *value);
+                HRESULT GetMany([in] UINT32 count, [out] T *items, [out, retval] UINT32 *value);
+            }
+
+            [
+                contract(Windows.Foundation.FoundationContract, 1.0),
+                uuid(faa585ea-6214-4217-afda-7f46de5869b3)
+            ]
+            interface IIterable<T> : IInspectable
+            {
+                HRESULT First([out, retval] Windows.Foundation.Collections.IIterator<T> **value);
+            }
+
+            [
+                contract(Windows.Foundation.FoundationContract, 1.0),
+                uuid(bbe1fa4c-b0e3-4583-baef-1f1b2e483e56)
+            ]
+            interface IVectorView<T> : IInspectable
+            {
+                HRESULT GetAt([in] ULONG index, [out, retval] T *value);
+                [propget] HRESULT Size([out, retval] ULONG *value);
+                HRESULT IndexOf([in, optional] T element, [out] ULONG *index, [out, retval] BOOLEAN *value);
+                HRESULT GetMany([in] ULONG start_index, [out] T *items, [out, retval] ULONG *value);
+            }
+        }
+#endif
+    }
+}
diff --git a/mingw-w64-headers/include/windows.foundation.h b/mingw-w64-headers/include/windows.foundation.h
index 4f77188..2cd1653 100644
--- a/mingw-w64-headers/include/windows.foundation.h
+++ b/mingw-w64-headers/include/windows.foundation.h
@@ -81,6 +81,8 @@
 /* Headers for imported files */
 
 #include <inspectable.h>
+#include <windowscontracts.h>
+#include <windows.foundation.collections.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -195,23 +197,6 @@
 #endif /* WIDL_using_Windows_Foundation */
 #endif
 
-#ifndef ____x_ABI_CWindows_CFoundation_CCollections_CIVectorView_FWD_DEFINED__
-#define ____x_ABI_CWindows_CFoundation_CCollections_CIVectorView_FWD_DEFINED__
-typedef interface __x_ABI_CWindows_CFoundation_CCollections_CIVectorView __x_ABI_CWindows_CFoundation_CCollections_CIVectorView;
-#ifdef __cplusplus
-#define __x_ABI_CWindows_CFoundation_CCollections_CIVectorView ABI::Windows::Foundation::Collections::IVectorView
-namespace ABI {
-    namespace Windows {
-        namespace Foundation {
-            namespace Collections {
-                interface IVectorView;
-            }
-        }
-    }
-}
-#endif /* __cplusplus */
-#endif
-
 #ifndef ____x_ABI_CWindows_CFoundation_CCollections_CIPropertySet_FWD_DEFINED__
 #define ____x_ABI_CWindows_CFoundation_CCollections_CIPropertySet_FWD_DEFINED__
 typedef interface __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet;
diff --git a/mingw-w64-headers/include/windows.foundation.idl b/mingw-w64-headers/include/windows.foundation.idl
index fa76a44..bfc93ae 100644
--- a/mingw-w64-headers/include/windows.foundation.idl
+++ b/mingw-w64-headers/include/windows.foundation.idl
@@ -9,6 +9,8 @@
 #endif
 
 import "inspectable.idl";
+import "windowscontracts.idl";
+import "windows.foundation.collections.idl";
 
 namespace Windows {
   namespace Foundation {
@@ -21,7 +23,6 @@
     struct    EventRegistrationToken;
 
     namespace Collections {
-      interface IVectorView;
       interface IPropertySet;
     }
   }
diff --git a/mingw-w64-headers/wine-import.sh b/mingw-w64-headers/wine-import.sh
index 1dd2748..3e4b8dc 100755
--- a/mingw-w64-headers/wine-import.sh
+++ b/mingw-w64-headers/wine-import.sh
@@ -192,7 +192,8 @@
 	vmr9 \
 	wincodec \
 	wincodecsdk \
-        windowscontracts \
+	windowscontracts \
+	windows.foundation.collections \
 	wmdrmsdk \
 	wmp \
 	wmsbuffer \