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.

435 lines
10 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000
  5. //
  6. // File: gettable.h
  7. //
  8. // Contents: Defines Enum for dsget.
  9. //
  10. // History: 16-Oct-2000 JeffJon Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #ifndef _GETTABLE_H_
  14. #define _GETTABLE_H_
  15. //forward declarations
  16. struct _DSGET_ATTRTABLE_ENTRY;
  17. struct _DSGetObjectTableEntry;
  18. //+--------------------------------------------------------------------------
  19. //
  20. // Class: CDSGetDisplayInfo
  21. //
  22. // Purpose: Object for maintaining attribute values which will be displayed
  23. //
  24. // History: 23-Oct-2000 JeffJon Created
  25. //
  26. //---------------------------------------------------------------------------
  27. class CDSGetDisplayInfo
  28. {
  29. public:
  30. //
  31. // Constructor
  32. //
  33. CDSGetDisplayInfo()
  34. : m_pszAttributeDisplayName(NULL),
  35. m_dwAttributeValueCount(0),
  36. m_ppszAttributeStringValue(NULL),
  37. m_dwAttributeValueSize(0),
  38. m_bShowAttribute(true)
  39. {}
  40. //
  41. // Desctructor
  42. //
  43. ~CDSGetDisplayInfo()
  44. {
  45. if (m_ppszAttributeStringValue)
  46. {
  47. delete[] m_ppszAttributeStringValue;
  48. m_ppszAttributeStringValue = NULL;
  49. }
  50. }
  51. //
  52. // Public Accessors
  53. //
  54. void SetDisplayName(PCWSTR pszDisplayName, bool bShowAttribute = true)
  55. {
  56. m_pszAttributeDisplayName = pszDisplayName;
  57. m_bShowAttribute = bShowAttribute;
  58. }
  59. PCWSTR GetDisplayName() { return m_pszAttributeDisplayName; }
  60. PCWSTR GetValue(DWORD dwIdx)
  61. {
  62. if (dwIdx < m_dwAttributeValueCount)
  63. {
  64. return m_ppszAttributeStringValue[dwIdx];
  65. }
  66. return NULL;
  67. }
  68. HRESULT AddValue(PCWSTR pszValue);
  69. DWORD GetValueCount() { return m_dwAttributeValueCount; }
  70. bool ShowAttribute() { return m_bShowAttribute; }
  71. private:
  72. //
  73. // The name of the attribute as it is to be displayed in the output
  74. //
  75. PCWSTR m_pszAttributeDisplayName;
  76. //
  77. // The number of values in ppszAttributeStringValueArray
  78. //
  79. DWORD m_dwAttributeValueCount;
  80. //
  81. // The string value as it is to be displayed in the output
  82. //
  83. PWSTR* m_ppszAttributeStringValue;
  84. //
  85. // The size of the attribute array
  86. //
  87. DWORD m_dwAttributeValueSize;
  88. //
  89. // Whether or not to show the attribute when displaying
  90. //
  91. bool m_bShowAttribute;
  92. };
  93. typedef CDSGetDisplayInfo* PDSGET_DISPLAY_INFO;
  94. //+-------------------------------------------------------------------------
  95. //
  96. // Type: PGETDISPLAYSTRINGFUNC
  97. //
  98. // Synopsis: The definition of a function that prepares ldapFilter from
  99. // the infix filter given on the commandline.
  100. //
  101. //
  102. // Returns: S_OK if the pAttr members were successfully set.
  103. // S_FALSE if the function failed but displayed its own error message.
  104. //
  105. // History: 25-Sep-2000 hiteshr Created
  106. //
  107. //---------------------------------------------------------------------------
  108. typedef HRESULT (*PGETDISPLAYSTRINGFUNC)(PCWSTR pszDN,
  109. CDSCmdBasePathsInfo& refBasePathsInfo,
  110. const CDSCmdCredentialObject& refCredentialObject,
  111. _DSGetObjectTableEntry* pEntry,
  112. ARG_RECORD* pRecord,
  113. PADS_ATTR_INFO pAttrInfo,
  114. CComPtr<IDirectoryObject>& spDirObject,
  115. PDSGET_DISPLAY_INFO pDisplayInfo);
  116. //+--------------------------------------------------------------------------
  117. //
  118. // Flags for specifying what the form of the output will be
  119. //
  120. //---------------------------------------------------------------------------
  121. #define DSGET_OUTPUT_DN_FLAG 0x00000001
  122. //+--------------------------------------------------------------------------
  123. //
  124. // Struct: _DSGET_ATTRTABLE_ENTRY
  125. //
  126. // Purpose: Definition of a table entry that describes the attribute for
  127. // which filter can be specified at commandline.
  128. //
  129. // History: 25-Sep-2000 hiteshr Created
  130. //
  131. //---------------------------------------------------------------------------
  132. typedef struct _DSGET_ATTRTABLE_ENTRY
  133. {
  134. //
  135. // The name that will be used for display (ie "Account disabled" instead of
  136. // "userAccountControl")
  137. //
  138. PCWSTR pszDisplayName;
  139. //
  140. // The ldapDisplayName of the attribute
  141. //
  142. PWSTR pszName;
  143. //
  144. // The unique identifier for this attribute that cooresponds to
  145. // the command line switch
  146. //
  147. UINT nAttributeID;
  148. //
  149. // Flags that specify the form of the output
  150. // For example DSGET_OUTPUT_DN_FLAG specifies
  151. // the output will be in DN form
  152. //
  153. DWORD dwOutputFlags;
  154. //
  155. // function that gets the string to display for
  156. // the value
  157. //
  158. PGETDISPLAYSTRINGFUNC pDisplayStringFunc;
  159. } DSGET_ATTR_TABLE_ENTRY, *PDSGET_ATTR_TABLE_ENTRY;
  160. //+--------------------------------------------------------------------------
  161. //
  162. // Struct: _DSGetObjectTableEntry
  163. //
  164. // Purpose: Definition of a table entry that describes attributes of a given
  165. // objecttype
  166. //
  167. // History: 25-Sep-2000 hiteshr Created
  168. //
  169. //---------------------------------------------------------------------------
  170. typedef struct _DSGetObjectTableEntry
  171. {
  172. //
  173. // The objectClass of the object to be created or modified
  174. //
  175. PCWSTR pszObjectClass;
  176. //
  177. // The command line string used to determine the object class
  178. // This is not always identical to pszObjectClass
  179. //
  180. PCWSTR pszCommandLineObjectType;
  181. //
  182. // The table to merge with the common switches for the parser
  183. //
  184. ARG_RECORD* pParserTable;
  185. //
  186. // The ID of the Usage help text for this
  187. //
  188. UINT* nUsageID;
  189. //
  190. // A count of the number of attributes in the table below
  191. //
  192. DWORD dwAttributeCount;
  193. //
  194. // A table of attributes for
  195. // which filter can be specified at commandline.
  196. //
  197. DSGET_ATTR_TABLE_ENTRY** pAttributeTable;
  198. } DSGetObjectTableEntry, *PDSGetObjectTableEntry;
  199. typedef enum DSGET_COMMAND_ENUM
  200. {
  201. eCommObjectType = eCommLast+1,
  202. eCommContinue,
  203. eCommList,
  204. eCommObjectDNorName,
  205. eCommDN,
  206. eCommDescription,
  207. eTerminator,
  208. //
  209. // User switches
  210. //
  211. eUserSamID = eTerminator,
  212. eUserSID,
  213. eUserUpn,
  214. eUserFn,
  215. eUserMi,
  216. eUserLn,
  217. eUserDisplay,
  218. eUserEmpID,
  219. eUserOffice,
  220. eUserTel,
  221. eUserEmail,
  222. eUserHometel,
  223. eUserPager,
  224. eUserMobile,
  225. eUserFax,
  226. eUserIPTel,
  227. eUserWebPage,
  228. eUserTitle,
  229. eUserDept,
  230. eUserCompany,
  231. eUserManager,
  232. eUserHomeDirectory,
  233. eUserHomeDrive,
  234. eUserProfilePath,
  235. eUserLogonScript,
  236. eUserMustchpwd,
  237. eUserCanchpwd,
  238. eUserPwdneverexpires,
  239. eUserDisabled,
  240. eUserAcctExpires,
  241. eUserReversiblePwd,
  242. eUserMemberOf,
  243. eUserExpand,
  244. eUserPart,
  245. eUserQLimit,
  246. eUserQuotaUsed,
  247. eUserLast = eUserQuotaUsed,
  248. //
  249. // Contact switches
  250. //
  251. eContactFn = eTerminator,
  252. eContactMi,
  253. eContactLn,
  254. eContactDisplay,
  255. eContactOffice,
  256. eContactTel,
  257. eContactEmail,
  258. eContactHometel,
  259. eContactPager,
  260. eContactMobile,
  261. eContactFax,
  262. eContactIPTel,
  263. eContactTitle,
  264. eContactDept,
  265. eContactCompany,
  266. eContactLast = eContactCompany,
  267. //
  268. // Computer switches
  269. //
  270. eComputerSamID = eTerminator,
  271. eComputerSID,
  272. eComputerLoc,
  273. eComputerDisabled,
  274. eComputerMemberOf,
  275. eComputerExpand,
  276. eComputerPart,
  277. eComputerQLimit,
  278. eComputerQuotaUsed,
  279. eComputerLast = eComputerQuotaUsed,
  280. //
  281. // Group switches
  282. //
  283. eGroupSamname = eTerminator,
  284. eGroupSID,
  285. eGroupSecgrp,
  286. eGroupScope,
  287. eGroupMemberOf,
  288. eGroupMembers,
  289. eGroupExpand,
  290. eGroupPart,
  291. eGroupQLimit,
  292. eGroupQuotaUsed,
  293. eGroupLast = eGroupQuotaUsed,
  294. //
  295. // OU doesn't have any additional switches
  296. //
  297. //
  298. // Server switches
  299. //
  300. eServerDnsName = eTerminator,
  301. eServerSite,
  302. eServerIsGC,
  303. eServerPart,
  304. eServerTopObjOwner,
  305. eServerLast = eServerTopObjOwner,
  306. //
  307. // Site switches
  308. //
  309. eSiteAutoTop = eTerminator,
  310. eSiteCacheGroups ,
  311. eSitePrefGC,
  312. eSiteLast = eSitePrefGC,
  313. //
  314. // Subnet switches
  315. //
  316. eSubnetLocation = eTerminator,
  317. eSubnetSite,
  318. eSubnetLast = eSubnetSite,
  319. //
  320. // Partition switches
  321. //
  322. ePartitionQDefault = eTerminator,
  323. ePartitionQTombstoneWeight,
  324. ePartitionTopObjOwner,
  325. ePartitionLast = ePartitionTopObjOwner,
  326. //
  327. // Quota switches
  328. //
  329. eQuotaAcct = eTerminator,
  330. eQuotaQLimit,
  331. eQuotaLast = eQuotaQLimit,
  332. /*
  333. //
  334. // Site Link switches
  335. //
  336. eSLinkIp = eTerminator,
  337. eSLinkSmtp,
  338. eSLinkAddsite,
  339. eSLinkRmsite,
  340. eSLinkCost,
  341. eSLinkRepint,
  342. eSLinkAutobacksync,
  343. eSLinkNotify,
  344. //
  345. // Site Link Bridge switches
  346. //
  347. eSLinkBrIp = eTerminator,
  348. eSLinkBrSmtp,
  349. eSLinkBrAddslink,
  350. eSLinkBrRmslink,
  351. //
  352. // Replication Connection switches
  353. //
  354. eConnTransport = eTerminator,
  355. eConnEnabled,
  356. eConnManual,
  357. eConnAutobacksync,
  358. eConnNotify,
  359. */
  360. };
  361. //
  362. // The parser table
  363. //
  364. extern ARG_RECORD DSGET_COMMON_COMMANDS[];
  365. //
  366. // The table of supported objects
  367. //
  368. extern PDSGetObjectTableEntry g_DSObjectTable[];
  369. //
  370. //Usage Table
  371. //
  372. extern UINT USAGE_DSGET[];
  373. extern UINT USAGE_DSGET_USER[];
  374. extern UINT USAGE_DSGET_CONTACT[];
  375. extern UINT USAGE_DSGET_COMPUTER[];
  376. extern UINT USAGE_DSGET_GROUP[];
  377. extern UINT USAGE_DSGET_OU[];
  378. extern UINT USAGE_DSGET_SERVER[];
  379. extern UINT USAGE_DSGET_SITE[];
  380. extern UINT USAGE_DSGET_SUBNET[];
  381. extern UINT USAGE_DSGET_PARTITION[];
  382. extern UINT USAGE_DSGET_QUOTA[];
  383. #endif //_QUERYTABLE_H_