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.

211 lines
3.9 KiB

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