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.

81 lines
3.4 KiB

  1. // File: pfnwldap.h
  2. #ifndef _PFNWLDAP_H_
  3. #define _PFNWLDAP_H_
  4. #include <winldap.h>
  5. // Why aren't these in winldap.h ?
  6. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_ABANDON)(LDAP *ld, ULONG msgid);
  7. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_BIND_S)(LDAP *ld, PCHAR dn, PCHAR cred, ULONG method);
  8. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_BIND)(LDAP *ld, PCHAR dn, PCHAR cred, ULONG method);
  9. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_ADD) (LDAP *ld, PCHAR dn, LDAPMod *attrs[]);
  10. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_SIMPLE_BIND_S)(LDAP *ld, PCHAR dn, PCHAR passwd);
  11. typedef WINLDAPAPI PCHAR * (LDAPAPI * PFN_LDAP_GET_VALUES)(LDAP *ld, LDAPMessage *entry, PCHAR attr);
  12. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_MSGFREE)(LDAPMessage *res);
  13. typedef WINLDAPAPI LDAP * (LDAPAPI * PFN_LDAP_OPEN)(PCHAR HostName, ULONG PortNumber);
  14. typedef WINLDAPAPI LDAP * (LDAPAPI * PFN_LDAP_INIT)(PCHAR HostName, ULONG PortNumber);
  15. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_RESULT)(LDAP *ld, ULONG msgid, ULONG all, struct l_timeval *timeout, LDAPMessage **res);
  16. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_SET_OPTION)(LDAP *ld, int option, void *invalue);
  17. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_UNBIND)(LDAP *ld);
  18. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_VALUE_FREE)(PCHAR *vals);
  19. typedef WINLDAPAPI LDAPMessage * (LDAPAPI * PFN_LDAP_FIRST_ENTRY)(LDAP *ld, LDAPMessage *res);
  20. typedef WINLDAPAPI LDAPMessage * (LDAPAPI * PFN_LDAP_NEXT_ENTRY) (LDAP *ld, LDAPMessage *entry);
  21. typedef WINLDAPAPI PCHAR (LDAPAPI * PFN_LDAP_FIRST_ATTRIBUTE)(LDAP *ld, LDAPMessage *entry, BerElement **ptr);
  22. typedef WINLDAPAPI PCHAR (LDAPAPI * PFN_LDAP_NEXT_ATTRIBUTE) (LDAP *ld, LDAPMessage *entry, BerElement *ptr);
  23. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_SEARCH) (LDAP *ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly);
  24. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_SEARCH_S)(LDAP *ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly, LDAPMessage **res);
  25. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_MODIFY) (LDAP *ld, PCHAR dn, LDAPMod *mods[]);
  26. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_DELETE) (LDAP *ld, PCHAR dn);
  27. typedef WINLDAPAPI ULONG (LDAPAPI * PFN_LDAP_GET_OPTION) ( LDAP *ld, int option, void *outvalue );
  28. class WLDAP
  29. {
  30. private:
  31. static HINSTANCE m_hInstance;
  32. protected:
  33. WLDAP() {};
  34. ~WLDAP() {};
  35. public:
  36. static HRESULT Init(void);
  37. static PFN_LDAP_ABANDON ldap_abandon;
  38. static PFN_LDAP_BIND_S ldap_bind_s;
  39. static PFN_LDAP_BIND ldap_bind;
  40. static PFN_LDAP_ADD ldap_add;
  41. static PFN_LDAP_FIRST_ATTRIBUTE ldap_first_attribute;
  42. static PFN_LDAP_FIRST_ENTRY ldap_first_entry;
  43. static PFN_LDAP_GET_VALUES ldap_get_values;
  44. static PFN_LDAP_MSGFREE ldap_msgfree;
  45. static PFN_LDAP_NEXT_ATTRIBUTE ldap_next_attribute;
  46. static PFN_LDAP_NEXT_ENTRY ldap_next_entry;
  47. static PFN_LDAP_OPEN ldap_open;
  48. static PFN_LDAP_INIT ldap_init;
  49. static PFN_LDAP_RESULT ldap_result;
  50. static PFN_LDAP_SEARCH ldap_search;
  51. static PFN_LDAP_SEARCH_S ldap_search_s;
  52. static PFN_LDAP_SET_OPTION ldap_set_option;
  53. static PFN_LDAP_SIMPLE_BIND_S ldap_simple_bind_s;
  54. static PFN_LDAP_UNBIND ldap_unbind;
  55. static PFN_LDAP_VALUE_FREE ldap_value_free;
  56. static PFN_LDAP_MODIFY ldap_modify;
  57. static PFN_LDAP_DELETE ldap_delete;
  58. static PFN_LDAP_GET_OPTION ldap_get_option;
  59. };
  60. #endif /* _PFNWLDAP_H_ */