Source code of Windows XP (NT5)
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.

99 lines
2.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995.
  5. //
  6. // File: overlap.hxx
  7. //
  8. // Contents: COverlappedStream header
  9. //
  10. // Classes: COverlappedStream
  11. //
  12. // History: 19-Sep-95 HenryLee Created
  13. //
  14. // Notes: Requires NtIoApi.h
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __OVERLAP_HXX__
  18. #define __OVERLAP_HXX__
  19. #include <storext.h>
  20. //+---------------------------------------------------------------------------
  21. //
  22. // Class: COverlappedStream
  23. //
  24. // Purpose:Implements IOverlappedStream for OFS streams and flat files
  25. // (as opposed to overlapped I/O for IStream for docfiles)
  26. //
  27. // Notes: This is class with a partial implementation
  28. // To use this class, inherit this into another class that
  29. // implements IUnknown and IStream (and expose QueryInterface)
  30. //
  31. //----------------------------------------------------------------------------
  32. class COverlappedStream : public IOverlappedStream
  33. {
  34. public:
  35. inline COverlappedStream (HANDLE h = NULL);
  36. inline ~COverlappedStream ();
  37. // IOverlappedStream
  38. STDMETHOD(ReadOverlapped) (
  39. /* [in, size_is(cb)] */ void * pv,
  40. /* [in] */ ULONG cb,
  41. /* [out] */ ULONG * pcbRead,
  42. /* [in,out] */ STGOVERLAPPED *lpOverlapped);
  43. STDMETHOD(WriteOverlapped) (
  44. /* [in, size_is(cb)] */ void *pv,
  45. /* [in] */ ULONG cb,
  46. /* [out] */ ULONG * pcbWritten,
  47. /* [in,out] */ STGOVERLAPPED *lpOverlapped);
  48. STDMETHOD(GetOverlappedResult) (
  49. /* [in, out] */ STGOVERLAPPED *lpOverlapped,
  50. /* [out] */ DWORD * plcbTransfer,
  51. /* [in] */ BOOL fWait);
  52. protected:
  53. NuSafeNtHandle _h;
  54. private:
  55. };
  56. SAFE_INTERFACE_PTR(SafeCOverlappedStream, COverlappedStream);
  57. #define StgOverlapped_SIG LONGSIG('O', 'V', 'E', 'R')
  58. #define StgOverlapped_SIGDEL LONGSIG('O', 'v', 'E', 'r')
  59. //+-------------------------------------------------------------------
  60. //
  61. // Member: COverlappedStream::COverlappedStream
  62. //
  63. // Synopsis: Initialize the generic overlapped object.
  64. //
  65. // Arguments: none
  66. //
  67. //--------------------------------------------------------------------
  68. inline COverlappedStream::COverlappedStream(HANDLE h) : _h(h)
  69. {
  70. }
  71. //+-------------------------------------------------------------------
  72. //
  73. // Member: COverlappedStream::~COverlappedStream
  74. //
  75. // Synopsis: Destroys the generic overlapped object.
  76. //
  77. // Arguments: none
  78. //
  79. //--------------------------------------------------------------------
  80. inline COverlappedStream::~COverlappedStream()
  81. {
  82. }
  83. #endif // #ifndef __OVERLAP_HXX__