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.

98 lines
3.3 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 2000
  6. //
  7. // File: cred.h
  8. //
  9. // Contents: declarations, constants for credential manager
  10. //
  11. //
  12. // History: KDamour 15Mar00 Created
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef NTDIGEST_CRED_H
  16. #define NTDIGEST_CRED_H
  17. #define SSP_TOKEN_ACCESS (READ_CONTROL |\
  18. WRITE_DAC |\
  19. TOKEN_DUPLICATE |\
  20. TOKEN_IMPERSONATE |\
  21. TOKEN_QUERY |\
  22. TOKEN_QUERY_SOURCE |\
  23. TOKEN_ADJUST_PRIVILEGES |\
  24. TOKEN_ADJUST_GROUPS |\
  25. TOKEN_ADJUST_DEFAULT)
  26. // Values for UseFlags
  27. #define DIGEST_CRED_INBOUND SECPKG_CRED_INBOUND
  28. #define DIGEST_CRED_OUTBOUND SECPKG_CRED_OUTBOUND
  29. #define DIGEST_CRED_MATCH_FLAGS (DIGEST_CRED_INBOUND | DIGEST_CRED_OUTBOUND)
  30. #define DIGEST_CRED_NULLSESSION SECPKG_CRED_RESERVED
  31. // Supplimental Credential format (provide a specified username, realm, password)
  32. // to
  33. // Initializes the credential manager package
  34. NTSTATUS CredHandlerInit(VOID);
  35. // Inserts a credential into the linked list
  36. NTSTATUS CredHandlerInsertCred(IN PDIGEST_CREDENTIAL pDigestCred);
  37. // Initialize the Credential Structure
  38. NTSTATUS CredentialInit(IN PDIGEST_CREDENTIAL pDigestCred);
  39. // Initialize the Credential Structure
  40. NTSTATUS CredentialFree(IN PDIGEST_CREDENTIAL pDigestCred);
  41. // This routine checks to see if the Credential Handle is from a currently
  42. // active client, and references the Credential if it is valid.
  43. // No need to specify UseFlags since we have a reference to the Credential
  44. NTSTATUS CredHandlerHandleToPtr(
  45. IN ULONG_PTR CredentialHandle,
  46. IN BOOLEAN DereferenceCredential,
  47. OUT PDIGEST_CREDENTIAL * UserCredential);
  48. // Locate a Credential based on the LogonId & ProcessID
  49. NTSTATUS CredHandlerLocatePtr(
  50. IN PLUID pLogonId,
  51. IN ULONG CredentialUseFlags,
  52. OUT PDIGEST_CREDENTIAL * UserCredential);
  53. // Releases the Credential by decreasing reference counter
  54. NTSTATUS CredHandlerRelease(PDIGEST_CREDENTIAL pCredential);
  55. // Set the unicode string password in the credential
  56. NTSTATUS CredHandlerPasswdSet(
  57. IN OUT PDIGEST_CREDENTIAL pCredential,
  58. IN PUNICODE_STRING pustrPasswd);
  59. // Get the unicode string password in the credential
  60. NTSTATUS CredHandlerPasswdGet(
  61. IN PDIGEST_CREDENTIAL pCredential,
  62. OUT PUNICODE_STRING pustrPasswd);
  63. NTSTATUS SspGetToken (OUT PHANDLE ReturnedTokenHandle);
  64. SECURITY_STATUS SspDuplicateToken(
  65. IN HANDLE OriginalToken,
  66. IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  67. OUT PHANDLE DuplicatedToken);
  68. // Print out the credential information
  69. NTSTATUS CredPrint(PDIGEST_CREDENTIAL pCredential);
  70. // Extract the authz information from supplied buffer
  71. NTSTATUS CredAuthzData(
  72. IN PVOID pAuthorizationData,
  73. IN PSECPKG_CALL_INFO pCallInfo,
  74. IN OUT PULONG NewCredentialUseFlags,
  75. IN OUT PUNICODE_STRING pUserName,
  76. IN OUT PUNICODE_STRING pDomainName,
  77. IN OUT PUNICODE_STRING pPassword);
  78. #endif // NTDIGEST_CRED_H