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.

248 lines
6.3 KiB

  1. /**********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990, 1991 **/
  4. /**********************************************************************/
  5. /*
  6. lmoesess.hxx
  7. This file contains the class declarations for the SESSION_ENUM
  8. and SESSION0_ENUM enumerator classes and their associated iterator
  9. classes.
  10. SESSION_ENUM is a base enumeration class intended to be subclassed for
  11. the desired info level. SESSION0_ENUM is an info level 0 enumerator.
  12. FILE HISTORY:
  13. KeithMo 28-Jul-1991 Created.
  14. KevinL 15-Sep-1991 Added SESSION1_ENUM.
  15. KeithMo 07-Oct-1991 Win32 Conversion.
  16. terryk 17-Oct-1991 Some fields are not supported in WIN32
  17. */
  18. #ifndef _LMOESESS_HXX
  19. #define _LMOESESS_HXX
  20. /*************************************************************************
  21. NAME: SESSION_ENUM
  22. SYNOPSIS: This is a base enumeration class intended to be subclassed
  23. for the desired info level.
  24. INTERFACE: SESSION_ENUM() - Class constructor.
  25. CallAPI() - Invoke the enumeration API.
  26. PARENT: LOC_LM_ENUM
  27. USES: None.
  28. CAVEATS:
  29. NOTES:
  30. HISTORY:
  31. KeithMo 28-Jul-1991 Created.
  32. **************************************************************************/
  33. DLL_CLASS SESSION_ENUM : public LOC_LM_ENUM
  34. {
  35. private:
  36. virtual APIERR CallAPI( BYTE ** ppbBuffer,
  37. UINT * pcEntriesRead );
  38. protected:
  39. SESSION_ENUM( const TCHAR * pszServer,
  40. UINT uLevel );
  41. }; // class SESSION_ENUM
  42. /*************************************************************************
  43. NAME: SESSION0_ENUM
  44. SYNOPSIS: SESSION0_ENUM is an enumerator for enumerating the
  45. connections to a particular server.
  46. INTERFACE: SESSION0_ENUM() - Class constructor.
  47. PARENT: SESSION_ENUM
  48. USES: None.
  49. CAVEATS:
  50. NOTES:
  51. HISTORY:
  52. KeithMo 28-Jul-1991 Created.
  53. **************************************************************************/
  54. DLL_CLASS SESSION0_ENUM : public SESSION_ENUM
  55. {
  56. public:
  57. SESSION0_ENUM( const TCHAR * pszServerName );
  58. }; // class SESSION0_ENUM
  59. /*************************************************************************
  60. NAME: SESSION0_ENUM_OBJ
  61. SYNOPSIS: This is basically the return type from the SESSION0_ENUM_ITER
  62. iterator.
  63. INTERFACE: SESSION0_ENUM_OBJ - Class constructor.
  64. ~SESSION0_ENUM_OBJ - Class destructor.
  65. QueryBufferPtr - Replaces ENUM_OBJ_BASE method.
  66. QueryComputerName - Returns the name of the computer
  67. that established the session.
  68. PARENT: ENUM_OBJ_BASE
  69. HISTORY:
  70. KeithMo 07-Oct-1991 Created.
  71. **************************************************************************/
  72. DLL_CLASS SESSION0_ENUM_OBJ : public ENUM_OBJ_BASE
  73. {
  74. public:
  75. //
  76. // Provide properly-casted buffer Query/Set methods.
  77. //
  78. const struct session_info_0 * QueryBufferPtr( VOID ) const
  79. { return (const struct session_info_0 *)ENUM_OBJ_BASE::QueryBufferPtr(); }
  80. VOID SetBufferPtr( const struct session_info_0 * pBuffer );
  81. //
  82. // Accessors.
  83. //
  84. DECLARE_ENUM_ACCESSOR( QueryComputerName, const TCHAR *, sesi0_cname );
  85. }; // class SESSION0_ENUM_OBJ
  86. DECLARE_LM_ENUM_ITER_OF( SESSION0, struct session_info_0 )
  87. /*************************************************************************
  88. NAME: SESSION1_ENUM
  89. SYNOPSIS: SESSION1_ENUM is an enumerator for enumerating the
  90. connections to a particular server.
  91. INTERFACE: SESSION1_ENUM() - Class constructor.
  92. PARENT: SESSION_ENUM
  93. USES: None.
  94. CAVEATS:
  95. NOTES:
  96. HISTORY:
  97. KevinL 15-Sep-1991 Created.
  98. **************************************************************************/
  99. DLL_CLASS SESSION1_ENUM : public SESSION_ENUM
  100. {
  101. public:
  102. SESSION1_ENUM( const TCHAR * pszServerName );
  103. }; // class SESSION1_ENUM
  104. /*************************************************************************
  105. NAME: SESSION1_ENUM_OBJ
  106. SYNOPSIS: This is basically the return type from the SESSION1_ENUM_ITER
  107. iterator.
  108. INTERFACE: SESSION1_ENUM_OBJ - Class constructor.
  109. ~SESSION1_ENUM_OBJ - Class destructor.
  110. QueryBufferPtr - Replaces ENUM_OBJ_BASE method.
  111. QueryComputerName - Returns the name of the computer
  112. that established the session.
  113. QueryUserName - Returns the name of the user
  114. that established the session.
  115. QueryNumConns - Returns the number of connections
  116. made during the session.
  117. QueryNumOpens - Returns the number of files et al
  118. opened during the session.
  119. QueryNumUsers - Returns the number of uses that
  120. made connections during the session.
  121. QueryTime - Returns the time the session has
  122. been active.
  123. QueryIdleTime - Returns the time the session has
  124. been idle.
  125. QueryUserFlags - Returns the user flags.
  126. PARENT: ENUM_OBJ_BASE
  127. HISTORY:
  128. KeithMo 07-Oct-1991 Created.
  129. **************************************************************************/
  130. DLL_CLASS SESSION1_ENUM_OBJ : public ENUM_OBJ_BASE
  131. {
  132. public:
  133. //
  134. // Provide properly-casted buffer Query/Set methods.
  135. //
  136. const struct session_info_1 * QueryBufferPtr( VOID ) const
  137. { return (const struct session_info_1 *)ENUM_OBJ_BASE::QueryBufferPtr(); }
  138. VOID SetBufferPtr( const struct session_info_1 * pBuffer );
  139. //
  140. // Accessors.
  141. //
  142. DECLARE_ENUM_ACCESSOR( QueryComputerName, const TCHAR *, sesi1_cname );
  143. DECLARE_ENUM_ACCESSOR( QueryUserName, const TCHAR *, sesi1_username );
  144. DECLARE_ENUM_ACCESSOR( QueryNumOpens, UINT, sesi1_num_opens );
  145. DECLARE_ENUM_ACCESSOR( QueryTime, ULONG, sesi1_time );
  146. DECLARE_ENUM_ACCESSOR( QueryIdleTime, ULONG, sesi1_idle_time );
  147. DECLARE_ENUM_ACCESSOR( QueryUserFlags, ULONG, sesi1_user_flags );
  148. #ifndef WIN32
  149. // WIN32BUGBUG
  150. DECLARE_ENUM_ACCESSOR( QueryNumConns, UINT, sesi1_num_conns );
  151. DECLARE_ENUM_ACCESSOR( QueryNumUsers, UINT, sesi1_num_users );
  152. #endif
  153. }; // class SESSION1_ENUM_OBJ
  154. DECLARE_LM_ENUM_ITER_OF( SESSION1, struct session_info_1 )
  155. #endif // _LMOESESS_HXX