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.

306 lines
7.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. CDSCmdBasePathsInfo& refBasePathsInfo,
  34. CDSCmdCredentialObject& refCredentialObject,
  35. PVOID pVoid,
  36. CComBSTR &strFilter);
  37. //+--------------------------------------------------------------------------
  38. //
  39. // Struct: _DSQUERY_ATTRTABLE_ENTRY
  40. //
  41. // Purpose: Definition of a table entry that describes the attribute for
  42. // which filter can be specified at commandline.
  43. //
  44. // History: 25-Sep-2000 hiteshr Created
  45. //
  46. //---------------------------------------------------------------------------
  47. typedef struct _DSQUERY_ATTRTABLE_ENTRY
  48. {
  49. //
  50. // The ldapDisplayName of the attribute
  51. //
  52. PWSTR pszName;
  53. //
  54. // The unique identifier for this attribute that cooresponds to
  55. // the command line switch
  56. //
  57. UINT nAttributeID;
  58. //
  59. // Pointer to the description of the attribute
  60. //
  61. PDSATTRIBUTEDESCRIPTION pAttrDesc;
  62. //
  63. // function that prepares ldapFilter from
  64. // the infix filter given on the commandline.
  65. //
  66. PMAKEFILTERFUNC pMakeFilterFunc;
  67. } DSQUERY_ATTR_TABLE_ENTRY, *PDSQUERY_ATTR_TABLE_ENTRY;
  68. typedef enum{
  69. DSQUERY_OUTPUT_ATTRONLY, //Only the names of attributes
  70. DSQUERY_OUTPUT_ATTR, //Attribute list given at commandline
  71. DSQUERY_OUTPUT_DN, //DN
  72. DSQUERY_OUTPUT_RDN, //RDN
  73. DSQUERY_OUTPUT_UPN, //UPN
  74. DSQUERY_OUTPUT_SAMID, //SAMID
  75. DSQUERY_OUTPUT_NTLMID,
  76. }DSQUERY_OUTPUT_FORMAT;
  77. typedef struct _DSQUERY_OUTPUT_FORMAT_MAP
  78. {
  79. LPCWSTR pszOutputFormat;
  80. DSQUERY_OUTPUT_FORMAT outputFormat;
  81. }DSQUERY_OUTPUT_FORMAT_MAP,*PDSQUERY_OUTPUT_FORMAT_MAP;
  82. //+--------------------------------------------------------------------------
  83. //
  84. // Struct: _DSQueryObjectTableEntry
  85. //
  86. // Purpose: Definition of a table entry that describes attributes of a given
  87. // objecttype
  88. //
  89. // History: 25-Sep-2000 hiteshr Created
  90. //
  91. //---------------------------------------------------------------------------
  92. typedef struct _DSQueryObjectTableEntry
  93. {
  94. //
  95. // The objectClass of the object to be created or modified
  96. //
  97. PCWSTR pszObjectClass;
  98. //
  99. // The command line string used to determine the object class
  100. // This is not always identical to pszObjectClass
  101. //
  102. PCWSTR pszCommandLineObjectType;
  103. //
  104. // The table to merge with the common switches for the parser
  105. //
  106. ARG_RECORD* pParserTable;
  107. //
  108. // The ID of the Usage help text for this
  109. //
  110. UINT* pUsageTable;
  111. //
  112. // A count of the number of attributes in the table below
  113. //
  114. DWORD dwAttributeCount;
  115. //
  116. // A table of attributes for
  117. // which filter can be specified at commandline.
  118. //
  119. DSQUERY_ATTR_TABLE_ENTRY** pAttributeTable;
  120. //
  121. // A count of the number of output formats in the table below
  122. //
  123. DWORD dwOutputCount;
  124. //
  125. // Array of valid values for Output format. NULL in case of dsquery *
  126. //
  127. PDSQUERY_OUTPUT_FORMAT_MAP *ppValidOutput;
  128. //
  129. // The unique identifier for commandline scope switch in ParserTable
  130. // -1 if not applicable
  131. //
  132. UINT nScopeID;
  133. //
  134. //This is the default fiter to use in case no filter is specified on commandline
  135. //
  136. LPCWSTR pszDefaultFilter;
  137. //
  138. //Append this filter to filter specifed at commandline.
  139. //
  140. LPCWSTR pszPrefixFilter;
  141. // Some sort of creation function
  142. } DSQueryObjectTableEntry, *PDSQueryObjectTableEntry;
  143. typedef enum DSQUERY_COMMAND_ENUM
  144. {
  145. eCommObjectType = eCommLast+1,
  146. eCommRecurse,
  147. eCommOutputFormat,
  148. eCommStartNode,
  149. eCommLimit,
  150. eTerminator,
  151. //
  152. // Star switches
  153. //
  154. eStarGC = eTerminator,
  155. eStarScope,
  156. eStarFilter,
  157. eStarAttr,
  158. eStarAttrsOnly,
  159. eStarList,
  160. //
  161. // User switches
  162. //
  163. eUserGC = eTerminator,
  164. eUserScope,
  165. eUserName,
  166. eUserDesc,
  167. eUserUPN,
  168. eUserSamid,
  169. eUserInactive,
  170. eUserStalepwd,
  171. eUserDisabled,
  172. //
  173. // Computer switches
  174. //
  175. eComputerGC = eTerminator,
  176. eComputerScope,
  177. eComputerName,
  178. eComputerDesc,
  179. eComputerSamid,
  180. eComputerInactive,
  181. eComputerStalepwd,
  182. eComputerDisabled,
  183. //
  184. // Group switches
  185. //
  186. eGroupGC = eTerminator,
  187. eGroupScope,
  188. eGroupName,
  189. eGroupDesc,
  190. eGroupSamid,
  191. //
  192. // OU switches
  193. //
  194. eOUGC = eTerminator,
  195. eOUScope,
  196. eOUName,
  197. eOUDesc,
  198. //
  199. // Server switches
  200. //
  201. eServerGC = eTerminator,
  202. eServerForest,
  203. eServerDomain,
  204. eServerSite,
  205. eServerName,
  206. eServerDesc,
  207. eServerHasFSMO,
  208. eServerIsGC,
  209. //
  210. // Site switches
  211. //
  212. eSiteGC = eTerminator,
  213. eSiteName,
  214. eSiteDesc,
  215. //
  216. //Contact switches
  217. //
  218. eContactGC = eTerminator,
  219. eContactScope,
  220. eContactName,
  221. eContactDesc,
  222. //
  223. //Subnet switches
  224. //
  225. eSubnetGC = eTerminator,
  226. eSubnetName,
  227. eSubnetDesc,
  228. eSubnetLoc,
  229. eSubnetSite,
  230. //
  231. // Quota switches
  232. //
  233. eQuotaAcct = eTerminator,
  234. eQuotaQLimit,
  235. eQuotaDesc,
  236. //
  237. // Partition switches
  238. //
  239. ePartitionPart = eTerminator,
  240. ePartitionDesc,
  241. };
  242. //
  243. // The parser table
  244. //
  245. extern ARG_RECORD DSQUERY_COMMON_COMMANDS[];
  246. //
  247. // The table of supported objects
  248. //
  249. extern PDSQueryObjectTableEntry g_DSObjectTable[];
  250. //
  251. //Usage Tables
  252. //
  253. extern UINT USAGE_DSQUERY[];
  254. extern UINT USAGE_DSQUERY_STAR[];
  255. extern UINT USAGE_DSQUERY_USER[];
  256. extern UINT USAGE_DSQUERY_COMPUTER[];
  257. extern UINT USAGE_DSQUERY_GROUP[];
  258. extern UINT USAGE_DSQUERY_OU[];
  259. extern UINT USAGE_DSQUERY_SERVER[];
  260. extern UINT USAGE_DSQUERY_CONTACT[];
  261. extern UINT USAGE_DSQUERY_SUBNET[];
  262. extern UINT USAGE_DSQUERY_SITE[];
  263. extern UINT USAGE_DSQUERY_QUOTA[];
  264. extern UINT USAGE_DSQUERY_PARTITION[];
  265. #endif //_QUERYTABLE_H_