From d923cd76b33d3432877a80634414cf732922467f Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Mon, 25 Apr 2022 10:49:44 +0530 Subject: [PATCH 2/2] include: Add Windows.Foundation.MemoryBuffer runtimeclass declaration. Signed-off-by: Biswapriyo Nath --- include/windows.foundation.idl | 53 +++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl index abd51ec..6308248 100644 --- a/include/windows.foundation.idl +++ b/include/windows.foundation.idl @@ -23,7 +23,7 @@ import "inspectable.idl"; import "asyncinfo.idl"; import "windowscontracts.idl"; -/* import "eventtoken.idl"; */ +import "eventtoken.idl"; /* import "ivectorchangedeventargs.idl"; */ import "windows.foundation.collections.idl"; @@ -41,6 +41,10 @@ namespace Windows { typedef struct Rect Rect; typedef struct DateTime DateTime; typedef struct TimeSpan TimeSpan; + interface IMemoryBuffer; + interface IMemoryBufferFactory; + interface IMemoryBufferReference; + runtimeclass MemoryBuffer; declare { interface Windows.Foundation.Collections.IIterable; @@ -59,6 +63,7 @@ namespace Windows { interface Windows.Foundation.IAsyncOperation; interface Windows.Foundation.IReference; interface Windows.Foundation.TypedEventHandler; + interface Windows.Foundation.TypedEventHandler; } [ @@ -171,5 +176,51 @@ namespace Windows { [propget] HRESULT Completed([out, retval] Windows.Foundation.AsyncActionCompletedHandler **handler); HRESULT GetResults(); } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + uuid(fbc4dd2a-245b-11e4-af98-689423260cf8) + ] + interface IMemoryBuffer : IInspectable + requires Windows.Foundation.IClosable + { + HRESULT CreateReference([out, retval] Windows.Foundation.IMemoryBufferReference **reference); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Foundation.MemoryBuffer), + uuid(fbc4dd2b-245b-11e4-af98-689423260cf8) + ] + interface IMemoryBufferFactory : IInspectable + { + HRESULT Create([in, range(0x00000000, 0x7fffffff)] UINT32 capacity, + [out, retval] Windows.Foundation.MemoryBuffer **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + uuid(fbc4dd29-245b-11e4-af98-689423260cf8) + ] + interface IMemoryBufferReference : IInspectable + requires Windows.Foundation.IClosable + { + [propget] HRESULT Capacity([out, retval] UINT32 *value); + [eventadd] HRESULT Closed([in] Windows.Foundation.TypedEventHandler *handler, + [out, retval] EventRegistrationToken *cookie); + [eventremove] HRESULT Closed([in] EventRegistrationToken cookie); + } + + [ + activatable(Windows.Foundation.IMemoryBufferFactory, Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass MemoryBuffer + { + [default] interface Windows.Foundation.IMemoryBuffer; + interface Windows.Foundation.IClosable; + } } } -- 2.35.3