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.

559 lines
8.8 KiB

  1. #include "dspch.h"
  2. #pragma hdrstop
  3. #define _WINLDAP_
  4. #define LDAP_UNICODE 0
  5. #include <winldap.h>
  6. static
  7. WINLDAPAPI
  8. ULONG LDAPAPI
  9. ldap_unbind(
  10. LDAP *ld
  11. )
  12. {
  13. return LDAP_NO_MEMORY;
  14. }
  15. static
  16. WINLDAPAPI
  17. ULONG LDAPAPI
  18. ldap_unbind_s(
  19. LDAP *ld
  20. )
  21. {
  22. return LDAP_NO_MEMORY;
  23. }
  24. static
  25. WINLDAPAPI
  26. ULONG LDAPAPI
  27. LdapMapErrorToWin32(
  28. ULONG LdapError
  29. )
  30. {
  31. return ERROR_PROC_NOT_FOUND;
  32. }
  33. static
  34. WINLDAPAPI
  35. ULONG LDAPAPI
  36. LdapGetLastError(
  37. VOID
  38. )
  39. {
  40. return ERROR_PROC_NOT_FOUND;
  41. }
  42. static
  43. WINLDAPAPI
  44. LDAPMessage *LDAPAPI
  45. ldap_first_entry(
  46. LDAP *ld,
  47. LDAPMessage *res
  48. )
  49. {
  50. return NULL;
  51. }
  52. static
  53. WINLDAPAPI
  54. LDAPMessage *LDAPAPI
  55. ldap_next_entry(
  56. LDAP *ld,
  57. LDAPMessage *entry
  58. )
  59. {
  60. return NULL;
  61. }
  62. static
  63. WINLDAPAPI
  64. ULONG LDAPAPI
  65. ldap_count_entries(
  66. LDAP *ld,
  67. LDAPMessage *res
  68. )
  69. {
  70. return -1;
  71. }
  72. static
  73. WINLDAPAPI
  74. ULONG LDAPAPI
  75. ldap_result(
  76. LDAP *ld,
  77. ULONG msgid,
  78. ULONG all,
  79. struct l_timeval *timeout,
  80. LDAPMessage **res
  81. )
  82. {
  83. return -1;
  84. }
  85. static
  86. WINLDAPAPI
  87. ULONG LDAPAPI
  88. ldap_msgfree(
  89. LDAPMessage *res
  90. )
  91. {
  92. return LDAP_NO_MEMORY;
  93. }
  94. static
  95. WINLDAPAPI
  96. ULONG LDAPAPI
  97. ldap_bind_s(
  98. LDAP *ld,
  99. const PCHAR dn,
  100. const PCHAR cred,
  101. ULONG method
  102. )
  103. {
  104. return LDAP_NO_MEMORY;
  105. }
  106. static
  107. WINLDAPAPI
  108. LDAP * LDAPAPI
  109. cldap_openA(
  110. PCHAR HostName,
  111. ULONG PortNumber
  112. )
  113. {
  114. return NULL;
  115. }
  116. static
  117. WINLDAPAPI
  118. ULONG LDAPAPI
  119. ldap_add_sW(
  120. LDAP *ld,
  121. PWCHAR dn,
  122. LDAPModW *attrs[]
  123. )
  124. {
  125. return LDAP_NO_MEMORY;
  126. }
  127. static
  128. WINLDAPAPI
  129. ULONG LDAPAPI
  130. ldap_add_ext_sW(
  131. LDAP *ld,
  132. const PWCHAR dn,
  133. LDAPModW *attrs[],
  134. PLDAPControlW *ServerControls,
  135. PLDAPControlW *ClientControls
  136. )
  137. {
  138. return LDAP_NO_MEMORY;
  139. }
  140. static
  141. WINLDAPAPI
  142. ULONG LDAPAPI
  143. ldap_bind_sW(
  144. LDAP *ld,
  145. PWCHAR dn,
  146. PWCHAR cred,
  147. ULONG method
  148. )
  149. {
  150. return LDAP_NO_MEMORY;
  151. }
  152. static
  153. WINLDAPAPI
  154. ULONG LDAPAPI
  155. ldap_count_values_len(
  156. struct berval **vals
  157. )
  158. {
  159. return -1;
  160. }
  161. static
  162. WINLDAPAPI
  163. ULONG LDAPAPI
  164. ldap_value_free_len(
  165. struct berval **vals
  166. )
  167. {
  168. return LDAP_NO_MEMORY;
  169. }
  170. static
  171. WINLDAPAPI
  172. ULONG LDAPAPI
  173. ldap_compare_sW(
  174. LDAP *ld,
  175. const PWCHAR dn,
  176. const PWCHAR attr,
  177. PWCHAR value
  178. )
  179. {
  180. return LDAP_NO_MEMORY;
  181. }
  182. static
  183. WINLDAPAPI
  184. ULONG LDAPAPI
  185. ldap_count_valuesW(
  186. PWCHAR *vals
  187. )
  188. {
  189. return -1;
  190. }
  191. static
  192. WINLDAPAPI
  193. ULONG LDAPAPI
  194. ldap_delete_sW(
  195. LDAP *ld,
  196. const PWCHAR dn
  197. )
  198. {
  199. return LDAP_NO_MEMORY;
  200. }
  201. static
  202. WINLDAPAPI
  203. ULONG LDAPAPI
  204. ldap_delete_ext_sW(
  205. LDAP *ld,
  206. const PWCHAR dn,
  207. PLDAPControlW *ServerControls,
  208. PLDAPControlW *ClientControls
  209. )
  210. {
  211. return LDAP_NO_MEMORY;
  212. }
  213. static
  214. WINLDAPAPI
  215. ULONG LDAPAPI
  216. ldap_escape_filter_elementA(
  217. PCHAR sourceFilterElement,
  218. ULONG sourceLength,
  219. PCHAR destFilterElement,
  220. ULONG destLength
  221. )
  222. {
  223. return LDAP_NO_MEMORY;
  224. }
  225. static
  226. PWCHAR __cdecl
  227. ldap_get_dnW (
  228. LDAP *ExternalHandle,
  229. LDAPMessage *LdapMsg
  230. )
  231. {
  232. return NULL;
  233. }
  234. static
  235. WINLDAPAPI
  236. ULONG LDAPAPI
  237. ldap_get_next_page_s(
  238. PLDAP ExternalHandle,
  239. PLDAPSearch SearchHandle,
  240. struct l_timeval *timeout,
  241. ULONG PageSize,
  242. ULONG *TotalCount,
  243. LDAPMessage **Results
  244. )
  245. {
  246. return LDAP_NO_MEMORY;
  247. }
  248. static
  249. WINLDAPAPI
  250. PWCHAR *LDAPAPI
  251. ldap_get_valuesW(
  252. LDAP *ld,
  253. LDAPMessage *entry,
  254. const PWCHAR attr
  255. )
  256. {
  257. return NULL;
  258. }
  259. static
  260. WINLDAPAPI
  261. struct berval **LDAPAPI
  262. ldap_get_values_lenA(
  263. LDAP *ExternalHandle,
  264. LDAPMessage *Message,
  265. const PCHAR attr
  266. )
  267. {
  268. return NULL;
  269. }
  270. static
  271. WINLDAPAPI
  272. struct berval **LDAPAPI
  273. ldap_get_values_lenW(
  274. LDAP *ExternalHandle,
  275. LDAPMessage *Message,
  276. const PWCHAR attr
  277. )
  278. {
  279. return NULL;
  280. }
  281. static
  282. WINLDAPAPI
  283. ULONG LDAPAPI
  284. ldap_modify_ext_sW(
  285. LDAP *ld,
  286. const PWCHAR dn,
  287. LDAPModW *mods[],
  288. PLDAPControlW *ServerControls,
  289. PLDAPControlW *ClientControls
  290. )
  291. {
  292. return LDAP_NO_MEMORY;
  293. }
  294. static
  295. WINLDAPAPI
  296. ULONG LDAPAPI
  297. ldap_modify_sW(
  298. LDAP *ld,
  299. PWCHAR dn,
  300. LDAPModW *mods[]
  301. )
  302. {
  303. return LDAP_NO_MEMORY;
  304. }
  305. static
  306. WINLDAPAPI
  307. LDAP * LDAPAPI
  308. ldap_openW(
  309. const PWCHAR HostName,
  310. ULONG PortNumber
  311. )
  312. {
  313. return NULL;
  314. }
  315. static
  316. WINLDAPAPI
  317. ULONG LDAPAPI
  318. ldap_rename_ext_sW(
  319. LDAP *ld,
  320. const PWCHAR dn,
  321. const PWCHAR NewRDN,
  322. const PWCHAR NewParent,
  323. INT DeleteOldRdn,
  324. PLDAPControlW *ServerControls,
  325. PLDAPControlW *ClientControls
  326. )
  327. {
  328. return LDAP_NO_MEMORY;
  329. }
  330. static
  331. WINLDAPAPI
  332. ULONG LDAPAPI
  333. ldap_searchA(
  334. LDAP *ld,
  335. const PCHAR base,
  336. ULONG scope,
  337. const PCHAR filter,
  338. PCHAR attrs[],
  339. ULONG attrsonly
  340. )
  341. {
  342. return -1;
  343. }
  344. static
  345. WINLDAPAPI
  346. ULONG LDAPAPI
  347. ldap_search_ext_sW(
  348. LDAP *ld,
  349. const PWCHAR base,
  350. ULONG scope,
  351. const PWCHAR filter,
  352. PWCHAR attrs[],
  353. ULONG attrsonly,
  354. PLDAPControlW *ServerControls,
  355. PLDAPControlW *ClientControls,
  356. struct l_timeval *timeout,
  357. ULONG SizeLimit,
  358. LDAPMessage **res
  359. )
  360. {
  361. return LDAP_NO_MEMORY;
  362. }
  363. static
  364. WINLDAPAPI
  365. ULONG LDAPAPI
  366. ldap_search_sW(
  367. LDAP *ld,
  368. const PWCHAR base,
  369. ULONG scope,
  370. const PWCHAR filter,
  371. PWCHAR attrs[],
  372. ULONG attrsonly,
  373. LDAPMessage **res
  374. )
  375. {
  376. *res = NULL;
  377. return LDAP_NO_MEMORY;
  378. }
  379. static
  380. WINLDAPAPI
  381. ULONG LDAPAPI
  382. ldap_value_freeW(
  383. PWCHAR *vals
  384. )
  385. {
  386. return LDAP_NO_MEMORY;
  387. }
  388. static
  389. WINLDAPAPI
  390. PCHAR LDAPAPI
  391. ldap_err2stringA(
  392. ULONG err
  393. )
  394. {
  395. return NULL;
  396. }
  397. static
  398. WINLDAPAPI
  399. ULONG LDAPAPI
  400. ldap_set_optionW(
  401. LDAP *ld,
  402. int option,
  403. const void *invalue
  404. )
  405. {
  406. return LDAP_NO_MEMORY;
  407. }
  408. static
  409. VOID __cdecl
  410. ldap_memfreeW(
  411. PWCHAR Block
  412. )
  413. {
  414. return;
  415. }
  416. static
  417. WINLDAPAPI
  418. ULONG LDAPAPI
  419. ldap_search_abandon_page(
  420. PLDAP ExternalHandle,
  421. PLDAPSearch SearchBlock
  422. )
  423. {
  424. return LDAP_NO_MEMORY;
  425. }
  426. WINLDAPAPI
  427. PLDAPSearch LDAPAPI
  428. ldap_search_init_pageW(
  429. PLDAP ExternalHandle,
  430. const PWCHAR DistinguishedName,
  431. ULONG ScopeOfSearch,
  432. const PWCHAR SearchFilter,
  433. PWCHAR AttributeList[],
  434. ULONG AttributesOnly,
  435. PLDAPControlW *ServerControls,
  436. PLDAPControlW *ClientControls,
  437. ULONG PageTimeLimit,
  438. ULONG TotalSizeLimit,
  439. PLDAPSortKeyW *SortKeys
  440. )
  441. {
  442. return NULL;
  443. }
  444. static
  445. WINLDAPAPI
  446. LDAP* LDAPAPI
  447. ldap_initW(
  448. const PWCHAR HostName,
  449. ULONG PortNumber
  450. )
  451. {
  452. return NULL;
  453. }
  454. static
  455. WINLDAPAPI
  456. ULONG LDAPAPI
  457. ldap_get_optionW(
  458. LDAP *ld,
  459. int option,
  460. void *outvalue
  461. )
  462. {
  463. return LDAP_NO_MEMORY;
  464. }
  465. //
  466. // !! WARNING !! The entries below must be in order by ORDINAL
  467. //
  468. DEFINE_ORDINAL_ENTRIES(wldap32)
  469. {
  470. DLOENTRY(12,ldap_get_optionW)
  471. DLOENTRY(13,ldap_unbind)
  472. DLOENTRY(14,ldap_set_optionW)
  473. DLOENTRY(16,LdapGetLastError)
  474. DLOENTRY(18,LdapMapErrorToWin32)
  475. DLOENTRY(26,ldap_first_entry)
  476. DLOENTRY(27,ldap_next_entry)
  477. DLOENTRY(36,ldap_count_entries)
  478. DLOENTRY(40,ldap_result)
  479. DLOENTRY(41,ldap_msgfree)
  480. DLOENTRY(45,ldap_bind_s)
  481. DLOENTRY(46,ldap_unbind_s)
  482. DLOENTRY(55,cldap_openA)
  483. DLOENTRY(65,ldap_add_ext_sW)
  484. DLOENTRY(69,ldap_add_sW)
  485. DLOENTRY(73,ldap_bind_sW)
  486. DLOENTRY(77,ldap_count_values_len)
  487. DLOENTRY(79,ldap_value_free_len)
  488. DLOENTRY(87,ldap_compare_sW)
  489. DLOENTRY(97,ldap_count_valuesW)
  490. DLOENTRY(111,ldap_delete_ext_sW)
  491. DLOENTRY(113,ldap_delete_sW)
  492. DLOENTRY(117,ldap_err2stringA)
  493. DLOENTRY(119,ldap_escape_filter_elementA)
  494. DLOENTRY(133,ldap_get_dnW)
  495. DLOENTRY(135,ldap_get_next_page_s)
  496. DLOENTRY(140,ldap_get_valuesW)
  497. DLOENTRY(141,ldap_get_values_lenA)
  498. DLOENTRY(142,ldap_get_values_lenW)
  499. DLOENTRY(145,ldap_initW)
  500. DLOENTRY(147,ldap_memfreeW)
  501. DLOENTRY(155,ldap_modify_ext_sW)
  502. DLOENTRY(157,ldap_modify_sW)
  503. DLOENTRY(170,ldap_openW)
  504. DLOENTRY(188,ldap_rename_ext_sW)
  505. DLOENTRY(189,ldap_searchA)
  506. DLOENTRY(191,ldap_search_abandon_page)
  507. DLOENTRY(203,ldap_search_ext_sW)
  508. DLOENTRY(206,ldap_search_init_pageW)
  509. DLOENTRY(208,ldap_search_sW)
  510. DLOENTRY(224,ldap_value_freeW)
  511. };
  512. DEFINE_ORDINAL_MAP(wldap32)