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.

376 lines
8.1 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. {}
  39. //
  40. // Desctructor
  41. //
  42. ~CDSGetDisplayInfo()
  43. {
  44. if (m_ppszAttributeStringValue)
  45. {
  46. delete[] m_ppszAttributeStringValue;
  47. m_ppszAttributeStringValue = NULL;
  48. }
  49. }
  50. //
  51. // Public Accessors
  52. //
  53. void SetDisplayName(PCWSTR pszDisplayName) { m_pszAttributeDisplayName = pszDisplayName; }
  54. PCWSTR GetDisplayName() { return m_pszAttributeDisplayName; }
  55. PCWSTR GetValue(DWORD dwIdx)
  56. {
  57. if (dwIdx < m_dwAttributeValueCount)
  58. {
  59. return m_ppszAttributeStringValue[dwIdx];
  60. }
  61. return NULL;
  62. }
  63. HRESULT AddValue(PCWSTR pszValue);
  64. DWORD GetValueCount() { return m_dwAttributeValueCount; }
  65. private:
  66. //
  67. // The name of the attribute as it is to be displayed in the output
  68. //
  69. PCWSTR m_pszAttributeDisplayName;
  70. //
  71. // The number of values in ppszAttributeStringValueArray
  72. //
  73. DWORD m_dwAttributeValueCount;
  74. //
  75. // The string value as it is to be displayed in the output
  76. //
  77. PWSTR* m_ppszAttributeStringValue;
  78. //
  79. // The size of the attribute array
  80. //
  81. DWORD m_dwAttributeValueSize;
  82. };
  83. typedef CDSGetDisplayInfo* PDSGET_DISPLAY_INFO;
  84. //+-------------------------------------------------------------------------
  85. //
  86. // Type: PGETDISPLAYSTRINGFUNC
  87. //
  88. // Synopsis: The definition of a function that prepares ldapFilter from
  89. // the infix filter given on the commandline.
  90. //
  91. //
  92. // Returns: S_OK if the pAttr members were successfully set.
  93. // S_FALSE if the function failed but displayed its own error message.
  94. //
  95. // History: 25-Sep-2000 hiteshr Created
  96. //
  97. //---------------------------------------------------------------------------
  98. typedef HRESULT (*PGETDISPLAYSTRINGFUNC)(PCWSTR pszDN,
  99. CDSCmdBasePathsInfo& refBasePathsInfo,
  100. const CDSCmdCredentialObject& refCredentialObject,
  101. _DSGetObjectTableEntry* pEntry,
  102. ARG_RECORD* pRecord,
  103. PADS_ATTR_INFO pAttrInfo,
  104. CComPtr<IDirectoryObject>& spDirObject,
  105. PDSGET_DISPLAY_INFO pDisplayInfo);
  106. //+--------------------------------------------------------------------------
  107. //
  108. // Struct: _DSGET_ATTRTABLE_ENTRY
  109. //
  110. // Purpose: Definition of a table entry that describes the attribute for
  111. // which filter can be specified at commandline.
  112. //
  113. // History: 25-Sep-2000 hiteshr Created
  114. //
  115. //---------------------------------------------------------------------------
  116. typedef struct _DSGET_ATTRTABLE_ENTRY
  117. {
  118. //
  119. // The name that will be used for display (ie "Account disabled" instead of
  120. // "userAccountControl")
  121. //
  122. PCWSTR pszDisplayName;
  123. //
  124. // The ldapDisplayName of the attribute
  125. //
  126. PWSTR pszName;
  127. //
  128. // The unique identifier for this attribute that cooresponds to
  129. // the command line switch
  130. //
  131. UINT nAttributeID;
  132. //
  133. // function that gets the string to display for
  134. // the value
  135. //
  136. PGETDISPLAYSTRINGFUNC pDisplayStringFunc;
  137. } DSGET_ATTR_TABLE_ENTRY, *PDSGET_ATTR_TABLE_ENTRY;
  138. //+--------------------------------------------------------------------------
  139. //
  140. // Struct: _DSGetObjectTableEntry
  141. //
  142. // Purpose: Definition of a table entry that describes attributes of a given
  143. // objecttype
  144. //
  145. // History: 25-Sep-2000 hiteshr Created
  146. //
  147. //---------------------------------------------------------------------------
  148. typedef struct _DSGetObjectTableEntry
  149. {
  150. //
  151. // The objectClass of the object to be created or modified
  152. //
  153. PCWSTR pszObjectClass;
  154. //
  155. // The command line string used to determine the object class
  156. // This is not always identical to pszObjectClass
  157. //
  158. PCWSTR pszCommandLineObjectType;
  159. //
  160. // The table to merge with the common switches for the parser
  161. //
  162. ARG_RECORD* pParserTable;
  163. //
  164. // The ID of the Usage help text for this
  165. //
  166. UINT nUsageID;
  167. //
  168. // A count of the number of attributes in the table below
  169. //
  170. DWORD dwAttributeCount;
  171. //
  172. // A table of attributes for
  173. // which filter can be specified at commandline.
  174. //
  175. DSGET_ATTR_TABLE_ENTRY** pAttributeTable;
  176. } DSGetObjectTableEntry, *PDSGetObjectTableEntry;
  177. typedef enum COMMON_COMMAND
  178. {
  179. //
  180. // Common switches
  181. //
  182. #ifdef DBG
  183. eCommDebug,
  184. #endif
  185. eCommHelp,
  186. eCommObjectType,
  187. eCommServer,
  188. eCommDomain,
  189. eCommUserName,
  190. eCommPassword,
  191. eCommContinue,
  192. eCommQuiet,
  193. eCommList,
  194. eCommObjectDNorName,
  195. eCommDN,
  196. eCommDescription,
  197. eTerminator,
  198. //
  199. // User switches
  200. //
  201. eUserSamID = eTerminator,
  202. eUserSID,
  203. eUserUpn,
  204. eUserFn,
  205. eUserMi,
  206. eUserLn,
  207. eUserDisplay,
  208. eUserEmpID,
  209. eUserOffice,
  210. eUserTel,
  211. eUserEmail,
  212. eUserHometel,
  213. eUserPager,
  214. eUserMobile,
  215. eUserFax,
  216. eUserIPTel,
  217. eUserWebPage,
  218. eUserTitle,
  219. eUserDept,
  220. eUserCompany,
  221. eUserManager,
  222. eUserHomeDirectory,
  223. eUserHomeDrive,
  224. eUserProfilePath,
  225. eUserLogonScript,
  226. eUserMustchpwd,
  227. eUserCanchpwd,
  228. eUserPwdneverexpires,
  229. eUserDisabled,
  230. eUserAcctExpires,
  231. eUserReversiblePwd,
  232. eUserMemberOf,
  233. eUserExpand,
  234. eUserLast = eUserExpand,
  235. //
  236. // Contact switches
  237. //
  238. eContactFn = eTerminator,
  239. eContactMi,
  240. eContactLn,
  241. eContactDisplay,
  242. eContactOffice,
  243. eContactTel,
  244. eContactEmail,
  245. eContactHometel,
  246. eContactPager,
  247. eContactMobile,
  248. eContactFax,
  249. eContactTitle,
  250. eContactDept,
  251. eContactCompany,
  252. eContactLast = eContactCompany,
  253. //
  254. // Computer switches
  255. //
  256. eComputerSamID = eTerminator,
  257. eComputerSID,
  258. eComputerLoc,
  259. eComputerDisabled,
  260. eComputerMemberOf,
  261. eComputerExpand,
  262. eComputerLast = eComputerExpand,
  263. //
  264. // Group switches
  265. //
  266. eGroupSamname = eTerminator,
  267. eGroupSID,
  268. eGroupSecgrp,
  269. eGroupScope,
  270. eGroupMemberOf,
  271. eGroupMembers,
  272. eGroupExpand,
  273. eGroupLast = eGroupExpand,
  274. //
  275. // OU doesn't have any additional switches
  276. //
  277. //
  278. // Server switches
  279. //
  280. eServerDnsName = eTerminator,
  281. eServerSite,
  282. eServerIsGC,
  283. eServerLast = eServerIsGC,
  284. //
  285. // Site switches
  286. //
  287. eSiteAutoTop = eTerminator,
  288. eSiteCacheGroups ,
  289. eSitePrefGC,
  290. eSiteLast = eSitePrefGC,
  291. //
  292. // Subnet switches
  293. //
  294. eSubnetLocation = eTerminator,
  295. eSubnetSite,
  296. eSubnetLast = eSubnetSite,
  297. /*
  298. //
  299. // Site Link switches
  300. //
  301. eSLinkIp = eTerminator,
  302. eSLinkSmtp,
  303. eSLinkAddsite,
  304. eSLinkRmsite,
  305. eSLinkCost,
  306. eSLinkRepint,
  307. eSLinkAutobacksync,
  308. eSLinkNotify,
  309. //
  310. // Site Link Bridge switches
  311. //
  312. eSLinkBrIp = eTerminator,
  313. eSLinkBrSmtp,
  314. eSLinkBrAddslink,
  315. eSLinkBrRmslink,
  316. //
  317. // Replication Connection switches
  318. //
  319. eConnTransport = eTerminator,
  320. eConnEnabled,
  321. eConnManual,
  322. eConnAutobacksync,
  323. eConnNotify,
  324. */
  325. };
  326. //
  327. // The parser table
  328. //
  329. extern ARG_RECORD DSGET_COMMON_COMMANDS[];
  330. //
  331. // The table of supported objects
  332. //
  333. extern PDSGetObjectTableEntry g_DSObjectTable[];
  334. #endif //_QUERYTABLE_H_