diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IStream.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IStream.cs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IStream.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IStream.cs new file mode 100644 index 0000000000..09b284041e --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IStream.cs @@ -0,0 +1,43 @@ +// 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. + +namespace System.Runtime.InteropServices.ComTypes +{ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct STATSTG + { + public string pwcsName; + public int type; + public long cbSize; + public FILETIME mtime; + public FILETIME ctime; + public FILETIME atime; + public int grfMode; + public int grfLocksSupported; + public Guid clsid; + public int grfStateBits; + public int reserved; + } + + [Guid("0000000c-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IStream + { + // ISequentialStream portion + void Read([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] byte[] pv, int cb, IntPtr pcbRead); + void Write([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] byte[] pv, int cb, IntPtr pcbWritten); + + // IStream portion + void Seek(long dlibMove, int dwOrigin, IntPtr plibNewPosition); + void SetSize(long libNewSize); + void CopyTo(IStream pstm, long cb, IntPtr pcbRead, IntPtr pcbWritten); + void Commit(int grfCommitFlags); + void Revert(); + void LockRegion(long libOffset, long cb, int dwLockType); + void UnlockRegion(long libOffset, long cb, int dwLockType); + void Stat(out STATSTG pstatstg, int grfStatFlag); + void Clone(out IStream ppstm); + } +} |