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.

179 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. buffer.hxx
  5. Abstract:
  6. This contains all buffer class definition.
  7. No reallocing of buffers is done. A buffer must be big enough
  8. to hold both buffer for a cat.
  9. Environment:
  10. ULIB, User Mode
  11. Notes:
  12. Revision History:
  13. --*/
  14. //
  15. // This class is no longer supported.
  16. //
  17. #define _BUFFER_
  18. #if !defined (_BUFFER_)
  19. #define _BUFFER_
  20. #include "error.hxx"
  21. DECLARE_CLASS( BUFFER );
  22. class BUFFER : public OBJECT {
  23. friend WSTRING;
  24. public:
  25. VIRTUAL
  26. ~BUFFER (
  27. );
  28. NONVIRTUAL
  29. BOOLEAN
  30. BuffCat (
  31. IN PCBUFFER BufferToCat
  32. );
  33. NONVIRTUAL
  34. PCVOID
  35. GetBufferPtr (
  36. ) CONST;
  37. NONVIRTUAL
  38. BOOLEAN
  39. PutBuffer (
  40. IN PCBUFFER BufferToCopy
  41. );
  42. NONVIRTUAL
  43. ULONG
  44. QueryBytesInBuffer (
  45. ) CONST;
  46. NONVIRTUAL
  47. BOOLEAN
  48. SetBuffer (
  49. IN PVOID InitialBuffer,
  50. IN ULONG SizeOfBuffer
  51. );
  52. protected:
  53. DECLARE_CONSTRUCTOR( BUFFER );
  54. NONVIRTUAL
  55. BOOLEAN
  56. BufferCopyAt (
  57. IN PCVOID BufferToCopy,
  58. IN ULONG BytesToCopy,
  59. IN ULONG StartingByte DEFAULT 0
  60. );
  61. NONVIRTUAL
  62. BOOLEAN
  63. DeleteAt (
  64. IN ULONG cbToDelete,
  65. IN ULONG oStartDelete
  66. );
  67. NONVIRTUAL
  68. BOOLEAN
  69. InsertAt (
  70. IN PCVOID BufferToCopy,
  71. IN ULONG cbToCopy,
  72. IN ULONG oStartCopy
  73. );
  74. NONVIRTUAL
  75. PVOID
  76. ReAllocate (
  77. IN ULONG NewCount
  78. );
  79. private:
  80. NONVIRTUAL
  81. VOID
  82. Construct (
  83. );
  84. PVOID pBuffer; // pointer to the data byffer
  85. ULONG cb; // count of bytes used
  86. ULONG _BufSize; // count of bytes in buffer
  87. STATIC
  88. ULONG _ThresHold;
  89. };
  90. INLINE
  91. PCVOID
  92. BUFFER::GetBufferPtr (
  93. ) CONST
  94. /*++
  95. Routine Description:
  96. Fetch pointer to internal buffer
  97. Arguments:
  98. None
  99. Return Value:
  100. PCVOID - pointer to internal buffer
  101. --*/
  102. {
  103. return ( pBuffer );
  104. }
  105. INLINE
  106. ULONG
  107. BUFFER::QueryBytesInBuffer (
  108. ) CONST
  109. /*++
  110. Routine Description:
  111. Fetch size in bytes of internal buffer
  112. Arguments:
  113. None
  114. Return Value:
  115. ULONG - size of internal buffer in bytes
  116. --*/
  117. {
  118. return ( cb );
  119. }
  120. #endif // _BUFFER_