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.

107 lines
2.2 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. // File: entry.hxx
  7. //
  8. // Contents: Entry management classes
  9. //
  10. // Classes: PEntry
  11. // CDirectEntry
  12. //
  13. //---------------------------------------------------------------
  14. #ifndef __ENTRY_HXX__
  15. #define __ENTRY_HXX__
  16. #include "msf.hxx"
  17. //+--------------------------------------------------------------
  18. //
  19. // Class: PEntry (en)
  20. //
  21. // Purpose: Entry management
  22. //
  23. // Interface: See below
  24. //
  25. //---------------------------------------------------------------
  26. #define ROOT_LUID 1
  27. #define MINISTREAM_LUID 2
  28. #define ITERATOR_LUID 3
  29. #define LUID_BASE 4
  30. class PEntry
  31. {
  32. public:
  33. inline DFLUID GetLuid(void);
  34. virtual SCODE GetTime(WHICHTIME wt, TIME_T *ptm) = 0;
  35. virtual SCODE SetTime(WHICHTIME wt, TIME_T tm) = 0;
  36. SCODE CopyTimesFrom(PEntry *penFrom);
  37. static inline DFLUID GetNewLuid(void);
  38. protected:
  39. PEntry(DFLUID dl);
  40. private:
  41. static DFLUID _dlBase;
  42. const DFLUID _dl;
  43. #ifdef _MSC_VER
  44. #pragma warning(disable:4512)
  45. // default assignment operator could not be generated since we have a const
  46. // member variable. This is okay snce we are not using the assignment
  47. // operatot anyway.
  48. #endif
  49. };
  50. #ifdef _MSC_VER
  51. #pragma warning(default:4512)
  52. #endif
  53. //+--------------------------------------------------------------
  54. //
  55. // Member: PEntry::GetNewLuid, public
  56. //
  57. // Synopsis: Returns a new luid
  58. //
  59. //---------------------------------------------------------------
  60. inline DFLUID PEntry::GetNewLuid(void)
  61. {
  62. DFLUID dl = _dlBase;
  63. AtomicInc((long *)&_dlBase);
  64. return dl;
  65. }
  66. //+--------------------------------------------------------------
  67. //
  68. // Member: PEntry::PEntry, protected
  69. //
  70. // Synopsis: Constructor, sets luid
  71. //
  72. //---------------------------------------------------------------
  73. inline PEntry::PEntry(DFLUID dl)
  74. : _dl(dl)
  75. {
  76. }
  77. //+--------------------------------------------------------------
  78. //
  79. // Member: PEntry::GetLuid, public
  80. //
  81. // Synopsis: Returns the luid
  82. //
  83. //---------------------------------------------------------------
  84. inline DFLUID PEntry::GetLuid(void)
  85. {
  86. return _dl;
  87. }
  88. #endif // #ifndef __ENTRY_HXX__