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.

113 lines
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: dfnlist.hxx
  7. //
  8. // Contents: CDfName class
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 04-Aug-94 PhilipLa Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __DFNLIST_HXX__
  18. #define __DFNLIST_HXX__
  19. #include <dfname.hxx>
  20. //+---------------------------------------------------------------------------
  21. //
  22. // Class: CDfNameList
  23. //
  24. // Purpose: Linked list of DfNames
  25. //
  26. // History: 04-Aug-94 PhilipLa Created
  27. //
  28. //----------------------------------------------------------------------------
  29. class CDfNameList
  30. {
  31. public:
  32. inline CDfName * GetName(void);
  33. inline SECT GetStart(void);
  34. inline ULONG GetSize(void);
  35. inline CDfNameList *GetNext(void);
  36. inline void SetName(WCHAR const *pwcs);
  37. inline void SetDfName(const CDfName *pdfn);
  38. inline void SetStart(SECT sectStart);
  39. inline void SetSize(ULONG ulSize);
  40. inline void Insert(CDfNameList **ppdflStart,
  41. CDfNameList *pdflPrev,
  42. CDfNameList *pdflNext);
  43. private:
  44. CDfName _df;
  45. SECT _sectStart;
  46. ULONG _ulSize;
  47. CDfNameList *_pdflNext;
  48. };
  49. inline CDfName * CDfNameList::GetName(void)
  50. {
  51. return &_df;
  52. }
  53. inline SECT CDfNameList::GetStart(void)
  54. {
  55. return _sectStart;
  56. }
  57. inline ULONG CDfNameList::GetSize(void)
  58. {
  59. return _ulSize;
  60. }
  61. inline CDfNameList * CDfNameList::GetNext(void)
  62. {
  63. return _pdflNext;
  64. }
  65. inline void CDfNameList::SetName(WCHAR const *pwcs)
  66. {
  67. _df.Set(pwcs);
  68. }
  69. inline void CDfNameList::SetDfName(const CDfName *pdfn)
  70. {
  71. _df = *pdfn;
  72. }
  73. inline void CDfNameList::SetStart(SECT sectStart)
  74. {
  75. _sectStart = sectStart;
  76. }
  77. inline void CDfNameList::SetSize(ULONG ulSize)
  78. {
  79. _ulSize = ulSize;
  80. }
  81. inline void CDfNameList::Insert(CDfNameList **ppdflStart,
  82. CDfNameList *pdflPrev,
  83. CDfNameList *pdflNext)
  84. {
  85. if (pdflPrev == NULL)
  86. {
  87. *ppdflStart = this;
  88. }
  89. else
  90. {
  91. pdflPrev->_pdflNext = this;
  92. }
  93. _pdflNext = pdflNext;
  94. }
  95. #endif // #ifndef __DFNLIST_HXX__