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.

126 lines
3.3 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. lmowksu.hxx
  7. Class declarations for the WKSTA_USER_1 class.
  8. The WKSTA_USER_1 class represents the local logged-on user.
  9. FILE HISTORY:
  10. KeithMo 14-Apr-1992 Created.
  11. */
  12. #ifndef _LMOWKSU_HXX_
  13. #define _LMOWKSU_HXX_
  14. #include "lmobj.hxx"
  15. /*************************************************************************
  16. NAME: WKSTA_USER_1
  17. SYNOPSIS: Info-level 0 workstation user class.
  18. INTERFACE: WKSTA_USER_1 - Class constructor
  19. ~WKSTA_USER_1 - Class destructor.
  20. Set/QueryUserName - Set or retrieve the logged-on
  21. user name.
  22. Set/QueryLogonDomain - Set or retrieve the user's
  23. logon domain.
  24. Set/QueryOtherDomains - Set or retrieve the user's
  25. "other" domains.
  26. Set/QueryLogonServer - Set or retrieve the server
  27. that validated the user's logon.
  28. PARENT: NEW_LM_OBJ
  29. HISTORY:
  30. KeithMo 14-Apr-1992 Created.
  31. **************************************************************************/
  32. DLL_CLASS WKSTA_USER_1 : public NEW_LM_OBJ
  33. {
  34. private:
  35. //
  36. // These data members cache the values retrieved
  37. // from the WKSTA_USER_INFO_1 structure.
  38. //
  39. NLS_STR _nlsUserName;
  40. NLS_STR _nlsLogonDomain;
  41. NLS_STR _nlsOtherDomains;
  42. NLS_STR _nlsLogonServer;
  43. //
  44. // This worker function is called to initialize the
  45. // WKSTA_USER_INFO_1 structure before the
  46. // NetWkstaUserSetInfo API is invoked.
  47. //
  48. APIERR W_Write( VOID );
  49. protected:
  50. //
  51. // These virtual callbacks are called by NEW_LM_OBJ to
  52. // invoke any necessary NetXxx{Get,Set}Info API.
  53. //
  54. virtual APIERR I_GetInfo( VOID );
  55. virtual APIERR I_WriteInfo( VOID );
  56. public:
  57. //
  58. // Usual constructor/destructor goodies.
  59. //
  60. WKSTA_USER_1( VOID );
  61. ~WKSTA_USER_1( VOID );
  62. //
  63. // Accessors.
  64. //
  65. const TCHAR * QueryUserName( VOID ) const
  66. { return _nlsUserName.QueryPch(); }
  67. const TCHAR * QueryLogonDomain( VOID ) const
  68. { return _nlsLogonDomain.QueryPch(); }
  69. const TCHAR * QueryOtherDomains( VOID ) const
  70. { return _nlsOtherDomains.QueryPch(); }
  71. const TCHAR * QueryLogonServer( VOID ) const
  72. { return _nlsLogonServer.QueryPch(); }
  73. APIERR SetUserName( const TCHAR * pszUserName )
  74. { return _nlsUserName.CopyFrom( pszUserName ); }
  75. APIERR SetLogonDomain( const TCHAR * pszLogonDomain )
  76. { return _nlsLogonDomain.CopyFrom( pszLogonDomain ); }
  77. APIERR SetOtherDomains( const TCHAR * pszOtherDomains )
  78. { return _nlsOtherDomains.CopyFrom( pszOtherDomains ); }
  79. APIERR SetLogonServer( const TCHAR * pszLogonServer )
  80. { return _nlsLogonServer.CopyFrom( pszLogonServer ); }
  81. }; // class WKSTA_USER_1
  82. #endif // _LMOWKSU_HXX_