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.

280 lines
6.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000
  5. //
  6. // File: querytable.h
  7. //
  8. // Contents: Defines Enum for parsertable.
  9. //
  10. // History: 25-Sep-2000 hiteshr Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #ifndef _QUERYTABLE_H_
  14. #define _QUERYTABLE_H_
  15. //forward declarations
  16. struct _DSQUERY_ATTRTABLE_ENTRY;
  17. //+-------------------------------------------------------------------------
  18. //
  19. // Type: PMAKEFILTERFUNC
  20. //
  21. // Synopsis: The definition of a function that prepares ldapFilter from
  22. // the infix filter given on the commandline.
  23. //
  24. //
  25. // Returns: S_OK if the pAttr members were successfully set.
  26. // S_FALSE if the function failed but displayed its own error message.
  27. //
  28. // History: 25-Sep-2000 hiteshr Created
  29. //
  30. //---------------------------------------------------------------------------
  31. typedef HRESULT (*PMAKEFILTERFUNC)(_DSQUERY_ATTRTABLE_ENTRY *pEntry,
  32. ARG_RECORD* pRecord,
  33. PVOID pVoid,
  34. CComBSTR &strFilter);
  35. //+--------------------------------------------------------------------------
  36. //
  37. // Struct: _DSQUERY_ATTRTABLE_ENTRY
  38. //
  39. // Purpose: Definition of a table entry that describes the attribute for
  40. // which filter can be specified at commandline.
  41. //
  42. // History: 25-Sep-2000 hiteshr Created
  43. //
  44. //---------------------------------------------------------------------------
  45. typedef struct _DSQUERY_ATTRTABLE_ENTRY
  46. {
  47. //
  48. // The ldapDisplayName of the attribute
  49. //
  50. PWSTR pszName;
  51. //
  52. // The unique identifier for this attribute that cooresponds to
  53. // the command line switch
  54. //
  55. UINT nAttributeID;
  56. //
  57. // Pointer to the description of the attribute
  58. //
  59. PDSATTRIBUTEDESCRIPTION pAttrDesc;
  60. //
  61. // function that prepares ldapFilter from
  62. // the infix filter given on the commandline.
  63. //
  64. PMAKEFILTERFUNC pMakeFilterFunc;
  65. } DSQUERY_ATTR_TABLE_ENTRY, *PDSQUERY_ATTR_TABLE_ENTRY;
  66. typedef enum{
  67. DSQUERY_OUTPUT_ATTRONLY, //Only the names of attributes
  68. DSQUERY_OUTPUT_ATTR, //Attribute list given at commandline
  69. DSQUERY_OUTPUT_DN, //DN
  70. DSQUERY_OUTPUT_RDN, //RDN
  71. DSQUERY_OUTPUT_UPN, //UPN
  72. DSQUERY_OUTPUT_SAMID, //SAMID
  73. DSQUERY_OUTPUT_NTLMID,
  74. }DSQUERY_OUTPUT_FORMAT;
  75. typedef struct _DSQUERY_OUTPUT_FORMAT_MAP
  76. {
  77. LPCWSTR pszOutputFormat;
  78. DSQUERY_OUTPUT_FORMAT outputFormat;
  79. }DSQUERY_OUTPUT_FORMAT_MAP,*PDSQUERY_OUTPUT_FORMAT_MAP;
  80. //+--------------------------------------------------------------------------
  81. //
  82. // Struct: _DSQueryObjectTableEntry
  83. //
  84. // Purpose: Definition of a table entry that describes attributes of a given
  85. // objecttype
  86. //
  87. // History: 25-Sep-2000 hiteshr Created
  88. //
  89. //---------------------------------------------------------------------------
  90. typedef struct _DSQueryObjectTableEntry
  91. {
  92. //
  93. // The objectClass of the object to be created or modified
  94. //
  95. PCWSTR pszObjectClass;
  96. //
  97. // The command line string used to determine the object class
  98. // This is not always identical to pszObjectClass
  99. //
  100. PCWSTR pszCommandLineObjectType;
  101. //
  102. // The table to merge with the common switches for the parser
  103. //
  104. ARG_RECORD* pParserTable;
  105. //
  106. // The ID of the Usage help text for this
  107. //
  108. UINT nUsageID;
  109. //
  110. // A count of the number of attributes in the table below
  111. //
  112. DWORD dwAttributeCount;
  113. //
  114. // A table of attributes for
  115. // which filter can be specified at commandline.
  116. //
  117. DSQUERY_ATTR_TABLE_ENTRY** pAttributeTable;
  118. //
  119. // A count of the number of output formats in the table below
  120. //
  121. DWORD dwOutputCount;
  122. //
  123. // Array of valid values for Output format. NULL in case of dsquery *
  124. //
  125. PDSQUERY_OUTPUT_FORMAT_MAP *ppValidOutput;
  126. //
  127. // The unique identifier for commandline scope switch in ParserTable
  128. // -1 if not applicable
  129. //
  130. UINT nScopeID;
  131. //
  132. //This is the default fiter to use in case no filter is specified on commandline
  133. //
  134. LPCWSTR pszDefaultFilter;
  135. //
  136. //Append this filter to filter specifed at commandline.
  137. //
  138. LPCWSTR pszPrefixFilter;
  139. // Some sort of creation function
  140. } DSQueryObjectTableEntry, *PDSQueryObjectTableEntry;
  141. typedef enum COMMON_COMMAND
  142. {
  143. //
  144. // Common switches
  145. //
  146. #ifdef DBG
  147. eCommDebug,
  148. #endif
  149. eCommHelp,
  150. eCommServer,
  151. eCommDomain,
  152. eCommUserName,
  153. eCommPassword,
  154. eCommQuiet,
  155. eCommObjectType,
  156. eCommRecurse,
  157. eCommGC,
  158. eCommOutputFormat,
  159. eCommStartNode,
  160. eCommLimit,
  161. eTerminator,
  162. //
  163. // Star switches
  164. //
  165. eStarScope = eTerminator,
  166. eStarFilter,
  167. eStarAttr,
  168. eStarAttrsOnly,
  169. eStarList,
  170. //
  171. // User switches
  172. //
  173. eUserScope= eTerminator,
  174. eUserName,
  175. eUserDesc,
  176. eUserUPN,
  177. eUserSamid,
  178. eUserInactive,
  179. eUserStalepwd,
  180. eUserDisabled,
  181. //
  182. // Computer switches
  183. //
  184. eComputerScope= eTerminator,
  185. eComputerName,
  186. eComputerDesc,
  187. eComputerSamid,
  188. eComputerInactive,
  189. eComputerStalepwd,
  190. eComputerDisabled,
  191. //
  192. // Group switches
  193. //
  194. eGroupScope = eTerminator,
  195. eGroupName,
  196. eGroupDesc,
  197. eGroupSamid,
  198. //
  199. // OU switches
  200. //
  201. eOUScope = eTerminator,
  202. eOUName,
  203. eOUDesc,
  204. //
  205. // Server switches
  206. //
  207. eServerForest = eTerminator,
  208. eServerDomain,
  209. eServerSite,
  210. eServerName,
  211. eServerDesc,
  212. eServerHasFSMO,
  213. eServerIsGC,
  214. //
  215. // Site switches
  216. //
  217. eSiteName = eTerminator,
  218. eSiteDesc,
  219. //
  220. //Contact switches
  221. //
  222. eContactScope = eTerminator,
  223. eContactName,
  224. eContactDesc,
  225. //
  226. //Subnet switches
  227. //
  228. eSubnetName = eTerminator,
  229. eSubnetDesc,
  230. eSubnetLoc,
  231. eSubnetSite,
  232. };
  233. //
  234. // The parser table
  235. //
  236. extern ARG_RECORD DSQUERY_COMMON_COMMANDS[];
  237. //
  238. // The table of supported objects
  239. //
  240. extern PDSQueryObjectTableEntry g_DSObjectTable[];
  241. #endif //_QUERYTABLE_H_