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.

91 lines
2.1 KiB

  1. #define STRDEF(s, d) (s && (s)[0] != '\0')?(s):(d)
  2. #define LIST_HEAD(name, type) \
  3. struct name { \
  4. struct type *lh_first; /* first element */ \
  5. }
  6. #define LIST_ENTRY(type) \
  7. struct { \
  8. struct type *le_next; /* next element */ \
  9. struct type **le_prev; /* address of previous next element */ \
  10. }
  11. #define LIST_INIT(head) { \
  12. (head)->lh_first = NULL; \
  13. }
  14. #define LIST_INSERT_HEAD(head, elm, field) { \
  15. if (((elm)->field.le_next = (head)->lh_first) != NULL) \
  16. (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
  17. (head)->lh_first = (elm); \
  18. (elm)->field.le_prev = &(head)->lh_first; \
  19. }
  20. #define LIST_REMOVE(elm, field) { \
  21. if ((elm)->field.le_next != NULL) \
  22. (elm)->field.le_next->field.le_prev = \
  23. (elm)->field.le_prev; \
  24. *(elm)->field.le_prev = (elm)->field.le_next; \
  25. }
  26. struct name_list {
  27. LIST_ENTRY(name_list) list;
  28. LPTSTR name;
  29. };
  30. typedef struct name_list name_list_t;
  31. #define NewNameList() \
  32. (name_list_t *)calloc(sizeof(name_list_t), 1)
  33. struct krb5_realm {
  34. LIST_ENTRY(krb5_realm) list;
  35. LIST_HEAD(kdc, name_list) kdc;
  36. LIST_HEAD(kpasswd, name_list) kpasswd;
  37. LIST_HEAD(altname, name_list) altname;
  38. DWORD realm_flags;
  39. DWORD ap_req_chksum;
  40. DWORD preauth_type;
  41. TCHAR name[1];
  42. };
  43. typedef struct krb5_realm krb5_realm_t;
  44. #define NewRealm(l) (krb5_realm_t *)calloc(sizeof(krb5_realm_t) + (l*sizeof(TCHAR)), 1)
  45. struct krb5_rgy {
  46. LIST_HEAD(realms, krb5_realm) realms;
  47. };
  48. typedef struct krb5_rgy krb5_rgy_t;
  49. struct enctype_entry
  50. {
  51. const struct enctype_lookup_entry *ktt;
  52. BOOL used;
  53. };
  54. typedef struct enctype_entry enctype_entry_t;
  55. #define REGKEY TEXT("system\\currentcontrolset\\control\\lsa\\kerberos")
  56. #ifndef REG_SZ
  57. #define REG_SZ 0x0001
  58. #endif
  59. #ifndef REG_BINARY
  60. #define REG_BINARY 0x0003
  61. #endif
  62. #ifndef REG_DWORD
  63. #define REG_DWORD 0x0004
  64. #endif
  65. #ifndef REG_MULTI_SZ
  66. #define REG_MULTI_SZ 0x0007
  67. #endif
  68. #ifndef HKEY_LOCAL_MACHINE
  69. #define HKEY_LOCAL_MACHINE 0x80000002
  70. #define HKEY_DYN_DATA 0x80000006
  71. #endif
  72. UINT Krb5NdiCreate(void);
  73. UINT Krb5NdiInstall(krb5_rgy_t*);
  74. UINT Krb5NdiDestroy(krb5_rgy_t*);