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.

149 lines
2.5 KiB

  1. #ifndef _CREDEN_HXX_
  2. #define _CREDEN_HXX_
  3. typedef LONG NTSTATUS;
  4. typedef NTSTATUS SECURITY_STATUS;
  5. #include <ntsecapi.h>
  6. #define STRINGIZE(y) _STRINGIZE_helper(y)
  7. #define _STRINGIZE_helper(z) #z
  8. extern "C" {
  9. typedef VOID (*FNRTLINITUNICODESTRING) (
  10. PUNICODE_STRING DestinationString,
  11. PCWSTR SourceString
  12. );
  13. typedef VOID (*FRTLRUNENCODEUNICODESTRING) (
  14. PUCHAR Seed,
  15. PUNICODE_STRING String
  16. );
  17. typedef VOID (*FRTLRUNDECODEUNICODESTRING) (
  18. UCHAR Seed,
  19. PUNICODE_STRING String
  20. );
  21. typedef NTSTATUS (*FRTLENCRYPTMEMORY) (
  22. PVOID Memory,
  23. ULONG MemoryLength,
  24. ULONG OptionFlags
  25. );
  26. typedef NTSTATUS (*FRTLDECRYPTMEMORY) (
  27. PVOID Memory,
  28. ULONG MemoryLength,
  29. ULONG OptionFlags
  30. );
  31. /*
  32. NTSTATUS
  33. RtlEncryptMemory(
  34. IN OUT PVOID Memory,
  35. IN ULONG MemoryLength
  36. );
  37. NTSTATUS
  38. RtlDecryptMemory(
  39. IN OUT PVOID Memory,
  40. IN ULONG MemoryLength
  41. );
  42. */
  43. } // extern "C"
  44. class CCredentials;
  45. class CCredentials
  46. {
  47. public:
  48. CCredentials::CCredentials();
  49. CCredentials::CCredentials(
  50. LPWSTR lpszUserName,
  51. LPWSTR lpszPassword,
  52. DWORD dwAuthFlags
  53. );
  54. CCredentials::CCredentials(
  55. const CCredentials& Credentials
  56. );
  57. CCredentials::~CCredentials();
  58. HRESULT
  59. CCredentials::GetUserName(
  60. LPWSTR * lppszUserName
  61. );
  62. HRESULT
  63. CCredentials::GetPassword(
  64. LPWSTR * lppszPassword
  65. );
  66. HRESULT
  67. CCredentials::SetUserName(
  68. LPWSTR lpszUserName
  69. );
  70. HRESULT
  71. CCredentials::SetPassword(
  72. LPWSTR lpszPassword
  73. );
  74. void
  75. CCredentials::operator=(
  76. const CCredentials& other
  77. );
  78. friend BOOL
  79. operator==(
  80. CCredentials& x,
  81. CCredentials& y
  82. );
  83. BOOL
  84. CCredentials::IsNullCredentials(
  85. );
  86. DWORD
  87. CCredentials::GetAuthFlags(
  88. );
  89. void
  90. CCredentials::SetAuthFlags(
  91. DWORD dwAuthFlags
  92. );
  93. private:
  94. LPWSTR _lpszUserName;
  95. LPWSTR _lpszPassword;
  96. DWORD _dwAuthFlags;
  97. DWORD _dwPasswordLen;
  98. };
  99. #endif // ifndef _CREDEN_HXX_