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.

176 lines
5.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. dsp.h
  5. Abstract:
  6. Private macros/definitions/prototypes for implementing a portion of the LSA store
  7. in the DS
  8. Author:
  9. Mac McLain (MacM) Jan 17, 1997
  10. Environment:
  11. User Mode
  12. Revision History:
  13. --*/
  14. #ifndef __DSATTRS_H__
  15. #define __DSATTRS_H__
  16. typedef enum _LSAPDS_DS_CLASSES {
  17. LsapDsClassXRef = 0,
  18. LsapDsClassTrustedDomain,
  19. LsapDsClassSecret,
  20. LsapDsClassLast
  21. } LSAPDS_DS_CLASSES, *PLSAPDS_DS_CLASSES;
  22. typedef enum _LSAPDS_DS_ATTRS {
  23. LsapDsAttrSamAccountName, // Machines sam account name
  24. LsapDsAttrSid, // Sid attribute
  25. LsapDsAttrSecDesc,
  26. LsapDsAttrNamingContext, // Naming context
  27. LsapDsAttrMachineRole, // Machine role
  28. LsapDsAttrMachineDns, // Dns name on the machine object
  29. LsapDsAttrInitialIncomingAuth,
  30. LsapDsAttrInitialOutgoingAuth,
  31. LsapDsAttrDnsRoot, // Domain Dns root
  32. LsapDsAttrSamAccountControl, // SAM user account control fields
  33. LsapDsAttrTrustPartner, // Trust partner for trusted domain objects
  34. LsapDsAttrTrustPartnerFlat, // Flat name of partner for trusted domain objects
  35. LsapDsAttrDefaultSecDesc, // Default object security descriptor
  36. LsapDsAttrSpn, // Client SPN
  37. LsapDsAttrLast
  38. } LSAPDS_SRCH_ATTRS;
  39. typedef enum _LSAPDS_DS_GUIDS {
  40. LsapDsGuidTrust,
  41. LsapDsGuidFlatName,
  42. LsapDsGuidInitialIncoming,
  43. LsapDsGuidInitialOutgoing,
  44. LsapDsGuidSid,
  45. LsapDsGuidAttributes,
  46. LsapDsGuidIncoming,
  47. LsapDsGuidOutgoing,
  48. LsapDsGuidDirection,
  49. LsapDsGuidPartner,
  50. LsapDsGuidPosix,
  51. LsapDsGuidType,
  52. LsapDsGuidSecret,
  53. LsapDsGuidCurrent,
  54. LsapDsGuidCurrentTime,
  55. LsapDsGuidPrevious,
  56. LsapDsguidPreviousTime,
  57. LsapDsGuidDelegatedTrustCreation
  58. } LSAPDS_DS_GUIDS, *PLSAPDS_DS_GUIDS;
  59. extern GUID LsapDsGuidList[ ];
  60. extern ULONG LsapDsAttributeIds[LsapDsAttrLast];
  61. extern ULONG LsapDsClassIds[LsapDsClassLast];
  62. extern ATTR LsapDsClasses[LsapDsClassLast];
  63. extern ATTR LsapDsAttrs[LsapDsAttrLast];
  64. //
  65. // Specially constructed multiple attributes that
  66. //
  67. extern ATTR LsapDsMachineDnsHost[ 1 ];
  68. #define LsapDsMachineDnsHostCount ( sizeof( LsapDsMachineDnsHost ) / sizeof( ATTR ) )
  69. #define LsapDsMachineClientSetAttrsCount 5
  70. extern ATTR LsapDsMachineClientSetAttrs[ LsapDsMachineClientSetAttrsCount ];
  71. extern ATTR LsapDsMachineSpn[ 1 ];
  72. #define LsapDsMachineSpnCount ( sizeof( LsapDsMachineSpn ) / sizeof( ATTR ) )
  73. extern ATTR LsapDsServerReferenceBl[ 1 ];
  74. #define LsapDsServerReferenceCountBl ( sizeof( LsapDsServerReferenceBl ) / sizeof( ATTR ) )
  75. #define LsapDsDomainNameSearchCount 2
  76. extern ATTR LsapDsDomainNameSearch [ LsapDsDomainNameSearchCount ];
  77. #define LsapDsDnsRootWellKnownObjectCount 1
  78. extern ATTR LsapDsDnsRootWellKnownObject[ LsapDsDnsRootWellKnownObjectCount ];
  79. extern ATTR LsapDsTDOQuotaAttributes[ 3 ];
  80. #define LsapDsTDOQuotaAttributesCount ( sizeof( LsapDsTDOQuotaAttributes ) / sizeof( ATTR ) )
  81. //
  82. // Used for the trusted domain object fixup on reboot
  83. //
  84. #define LsapDsTrustedDomainFixupAttributeCount 11
  85. extern ATTR LsapDsTrustedDomainFixupAttributes[ LsapDsTrustedDomainFixupAttributeCount ];
  86. #define LsapDsTrustedDomainFixupXRefCount 3
  87. extern ATTR LsapDsTrustedDomainFixupXRefAttributes[ LsapDsTrustedDomainFixupXRefCount ];
  88. #define LsapDsForestInfoSearchAttributeCount 6
  89. extern ATTR LsapDsForestInfoSearchAttributes[ LsapDsForestInfoSearchAttributeCount ];
  90. #define LsapDsITAFixupAttributeCount 2
  91. extern ATTR LsapDsITAFixupAttributes[ LsapDsITAFixupAttributeCount ];
  92. //
  93. // Macros to help with the manipulation of attributes
  94. //
  95. #define LSAP_DS_SET_DS_ATTRIBUTE_STRING( pattr, string ) \
  96. (pattr)->AttrVal.pAVal->valLen = wcslen( string ) * sizeof( WCHAR ); \
  97. (pattr)->AttrVal.pAVal->pVal = (PUCHAR)string; \
  98. #define LSAP_DS_SET_DS_ATTRIBUTE_UNICODE( pattr, string ) \
  99. (pattr)->AttrVal.pAVal->valLen = (string)->Length; \
  100. (pattr)->AttrVal.pAVal->pVal = (PUCHAR)(string)->Buffer; \
  101. #define LSAP_DS_SET_DS_ATTRIBUTE_ULONG( pattr, ulongval ) \
  102. (pattr)->AttrVal.pAVal->valLen = sizeof( ULONG ); \
  103. (pattr)->AttrVal.pAVal->pVal = (PUCHAR)&ulongval; \
  104. #define LSAP_DS_SET_DS_ATTRIBUTE_SID( pattr, sid ) \
  105. (pattr)->AttrVal.pAVal->valLen = RtlLengthSid( sid ); \
  106. (pattr)->AttrVal.pAVal->pVal = (PUCHAR)sid; \
  107. #define LSAP_DS_SET_DS_ATTRIBUTE_DSNAME( pattr, dsname ) \
  108. (pattr)->AttrVal.pAVal->valLen = dsname->structLen; \
  109. (pattr)->AttrVal.pAVal->pVal = (PUCHAR)dsname; \
  110. #define LSAP_DS_GET_DS_ATTRIBUTE_LENGTH( pattr ) \
  111. (pattr)->AttrVal.pAVal->valLen
  112. #define LSAP_DS_GET_DS_ATTRIBUTE_AS_ULONG( pattr ) \
  113. (*(PULONG)((pattr)->AttrVal.pAVal->pVal) )
  114. #define LSAP_DS_GET_DS_ATTRIBUTE_AS_DSNAME( pattr ) \
  115. ((PDSNAME)((pattr)->AttrVal.pAVal->pVal ))
  116. #define LSAP_DS_GET_DS_ATTRIBUTE_AS_PWSTR( pattr ) \
  117. ((PWSTR)((pattr)->AttrVal.pAVal->pVal ))
  118. #define LSAP_DS_GET_DS_ATTRIBUTE_AS_USN( pattr ) \
  119. ((PUSN)((pattr)->AttrVal.pAVal->pVal ))
  120. #define LSAP_DS_GET_DS_ATTRIBUTE_AS_PBYTE( pattr ) \
  121. ((PBYTE)((pattr)->AttrVal.pAVal->pVal ))
  122. //
  123. // GUID for the trusted domain auth property set
  124. //
  125. extern GUID LsapDsTrustedDomainAuthPropSet;
  126. #endif // __DSATTRS_H__