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.

241 lines
5.6 KiB

  1. /**********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990, 1991 **/
  4. /**********************************************************************/
  5. /*
  6. lmoeconn.hxx
  7. This file contains the class declarations for the CONN_ENUM,
  8. CONN0_ENUM, CONN1_ENUM enumerator class and their associated
  9. iterator classes.
  10. CONN_ENUM is a base enumeration class intended to be subclassed for
  11. the desired info level. CONN0_ENUM is an info level 0 enumerator,
  12. while CONN1_ENUM is an info level 1 enumerator.
  13. FILE HISTORY:
  14. KeithMo 28-Jul-1991 Created.
  15. KeithMo 12-Aug-1991 Code review cleanup.
  16. KeithMo 07-Oct-1991 Win32 Conversion.
  17. */
  18. #ifndef _LMOECONN_HXX
  19. #define _LMOECONN_HXX
  20. /*************************************************************************
  21. NAME: CONN_ENUM
  22. SYNOPSIS: This is a base enumeration class intended to be subclassed
  23. for the desired info level.
  24. INTERFACE: CONN_ENUM() - Class constructor.
  25. CallAPI() - Invoke the enumeration API.
  26. PARENT: LOC_LM_ENUM
  27. USES: NLS_STR
  28. CAVEATS:
  29. NOTES:
  30. HISTORY:
  31. KeithMo 28-Jul-1991 Created.
  32. KeithMo 12-Aug-1991 Code review cleanup.
  33. **************************************************************************/
  34. DLL_CLASS CONN_ENUM : public LOC_LM_ENUM
  35. {
  36. private:
  37. NLS_STR _nlsQualifier;
  38. virtual APIERR CallAPI( BYTE ** ppbBuffer,
  39. UINT * pcEntriesRead );
  40. protected:
  41. CONN_ENUM( const TCHAR * pszServer,
  42. const TCHAR * pszQualifier,
  43. UINT uLevel );
  44. }; // class CONN_ENUM
  45. /*************************************************************************
  46. NAME: CONN0_ENUM
  47. SYNOPSIS: CONN0_ENUM is an enumerator for enumerating the
  48. connections to a particular server.
  49. INTERFACE: CONN0_ENUM() - Class constructor.
  50. PARENT: CONN_ENUM
  51. USES: None.
  52. CAVEATS:
  53. NOTES:
  54. HISTORY:
  55. KeithMo 28-Jul-1991 Created.
  56. **************************************************************************/
  57. DLL_CLASS CONN0_ENUM : public CONN_ENUM
  58. {
  59. public:
  60. CONN0_ENUM( const TCHAR * pszServerName,
  61. const TCHAR * pszQualifier );
  62. }; // class CONN0_ENUM
  63. /*************************************************************************
  64. NAME: CONN0_ENUM_OBJ
  65. SYNOPSIS: This is basically the return type from the CONN0_ENUM_ITER
  66. iterator.
  67. INTERFACE: CONN0_ENUM_OBJ - Class constructor.
  68. ~CONN0_ENUM_OBJ - Class destructor.
  69. QueryBufferPtr - Replaces ENUM_OBJ_BASE method.
  70. QueryID - Returns the connection ID.
  71. PARENT: ENUM_OBJ_BASE
  72. HISTORY:
  73. KeithMo 07-Oct-1991 Created.
  74. **************************************************************************/
  75. DLL_CLASS CONN0_ENUM_OBJ : public ENUM_OBJ_BASE
  76. {
  77. public:
  78. //
  79. // Provide properly-casted buffer Query/Set methods.
  80. //
  81. const struct connection_info_0 * QueryBufferPtr( VOID ) const
  82. { return (const struct connection_info_0 *)ENUM_OBJ_BASE::QueryBufferPtr(); }
  83. VOID SetBufferPtr( const struct connection_info_0 * pBuffer );
  84. //
  85. // Accessors.
  86. //
  87. DECLARE_ENUM_ACCESSOR( QueryID, UINT, coni0_id );
  88. }; // class CONN0_ENUM_OBJ
  89. DECLARE_LM_ENUM_ITER_OF( CONN0, struct connection_info_0 )
  90. /*************************************************************************
  91. NAME: CONN1_ENUM
  92. SYNOPSIS: CONN1_ENUM is an enumerator for enumerating the
  93. connections to a particular server.
  94. INTERFACE: CONN1_ENUM() - Class constructor.
  95. PARENT: CONN_ENUM
  96. USES: None.
  97. CAVEATS:
  98. NOTES:
  99. HISTORY:
  100. KeithMo 28-Jul-1991 Created.
  101. **************************************************************************/
  102. DLL_CLASS CONN1_ENUM : public CONN_ENUM
  103. {
  104. public:
  105. CONN1_ENUM( const TCHAR * pszServerName,
  106. const TCHAR * pszQualifier );
  107. }; // class CONN1_ENUM
  108. /*************************************************************************
  109. NAME: CONN1_ENUM_OBJ
  110. SYNOPSIS: This is basically the return type from the CONN1_ENUM_ITER
  111. iterator.
  112. INTERFACE: CONN1_ENUM_OBJ - Class constructor.
  113. ~CONN1_ENUM_OBJ - Class destructor.
  114. QueryBufferPtr - Replaces ENUM_OBJ_BASE method.
  115. QueryID - Returns the connection ID.
  116. QueryType - Returns the connection type.
  117. QueryNumOpens - Returns the number of active
  118. opens on this connection.
  119. QueryNumUsers - Returns the number of users
  120. on this connection.
  121. QueryTime - Returns the connection time.
  122. QueryUserName - Returns the user name.
  123. QueryNetName - Returns the network resource name.
  124. PARENT: ENUM_OBJ_BASE
  125. HISTORY:
  126. KeithMo 07-Oct-1991 Created.
  127. **************************************************************************/
  128. DLL_CLASS CONN1_ENUM_OBJ : public ENUM_OBJ_BASE
  129. {
  130. public:
  131. //
  132. // Provide properly-casted buffer Query/Set methods.
  133. //
  134. const struct connection_info_1 * QueryBufferPtr( VOID ) const
  135. { return (const struct connection_info_1 *)ENUM_OBJ_BASE::QueryBufferPtr(); }
  136. VOID SetBufferPtr( const struct connection_info_1 * pBuffer );
  137. //
  138. // Accessors.
  139. //
  140. DECLARE_ENUM_ACCESSOR( QueryID, UINT, coni1_id );
  141. DECLARE_ENUM_ACCESSOR( QueryType, UINT, coni1_type );
  142. DECLARE_ENUM_ACCESSOR( QueryNumOpens, UINT, coni1_num_opens );
  143. DECLARE_ENUM_ACCESSOR( QueryNumUsers, UINT, coni1_num_users );
  144. DECLARE_ENUM_ACCESSOR( QueryTime, ULONG, coni1_time );
  145. DECLARE_ENUM_ACCESSOR( QueryUserName, const TCHAR *, coni1_username );
  146. DECLARE_ENUM_ACCESSOR( QueryNetName, const TCHAR *, coni1_netname );
  147. }; // class CONN1_ENUM_OBJ
  148. DECLARE_LM_ENUM_ITER_OF( CONN1, struct connection_info_1 )
  149. #endif // _LMOECONN_HXX