Signed-off-by: Alvin Wong <al...@alvinhc.com>
---
Implemented according to
https://learn.microsoft.com/en-us/windows/win32/api/robuffer/. This file
defines the Windows::Storage::Streams::IBufferByteAccess interface which
implementors of (ABI::)Windows::Storage::Streams::IBuffer must also
implement.

The Windows SDK does not actually have an IDL file for robuffer.h, and
its robuffer.h only defines the interface in C++. It also doesn't
declare an IID for this interface (only the UUID for __uuidof is
provided.)

The header generated from this IID should provide functionally identical
definitions as the one from Windows SDK. Additionally, it also provide
extra declarations including the IID and the C definition of the vtable
of IBufferByteAccess, which in theory would allow users to implement
this interface. But any user code that does this will be incompatible
with MSVC unless they provide compatible definitions themselves.

 mingw-w64-headers/Makefile.am          |  1 +
 mingw-w64-headers/include/robuffer.idl | 28 ++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 mingw-w64-headers/include/robuffer.idl

diff --git a/mingw-w64-headers/Makefile.am b/mingw-w64-headers/Makefile.am
index ee3601209..dcdee4c03 100644
--- a/mingw-w64-headers/Makefile.am
+++ b/mingw-w64-headers/Makefile.am
@@ -252,6 +252,7 @@ IDL_SRCS = \
   include/qedit.idl \
   include/qnetwork.idl \
   include/relogger.idl \
+  include/robuffer.idl \
   include/rtworkq.idl \
   include/vmr9.idl \
   include/wincodec.idl \
diff --git a/mingw-w64-headers/include/robuffer.idl 
b/mingw-w64-headers/include/robuffer.idl
new file mode 100644
index 000000000..cc9225627
--- /dev/null
+++ b/mingw-w64-headers/include/robuffer.idl
@@ -0,0 +1,28 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#ifdef __WIDL__
+#pragma winrt
+#endif
+
+import "objidl.idl";
+
+cpp_quote("#if NTDDI_VERSION >= NTDDI_WIN8")
+
+namespace Windows.Storage.Streams {
+
+    [
+        uuid(905a0fef-bc53-11df-8c49-001e4fc686da),
+    ]
+    interface IBufferByteAccess : IUnknown
+    {
+        HRESULT Buffer([out, retval] byte **value);
+    }
+
+}
+
+cpp_quote("STDAPI RoGetBufferMarshaler(IMarshal **bufferMarshaler);")
+cpp_quote("#endif")
-- 
2.39.0



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to