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.

239 lines
6.2 KiB

  1. /**********************************************************************/
  2. /** Microsoft NT Windows **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. lmosess.hxx
  7. LM_SESSION header file.
  8. The class hierary is the following:
  9. LOC_LM_OBJ
  10. LM_SESSION
  11. LM_SESSION_0
  12. LM_SESSION_10
  13. LM_SESSION_1
  14. LM_SESSION_2
  15. NOTES:
  16. // CODEWORK: make all the QueryXXX() methods to inline.
  17. FILE HISTORY:
  18. terryk 21-Aug-91 Created
  19. terryk 26-Aug-91 Code review changed. Attend: keithmo
  20. chuckc terryk
  21. terryk 07-Oct-91 type change for NT
  22. terryk 21-Oct-91 type change for NT
  23. */
  24. #ifndef _LMOSESS_HXX_
  25. #define _LMOSESS_HXX_
  26. /**********************************************************\
  27. NAME: LM_SESSION
  28. SYNOPSIS: Session object
  29. INTERFACE: LM_SESSION() - constructor
  30. QueryServer() - return the server name
  31. QueryName() - return the client name
  32. PARENT: LOC_LM_OBJ
  33. USES: NLS_STR
  34. CAVEATS: shadow class for all the LM_SESSION object
  35. HISTORY:
  36. terryk 21-Aug-91 Created
  37. \**********************************************************/
  38. DLL_CLASS LM_SESSION: public LOC_LM_OBJ
  39. {
  40. private:
  41. NLS_STR _nlsComputername;
  42. protected:
  43. virtual APIERR I_Delete( UINT usForce = 0 );
  44. APIERR SetName( const TCHAR * pszComputername );
  45. LM_SESSION(const TCHAR *pszComputername, const TCHAR *pszLocation = NULL);
  46. LM_SESSION(const TCHAR *pszComputername, enum LOCATION_TYPE loctype);
  47. LM_SESSION(const TCHAR *pszComputername, const LOCATION & loc);
  48. public:
  49. const TCHAR * QueryName( VOID ) const;
  50. const TCHAR * QueryServer( VOID ) const
  51. { return LOC_LM_OBJ::QueryServer(); }
  52. };
  53. /**********************************************************\
  54. NAME: LM_SESSION_0
  55. SYNOPSIS: LM_SESSION level 0 object.
  56. INTERFACE: LM_SESSION_0() - constructor
  57. PARENT: LM_SESSION
  58. USES: NLS_STR
  59. HISTORY:
  60. terryk 21-Aug-91 Created
  61. \**********************************************************/
  62. DLL_CLASS LM_SESSION_0: public LM_SESSION
  63. {
  64. protected:
  65. virtual APIERR I_GetInfo( VOID );
  66. public:
  67. LM_SESSION_0(const TCHAR *pszComputername, const TCHAR *pszLocation = NULL);
  68. LM_SESSION_0(const TCHAR *pszComputername, enum LOCATION_TYPE loctype);
  69. LM_SESSION_0(const TCHAR *pszComputername, const LOCATION & loc);
  70. };
  71. /**********************************************************\
  72. NAME: LM_SESSION_10
  73. SYNOPSIS: LM_SESSION level 10 object. This level contains the
  74. following information:
  75. computer name
  76. user name
  77. time
  78. idle time
  79. INTERFACE: LM_SESSION_10() - constructor
  80. QueryUsername() - return the user name
  81. QueryTime() - return the connection time
  82. QueryIdleTime() - return the idle time
  83. PARENT: LM_SESSION_0
  84. USES: NLS_STR
  85. HISTORY:
  86. terryk 21-Aug-91 Created
  87. \**********************************************************/
  88. DLL_CLASS LM_SESSION_10: public LM_SESSION_0
  89. {
  90. private:
  91. NLS_STR _nlsUsername;
  92. ULONG _ulTime;
  93. ULONG _ulIdleTime;
  94. protected:
  95. virtual APIERR I_GetInfo( VOID );
  96. APIERR SetUsername( const TCHAR * pszUsername );
  97. VOID SetTime( ULONG ulTime );
  98. VOID SetIdleTime( ULONG ulIdleTime );
  99. public:
  100. LM_SESSION_10(const TCHAR *pszComputername, const TCHAR *pszLocation = NULL);
  101. LM_SESSION_10(const TCHAR *pszComputername, enum LOCATION_TYPE loctype);
  102. LM_SESSION_10(const TCHAR *pszComputername, const LOCATION & loc);
  103. const TCHAR * QueryUsername( VOID ) const;
  104. ULONG QueryTime( VOID ) const;
  105. ULONG QueryIdleTime( VOID ) const;
  106. };
  107. /**********************************************************\
  108. NAME: LM_SESSION_1
  109. SYNOPSIS: LM_SESSION level 1 class
  110. INTERFACE: LM_SESSION_1() - constructor
  111. QueryNumConns() - return the number of connection
  112. QueryNumOpens() - return the number of opening device
  113. QueryNumUsers() - return the number of logon user
  114. QueryUserFlags() - return the user flags
  115. IsGuest() - is a guest account connection?
  116. IsEncrypted() - use password encryption?
  117. PARENT: LM_SESSION_10
  118. HISTORY:
  119. terryk 21-Aug-91 Created
  120. \**********************************************************/
  121. DLL_CLASS LM_SESSION_1: public LM_SESSION_10
  122. {
  123. private:
  124. #ifndef WIN32
  125. UINT _uiNumConns;
  126. UINT _uiNumUsers;
  127. #endif
  128. UINT _uNumOpens;
  129. ULONG _ulUserFlags;
  130. protected:
  131. virtual APIERR I_GetInfo( VOID );
  132. #ifndef WIN32
  133. VOID SetNumConns( UINT uiNumConns );
  134. VOID SetNumUsers( UINT uiNumUsers );
  135. #endif
  136. VOID SetNumOpens( UINT uNumOpens );
  137. VOID SetUserFlags( ULONG ulUserFlags );
  138. public:
  139. LM_SESSION_1(const TCHAR *pszComputername, const TCHAR *pszLocation = NULL);
  140. LM_SESSION_1(const TCHAR *pszComputername, enum LOCATION_TYPE loctype);
  141. LM_SESSION_1(const TCHAR *pszComputername, const LOCATION & loc);
  142. #ifndef WIN32
  143. UINT QueryNumConns( VOID ) const;
  144. UINT QueryNumUsers( VOID ) const;
  145. #endif
  146. UINT QueryNumOpens( VOID ) const;
  147. ULONG QueryUserFlags( VOID ) const;
  148. BOOL IsGuest( VOID ) const;
  149. BOOL IsEncrypted( VOID ) const;
  150. };
  151. /**********************************************************\
  152. NAME: LM_SESSION_2
  153. SYNOPSIS: LM_SESSION level 2 class
  154. INTERFACE: LM_SESSION_2() - constructor
  155. QueryClientType() - return the cltype name string
  156. PARENT: LM_SESSION_1
  157. USES: NLS_STR
  158. HISTORY:
  159. terryk 21-Aug-91 Created
  160. \**********************************************************/
  161. DLL_CLASS LM_SESSION_2: public LM_SESSION_1
  162. {
  163. private:
  164. NLS_STR _nlsClientType;
  165. protected:
  166. virtual APIERR I_GetInfo( VOID );
  167. APIERR SetClientType( const TCHAR * pszCltypename );
  168. public:
  169. LM_SESSION_2(const TCHAR *pszComputername, const TCHAR *pszLocation = NULL);
  170. LM_SESSION_2(const TCHAR *pszComputername, enum LOCATION_TYPE loctype);
  171. LM_SESSION_2(const TCHAR *pszComputername, const LOCATION & loc);
  172. const TCHAR * QueryClientType( VOID ) const;
  173. };
  174. #endif // _LMOSESS_HXX_