IStream.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //------------------------------------------------------------------------------
  2. // <copyright file="IStream.cs" company="Microsoft">
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. // </copyright>
  5. //------------------------------------------------------------------------------
  6. using System;
  7. using System.Runtime.InteropServices;
  8. namespace Experimental.System.Messaging.Interop
  9. {
  10. [ComImport(),
  11. Guid("0000000C-0000-0000-C000-000000000046"),
  12. InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  13. internal interface IStream
  14. {
  15. int Read(IntPtr buf, int len);
  16. int Write(IntPtr buf, int len);
  17. [return: MarshalAs(UnmanagedType.I8)]
  18. long Seek([In, MarshalAs(UnmanagedType.I8)] long dlibMove, int dwOrigin);
  19. void SetSize([In, MarshalAs(UnmanagedType.I8)] long libNewSize);
  20. [return: MarshalAs(UnmanagedType.I8)]
  21. long CopyTo([In, MarshalAs(UnmanagedType.Interface)] IStream pstm,
  22. [In, MarshalAs(UnmanagedType.I8)] long cb,
  23. [Out, MarshalAs(UnmanagedType.LPArray)] long[] pcbRead);
  24. void Commit(int grfCommitFlags);
  25. void Revert();
  26. void LockRegion([In, MarshalAs(UnmanagedType.I8)] long libOffset,
  27. [In, MarshalAs(UnmanagedType.I8)] long cb,
  28. int dwLockType);
  29. void UnlockRegion([In, MarshalAs(UnmanagedType.I8)] long libOffset,
  30. [In, MarshalAs(UnmanagedType.I8)] long cb,
  31. int dwLockType);
  32. void Stat(IntPtr pStatstg, int grfStatFlag);
  33. [return: MarshalAs(UnmanagedType.Interface)]
  34. IStream Clone();
  35. }
  36. }