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.

124 lines
3.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: rothint.hxx
  7. //
  8. // Contents: Base class for ROT hint table used in NT
  9. //
  10. // History: 24-Jan-95 Ricksa Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #ifndef __ROTHINT_HXX__
  14. #define __ROTHINT_HXX__
  15. // Size of the hint table and size of the SCM's hash table for the ROT.
  16. #define SCM_HASH_SIZE 251
  17. // Name of hint table for non-NT1X
  18. #define ROTHINT_NAME L"Global\\RotHintTable"
  19. #if 1 // #ifndef _CHICAGO_
  20. //+-------------------------------------------------------------------------
  21. //
  22. // Class: CRotHintTable (rht)
  23. //
  24. // Purpose: Base class for hint table shared between SCM and OLE32.
  25. // It is designed to abstract what is fundamental an array
  26. // of on/off switches.
  27. //
  28. // Interface: SetIndicator - set indicator byte
  29. // ClearIndicator - clear indicator byte
  30. // GetIndicator - get indicator byte.
  31. //
  32. // History: 24-Jan-93 Ricksa Created
  33. //
  34. // Notes:
  35. //
  36. //--------------------------------------------------------------------------
  37. class CRotHintTable
  38. {
  39. public:
  40. CRotHintTable(void);
  41. void SetIndicator(DWORD dwOffset);
  42. void ClearIndicator(DWORD dwOffset);
  43. BOOL GetIndicator(DWORD dwOffset);
  44. protected:
  45. // This memory is allocated by the derived class.
  46. // The SCM actually creates the memory while the
  47. // client just opens the memory.
  48. BYTE * _pbHintArray;
  49. };
  50. //+-------------------------------------------------------------------------
  51. //
  52. // Member: CRotHintTable::CRotHintTable
  53. //
  54. // Synopsis: Initialize object
  55. //
  56. // History: 24-Jan-95 Ricksa Created
  57. //
  58. //--------------------------------------------------------------------------
  59. inline CRotHintTable::CRotHintTable(void) : _pbHintArray(NULL)
  60. {
  61. // Header does all the work
  62. }
  63. //+-------------------------------------------------------------------------
  64. //
  65. // Member: CRotHintTable::SetIndicator
  66. //
  67. // Synopsis: Turn switch on
  68. //
  69. // History: 24-Jan-95 Ricksa Created
  70. //
  71. //--------------------------------------------------------------------------
  72. inline void CRotHintTable::SetIndicator(DWORD dwOffset)
  73. {
  74. _pbHintArray[dwOffset] = TRUE;
  75. }
  76. //+-------------------------------------------------------------------------
  77. //
  78. // Member: CRotHintTable::ClearIndicator
  79. //
  80. // Synopsis: Turn switch off
  81. //
  82. // History: 24-Jan-95 Ricksa Created
  83. //
  84. //--------------------------------------------------------------------------
  85. inline void CRotHintTable::ClearIndicator(DWORD dwOffset)
  86. {
  87. _pbHintArray[dwOffset] = FALSE;
  88. }
  89. //+-------------------------------------------------------------------------
  90. //
  91. // Member: CRotHintTable::GetIndicator
  92. //
  93. // Synopsis: Get the state of the switch
  94. //
  95. // History: 24-Jan-95 Ricksa Created
  96. //
  97. //--------------------------------------------------------------------------
  98. inline BOOL CRotHintTable::GetIndicator(DWORD dwOffset)
  99. {
  100. return _pbHintArray[dwOffset];
  101. }
  102. #endif // !_CHICAGO_
  103. #endif // __ROTHINT_HXX__