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.

251 lines
4.7 KiB

  1. typedef struct {
  2. LPTSTR pszName;
  3. DWORD nIndex;
  4. } SEARCHENTRY;
  5. typedef HANDLE LDAP_SCHEMA_HANDLE;
  6. #define ATTR_USAGE_USERAPPLICATIONS 1
  7. #define ATTR_USAGE_DIRECTORYOPERATION 2
  8. #define ATTR_USAGE_DISTRIBUTEDOPERATION 3
  9. #define ATTR_USAGE_DSAOPERATION 4
  10. typedef struct _PropertyInfo
  11. {
  12. LPTSTR pszPropertyName;
  13. LPTSTR pszOID;
  14. LPTSTR pszSyntax;
  15. long lMaxRange;
  16. long lMinRange;
  17. BOOL fSingleValued;
  18. LPTSTR pszDescription;
  19. LPTSTR pszOIDSup;
  20. LPTSTR pszOIDEquality;
  21. LPTSTR pszOIDOrdering;
  22. LPTSTR pszOIDSubstr;
  23. BOOL fObsolete;
  24. BOOL fCollective;
  25. BOOL fDynamic;
  26. BOOL fNoUserModification;
  27. DWORD dwUsage; // contain ATTR_USAGE... defined above
  28. BOOL fProcessedSuperiorClass;
  29. } PROPERTYINFO, *PPROPERTYINFO;
  30. #define CLASS_TYPE_STRUCTURAL 1 // same as NT's definition
  31. #define CLASS_TYPE_ABSTRACT 2
  32. #define CLASS_TYPE_AUXILIARY 3
  33. typedef struct _ClassInfo
  34. {
  35. LPTSTR pszName;
  36. LPTSTR pszOID;
  37. DWORD dwType; // contain CLASS_TYPE... defined above
  38. const GUID *pCLSID;
  39. const GUID *pPrimaryInterfaceGUID;
  40. LPTSTR pszHelpFileName;
  41. long lHelpFileContext;
  42. LPTSTR pszDescription;
  43. BOOL fObsolete;
  44. LPTSTR *pOIDsSuperiorClasses;
  45. LPTSTR *pOIDsAuxClasses;
  46. int *pOIDsMustContain; // contain indexes into the aPropertiesSearchTable
  47. DWORD nNumOfMustContain;
  48. int *pOIDsMayContain; // contain indexes into the aPropertiesSearchTable
  49. DWORD nNumOfMayContain;
  50. int *pOIDsNotContain; // contain indexes into the aPropertiesSearchTable
  51. DWORD nNumOfNotContain;
  52. BOOL fProcessedSuperiorClasses;
  53. BOOL IsContainer; // can contain -1 if we have not processed it
  54. } CLASSINFO, *PCLASSINFO;
  55. typedef struct _SyntaxInfo
  56. {
  57. LPTSTR pszName;
  58. long lOleAutoDataType;
  59. } SYNTAXINFO, *PSYNTAXINFO;
  60. class SCHEMAINFO
  61. {
  62. private:
  63. DWORD _cRef;
  64. BOOL _fObsolete;
  65. public:
  66. BOOL fDefaultSchema;
  67. BOOL fAppearsV3;
  68. LPTSTR pszServerName;
  69. LPTSTR pszSubSchemaSubEntry;
  70. LPTSTR pszTime;
  71. LPWSTR pszUserName;
  72. SCHEMAINFO *Next;
  73. CLASSINFO *aClasses;
  74. DWORD nNumOfClasses;
  75. SEARCHENTRY *aClassesSearchTable;
  76. PROPERTYINFO *aProperties;
  77. DWORD nNumOfProperties;
  78. SEARCHENTRY *aPropertiesSearchTable;
  79. SCHEMAINFO();
  80. ~SCHEMAINFO();
  81. DWORD AddRef();
  82. DWORD Release();
  83. BOOL IsObsolete()
  84. { return _fObsolete; }
  85. BOOL IsRefCountZero()
  86. { return (_cRef == 0 ); }
  87. VOID MakeObsolete()
  88. { _fObsolete = TRUE; }
  89. VOID MakeCurrent()
  90. { _fObsolete = FALSE; }
  91. };
  92. DWORD
  93. LdapGetSyntaxIdOfAttribute(
  94. LPWSTR pszStringSyntax
  95. );
  96. HRESULT
  97. LdapGetSyntaxOfAttributeOnServer(
  98. LPTSTR pszServerPath,
  99. LPTSTR pszAttrName,
  100. DWORD *pdwSyntaxId,
  101. CCredentials& Credentials,
  102. DWORD dwPort,
  103. BOOL fFromServer = FALSE
  104. );
  105. HRESULT
  106. LdapIsClassNameValidOnServer(
  107. LPTSTR pszServerPath,
  108. LPTSTR pszClassName,
  109. BOOL *pfValid,
  110. CCredentials& Credentials,
  111. DWORD dwPort
  112. );
  113. HRESULT
  114. LdapGetSchemaObjectCount(
  115. LPTSTR pszServerPath,
  116. DWORD *pnNumOfClasses,
  117. DWORD *pnNumOfProperties,
  118. CCredentials& Credentials,
  119. DWORD dwPort
  120. );
  121. HRESULT
  122. LdapGetSubSchemaSubEntryPath(
  123. LPTSTR pszServerPath,
  124. LPTSTR *ppszSubSchemaSubEntryPath,
  125. CCredentials& Credentials,
  126. DWORD dwPort
  127. );
  128. HRESULT
  129. LdapMakeSchemaCacheObsolete(
  130. LPTSTR pszServerPath,
  131. CCredentials& Credentials,
  132. DWORD dwPort
  133. );
  134. HRESULT
  135. SchemaOpen(
  136. IN LPTSTR pszServerPath,
  137. OUT LDAP_SCHEMA_HANDLE *phSchema,
  138. IN CCredentials& Credentials,
  139. DWORD dwPort
  140. );
  141. HRESULT
  142. SchemaClose(
  143. IN OUT LDAP_SCHEMA_HANDLE *phSchema
  144. );
  145. HRESULT
  146. SchemaAddRef(
  147. IN LDAP_SCHEMA_HANDLE hSchema
  148. );
  149. HRESULT
  150. SchemaGetObjectCount(
  151. LDAP_SCHEMA_HANDLE hSchema,
  152. DWORD *pnNumOfClasses,
  153. DWORD *pnNumOfProperties
  154. );
  155. HRESULT
  156. SchemaGetClassInfoByIndex(
  157. LDAP_SCHEMA_HANDLE hSchema,
  158. DWORD dwIndex,
  159. CLASSINFO **ppClassInfo
  160. );
  161. HRESULT
  162. SchemaGetPropertyInfoByIndex(
  163. LDAP_SCHEMA_HANDLE hSchema,
  164. DWORD dwIndex,
  165. PROPERTYINFO **ppPropertyInfo
  166. );
  167. HRESULT
  168. SchemaGetClassInfo(
  169. LDAP_SCHEMA_HANDLE hSchema,
  170. LPTSTR pszClassName,
  171. CLASSINFO **ppClassInfo
  172. );
  173. HRESULT
  174. SchemaGetPropertyInfo(
  175. LDAP_SCHEMA_HANDLE hSchema,
  176. LPTSTR pszPropertyName,
  177. PROPERTYINFO **ppPropertyInfo
  178. );
  179. HRESULT
  180. SchemaGetSyntaxOfAttribute(
  181. LDAP_SCHEMA_HANDLE hSchema,
  182. LPTSTR pszAttrName,
  183. DWORD *pdwSyntaxId
  184. );
  185. HRESULT
  186. SchemaIsClassAContainer(
  187. LDAP_SCHEMA_HANDLE hSchema,
  188. LPTSTR pszClassName,
  189. BOOL *pfContainer
  190. );
  191. HRESULT
  192. SchemaGetStringsFromStringTable(
  193. LDAP_SCHEMA_HANDLE hSchema,
  194. int *proplist,
  195. DWORD nCount,
  196. LPWSTR **paStrings
  197. );