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.

444 lines
9.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: cprops.cxx
  7. //
  8. // Contents: Property Cache functionality for NDS
  9. //
  10. // Functions:
  11. // CPropertyCache::addproperty
  12. // CPropertyCache::updateproperty
  13. // CPropertyCache::findproperty
  14. // CPropertyCache::getproperty
  15. // CPropertyCache::putproperty
  16. // CProperyCache::CPropertyCache
  17. // CPropertyCache::~CPropertyCache
  18. // CPropertyCache::createpropertycache
  19. //
  20. // History: 25-Apr-96 KrishnaG Cloned off GlennC's ndssntx.h
  21. // to resolve inconsistencies with
  22. // datatypes
  23. //
  24. //----------------------------------------------------------------------------
  25. #ifndef __NDSTYPES_HXX
  26. #define __NDSTYPES_HXX
  27. //
  28. // NDS Distinguished Name
  29. //
  30. // Used in attributes: Alias Object Name, Default Queue, Device,
  31. // Group Membership, Higher Privileges, Host Device,
  32. // Host Server, Member, Message Server, Operator, Owner,
  33. // Profile, Reference, Resource, Role Occupant,
  34. // Security Equals, See Also, Server, User, Volume
  35. //
  36. typedef struct
  37. {
  38. LPWSTR DNString;
  39. } NDS_ASN1_TYPE_1, * LPNDS_ASN1_TYPE_1;
  40. //
  41. // NDS Case Exact String syntax
  42. //
  43. // Used in attribute: Home Directory
  44. //
  45. typedef struct
  46. {
  47. LPWSTR CaseExactString;
  48. } NDS_ASN1_TYPE_2, * LPNDS_ASN1_TYPE_2;
  49. //
  50. // NDS Case Ignore String syntax
  51. //
  52. // Used in attributes: Cartridge, CN (Common Name), C (Country Name),
  53. // Description, Host Resource Name, L (Locality Name),
  54. // O (Organization Name), OU (Organizational Unit Name),
  55. // Physical Delivery Office Name, Postal Code,
  56. // Postal Office Box, Queue Directory, SAP Name,
  57. // S (State or Province Name), SA (Street Address),
  58. // Supported Services, Supported Typefaces, Surname,
  59. // Title, Unknown Base Class, Version
  60. //
  61. typedef struct
  62. {
  63. LPWSTR CaseIgnoreString;
  64. } NDS_ASN1_TYPE_3, * LPNDS_ASN1_TYPE_3;
  65. //
  66. // NDS Printable String syntax
  67. //
  68. // Used in attributes: Page Description Language, Serial Number
  69. //
  70. typedef struct
  71. {
  72. LPWSTR PrintableString;
  73. } NDS_ASN1_TYPE_4, * LPNDS_ASN1_TYPE_4;
  74. //
  75. // NDS Numeric String syntax
  76. //
  77. // Used in attributes: Bindery Type
  78. //
  79. typedef struct
  80. {
  81. LPWSTR NumericString;
  82. } NDS_ASN1_TYPE_5, * LPNDS_ASN1_TYPE_5;
  83. //
  84. // NDS Case Ignore List syntax
  85. //
  86. // Used in attribute: Language
  87. //
  88. typedef struct _NDS_CI_LIST
  89. {
  90. struct _NDS_CI_LIST * Next;
  91. LPWSTR String;
  92. }
  93. NDS_ASN1_TYPE_6, * LPNDS_ASN1_TYPE_6;
  94. //
  95. // NDS Boolean syntax
  96. //
  97. // Used in attributes: Allow Unlimited Credit, Detect Intruder,
  98. // Lockout After Detection, Locked By Intruder,
  99. // Login Diabled, Password Allow Change, Password Required,
  100. // Password Unique Required
  101. //
  102. typedef struct
  103. {
  104. DWORD Boolean;
  105. } NDS_ASN1_TYPE_7, * LPNDS_ASN1_TYPE_7;
  106. //
  107. // Example: NDS Integer syntax
  108. //
  109. // Used in attributes: Bindery Object Restriction, Convergence, GID (Group ID),
  110. // Login Grace Limit, Login Intruder Limit,
  111. // Login Maximum Simultaneous, Memory,
  112. // Minimum Account Balance, Password Minimum Length, Status,
  113. // Supported Connections, UID (User ID)
  114. //
  115. typedef struct
  116. {
  117. DWORD Integer;
  118. } NDS_ASN1_TYPE_8, * LPNDS_ASN1_TYPE_8;
  119. //
  120. // NDS Octet String syntax
  121. //
  122. // Used in attributes: Athority Revocation, Bindery Property, CA Private Key,
  123. // CA Public Key, Certificate Revocation,
  124. // Cross Certificate Pair, Login Allowed Time Map,
  125. // Passwords Used, Printer Configuration, Private Key,
  126. // Public Key
  127. //
  128. typedef struct
  129. {
  130. DWORD Length;
  131. LPBYTE OctetString;
  132. } NDS_ASN1_TYPE_9, * LPNDS_ASN1_TYPE_9;
  133. //
  134. // NDS Telephone Number syntax
  135. //
  136. // Used in attribute: Telephone Number
  137. //
  138. typedef struct
  139. {
  140. LPWSTR TelephoneNumber;
  141. } NDS_ASN1_TYPE_10, * LPNDS_ASN1_TYPE_10;
  142. //
  143. // NDS Facsimile Telephone Number syntax
  144. //
  145. // Used in attribute: Facsimile Telephone Number
  146. //
  147. typedef struct
  148. {
  149. LPWSTR TelephoneNumber;
  150. DWORD NumberOfBits;
  151. LPBYTE Parameters;
  152. } NDS_ASN1_TYPE_11, * LPNDS_ASN1_TYPE_11;
  153. //
  154. // NDS Network Address syntax
  155. //
  156. // Used in attributes: Login Intruder Address, Network Address,
  157. // Network Address Restriction
  158. //
  159. typedef struct
  160. {
  161. DWORD AddressType; // 0 = IPX,
  162. DWORD AddressLength;
  163. BYTE * Address;
  164. } NDS_ASN1_TYPE_12, * LPNDS_ASN1_TYPE_12;
  165. //
  166. // NDS Octet List syntax
  167. //
  168. // Used in attribute: (none)
  169. //
  170. typedef struct _NDS_OCTET_LIST
  171. {
  172. struct _NDS_OCTET_LIST * Next;
  173. DWORD Length;
  174. BYTE * Data;
  175. }NDS_ASN1_TYPE_13, * LPNDS_ASN1_TYPE_13;
  176. //
  177. // NDS EMail Address syntax
  178. //
  179. // Used in attribute: EMail Address
  180. //
  181. typedef struct
  182. {
  183. DWORD Type;
  184. LPWSTR Address;
  185. } NDS_ASN1_TYPE_14, * LPNDS_ASN1_TYPE_14;
  186. //
  187. // NDS Path syntax
  188. //
  189. // Used in attribute: Path
  190. //
  191. typedef struct
  192. {
  193. DWORD Type;
  194. LPWSTR VolumeName;
  195. LPWSTR Path;
  196. } NDS_ASN1_TYPE_15, * LPNDS_ASN1_TYPE_15;
  197. //
  198. // NDS Replica Pointer syntax
  199. //
  200. // Used in attribute: Replica
  201. //
  202. typedef struct
  203. {
  204. LPWSTR ServerName;
  205. DWORD ReplicaType;
  206. DWORD ReplicaNumber;
  207. DWORD Count;
  208. LPNDS_ASN1_TYPE_12 ReplicaAddressHints;
  209. //
  210. // Note - This is where GlennC's datatypes and the ADs Nds Datatypes
  211. // part company. He expects a contiguous buffer of Type 12 structures
  212. // but the number of Type 12 structures cannot be determined until runtime
  213. //
  214. // ReplicaAddressHint is variable and
  215. // can be calculated by Count * the
  216. // length of a NDS_ASN1_TYPE_12 ( that is
  217. // Count * 9).
  218. } NDS_ASN1_TYPE_16, * LPNDS_ASN1_TYPE_16;
  219. //
  220. // NDS Object ACL syntax
  221. //
  222. // Used in attributes: ACL, Inherited ACL
  223. //
  224. typedef struct
  225. {
  226. LPWSTR ProtectedAttrName;
  227. LPWSTR SubjectName;
  228. DWORD Privileges;
  229. } NDS_ASN1_TYPE_17, * LPNDS_ASN1_TYPE_17;
  230. //
  231. // NDS Postal Address syntax
  232. //
  233. // Used in attribute: Postal Address
  234. //
  235. typedef struct
  236. {
  237. LPWSTR PostalAddress[6]; // Value is limited to 6 lines,
  238. // 30 characters each.
  239. } NDS_ASN1_TYPE_18, * LPNDS_ASN1_TYPE_18;
  240. //
  241. // NDS Timestamp syntax
  242. //
  243. // Used in attribute: Obituary, Partition Creation Time, Received Up To,
  244. // Syncronized Up To
  245. //
  246. typedef struct
  247. {
  248. DWORD WholeSeconds; // Zero equals 12:00 midnight, January 1, 1970, UTC
  249. DWORD EventID;
  250. } NDS_ASN1_TYPE_19, * LPNDS_ASN1_TYPE_19;
  251. //
  252. // NDS Class Name syntax
  253. //
  254. // Used in attribute: Object Class
  255. //
  256. typedef struct
  257. {
  258. LPWSTR ClassName;
  259. } NDS_ASN1_TYPE_20, * LPNDS_ASN1_TYPE_20;
  260. //
  261. // NDS Stream syntax
  262. //
  263. // Used in attribute: Login Script, Print Job Configuration, Printer Control,
  264. // Type Creator Map
  265. //
  266. typedef struct
  267. {
  268. DWORD Length; // Always zero
  269. BYTE * Data;
  270. } NDS_ASN1_TYPE_21, * LPNDS_ASN1_TYPE_21;
  271. //
  272. // NDS Count syntax
  273. //
  274. // Used in attributes: Account Balance, Login Grace Remaining,
  275. // Login Intruder Attempts
  276. //
  277. typedef struct
  278. {
  279. DWORD Counter;
  280. } NDS_ASN1_TYPE_22, * LPNDS_ASN1_TYPE_22;
  281. //
  282. // NDS Back Link syntax
  283. //
  284. // Used in attribute: Back Link
  285. //
  286. typedef struct
  287. {
  288. DWORD RemoteID;
  289. LPWSTR ObjectName;
  290. } NDS_ASN1_TYPE_23, * LPNDS_ASN1_TYPE_23;
  291. //
  292. // NDS Time syntax
  293. //
  294. // Used in attributes: Last Login Time, Login Expiration Time,
  295. // Login Intruder Rest Time, Login Time,
  296. // Low Convergence Reset Time, Password Expiration Time
  297. //
  298. typedef struct
  299. {
  300. DWORD Time; // (in whole seconds) zero equals 12:00 midnight,
  301. // January 1, 1970, UTC
  302. } NDS_ASN1_TYPE_24, * LPNDS_ASN1_TYPE_24;
  303. //
  304. // NDS Typed Name syntax
  305. //
  306. // Used in attribute: Notify, Print Server, Printer, Queue
  307. //
  308. typedef struct
  309. {
  310. LPWSTR ObjectName;
  311. DWORD Level;
  312. DWORD Interval;
  313. } NDS_ASN1_TYPE_25, * LPNDS_ASN1_TYPE_25;
  314. //
  315. // NDS Hold syntax
  316. //
  317. // Used in attribute: Server Holds
  318. //
  319. typedef struct
  320. {
  321. LPWSTR ObjectName;
  322. DWORD Amount;
  323. } NDS_ASN1_TYPE_26, * LPNDS_ASN1_TYPE_26;
  324. //
  325. // NDS Interval syntax
  326. //
  327. // Used in attribute: High Convergence Syncronization Interval,
  328. // Intruder Attempt Reset Interval,
  329. // Intruder Lockout Reset Interval,
  330. // Low Convergence Syncronization Interval,
  331. // Password Expiration Interval
  332. //
  333. typedef struct
  334. {
  335. DWORD Interval;
  336. } NDS_ASN1_TYPE_27, * LPNDS_ASN1_TYPE_27;
  337. #endif
  338. typedef struct _ndstype{
  339. DWORD NdsType;
  340. union {
  341. NDS_ASN1_TYPE_1 value_1;
  342. NDS_ASN1_TYPE_2 value_2;
  343. NDS_ASN1_TYPE_3 value_3;
  344. NDS_ASN1_TYPE_4 value_4;
  345. NDS_ASN1_TYPE_5 value_5;
  346. NDS_ASN1_TYPE_6 value_6;
  347. NDS_ASN1_TYPE_7 value_7;
  348. NDS_ASN1_TYPE_8 value_8;
  349. NDS_ASN1_TYPE_9 value_9;
  350. NDS_ASN1_TYPE_10 value_10;
  351. NDS_ASN1_TYPE_11 value_11;
  352. NDS_ASN1_TYPE_12 value_12;
  353. NDS_ASN1_TYPE_13 value_13;
  354. NDS_ASN1_TYPE_14 value_14;
  355. NDS_ASN1_TYPE_15 value_15;
  356. NDS_ASN1_TYPE_16 value_16;
  357. NDS_ASN1_TYPE_17 value_17;
  358. NDS_ASN1_TYPE_18 value_18;
  359. NDS_ASN1_TYPE_19 value_19;
  360. NDS_ASN1_TYPE_20 value_20;
  361. NDS_ASN1_TYPE_21 value_21;
  362. NDS_ASN1_TYPE_22 value_22;
  363. NDS_ASN1_TYPE_23 value_23;
  364. NDS_ASN1_TYPE_24 value_24;
  365. NDS_ASN1_TYPE_25 value_25;
  366. NDS_ASN1_TYPE_26 value_26;
  367. NDS_ASN1_TYPE_27 value_27;
  368. }NdsValue;
  369. }NDSOBJECT, *PNDSOBJECT, *LPNDSOBJECT;