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.

124 lines
3.7 KiB

  1. /**********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990 **/
  4. /**********************************************************************/
  5. /*
  6. * This module contains the wrappers to NT-specific infolevels of the
  7. * USER object. These infolevels are only supported on an NT server; at
  8. * present, they may only be called from an NT client.
  9. *
  10. * This is just a rough design, since the APIs are not yet implemented.
  11. *
  12. * History
  13. * jonn 01/17/92 NT-specific USER subclasses
  14. */
  15. #ifndef _NTUSER_HXX_
  16. #define _NTUSER_HXX_
  17. #include "lmouser.hxx"
  18. /*************************************************************************
  19. NAME: USER_3
  20. SYNOPSIS: Wrapper for User APIs, level 3
  21. USER_3 may only be used for accounts on an NT machine.
  22. INTERFACE: Construct with account name and server/domain name
  23. QueryAccountType
  24. SetAccountType
  25. Queries/changes flags in the user flags relating
  26. to account type: normal, remote, wksta trust
  27. account, or server trust account
  28. PARENT: USER_2
  29. USES: NLS_STR
  30. HISTORY:
  31. jonn 01/17/92 Created
  32. jonn 4/27/92 USER_2 and USER_3 virtual dtor
  33. jonn 4/27/92 Removed unused accessors, implemented others
  34. **************************************************************************/
  35. typedef enum _ACCOUNT_TYPE
  36. {
  37. AccountType_Normal = UF_NORMAL_ACCOUNT,
  38. AccountType_Remote = UF_TEMP_DUPLICATE_ACCOUNT,
  39. AccountType_DomainTrust = UF_INTERDOMAIN_TRUST_ACCOUNT,
  40. AccountType_WkstaTrust = UF_WORKSTATION_TRUST_ACCOUNT,
  41. AccountType_ServerTrust = UF_SERVER_TRUST_ACCOUNT
  42. } ACCOUNT_TYPE, *PACCOUNT_TYPE;
  43. DLL_CLASS USER_3 : public USER_2
  44. {
  45. private:
  46. DWORD _dwUserId;
  47. DWORD _dwPrimaryGroupId;
  48. NLS_STR _nlsProfile;
  49. NLS_STR _nlsHomedirDrive;
  50. DWORD _dwPasswordExpired;
  51. VOID CtAux(); // constructor helper
  52. protected:
  53. APIERR W_Write(); // helper for I_WriteInfo and I_WriteNew
  54. APIERR W_CloneFrom( const USER_3 & user3 );
  55. virtual APIERR W_CreateNew();
  56. virtual APIERR I_GetInfo();
  57. virtual APIERR I_WriteInfo();
  58. virtual APIERR I_CreateNew();
  59. virtual APIERR I_WriteNew();
  60. virtual APIERR I_ChangeToNew();
  61. // This is protected because ordinary users cannot set this.
  62. APIERR SetUserId( DWORD dwUserId );
  63. public:
  64. USER_3(const TCHAR *pszAccount, const TCHAR *pszLocation = NULL);
  65. USER_3(const TCHAR *pszAccount, enum LOCATION_TYPE loctype);
  66. USER_3(const TCHAR *pszAccount, const LOCATION & loc);
  67. virtual ~USER_3();
  68. APIERR CloneFrom( const USER_3 & user3 );
  69. inline const TCHAR * QueryProfile() const
  70. { CHECK_OK(NULL); return _nlsProfile.QueryPch(); }
  71. // must be a valid pathname with null-termination
  72. APIERR SetProfile( const TCHAR *pszPassword );
  73. // This information is only loaded by GetInfo -- do not try to
  74. // create a new user and immediately call QueryUserId().
  75. DWORD QueryUserId() const
  76. { CHECK_OK(NULL); return _dwUserId; }
  77. // SetUserId is protected
  78. DWORD QueryPrimaryGroupId() const
  79. { CHECK_OK(0L); return _dwPrimaryGroupId; }
  80. APIERR SetPrimaryGroupId( DWORD dwPrimaryGroupId );
  81. ACCOUNT_TYPE QueryAccountType() const;
  82. APIERR SetAccountType( ACCOUNT_TYPE trusttype );
  83. inline const TCHAR * QueryHomedirDrive() const
  84. { CHECK_OK(NULL); return _nlsHomedirDrive.QueryPch(); }
  85. APIERR SetHomedirDrive( const TCHAR * pchHomedirDrive );
  86. DWORD QueryPasswordExpired() const
  87. { CHECK_OK(0L); return _dwPasswordExpired; }
  88. APIERR SetPasswordExpired( DWORD dwPasswordExpired );
  89. };
  90. #endif // _NTUSER_HXX_