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.

213 lines
3.7 KiB

  1. class FAR CSchemaLexer
  2. {
  3. public:
  4. CSchemaLexer(LPTSTR szBuffer);
  5. ~CSchemaLexer();
  6. BOOL
  7. CSchemaLexer::IsKeyword(LPTSTR szToken, LPDWORD pdwToken);
  8. TCHAR
  9. CSchemaLexer::NextChar();
  10. void
  11. CSchemaLexer::PushbackChar();
  12. HRESULT
  13. CSchemaLexer::GetNextToken(LPTSTR szToken, LPDWORD pdwToken);
  14. HRESULT
  15. CSchemaLexer::GetNextToken2(LPTSTR szToken, LPDWORD pdwToken);
  16. HRESULT
  17. CSchemaLexer::PushBackToken();
  18. private:
  19. LPTSTR _ptr;
  20. LPTSTR _Buffer;
  21. DWORD _dwLastTokenLength;
  22. DWORD _dwLastToken;
  23. DWORD _dwEndofString;
  24. BOOL _fInQuotes;
  25. };
  26. HRESULT
  27. LdapGetSchema(
  28. LPTSTR pszLDAPPath,
  29. SCHEMAINFO **ppSchemaInfo,
  30. CCredentials& Credentials,
  31. DWORD dwPort
  32. );
  33. HRESULT
  34. LdapRemoveSchemaInfoOnServer(
  35. LPTSTR pszLDAPPath,
  36. CCredentials& Credentials,
  37. DWORD dwPort,
  38. BOOL fForce = FALSE
  39. );
  40. VOID
  41. FreePropertyInfoArray(
  42. PROPERTYINFO *aProperties,
  43. DWORD nProperties
  44. );
  45. VOID
  46. FreeClassInfoArray(
  47. CLASSINFO *aClasses,
  48. DWORD nClasses
  49. );
  50. int
  51. FindEntryInSearchTable(
  52. LPTSTR pszName,
  53. SEARCHENTRY *aSearchTable,
  54. DWORD nSearchTableSize
  55. );
  56. int FindSearchTableIndex(
  57. LPTSTR pszName,
  58. SEARCHENTRY *aSearchTable,
  59. DWORD nSearchTableSize
  60. );
  61. VOID SortAndRemoveDuplicateOIDs(
  62. int *aOIDs,
  63. DWORD *pnNumOfOIDs
  64. );
  65. VOID
  66. SchemaInit(
  67. VOID
  68. );
  69. VOID
  70. SchemaCleanup(
  71. VOID
  72. );
  73. int _cdecl intcmp(
  74. const void *s1,
  75. const void *s2
  76. );
  77. HRESULT
  78. ReadSubSchemaSubEntry(
  79. LPWSTR pszLDAPServer,
  80. LPWSTR * ppszSubSchemaEntry,
  81. OUT BOOL * pfBoundOk, // OPTIONAL, can be NULL
  82. CCredentials& Credentials,
  83. DWORD dwPort
  84. );
  85. HRESULT
  86. ReadPagingSupportedAttr(
  87. LPWSTR pszLDAPServer,
  88. BOOL * pfPagingSupported,
  89. CCredentials& Credentials,
  90. DWORD dwPort
  91. );
  92. HRESULT
  93. ReadSortingSupportedAttr(
  94. LPWSTR pszLDAPServer,
  95. BOOL * pfSortingSupported,
  96. CCredentials& Credentials,
  97. DWORD dwPort
  98. );
  99. HRESULT
  100. ReadVLVSupportedAttr(
  101. LPWSTR pszLDAPServer,
  102. BOOL * pfVLVSupported,
  103. CCredentials& Credentials,
  104. DWORD dwPort
  105. );
  106. HRESULT
  107. ReadAttribScopedSupportedAttr(
  108. LPWSTR pszLDAPServer,
  109. BOOL * pfAttribScopedSupported,
  110. CCredentials& Credentials,
  111. DWORD dwPort
  112. );
  113. HRESULT
  114. ReadSecurityDescriptorControlType(
  115. LPWSTR pszLDAPServer,
  116. DWORD *pdwSecDescType,
  117. CCredentials& Credentials,
  118. DWORD dwPort
  119. );
  120. HRESULT
  121. ReadDomScopeSupportedAttr(
  122. LPWSTR pszLDAPServer,
  123. BOOL * pfDomScopeSupported,
  124. CCredentials& Credentials,
  125. DWORD dwPort
  126. );
  127. HRESULT
  128. ReadServerSupportsIsADControl(
  129. LPWSTR pszLDAPServer,
  130. BOOL * pfDomScopeSupported,
  131. CCredentials& Credentials,
  132. DWORD dwPort
  133. );
  134. HRESULT
  135. ReadServerSupportsIsEnhancedAD(
  136. LPWSTR pszLDAPServer,
  137. BOOL * pfServerIsEnhancedAD,
  138. BOOL * pfServerIsADControl,
  139. CCredentials& Credentials,
  140. DWORD dwPort
  141. );
  142. //
  143. // Helper function to process the schema info into the format
  144. // that we use internally.
  145. //
  146. HRESULT
  147. ProcessSchemaInfo(
  148. SCHEMAINFO *pSchemaInfo,
  149. LPTSTR *aValuesAttribTypes,
  150. DWORD dwAttribCount,
  151. LPTSTR *aValuesObjClasses,
  152. DWORD dwObjClassesCount,
  153. LPTSTR *aValuesRules,
  154. DWORD dwRulesCount,
  155. BOOL fProcessAUX
  156. );
  157. //
  158. // To be used internally only to read the schema info in one shot.
  159. //
  160. HRESULT
  161. HelperReadLDAPSchemaInfo(
  162. LPWSTR pszLDAPServer,
  163. LPWSTR pszSubSchemaSubEntry,
  164. LPWSTR szAttributes[],
  165. LPWSTR pszFilter,
  166. LPTSTR **aValuesAttribTypes,
  167. LPTSTR **aValuesObjClasses,
  168. LPTSTR **aValuesRules,
  169. int *nCountAttributes,
  170. int *nCountObjClasses,
  171. int *nCountRules,
  172. CCredentials& Credentials,
  173. DWORD dwPort
  174. );
  175. #define ADSI_LDAPC_SECDESC_NONE 0
  176. #define ADSI_LDAPC_SECDESC_NT 1
  177. #define ADSI_LDAPC_SECDESC_OTHER 2