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.

287 lines
7.5 KiB

  1. /*****************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /*****************************************************************/
  5. /*
  6. * History:
  7. * RustanL 03-Jan-1991 Created
  8. * RustanL 10-Jan-1991 Added SERVER1 subclass and iterator
  9. * KeithMo 07-Oct-1991 Win32 Conversion.
  10. * terryk 17-Oct-1991 some fields are not supported by WIN32
  11. * KeithMo 21-Oct-1991 They are now.
  12. * AnirudhS 07-Mar-1996 Added CONTEXT_ENUM (moved from lmoectx.hxx)
  13. *
  14. */
  15. #ifndef _LMOESRV_HXX_
  16. #define _LMOESRV_HXX_
  17. #include "lmoenum.hxx"
  18. #include "string.hxx"
  19. /*************************************************************************
  20. NAME: SERVER_ENUM
  21. SYNOPSIS: Base class for server enumerations.
  22. INTERFACE: SERVER_ENUM - Class constructor.
  23. ~SERVER_ENUM - Class destructor.
  24. CallAPI - Invoke the enumeration API.
  25. PARENT: LOC_LM_ENUM
  26. USES: NLS_STR
  27. HISTORY:
  28. RustanL 03-Jan-1991 Created
  29. RustanL 10-Jan-1991 Added SERVER1 subclass and iterator
  30. KeithMo 07-Oct-1991 Changed all USHORTs to UINTs, fixed
  31. comment block, keep the domain name
  32. in an NLS_STR.
  33. **************************************************************************/
  34. DLL_CLASS SERVER_ENUM : public LOC_LM_ENUM
  35. {
  36. private:
  37. NLS_STR _nlsDomain;
  38. ULONG _flServerType;
  39. virtual APIERR CallAPI( BYTE ** ppbBuffer,
  40. UINT * pcEntriesRead );
  41. protected:
  42. SERVER_ENUM( const TCHAR * pszServer,
  43. UINT level,
  44. const TCHAR * pszDomain,
  45. ULONG flServerType );
  46. }; // class SERVER_ENUM
  47. /*************************************************************************
  48. NAME: SERVER1_ENUM
  49. SYNOPSIS: Info level 1 server enumeration class.
  50. INTERFACE: SERVER1_ENUM - Class constructor.
  51. ~SERVER1_ENUM - Class destructor.
  52. PARENT: SERVER_ENUM
  53. HISTORY:
  54. RustanL 03-Jan-1991 Created
  55. RustanL 10-Jan-1991 Added SERVER1 subclass and iterator
  56. KeithMo 07-Oct-1991 Changed all USHORTs to UINTs, fixed
  57. comment block.
  58. **************************************************************************/
  59. DLL_CLASS SERVER1_ENUM : public SERVER_ENUM
  60. {
  61. public:
  62. SERVER1_ENUM( const TCHAR * pszServer,
  63. const TCHAR * pszDomain,
  64. ULONG flServerType = SV_TYPE_ALL );
  65. }; // class SERVER1_ENUM
  66. /*************************************************************************
  67. NAME: SERVER1_ENUM_OBJ
  68. SYNOPSIS: This is basically the return type from the SERVER1_ENUM_ITER
  69. iterator.
  70. INTERFACE: SERVER1_ENUM_OBJ - Class constructor.
  71. ~SERVER1_ENUM_OBJ - Class destructor.
  72. QueryBufferPtr - Replaces ENUM_OBJ_BASE method.
  73. QueryName - Returns the server name.
  74. QueryComment - Returns the server comment.
  75. QueryMajorVer - Returns the LanMan major version.
  76. QueryMinorVer - Returns the LanMan minor version.
  77. QueryServerType - Returns the server type.
  78. PARENT: ENUM_OBJ_BASE
  79. HISTORY:
  80. KeithMo 07-Oct-1991 Created.
  81. KeithMo 21-Oct-1991 Added WIN32 support.
  82. **************************************************************************/
  83. DLL_CLASS SERVER1_ENUM_OBJ : public ENUM_OBJ_BASE
  84. {
  85. public:
  86. //
  87. // Provide properly-casted buffer Query/Set methods.
  88. //
  89. #ifdef WIN32
  90. const SERVER_INFO_101 * QueryBufferPtr( VOID ) const
  91. { return (const SERVER_INFO_101 *)ENUM_OBJ_BASE::QueryBufferPtr(); }
  92. VOID SetBufferPtr( const SERVER_INFO_101 * pBuffer );
  93. #else // !WIN32
  94. const struct server_info_1 * QueryBufferPtr( VOID ) const
  95. { return (const struct server_info_1 *)ENUM_OBJ_BASE::QueryBufferPtr(); }
  96. VOID SetBufferPtr( const struct server_info_1 * pBuffer );
  97. #endif // WIN32
  98. //
  99. // Accessors.
  100. //
  101. #ifdef WIN32
  102. DECLARE_ENUM_ACCESSOR( QueryName, const TCHAR *, sv101_name );
  103. DECLARE_ENUM_ACCESSOR( QueryComment, const TCHAR *, sv101_comment );
  104. DECLARE_ENUM_ACCESSOR( QueryMajorVer, UINT, sv101_version_major );
  105. DECLARE_ENUM_ACCESSOR( QueryMinorVer, UINT, sv101_version_minor );
  106. DECLARE_ENUM_ACCESSOR( QueryServerType, ULONG, sv101_type );
  107. #else // !WIN32
  108. DECLARE_ENUM_ACCESSOR( QueryName, const TCHAR *, sv1_name );
  109. DECLARE_ENUM_ACCESSOR( QueryComment, const TCHAR *, sv1_comment );
  110. DECLARE_ENUM_ACCESSOR( QueryMajorVer, UINT, sv1_version_major );
  111. DECLARE_ENUM_ACCESSOR( QueryMinorVer, UINT, sv1_version_minor );
  112. DECLARE_ENUM_ACCESSOR( QueryServerType, ULONG, sv1_type );
  113. #endif // WIN32
  114. }; // class SERVER1_ENUM_OBJ
  115. #ifdef WIN32
  116. DECLARE_LM_ENUM_ITER_OF( SERVER1, SERVER_INFO_101 );
  117. #else // !WIN32
  118. DECLARE_LM_ENUM_ITER_OF( SERVER1, struct server_info_1 );
  119. #endif // WIN32
  120. /*************************************************************************
  121. NAME: CONTEXT_ENUM
  122. SYNOPSIS: Info level 1 context (server) enumeration class.
  123. BUGBUG Ideally, this should be derived from SERVER1_ENUM, but
  124. that class must first allow overriding the CallAPI method.
  125. INTERFACE: CONTEXT_ENUM - Class constructor.
  126. ~CONTEXT_ENUM - Class destructor.
  127. CallAPI - Invoke the enumeration API.
  128. PARENT: LOC_LM_ENUM
  129. USES: NLS_STR
  130. HISTORY:
  131. AnirudhS 21-Mar-1995 Created from SERVER1_ENUM and
  132. SERVER_ENUM classes
  133. **************************************************************************/
  134. DLL_CLASS CONTEXT_ENUM : public LOC_LM_ENUM
  135. {
  136. protected:
  137. ULONG _flServerType;
  138. virtual APIERR CallAPI( BYTE ** ppbBuffer,
  139. UINT * pcEntriesRead );
  140. public:
  141. CONTEXT_ENUM( ULONG flServerType );
  142. }; // class CONTEXT_ENUM
  143. /*************************************************************************
  144. NAME: CONTEXT_ENUM_OBJ
  145. SYNOPSIS: This is basically the return type from the CONTEXT_ENUM_ITER
  146. iterator.
  147. INTERFACE: CONTEXT_ENUM_OBJ - Class constructor.
  148. ~CONTEXT_ENUM_OBJ - Class destructor.
  149. QueryBufferPtr - Replaces ENUM_OBJ_BASE method.
  150. QueryName - Returns the server name.
  151. QueryComment - Returns the server comment.
  152. QueryMajorVer - Returns the LanMan major version.
  153. QueryMinorVer - Returns the LanMan minor version.
  154. QueryServerType - Returns the server type.
  155. PARENT: ENUM_OBJ_BASE
  156. HISTORY:
  157. AnirudhS 21-Mar-1995 Created from SERVER1_ENUM_OBJ
  158. **************************************************************************/
  159. DLL_CLASS CONTEXT_ENUM_OBJ : public ENUM_OBJ_BASE
  160. {
  161. public:
  162. //
  163. // Provide properly-casted buffer Query/Set methods.
  164. //
  165. const SERVER_INFO_101 * QueryBufferPtr( VOID ) const
  166. { return (const SERVER_INFO_101 *)ENUM_OBJ_BASE::QueryBufferPtr(); }
  167. VOID SetBufferPtr( const SERVER_INFO_101 * pBuffer );
  168. //
  169. // Accessors.
  170. //
  171. DECLARE_ENUM_ACCESSOR( QueryName, const TCHAR *, sv101_name );
  172. DECLARE_ENUM_ACCESSOR( QueryComment, const TCHAR *, sv101_comment );
  173. DECLARE_ENUM_ACCESSOR( QueryMajorVer, UINT, sv101_version_major );
  174. DECLARE_ENUM_ACCESSOR( QueryMinorVer, UINT, sv101_version_minor );
  175. DECLARE_ENUM_ACCESSOR( QueryServerType, ULONG, sv101_type );
  176. }; // class CONTEXT_ENUM_OBJ
  177. DECLARE_LM_ENUM_ITER_OF( CONTEXT, SERVER_INFO_101 );
  178. #endif // _LMOESRV_HXX_