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.

130 lines
2.9 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1992 - 1996
  6. //
  7. // File: credmgr.h
  8. //
  9. // Contents: Structures and prototyps for Kerberos credential list
  10. //
  11. //
  12. // History: 17-April-1996 Created MikeSw
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __CREDMGR_H__
  16. #define __CREDMGR_H__
  17. //
  18. // All global variables declared as EXTERN will be allocated in the file
  19. // that defines CREDMGR_ALLOCATE
  20. //
  21. #ifdef EXTERN
  22. #undef EXTERN
  23. #endif
  24. #ifdef CREDMGR_ALLOCATE
  25. #define EXTERN
  26. #else
  27. #define EXTERN extern
  28. #endif
  29. EXTERN KERBEROS_LIST KerbCredentialList;
  30. EXTERN BOOLEAN KerberosCredentialsInitialized;
  31. #define KerbGetCredentialHandle(_Credential_) ((LSA_SEC_HANDLE)(_Credential_))
  32. NTSTATUS
  33. KerbInitCredentialList(
  34. VOID
  35. );
  36. VOID
  37. KerbFreeCredentialList(
  38. VOID
  39. );
  40. NTSTATUS
  41. KerbAllocateCredential(
  42. PKERB_CREDENTIAL * NewCredential
  43. );
  44. NTSTATUS
  45. KerbInsertCredential(
  46. IN PKERB_CREDENTIAL Credential
  47. );
  48. NTSTATUS
  49. KerbReferenceCredential(
  50. IN LSA_SEC_HANDLE CredentialHandle,
  51. IN ULONG Flags,
  52. IN BOOLEAN RemoveFromList,
  53. OUT PKERB_CREDENTIAL * Credential
  54. );
  55. VOID
  56. KerbDereferenceCredential(
  57. IN PKERB_CREDENTIAL Credential
  58. );
  59. VOID
  60. KerbPurgeCredentials(
  61. IN PLIST_ENTRY CredentialList
  62. );
  63. NTSTATUS
  64. KerbCreateCredential(
  65. IN PLUID LogonId,
  66. IN PKERB_LOGON_SESSION LogonSession,
  67. IN ULONG CredentialUseFlags,
  68. IN PKERB_PRIMARY_CREDENTIAL * SuppliedCredentials,
  69. IN ULONG CredentialFlags,
  70. IN PUNICODE_STRING CredentialName,
  71. OUT PKERB_CREDENTIAL * NewCredential,
  72. OUT PTimeStamp ExpirationTime
  73. );
  74. VOID
  75. KerbFreePrimaryCredentials(
  76. IN PKERB_PRIMARY_CREDENTIAL Credentials,
  77. IN BOOLEAN FreeBaseStructure
  78. );
  79. NTSTATUS
  80. KerbGetTicketForCredential(
  81. IN OPTIONAL PKERB_LOGON_SESSION LogonSession,
  82. IN PKERB_CREDENTIAL Credential,
  83. IN OPTIONAL PKERB_CREDMAN_CRED CredManCredentials,
  84. IN OPTIONAL PUNICODE_STRING SuppRealm
  85. );
  86. //
  87. // Credential flags
  88. //
  89. #define KERB_CRED_INBOUND SECPKG_CRED_INBOUND
  90. #define KERB_CRED_OUTBOUND SECPKG_CRED_OUTBOUND
  91. #define KERB_CRED_BOTH SECPKG_CRED_BOTH
  92. #define KERB_CRED_TGT_AVAIL 0x80000000
  93. #define KERB_CRED_NO_PAC 0x40000000
  94. #define KERB_CRED_RESTRICTED 0x10000000
  95. #define KERB_CRED_S4U_REQUIRED 0x01000000
  96. #define KERB_CRED_LOCATE_ONLY 0x04000000 // Don't update the supplied credentials. Used for S4UToSelf location only.
  97. #define KERB_CRED_LOCAL_ACCOUNT 0x08000000 // set on local accounts so Cred Man may be used
  98. #define KERB_CRED_NULL_SESSION 0x20000000
  99. #define KERB_CRED_LS_DEFAULT 0x00100000
  100. #define KERB_CRED_MATCH_FLAGS (KERB_CRED_INBOUND | KERB_CRED_OUTBOUND | KERB_CRED_NULL_SESSION | KERB_CRED_NO_PAC)
  101. #endif // __CREDMGR_H__