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.

138 lines
4.2 KiB

  1. /**********************************************************************/
  2. /** Microsoft Passport **/
  3. /** Copyright(c) Microsoft Corporation, 1999 - 2001 **/
  4. /**********************************************************************/
  5. /*
  6. registryconfig.h
  7. Define class for fetching nexus files -- e.g. partner.xml
  8. FILE HISTORY:
  9. */
  10. // RegistryConfig.h: interface for the CRegistryConfig class.
  11. //
  12. //////////////////////////////////////////////////////////////////////
  13. #if !defined(AFX_REGISTRYCONFIG_H__74EB2515_E239_11D2_95E9_00C04F8E7A70__INCLUDED_)
  14. #define AFX_REGISTRYCONFIG_H__74EB2515_E239_11D2_95E9_00C04F8E7A70__INCLUDED_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif // _MSC_VER > 1000
  18. #include "BstrHash.h"
  19. #include "CoCrypt.h"
  20. #include "ptstl.h"
  21. #include "dsysdbg.h"
  22. // logging declarations
  23. DECLARE_DEBUG2(Passport);
  24. extern BOOL g_fLoggingOn;
  25. void PassportLog(CHAR* Format, ...);
  26. void InitLogging();
  27. void CloseLogging();
  28. typedef PtStlMap<int,CCoCrypt*> INT2CRYPT;
  29. typedef PtStlMap<int,time_t> INT2TIME;
  30. class CRegistryConfig
  31. {
  32. public:
  33. CRegistryConfig(LPSTR szSiteName = NULL);
  34. virtual ~CRegistryConfig();
  35. BOOL isValid() { return m_valid; }
  36. CCoCrypt* getCrypt(int keyNum, time_t* validUntil);
  37. CCoCrypt* getCurrentCrypt() { return getCrypt(m_currentKey,NULL); }
  38. int getCurrentCryptVersion() { return m_currentKey; }
  39. int getSiteId() { return m_siteId; }
  40. // Return a description of the failure
  41. BSTR getFailureString();
  42. // Shout out to all my LISP homies
  43. BOOL forceLoginP() { return m_forceLogin; }
  44. BOOL setCookiesP() { return m_setCookies; }
  45. BOOL bInDA() { return m_bInDA; }
  46. LPSTR getHostName() { return m_hostName; }
  47. LPSTR getHostIP() { return m_hostIP; }
  48. LPSTR getTicketDomain() { return m_ticketDomain; }
  49. LPSTR getProfileDomain() { return m_profileDomain; }
  50. LPSTR getSecureDomain() { return m_secureDomain; }
  51. LPSTR getTicketPath() { return m_ticketPath; }
  52. LPSTR getProfilePath() { return m_profilePath; }
  53. LPSTR getSecurePath() { return m_securePath; }
  54. ULONG getDefaultTicketAge() { return m_ticketAge; }
  55. USHORT getDefaultLCID() { return m_lcid; }
  56. LPWSTR getDefaultCoBrand() { return m_coBrand; }
  57. LPWSTR getDefaultRU() { return m_ru; }
  58. BOOL DisasterModeP() { return m_disasterMode; }
  59. LPWSTR getDisasterUrl() { return m_disasterUrl; }
  60. int getSecureLevel(){ return m_secureLevel;};
  61. int getNotUseHTTPOnly(){ return m_notUseHTTPOnly;};
  62. int getKPP(){ return m_KPP;};
  63. LPWSTR getNameSpace(){ return m_NameSpace;};
  64. LPWSTR getExtraParams(){ return m_ExtraParams;};
  65. CRegistryConfig* AddRef();
  66. void Release();
  67. HRESULT GetCurrentConfig(LPCWSTR name, VARIANT* pVal);
  68. static long GetHostName(LPSTR szSiteName,
  69. LPSTR szHostNameBuf,
  70. LPDWORD lpdwHostNameBufLen);
  71. protected:
  72. void setReason(LPWSTR reason);
  73. BOOL readCryptoKeys(HKEY hkPassport);
  74. BOOL m_disasterMode;
  75. char* m_hostName;
  76. char* m_hostIP;
  77. WCHAR* m_disasterUrl;
  78. char* m_ticketDomain;
  79. char* m_profileDomain;
  80. char* m_secureDomain;
  81. char* m_ticketPath;
  82. char* m_profilePath;
  83. char* m_securePath;
  84. WCHAR* m_coBrand;
  85. WCHAR* m_ru;
  86. BOOL m_setCookies;
  87. ULONG m_ticketAge;
  88. BOOL m_forceLogin;
  89. BOOL m_bInDA;
  90. USHORT m_lcid;
  91. int m_KPP;
  92. WCHAR* m_NameSpace;
  93. WCHAR* m_ExtraParams;
  94. INT2CRYPT *m_pcrypts;
  95. INT2TIME *m_pcryptValidTimes;
  96. int m_currentKey;
  97. int m_siteId;
  98. BOOL m_valid;
  99. BSTR m_szReason;
  100. long m_refs;
  101. int m_secureLevel;
  102. int m_notUseHTTPOnly;
  103. HKEY m_hkPassport;
  104. };
  105. #endif // !defined(AFX_REGISTRYCONFIG_H__74EB2515_E239_11D2_95E9_00C04F8E7A70__INCLUDED_)