// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; using System.Security; using System.Threading; namespace System.Runtime.InteropServices.WindowsRuntime { /// /// Exposes a helper method that allows WindowsRuntimeBuffer : IBuffer, IBufferInternal which is implemented in /// System.Runtime.WindowsRuntime.dll to call into the VM. /// [FriendAccessAllowed] internal static class WindowsRuntimeBufferHelper { [DllImport(JitHelpers.QCall)] [SuppressUnmanagedCodeSecurity] private unsafe extern static void StoreOverlappedPtrInCCW(ObjectHandleOnStack windowsRuntimeBuffer, NativeOverlapped* overlapped); [FriendAccessAllowed] internal unsafe static void StoreOverlappedInCCW(Object windowsRuntimeBuffer, NativeOverlapped* overlapped) { StoreOverlappedPtrInCCW(JitHelpers.GetObjectHandleOnStack(ref windowsRuntimeBuffer), overlapped); } } // class WindowsRuntimeBufferHelper } // namespace // WindowsRuntimeBufferHelper.cs