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.

105 lines
2.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: genenum.h
  7. //
  8. // Contents: Declaration of a generic enum object and test object.
  9. //
  10. // Classes: CGenEnumObject
  11. //
  12. // Functions:
  13. //
  14. // History: dd-mmm-yy Author Comment
  15. // 23-May-94 kennethm author! author!
  16. //
  17. //--------------------------------------------------------------------------
  18. #ifndef _GENENUM_H
  19. #define _GENENUM_H
  20. //
  21. // This macro allows the code to use a different outputstring function.
  22. //
  23. #define OutputStr(a) OutputString a
  24. //+-------------------------------------------------------------------------
  25. //
  26. // Class: IGenEnum
  27. //
  28. // Purpose: generic enumerator
  29. //
  30. // Interface: Abstract class
  31. //
  32. // History: dd-mmm-yy Author Comment
  33. // 23-May-94 kennethm author
  34. //
  35. // Notes:
  36. //
  37. //--------------------------------------------------------------------------
  38. class IGenEnum
  39. {
  40. public:
  41. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObj) = 0;
  42. STDMETHOD_(ULONG,AddRef)(void) = 0;
  43. STDMETHOD_(ULONG,Release)(void) = 0;
  44. STDMETHOD(Next) (ULONG celt, void *rgelt,
  45. ULONG *pceltFetched) = 0;
  46. STDMETHOD(Skip) (ULONG celt) = 0;
  47. STDMETHOD(Reset) (void) = 0;
  48. STDMETHOD(Clone) (void **ppenum) = 0;
  49. };
  50. //+-------------------------------------------------------------------------
  51. //
  52. // Class: CEnumeratorTest
  53. //
  54. // Purpose: enumerator test class
  55. //
  56. // Interface:
  57. //
  58. // History: dd-mmm-yy Author Comment
  59. // 23-May-94 kennethm author
  60. //
  61. // Notes:
  62. //
  63. //--------------------------------------------------------------------------
  64. class CEnumeratorTest
  65. {
  66. public:
  67. // Constructor
  68. CEnumeratorTest(
  69. void *penum,
  70. size_t ElementSize,
  71. LONG ElementCount,
  72. HRESULT& rhr);
  73. // Test for each enumerator object
  74. HRESULT TestAll(void);
  75. HRESULT TestNext(void);
  76. // NYI! HRESULT TestSkip(void);
  77. // HRESULT TestClone(void);
  78. // HRESULT TestRelease(void);
  79. // For derived classes which know what we are enumerating
  80. virtual BOOL Verify(void *) = 0;
  81. virtual BOOL VerifyAll(void *, LONG);
  82. virtual void CleanUp(void *);
  83. private:
  84. BOOL GetNext(ULONG celt, ULONG* pceltFetched, HRESULT* phresult);
  85. IGenEnum * m_pEnumTest;
  86. size_t m_ElementSize;
  87. LONG m_ElementCount;
  88. };
  89. #endif // !_GENENUM_H