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.

409 lines
17 KiB

  1. //========================================================================
  2. // Copyright (C) 1997 Microsoft Corporation
  3. // Author: RameshV
  4. // Description: This file has been generated. Pl look at the .c file
  5. //========================================================================
  6. typedef struct _STORE_HANDLE { // this is what is used almost always
  7. DWORD MustBeZero; // for future use
  8. LPWSTR Location; // where does this refer to?
  9. LPWSTR UserName; // who is the user?
  10. LPWSTR Password; // what is the password?
  11. DWORD AuthFlags; // what permission was this opened with?
  12. HANDLE ADSIHandle; // handle to within ADSI
  13. ADS_SEARCH_HANDLE SearchHandle; // any searches going on?
  14. LPVOID Memory; // memory allocated for this call..
  15. DWORD MemSize; // how much was really allocated?
  16. BOOL SearchStarted; // Did we start the search?
  17. } STORE_HANDLE, *LPSTORE_HANDLE, *PSTORE_HANDLE;
  18. DWORD
  19. StoreInitHandle( // initialize a handle
  20. IN OUT STORE_HANDLE *hStore, // will be filled in with stuff..
  21. IN DWORD Reserved, // must be zero -- for future use
  22. IN LPWSTR Domain, // OPTIONAL NULL==>default Domain
  23. IN LPWSTR UserName, // OPTIONAL NULL==>default credentials
  24. IN LPWSTR Password, // OPTIONAL used only if UserName given
  25. IN DWORD AuthFlags // OPTIONAL 0 ==> default??????
  26. ) ;
  27. DWORD
  28. StoreCleanupHandle( // cleanup the handle
  29. IN OUT LPSTORE_HANDLE hStore,
  30. IN DWORD Reserved
  31. ) ;
  32. enum {
  33. StoreGetChildType,
  34. StoreGetAbsoluteSameServerType,
  35. StoreGetAbsoluteOtherServerType
  36. } _StoreGetType;
  37. DWORD
  38. StoreGetHandle( // get handle to child object, absolute object..
  39. IN OUT LPSTORE_HANDLE hStore, // this gets modified..
  40. IN DWORD Reserved,
  41. IN DWORD StoreGetType, // same server? just a simple child?
  42. IN LPWSTR Path,
  43. IN OUT STORE_HANDLE *hStoreOut // new handle created..
  44. ) ;
  45. DWORD
  46. StoreSetSearchOneLevel( // search will return everything one level below
  47. IN OUT LPSTORE_HANDLE hStore,
  48. IN DWORD Reserved
  49. ) ;
  50. DWORD
  51. StoreSetSearchSubTree( // search will return the subtree below in ANY order
  52. IN OUT LPSTORE_HANDLE hStore,
  53. IN DWORD Reserved
  54. ) ;
  55. DWORD
  56. StoreBeginSearch(
  57. IN OUT LPSTORE_HANDLE hStore,
  58. IN DWORD Reserved,
  59. IN LPWSTR SearchFilter
  60. ) ;
  61. DWORD
  62. StoreEndSearch(
  63. IN OUT LPSTORE_HANDLE hStore,
  64. IN DWORD Reserved
  65. ) ;
  66. DWORD // ERROR_NO_MORE_ITEMS if exhausted
  67. StoreSearchGetNext(
  68. IN OUT LPSTORE_HANDLE hStore,
  69. IN DWORD Reserved,
  70. OUT LPSTORE_HANDLE hStoreOut
  71. ) ;
  72. DWORD
  73. StoreCreateObjectVA( // create a new object - var-args ending with ADSTYPE_INVALID
  74. IN OUT LPSTORE_HANDLE hStore,
  75. IN DWORD Reserved,
  76. IN LPWSTR NewObjName, // name of the new object -- must be "CN=name" types
  77. ... // fmt is AttrType, AttrName, AttrValue [AttrValueLen]
  78. ) ;
  79. DWORD
  80. StoreCreateObjectL( // create the object as an array
  81. IN OUT LPSTORE_HANDLE hStore,
  82. IN DWORD Reserved,
  83. IN LPWSTR NewObjName, // must be "CN=XXX" types
  84. IN PADS_ATTR_INFO Attributes, // the required attributes
  85. IN DWORD nAttributes // size of above array
  86. ) ;
  87. #define StoreCreateObject StoreCreateObjectVA
  88. DWORD
  89. StoreDeleteObject(
  90. IN OUT LPSTORE_HANDLE hStore,
  91. IN DWORD Reserved,
  92. IN LPWSTR ObjectName
  93. ) ;
  94. //DOC StoreDeleteThisObject deletes the object defined by hStore,StoreGetType and ADsPath.
  95. //DOC The refer to the object just the same way as for StoreGetHandle.
  96. DWORD
  97. StoreDeleteThisObject( // delete an object
  98. IN LPSTORE_HANDLE hStore, // point of anchor frm which reference is done
  99. IN DWORD Reserved, // must be zero, reserved for future use
  100. IN DWORD StoreGetType, // path is relative, absolute or diff server?
  101. IN LPWSTR Path // ADsPath to the object or relative path
  102. ) ;
  103. DWORD
  104. StoreSetAttributesVA( // set the attributes, var_args interface (nearly similar to CreateVA)
  105. IN OUT LPSTORE_HANDLE hStore,
  106. IN DWORD Reserved,
  107. IN OUT DWORD* nAttributesModified,
  108. ... // fmt is {ADSTYPE, CtrlCode, AttribName, Value}* ending in ADSTYPE_INVALID
  109. ) ;
  110. DWORD
  111. StoreSetAttributesL( // PADS_ATTR_INFO array equiv for SetAttributesVA
  112. IN OUT LPSTORE_HANDLE hStore,
  113. IN DWORD Reserved,
  114. IN OUT DWORD* nAttributesModified,
  115. IN PADS_ATTR_INFO AttribArray,
  116. IN DWORD nAttributes
  117. ) ;
  118. typedef struct _EATTRIB { // encapsulated attribute
  119. unsigned int Address1_present : 1;
  120. unsigned int Address2_present : 1;
  121. unsigned int Address3_present : 1;
  122. unsigned int ADsPath_present : 1;
  123. unsigned int StoreGetType_present : 1;
  124. unsigned int Flags1_present : 1;
  125. unsigned int Flags2_present : 1;
  126. unsigned int Dword1_present : 1;
  127. unsigned int Dword2_present : 1;
  128. unsigned int String1_present : 1;
  129. unsigned int String2_present : 1;
  130. unsigned int String3_present : 1;
  131. unsigned int String4_present : 1;
  132. unsigned int Binary1_present : 1;
  133. unsigned int Binary2_present : 1;
  134. DWORD Address1; // character "i"
  135. DWORD Address2; // character "j"
  136. DWORD Address3; // character "k"
  137. LPWSTR ADsPath; // character "p" "r" "l"
  138. DWORD StoreGetType; // "p,r,l" ==> sameserver, child, otherserver
  139. DWORD Flags1; // character "f"
  140. DWORD Flags2; // character "g"
  141. DWORD Dword1; // character "d"
  142. DWORD Dword2; // character "e"
  143. LPWSTR String1; // character "s"
  144. LPWSTR String2; // character "t"
  145. LPWSTR String3; // character "u"
  146. LPWSTR String4; // character "v"
  147. LPBYTE Binary1; // character "b"
  148. DWORD BinLen1; // # of bytes of above
  149. LPBYTE Binary2; // character "d"
  150. DWORD BinLen2; // # of bytes of above
  151. } EATTRIB, *PEATTRIB, *LPEATTRIB;
  152. #define IS_ADDRESS1_PRESENT(pEA) ((pEA)->Address1_present)
  153. #define IS_ADDRESS1_ABSENT(pEA) (!IS_ADDRESS1_PRESENT(pEA))
  154. #define ADDRESS1_PRESENT(pEA) ((pEA)->Address1_present = 1 )
  155. #define ADDRESS1_ABSENT(pEA) ((pEA)->Address1_present = 0 )
  156. #define IS_ADDRESS2_PRESENT(pEA) ((pEA)->Address2_present)
  157. #define IS_ADDRESS2_ABSENT(pEA) (!IS_ADDRESS2_PRESENT(pEA))
  158. #define ADDRESS2_PRESENT(pEA) ((pEA)->Address2_present = 1 )
  159. #define ADDRESS2_ABSENT(pEA) ((pEA)->Address2_present = 0 )
  160. #define IS_ADDRESS3_PRESENT(pEA) ((pEA)->Address3_present)
  161. #define IS_ADDRESS3_ABSENT(pEA) (!IS_ADDRESS3_PRESENT(pEA))
  162. #define ADDRESS3_PRESENT(pEA) ((pEA)->Address3_present = 1 )
  163. #define ADDRESS3_ABSENT(pEA) ((pEA)->Address3_present = 0 )
  164. #define IS_ADSPATH_PRESENT(pEA) ((pEA)->ADsPath_present)
  165. #define IS_ADSPATH_ABSENT(pEA) (!IS_ADSPATH_PRESENT(pEA))
  166. #define ADSPATH_PRESENT(pEA) ((pEA)->ADsPath_present = 1)
  167. #define ADSPATH_ABSENT(pEA) ((pEA)->ADsPath_present = 0)
  168. #define IS_STOREGETTYPE_PRESENT(pEA) ((pEA)->StoreGetType_present)
  169. #define IS_STOREGETTYPE_ABSENT(pEA) (!((pEA)->StoreGetType_present))
  170. #define STOREGETTYPE_PRESENT(pEA) ((pEA)->StoreGetType_present = 1)
  171. #define STOREGETTYPE_ABSENT(pEA) ((pEA)->StoreGetType_present = 0)
  172. #define IS_FLAGS1_PRESENT(pEA) ((pEA)->Flags1_present)
  173. #define IS_FLAGS1_ABSENT(pEA) (!((pEA)->Flags1_present))
  174. #define FLAGS1_PRESENT(pEA) ((pEA)->Flags1_present = 1)
  175. #define FLAGS1_ABSENT(pEA) ((pEA)->Flags1_present = 0)
  176. #define IS_FLAGS2_PRESENT(pEA) ((pEA)->Flags2_present)
  177. #define IS_FLAGS2_ABSENT(pEA) (!((pEA)->Flags2_present))
  178. #define FLAGS2_PRESENT(pEA) ((pEA)->Flags2_present = 1)
  179. #define FLAGS2_ABSENT(pEA) ((pEA)->Flags2_present = 0)
  180. #define IS_DWORD1_PRESENT(pEA) ((pEA)->Dword1_present)
  181. #define IS_DWORD1_ABSENT(pEA) (!((pEA)->Dword1_present))
  182. #define DWORD1_PRESENT(pEA) ((pEA)->Dword1_present = 1)
  183. #define DWORD1_ABSENT(pEA) ((pEA)->Dword1_present = 0)
  184. #define IS_DWORD2_PRESENT(pEA) ((pEA)->Dword2_present)
  185. #define IS_DWORD2_ABSENT(pEA) (!((pEA)->Dword2_present))
  186. #define DWORD2_PRESENT(pEA) ((pEA)->Dword2_present = 1)
  187. #define DWORD2_ABSENT(pEA) ((pEA)->Dword2_present = 0)
  188. #define IS_STRING1_PRESENT(pEA) ((pEA)->String1_present)
  189. #define IS_STRING1_ABSENT(pEA) (!((pEA)->String1_present))
  190. #define STRING1_PRESENT(pEA) ((pEA)->String1_present = 1)
  191. #define STRING1_ABSENT(pEA) ((pEA)->String1_present = 0)
  192. #define IS_STRING2_PRESENT(pEA) ((pEA)->String2_present)
  193. #define IS_STRING2_ABSENT(pEA) (!((pEA)->String2_present))
  194. #define STRING2_PRESENT(pEA) ((pEA)->String2_present = 1)
  195. #define STRING2_ABSENT(pEA) ((pEA)->String2_present = 0)
  196. #define IS_STRING3_PRESENT(pEA) ((pEA)->String3_present)
  197. #define IS_STRING3_ABSENT(pEA) (!((pEA)->String3_present))
  198. #define STRING3_PRESENT(pEA) ((pEA)->String3_present = 1)
  199. #define STRING3_ABSENT(pEA) ((pEA)->String3_present = 0)
  200. #define IS_STRING4_PRESENT(pEA) ((pEA)->String4_present)
  201. #define IS_STRING4_ABSENT(pEA) (!((pEA)->String4_present))
  202. #define STRING4_PRESENT(pEA) ((pEA)->String4_present = 1)
  203. #define STRING4_ABSENT(pEA) ((pEA)->String4_present = 0)
  204. #define IS_BINARY1_PRESENT(pEA) ((pEA)->Binary1_present)
  205. #define IS_BINARY1_ABSENT(pEA) (!((pEA)->Binary1_present))
  206. #define BINARY1_PRESENT(pEA) ((pEA)->Binary1_present = 1)
  207. #define BINARY1_ABSENT(pEA) ((pEA)->Binary1_present = 0)
  208. #define IS_BINARY2_PRESENT(pEA) ((pEA)->Binary2_present)
  209. #define IS_BINARY2_ABSENT(pEA) (!((pEA)->Binary2_present))
  210. #define BINARY2_PRESENT(pEA) ((pEA)->Binary2_present = 1)
  211. #define BINARY2_ABSENT(pEA) ((pEA)->Binary2_present = 0)
  212. BOOL _inline
  213. IsAnythingPresent(
  214. IN PEATTRIB pEA
  215. )
  216. {
  217. return IS_ADDRESS1_PRESENT(pEA)
  218. || IS_ADDRESS2_PRESENT(pEA)
  219. || IS_ADDRESS3_PRESENT(pEA)
  220. || IS_ADSPATH_PRESENT(pEA)
  221. || IS_STOREGETTYPE_PRESENT(pEA)
  222. || IS_FLAGS1_PRESENT(pEA)
  223. || IS_FLAGS2_PRESENT(pEA)
  224. || IS_DWORD1_PRESENT(pEA)
  225. || IS_DWORD2_PRESENT(pEA)
  226. || IS_STRING1_PRESENT(pEA)
  227. || IS_STRING2_PRESENT(pEA)
  228. || IS_STRING3_PRESENT(pEA)
  229. || IS_STRING4_PRESENT(pEA)
  230. || IS_BINARY1_PRESENT(pEA)
  231. || IS_BINARY2_PRESENT(pEA)
  232. ;
  233. }
  234. BOOL _inline
  235. IsEverythingPresent(
  236. IN PEATTRIB pEA
  237. )
  238. {
  239. return IS_ADDRESS1_PRESENT(pEA)
  240. && IS_ADDRESS2_PRESENT(pEA)
  241. && IS_ADDRESS3_PRESENT(pEA)
  242. && IS_ADSPATH_PRESENT(pEA)
  243. && IS_STOREGETTYPE_PRESENT(pEA)
  244. && IS_FLAGS1_PRESENT(pEA)
  245. && IS_FLAGS2_PRESENT(pEA)
  246. && IS_DWORD1_PRESENT(pEA)
  247. && IS_DWORD2_PRESENT(pEA)
  248. && IS_STRING1_PRESENT(pEA)
  249. && IS_STRING2_PRESENT(pEA)
  250. && IS_STRING3_PRESENT(pEA)
  251. && IS_STRING4_PRESENT(pEA)
  252. && IS_BINARY1_PRESENT(pEA)
  253. && IS_BINARY2_PRESENT(pEA)
  254. ;
  255. }
  256. VOID _inline
  257. EverythingPresent(
  258. IN PEATTRIB pEA
  259. )
  260. {
  261. ADDRESS1_PRESENT(pEA);
  262. ADDRESS2_PRESENT(pEA);
  263. ADDRESS3_PRESENT(pEA);
  264. ADSPATH_PRESENT(pEA);
  265. STOREGETTYPE_ABSENT(pEA);
  266. FLAGS1_PRESENT(pEA);
  267. FLAGS2_PRESENT(pEA);
  268. DWORD1_PRESENT(pEA);
  269. DWORD2_PRESENT(pEA);
  270. STRING1_PRESENT(pEA);
  271. STRING2_PRESENT(pEA);
  272. STRING3_PRESENT(pEA);
  273. STRING4_PRESENT(pEA);
  274. BINARY1_PRESENT(pEA);
  275. BINARY2_PRESENT(pEA);
  276. }
  277. VOID _inline
  278. NothingPresent(
  279. IN PEATTRIB pEA
  280. )
  281. {
  282. ADDRESS1_ABSENT(pEA);
  283. ADDRESS2_ABSENT(pEA);
  284. ADDRESS3_ABSENT(pEA);
  285. ADSPATH_ABSENT(pEA);
  286. STOREGETTYPE_ABSENT(pEA);
  287. FLAGS1_ABSENT(pEA);
  288. FLAGS2_ABSENT(pEA);
  289. DWORD1_ABSENT(pEA);
  290. DWORD2_ABSENT(pEA);
  291. STRING1_ABSENT(pEA);
  292. STRING2_ABSENT(pEA);
  293. STRING3_ABSENT(pEA);
  294. STRING4_ABSENT(pEA);
  295. BINARY1_ABSENT(pEA);
  296. BINARY2_ABSENT(pEA);
  297. }
  298. DWORD
  299. StoreCollectAttributes(
  300. IN OUT PSTORE_HANDLE hStore,
  301. IN DWORD Reserved,
  302. IN LPWSTR AttribName, // this attrib must be some kind of a text string
  303. IN OUT PARRAY ArrayToAddTo, // array of PEATTRIBs
  304. IN DWORD RecursionDepth // 0 ==> no recursion
  305. ) ;
  306. DWORD
  307. StoreCollectBinaryAttributes(
  308. IN OUT PSTORE_HANDLE hStore,
  309. IN DWORD Reserved,
  310. IN LPWSTR AttribName, // accept only attrib type OCTET_STRING
  311. IN OUT PARRAY ArrayToAddTo, // array of PEATTRIBs
  312. IN DWORD RecursionDepth // 0 ==> no recursion
  313. ) ;
  314. //DOC StoreUpdateAttributes is sort of the converse of StoreCollectAttributes.
  315. //DOC This function takes an array of type EATTRIB elements and updates the DS
  316. //DOC with this array. This function does not work when the attrib is of type
  317. //DOC OCTET_STRING etc. It works only with types that can be derived from
  318. //DOC PrintableString.
  319. DWORD
  320. StoreUpdateAttributes( // update a list of attributes
  321. IN OUT LPSTORE_HANDLE hStore, // handle to obj to update
  322. IN DWORD Reserved, // for future use, must be zero
  323. IN LPWSTR AttribName, // name of attrib, must be string type
  324. IN PARRAY Array // list of attribs
  325. ) ;
  326. //DOC StoreUpdateBinaryAttributes is sort of the converse of StoreCollectBinaryAttributes
  327. //DOC This function takes an array of type EATTRIB elements and updates the DS
  328. //DOC with this array. This function works only when the attrib is of type
  329. //DOC OCTET_STRING etc. It doesnt work with types that can be derived from
  330. //DOC PrintableString!!!.
  331. DWORD
  332. StoreUpdateBinaryAttributes( // update a list of attributes
  333. IN OUT LPSTORE_HANDLE hStore, // handle to obj to update
  334. IN DWORD Reserved, // for future use, must be zero
  335. IN LPWSTR AttribName, // name of attrib, must be OCTET_STRING type
  336. IN PARRAY Array // list of attribs
  337. ) ;
  338. //========================================================================
  339. // end of file
  340. //========================================================================