Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. mmapstm.h
  5. Abstract:
  6. IStream over a memory-mapped file, derived (in the C++ sense) from
  7. RTL_MEMORY_STREAM. Note the semantics and implementation here
  8. of IStream::Stat are specialized for use by sxs.
  9. Author:
  10. Jay Krell (a-JayK) June 2000
  11. Revision History:
  12. --*/
  13. #include "nturtl.h"
  14. typedef struct _BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE {
  15. RTL_MEMORY_STREAM_WITH_VTABLE MemStream;
  16. HANDLE FileHandle;
  17. } BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE, *PBASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE;
  18. VOID
  19. STDMETHODCALLTYPE
  20. BaseSrvInitMemoryMappedStream(
  21. PBASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE MmapStream
  22. );
  23. VOID
  24. STDMETHODCALLTYPE
  25. BaseSrvFinalReleaseMemoryMappedStream(
  26. PRTL_MEMORY_STREAM_WITH_VTABLE MemStream
  27. );
  28. //
  29. // We mostly just inherit the RtlMemoryStream implementation.
  30. // "Declare" that by providing names for our virtual member functions
  31. // whose first parameter is of the correct type.
  32. //
  33. #define BaseSrvAddRefMemoryMappedStream \
  34. ((PRTL_ADDREF_STREAM1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlAddRefMemoryStream)
  35. #define BaseSrvReleaseMemoryMappedStream \
  36. ((PRTL_RELEASE_STREAM1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlReleaseMemoryStream)
  37. #define BaseSrvQueryInterfaceMemoryMappedStream \
  38. ((PRTL_QUERYINTERFACE_STREAM1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlQueryInterfaceMemoryStream)
  39. #define BaseSrvReadMemoryMappedStream \
  40. ((PRTL_READ_STREAM1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlReadMemoryStream)
  41. #define BaseSrvWriteMemoryMappedStream \
  42. ((PRTL_WRITE_STREAM1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlWriteMemoryStream)
  43. #define BaseSrvSeekMemoryMappedStream \
  44. ((PRTL_SEEK_STREAM1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlSeekMemoryStream)
  45. #define BaseSrvSetMemoryMappedStreamSize \
  46. ((PRTL_SET_STREAM_SIZE1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlSetMemoryStreamSize)
  47. #define BaseSrvCopyMemoryMappedStreamTo \
  48. ((PRTL_COPY_STREAM_TO1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlCopyMemoryStreamTo)
  49. #define BaseSrvCommitMemoryMappedStream \
  50. ((PRTL_COMMIT_STREAM1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlCommitMemoryStream)
  51. #define BaseSrvRevertMemoryMappedStream \
  52. ((PRTL_REVERT_STREAM1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlRevertMemoryStream)
  53. #define BaseSrvLockMemoryMappedStreamRegion \
  54. ((PRTL_LOCK_STREAM_REGION1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlLockMemoryStreamRegion)
  55. #define BaseSrvUnlockMemoryMappedStreamRegion \
  56. ((PRTL_UNLOCK_STREAM_REGION1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlUnlockMemoryStreamRegion)
  57. // override
  58. HRESULT
  59. STDMETHODCALLTYPE
  60. BaseSrvStatMemoryMappedStream(
  61. PBASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE MmapStream,
  62. STATSTG* Stat,
  63. DWORD Flags
  64. );
  65. #define BaseSrvCloneMemoryMappedStream \
  66. ((PRTL_CLONE_STREAM1(BASE_SRV_MEMORY_MAPPED_STREAM_WITH_VTABLE))RtlCloneMemoryStream)