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.

121 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. pipe.hxx
  5. Abstract:
  6. This module defines the PIPE object.
  7. Author:
  8. Barry J. Gilhuly (W-Barry) June 27, 1991
  9. Environment:
  10. ULIB, User Mode
  11. --*/
  12. #if ! defined( _PIPE_ )
  13. #define _PIPE_
  14. DECLARE_CLASS( PIPE_STREAM );
  15. DECLARE_CLASS( PIPE );
  16. DECLARE_CLASS( WSTRING );
  17. class PIPE : public OBJECT {
  18. public:
  19. DECLARE_CONSTRUCTOR( PIPE );
  20. DECLARE_CAST_MEMBER_FUNCTION( PIPE );
  21. BOOLEAN
  22. Initialize(
  23. IN LPSECURITY_ATTRIBUTES PipeAttributes DEFAULT NULL,
  24. IN ULONG PipeSize DEFAULT 0,
  25. IN PWSTRING PipeName DEFAULT NULL
  26. );
  27. PPIPE_STREAM
  28. QueryReadStream(
  29. );
  30. PPIPE_STREAM
  31. QueryWriteStream(
  32. );
  33. private:
  34. PPIPE_STREAM
  35. QueryPipeStream(
  36. IN HANDLE hStream,
  37. IN STREAMACCESS Access
  38. );
  39. VOID
  40. Destroy(
  41. );
  42. BOOLEAN _fInitialized;
  43. HANDLE _hReadPipe;
  44. HANDLE _hWritePipe;
  45. };
  46. INLINE
  47. PPIPE_STREAM
  48. PIPE::QueryReadStream(
  49. )
  50. /*++
  51. Routine Description:
  52. Create a stream with read access to the PIPE.
  53. Arguments:
  54. None.
  55. Return Value:
  56. A pointer to the created stream if success. Otherwise, it returns
  57. NULL.
  58. --*/
  59. {
  60. return( QueryPipeStream( _hReadPipe, READ_ACCESS ) );
  61. }
  62. INLINE
  63. PPIPE_STREAM
  64. PIPE::QueryWriteStream(
  65. )
  66. /*++
  67. Routine Description:
  68. Create a stream with write access to the PIPE.
  69. Arguments:
  70. None.
  71. Return Value:
  72. A pointer to the created stream if success. Otherwise, it returns
  73. NULL.
  74. --*/
  75. {
  76. return( QueryPipeStream( _hWritePipe, WRITE_ACCESS ) );
  77. }
  78. #endif // _PIPE_