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.

244 lines
6.9 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1992 **/
  4. /**********************************************************************/
  5. /*
  6. UINTLSAX.HXX
  7. This header file defines extension classes for the LSA wrappers.
  8. LSA_SECRET: a subclass of LSA_OBJECT which covers the functions
  9. associated with Secret Objects. Unlike LSA_POLICY
  10. objects, these follow a [construct - {open|create} -
  11. {close|delete} - destruct] paradigm.
  12. Use of this class should be avoided; see the
  13. LSA_POLICY member functions JoinDomain() and
  14. TrustDomain().
  15. LSA_TRUSTED_DOMAIN: a subclass of LSA_OBJECT which covers the
  16. functions of Trusted Domains. Like LSA_SECRETs,
  17. these objects should be used indirectly through
  18. LSA_POLICY methods.
  19. LSA_TRUSTED_DC_LIST: a wrapper for the memory returned by the
  20. tne API I_NetGetDCList(). This memory is freed
  21. through ::NetApiFreeBuffer(), and thus cannot be
  22. a subclass of NT_MEMORY.
  23. LSA_DOMAIN_INFO: a wrapper domain information. Will change
  24. substantially when new Win32 APIs become available.
  25. FILE HISTORY:
  26. DavidHov 3/10/92 Created
  27. */
  28. #ifndef _UINTLSAX_HXX_
  29. #define _UINTLSAX_HXX_
  30. #include "uintlsa.hxx"
  31. DLL_CLASS LSA_SECRET ;
  32. DLL_CLASS LSA_TRUSTED_DOMAIN ;
  33. /*************************************************************************
  34. NAME: LSA_SECRET (lsascrt)
  35. SYNOPSIS: Wrapper class for an LSA "Secret Object'
  36. INTERFACE:
  37. PARENT: LSA_OBJECT
  38. USES:
  39. CAVEATS:
  40. NOTES:
  41. HISTORY:
  42. DavidHov 4/9/92 Created
  43. **************************************************************************/
  44. DLL_CLASS LSA_SECRET : public LSA_OBJECT
  45. {
  46. public:
  47. LSA_SECRET ( const NLS_STR & nlsSecretName ) ;
  48. ~LSA_SECRET () ;
  49. APIERR Create ( const LSA_POLICY & lsapol,
  50. ACCESS_MASK accessDesired = SECRET_ALL_ACCESS ) ;
  51. APIERR Open ( const LSA_POLICY & lsapol,
  52. ACCESS_MASK accessDesired = SECRET_READ ) ;
  53. APIERR QueryInfo ( NLS_STR * pnlsCurrentValue,
  54. NLS_STR * pnlsOldValue,
  55. LARGE_INTEGER * plintCurrentValueSetTime,
  56. LARGE_INTEGER * plintOldValueSetTime ) const ;
  57. APIERR SetInfo ( const NLS_STR * pnlsCurrentValue,
  58. const NLS_STR * pnlsOldValue = NULL ) ;
  59. private:
  60. NLS_STR _nlsSecretName ;
  61. };
  62. /*************************************************************************
  63. NAME: LSA_TRUSTED_DOMAIN (lsatdom)
  64. SYNOPSIS: Wrapper class for an LSA "Trusted Domain"
  65. INTERFACE:
  66. PARENT: LSA_OBJECT
  67. USES:
  68. CAVEATS:
  69. NOTES:
  70. HISTORY:
  71. DavidHov 4/9/92 Created
  72. **************************************************************************/
  73. DLL_CLASS LSA_TRUSTED_DOMAIN : public LSA_OBJECT
  74. {
  75. public:
  76. // Open an existing trusted domain.
  77. LSA_TRUSTED_DOMAIN ( const LSA_POLICY & lsapol,
  78. const PSID psid,
  79. ACCESS_MASK desiredAccess = TRUSTED_READ ) ;
  80. // Open an existing trusted domain using
  81. // an enumeration return structure
  82. LSA_TRUSTED_DOMAIN ( const LSA_POLICY & lsapol,
  83. const LSA_TRUST_INFORMATION & lstInfo,
  84. ACCESS_MASK desiredAccess = TRUSTED_READ ) ;
  85. // Create a new trusted domain.
  86. LSA_TRUSTED_DOMAIN ( const LSA_POLICY & lsapol,
  87. const NLS_STR & nlsDomainName,
  88. const PSID psid,
  89. ACCESS_MASK desiredAccess = TRUSTED_ALL_ACCESS ) ;
  90. ~ LSA_TRUSTED_DOMAIN () ;
  91. // Query functions
  92. APIERR QueryPosixOffset ( ULONG * plPosixOffset ) const ;
  93. APIERR QueryControllerList ( LSA_REF_DOMAIN_MEM * plsatdm ) const ;
  94. // Set functions
  95. APIERR SetPosixOffset ( ULONG lPosixOffset ) ;
  96. APIERR SetControllerList ( LSA_REF_DOMAIN_MEM * plsatdm ) ;
  97. APIERR SetControllerList (
  98. const TRUSTED_CONTROLLERS_INFO & tciInfo ) ;
  99. // Destroy the trust relationship
  100. APIERR Delete () ;
  101. private:
  102. };
  103. /*************************************************************************
  104. NAME: LSA_TRUSTED_DC_LIST
  105. SYNOPSIS: Wrapper for trusted domain contorller information
  106. returned by I_NetGetDCList() API.
  107. INTERFACE:
  108. PARENT: BASE
  109. USES: none
  110. CAVEATS: This class assumes it knows the structure of a
  111. TRUSTED_CONTROLLERS_INFO structure.
  112. NOTES:
  113. HISTORY: DavidHov 4/11/92 Created
  114. **************************************************************************/
  115. DLL_CLASS LSA_TRUSTED_DC_LIST : public BASE
  116. {
  117. public:
  118. LSA_TRUSTED_DC_LIST ( const NLS_STR & nlsDomain,
  119. const TCHAR * pszTrustedDcHint = NULL ) ;
  120. ~ LSA_TRUSTED_DC_LIST () ;
  121. const TRUSTED_CONTROLLERS_INFO & QueryControllerList () const ;
  122. const UNICODE_STRING & operator [] ( INT iIndex ) const ;
  123. INT QueryCount () ;
  124. private:
  125. ULONG _lcDc ;
  126. UNICODE_STRING * _punsNames ;
  127. TRUSTED_CONTROLLERS_INFO _tciInfo ;
  128. APIERR QueryInfo ( const NLS_STR & nlsDomain,
  129. const TCHAR * pszTrustedDcHint ) ;
  130. VOID FreeBuffer () ;
  131. };
  132. /*************************************************************************
  133. NAME: LSA_DOMAIN_INFO
  134. SYNOPSIS: Wrapper for synthetic LSA/NETAPI information.
  135. This class is required, since one of the things
  136. that can be queried returns a PSID, and the underlying
  137. memory associated with that object must be properly
  138. deleted.
  139. INTERFACE:
  140. PARENT: BASE
  141. USES: NLS_STR
  142. CAVEATS: This class is incomplete, since it only
  143. knows how to deal with the primary domain
  144. at this time.
  145. NOTES:
  146. HISTORY: DavidHov 4/11/92 Created
  147. **************************************************************************/
  148. DLL_CLASS LSA_DOMAIN_INFO : public BASE
  149. {
  150. public:
  151. LSA_DOMAIN_INFO ( const NLS_STR & nlsDomainName,
  152. const NLS_STR * pnlsServer = NULL,
  153. const NLS_STR * pnlsDcName = NULL ) ;
  154. ~ LSA_DOMAIN_INFO () ;
  155. // BUGBUG: this should not require an LSA_POLICY,
  156. // but it does, since this only works for the
  157. // local primary domain at this time...
  158. const PSID QueryPSID () const ;
  159. APIERR QueryDcName ( NLS_STR * pnlsDcName ) ;
  160. private:
  161. NLS_STR _nlsDomainName ;
  162. NLS_STR _nlsDcName ;
  163. LSA_PRIMARY_DOM_INFO_MEM _lsapdim ;
  164. };
  165. #endif // _UINTLSAX_HXX_