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.

141 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. logon.h
  5. Abstract:
  6. This interface abstracts a Passport Logon Session.
  7. Author:
  8. Biao Wang (biaow) 01-Oct-2000
  9. --*/
  10. #ifndef LOGON_H
  11. #define LOGON_H
  12. #include "xstring.h"
  13. void DecryptPassword ( WCHAR* pClearPassword, PVOID pPassword, DWORD cbSize );
  14. class SESSION;
  15. class LOGON
  16. {
  17. public:
  18. LOGON(SESSION*, DWORD dwParentFlags);
  19. virtual ~LOGON(void);
  20. BOOL Open(PCWSTR pwszPartnerInfo);
  21. void Close(void);
  22. BOOL SetCredentials(
  23. PCWSTR pwszRealm,
  24. PCWSTR pwszTarget,
  25. PCWSTR pwszSignIn,
  26. PCWSTR pwszPassword,
  27. PSYSTEMTIME pTimeCredsEntered
  28. );
  29. BOOL GetLogonHost(
  30. PWSTR pwszHostName,
  31. OUT PDWORD pdwHostNameLen
  32. ) const;
  33. DWORD Logon(BOOL fAnonymous);
  34. PLIST_ENTRY GetPrivacyEvents(void) const { return (PLIST_ENTRY)&m_PrivacyEventList; }
  35. BOOL GetChallengeInfo(
  36. HBITMAP* phBitmap,
  37. PBOOL pfPrompt,
  38. PWSTR pwszCbText,
  39. PDWORD pdwTextLen,
  40. PWSTR pwszRealm,
  41. DWORD dwMaxRealmLen,
  42. PWSTR pwszReqUserName,
  43. PDWORD pdwReqUserNameLen
  44. ) const;
  45. BOOL GetChallengeContent(
  46. PBYTE pContent,
  47. OUT PDWORD pdwContentLen
  48. ) const;
  49. BOOL GetAuthorizationInfo(
  50. PWSTR pwszTicket, // e.g. "from-PP = ..."
  51. PDWORD pdwTicketLen,
  52. PBOOL pfKeepVerb, // if TRUE, no data will be copied into pwszUrl
  53. PWSTR pwszUrl, // user supplied buffer ...
  54. PDWORD pdwUrlLen // ... and length (will be updated to actual length
  55. // on successful return)
  56. ) const;
  57. VOID StatusCallback(
  58. IN HINTERNET hInternet,
  59. IN DWORD dwInternetStatus,
  60. IN LPVOID lpvStatusInformation,
  61. IN DWORD dwStatusInformationLength);
  62. protected:
  63. void GetCachedCreds(
  64. PCWSTR pwszRealm,
  65. PCWSTR pwszTarget,
  66. PCREDENTIALW** pppCreds,
  67. DWORD* pdwCreds
  68. );
  69. BOOL DownLoadCoBrandBitmap(
  70. PWSTR pwszChallenge
  71. );
  72. DWORD Handle401FromDA(
  73. HINTERNET hRequest,
  74. BOOL fTicketRequest
  75. );
  76. DWORD Handle200FromDA(
  77. HINTERNET hRequest
  78. );
  79. void CheckForVersionChange(
  80. HINTERNET hRequest
  81. );
  82. protected:
  83. SESSION* m_pSession;
  84. HINTERNET m_hConnect;
  85. BOOL m_fCredsPresent;
  86. PWSTR m_pwszSignIn;
  87. CSecureStr m_Password;
  88. WCHAR m_wNewDAUrl[1024];
  89. PWSTR m_pwszTicketRequest;
  90. PWSTR m_pwszAuthInfo;
  91. PWSTR m_pwszReturnUrl;
  92. // PWSTR m_pwszCbUrl;
  93. BOOL m_fWhistler;
  94. HBITMAP m_hBitmap;
  95. BOOL m_fPrompt;
  96. WCHAR m_wRealm[128];
  97. WCHAR m_wTimeSkew[16];
  98. PWSTR m_pwszAuthHeader;
  99. DWORD m_dwParentFlags;
  100. PWSTR m_pwszCbtxt;
  101. WCHAR m_wDAHostName[256];
  102. LPSTREAM m_p401Content;
  103. SYSTEMTIME m_TimeCredsEntered;
  104. LIST_ENTRY m_PrivacyEventList;
  105. };
  106. #endif // LOGON_H