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.

55 lines
2.1 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Microsoft WMIOLE DB Provider
  4. // (C) Copyright 1999 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // Class Definitions for CExtBuffer Class
  7. //
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. #ifndef _EXTBUFF_H_
  10. #define _EXTBUFF_H_
  11. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  12. // Forward Declaration
  13. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  14. class FAR CExtBuffer;
  15. typedef CExtBuffer FAR *LPEXTBUFFER;
  16. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  17. //
  18. // Allocates and manages fixed sized block memory routines
  19. //
  20. // ext or pext
  21. //
  22. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  23. class FAR CExtBuffer
  24. {
  25. private:
  26. ULONG m_cbItem; // Current count of items
  27. ULONG m_cItem; // Item size, in bytes
  28. ULONG m_cbReserved; // Reserved byte count
  29. ULONG m_cbAlloc; // Allocated byte count
  30. ULONG m_dbAlloc; // increment value
  31. BYTE *m_rgItem; // Ptr to beginning of buffer
  32. private:
  33. CExtBuffer( const CExtBuffer & p); // Not implemented; private so dcl prevents generation.
  34. CExtBuffer& operator=(const CExtBuffer & p);
  35. public:
  36. CExtBuffer ( void );
  37. ~CExtBuffer ( void );
  38. void * operator[] (ULONG nIndex); // Calculated data pointer from index value
  39. STDMETHODIMP FInit (ULONG cItemMax, ULONG cbItem, ULONG cbPage); // Initialize the fixed size buffer
  40. STDMETHODIMP InsertIntoExtBuffer (VOID* pvItem, ULONG &hItem); // Add new items to the buffer
  41. STDMETHODIMP GetItemOfExtBuffer (HACCESSOR hItem, VOID* pvItem); // Retrieve items from buffer
  42. STDMETHODIMP GetFirstLastItemH (HACCESSOR &hItemFirst, HACCESSOR &hItemLast);// Get usage extent indexes
  43. };
  44. #endif