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.

70 lines
2.4 KiB

  1. // File: pfnwldap.cpp
  2. #include "precomp.h"
  3. #include "pfnwldap.h"
  4. static const TCHAR * s_pcszWldap32 = TEXT("wldap32.dll");
  5. HINSTANCE WLDAP::m_hInstance = NULL;
  6. PFN_LDAP_ABANDON WLDAP::ldap_abandon = NULL;
  7. PFN_LDAP_BIND_S WLDAP::ldap_bind_s = NULL;
  8. PFN_LDAP_BIND WLDAP::ldap_bind = NULL;
  9. PFN_LDAP_ADD WLDAP::ldap_add = NULL;
  10. PFN_LDAP_SIMPLE_BIND_S WLDAP::ldap_simple_bind_s = NULL;
  11. PFN_LDAP_FIRST_ATTRIBUTE WLDAP::ldap_first_attribute = NULL;
  12. PFN_LDAP_FIRST_ENTRY WLDAP::ldap_first_entry = NULL;
  13. PFN_LDAP_GET_VALUES WLDAP::ldap_get_values = NULL;
  14. PFN_LDAP_MSGFREE WLDAP::ldap_msgfree = NULL;
  15. PFN_LDAP_NEXT_ATTRIBUTE WLDAP::ldap_next_attribute = NULL;
  16. PFN_LDAP_NEXT_ENTRY WLDAP::ldap_next_entry = NULL;
  17. PFN_LDAP_OPEN WLDAP::ldap_open = NULL;
  18. PFN_LDAP_OPEN WLDAP::ldap_init = NULL;
  19. PFN_LDAP_RESULT WLDAP::ldap_result = NULL;
  20. PFN_LDAP_SEARCH WLDAP::ldap_search = NULL;
  21. PFN_LDAP_SEARCH_S WLDAP::ldap_search_s = NULL;
  22. PFN_LDAP_SET_OPTION WLDAP::ldap_set_option = NULL;
  23. PFN_LDAP_UNBIND WLDAP::ldap_unbind = NULL;
  24. PFN_LDAP_VALUE_FREE WLDAP::ldap_value_free = NULL;
  25. PFN_LDAP_MODIFY WLDAP::ldap_modify = NULL;
  26. PFN_LDAP_DELETE WLDAP::ldap_delete = NULL;
  27. PFN_LDAP_GET_OPTION WLDAP::ldap_get_option = NULL;
  28. #define WLDAP_APIFCN_ENTRY(pfn) {(PVOID *) &WLDAP::##pfn, #pfn}
  29. APIFCN s_apiFcnWldap[] = {
  30. WLDAP_APIFCN_ENTRY(ldap_abandon),
  31. WLDAP_APIFCN_ENTRY(ldap_bind_s),
  32. WLDAP_APIFCN_ENTRY(ldap_bind),
  33. WLDAP_APIFCN_ENTRY(ldap_add),
  34. WLDAP_APIFCN_ENTRY(ldap_first_attribute),
  35. WLDAP_APIFCN_ENTRY(ldap_first_attribute),
  36. WLDAP_APIFCN_ENTRY(ldap_first_entry),
  37. WLDAP_APIFCN_ENTRY(ldap_get_values),
  38. WLDAP_APIFCN_ENTRY(ldap_msgfree),
  39. WLDAP_APIFCN_ENTRY(ldap_next_attribute),
  40. WLDAP_APIFCN_ENTRY(ldap_next_entry),
  41. WLDAP_APIFCN_ENTRY(ldap_open),
  42. WLDAP_APIFCN_ENTRY(ldap_init),
  43. WLDAP_APIFCN_ENTRY(ldap_result),
  44. WLDAP_APIFCN_ENTRY(ldap_search),
  45. WLDAP_APIFCN_ENTRY(ldap_search_s),
  46. WLDAP_APIFCN_ENTRY(ldap_set_option),
  47. WLDAP_APIFCN_ENTRY(ldap_simple_bind_s),
  48. WLDAP_APIFCN_ENTRY(ldap_unbind),
  49. WLDAP_APIFCN_ENTRY(ldap_value_free),
  50. WLDAP_APIFCN_ENTRY(ldap_modify),
  51. WLDAP_APIFCN_ENTRY(ldap_delete),
  52. WLDAP_APIFCN_ENTRY(ldap_get_option)
  53. };
  54. HRESULT WLDAP::Init(void)
  55. {
  56. if (NULL != m_hInstance)
  57. return S_OK;
  58. return HrInitLpfn(s_apiFcnWldap, ARRAY_ELEMENTS(s_apiFcnWldap), &m_hInstance, s_pcszWldap32);
  59. }