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.

198 lines
4.5 KiB

  1. /**********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990 **/
  4. /**********************************************************************/
  5. /*
  6. * History
  7. * o-SimoP 08-Apr-91 Cloned from lmouser.hxx
  8. * o-SimoP 20-Apr-91 CR changes, attended by ChuckC,
  9. * ErichCh, RustanL, JonN and me
  10. * terryk 07-Oct-91 type changes for NT
  11. * jonn 08-Oct-91 Added GROUP_0 and GROUP_1
  12. */
  13. #ifndef _LMOGROUP_HXX_
  14. #define _LMOGROUP_HXX_
  15. #include "lmobj.hxx"
  16. /*
  17. NT BUGBUG: The following definition of MAX_GROUP_INFO_SIZE_1
  18. is not safe for NT. It should be moved to a global header file.
  19. */
  20. #define MAX_GROUP_INFO_SIZE_1 (sizeof(struct group_info_1) + (MAXCOMMENTSZ+1))
  21. /*************************************************************************
  22. NAME: GROUP
  23. SYNOPSIS: Superclass for manipulation of groups
  24. INTERFACE: GROUP(), constructor
  25. ~GROUP(), destructor
  26. QueryName(), returns pointer to the group name
  27. that was passed in to constructor or
  28. set by SetName if the name was correct.
  29. Otherwise returns previous name.
  30. SetName(), sets group name, returns error code
  31. which is NERR_Success on success.
  32. I_Delete(), deletes a group.
  33. PARENT: LOC_LM_OBJ
  34. HISTORY:
  35. o-SimoP 08-Apr-91 Cloned from lmouser.hxx
  36. **************************************************************************/
  37. DLL_CLASS GROUP : public LOC_LM_OBJ
  38. {
  39. private:
  40. NLS_STR _nlsGroup;
  41. VOID CtAux( const TCHAR * pszGroup );
  42. protected:
  43. virtual APIERR I_Delete( UINT uiForce );
  44. APIERR W_CloneFrom( const GROUP & group );
  45. public:
  46. GROUP(const TCHAR *pszGroup, const TCHAR *pszLocation = NULL);
  47. GROUP(const TCHAR *pszGroup, enum LOCATION_TYPE loctype);
  48. GROUP(const TCHAR *pszGroup, const LOCATION & loc);
  49. ~GROUP();
  50. const TCHAR *QueryName() const;
  51. APIERR SetName( const TCHAR *pszGroup );
  52. };
  53. /*************************************************************************
  54. NAME: GROUP_0
  55. SYNOPSIS: NetGroupGet/SetGroup[0] (dummy class)
  56. INTERFACE: GROUP_0() constructor
  57. ~GROUP_0() destructor
  58. PARENT: GROUP
  59. HISTORY:
  60. jonn 08-Oct-91 Created
  61. **************************************************************************/
  62. DLL_CLASS GROUP_0 : public GROUP
  63. {
  64. public:
  65. GROUP_0(const TCHAR *pszGroup, const TCHAR *pszLocation = NULL)
  66. : GROUP( pszGroup, pszLocation )
  67. {}
  68. GROUP_0(const TCHAR *pszGroup, enum LOCATION_TYPE loctype)
  69. : GROUP( pszGroup, loctype )
  70. {}
  71. GROUP_0(const TCHAR *pszGroup, const LOCATION & loc)
  72. : GROUP( pszGroup, loc )
  73. {}
  74. ~GROUP_0() {}
  75. };
  76. /*************************************************************************
  77. NAME: GROUP_1
  78. SYNOPSIS: NetGroupGet/SetGroup[1]
  79. INTERFACE: GROUP_1() constructor
  80. ~GROUP_1() destructor
  81. I_GetInfo
  82. Reads in the current state of the object
  83. I_WriteInfo
  84. Writes the current state of the object to the
  85. API. This write is atomic, either all
  86. parameters are set or none are set.
  87. I_CreateNew
  88. Sets up the GROUP_1 object with default values in
  89. preparation for a call to WriteNew
  90. I_WriteNew
  91. Adds a new group
  92. CloneFrom
  93. Makes this GROUP_1 instance an exact copy of the
  94. parameter GROUP_1 instance. All fields including
  95. name and state will be copied. If this operation
  96. fails, the object will be invalid. The parameter
  97. must be a GROUP_1 and not a subclass of GROUP_1.
  98. QueryComment()
  99. SetComment()
  100. PARENT: GROUP_0
  101. HISTORY:
  102. jonn 08-Oct-91 Created
  103. **************************************************************************/
  104. DLL_CLASS GROUP_1 : public GROUP_0
  105. {
  106. private:
  107. NLS_STR _nlsComment;
  108. VOID CtAux();
  109. APIERR W_Write(); // helper for I_WriteInfo and I_WriteNew
  110. protected:
  111. virtual APIERR I_GetInfo();
  112. virtual APIERR I_WriteInfo();
  113. virtual APIERR I_CreateNew();
  114. virtual APIERR I_WriteNew();
  115. virtual APIERR I_ChangeToNew();
  116. virtual APIERR W_CreateNew();
  117. APIERR W_CloneFrom( const GROUP_1 & group1 );
  118. public:
  119. GROUP_1(const TCHAR *pszGroup, const TCHAR *pszLocation = NULL);
  120. GROUP_1(const TCHAR *pszGroup, enum LOCATION_TYPE loctype);
  121. GROUP_1(const TCHAR *pszGroup, const LOCATION & loc);
  122. ~GROUP_1();
  123. APIERR CloneFrom( const GROUP_1 & group1 );
  124. inline const TCHAR * QueryComment() const
  125. { CHECK_OK(NULL); return _nlsComment.QueryPch(); }
  126. APIERR SetComment( const TCHAR * pszComment );
  127. };
  128. #endif // _LMOGROUP_HXX_