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.

134 lines
4.0 KiB

  1. /**********************************************************************/
  2. /** Microsoft Passport **/
  3. /** Copyright(c) Microsoft Corporation, 1999 - 2001 **/
  4. /**********************************************************************/
  5. /*
  6. NexusConfig.h
  7. Define class for fetching nexus files -- e.g. partner.xml
  8. FILE HISTORY:
  9. */
  10. // NexusConfig.h: interface for the CNexusConfig class.
  11. //
  12. //////////////////////////////////////////////////////////////////////
  13. #if !defined(AFX_NEXUSCONFIG_H__74EB2516_E239_11D2_95E9_00C04F8E7A70__INCLUDED_)
  14. #define AFX_NEXUSCONFIG_H__74EB2516_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 "ProfileSchema.h" // also imports msxml
  21. #include "TicketSchema.h" // also imports msxml
  22. #include "PassportLock.hpp"
  23. #include "ptstl.h"
  24. //
  25. // TOP FOLDER NAMES in PARTNER.XML
  26. //
  27. // folder for profile schemata
  28. #define FOLDER_PROFILE_SCHEMATA L"SCHEMATA"
  29. // folder for ticket schemas
  30. #define FOLDER_TICKET_SCHEMATA L"TICKETSCHEMATA"
  31. // folder for passport network
  32. #define FOLDER_PASSPORT_NETWORK L"PASSPORTNETWORK"
  33. //
  34. //
  35. typedef PtStlMap<USHORT,BSTR > LCID2ATTR;
  36. // if bDoLCIDReplace is true, bstrAttrVal will have the attribute value
  37. // with replacement parameters.
  38. // if bDoLCIDReplace is false, pLCIDAttrMap will point to a map of values
  39. // indexed by lcid.
  40. typedef struct
  41. {
  42. bool bDoLCIDReplace;
  43. union
  44. {
  45. LCID2ATTR* pLCIDAttrMap;
  46. BSTR bstrAttrVal;
  47. };
  48. }
  49. ATTRVAL;
  50. typedef PtStlMap<BSTR,CProfileSchema*,RawBstrLT> BSTR2PS;
  51. typedef PtStlMap<BSTR,CTicketSchema*,RawBstrLT> BSTR2TS;
  52. typedef PtStlMap<BSTR,ATTRVAL*,RawBstrLT> ATTRMAP;
  53. typedef PtStlMap<BSTR,ATTRMAP*,RawBstrLT> BSTR2DA;
  54. class CNexusConfig
  55. {
  56. public:
  57. CNexusConfig();
  58. virtual ~CNexusConfig();
  59. BSTR GetXMLInfo();
  60. // Get a profile schema by name, or the default if null is passed
  61. CProfileSchema* getProfileSchema(BSTR schemaName = NULL);
  62. // Get a ticket schema by name, or the default if null is passed
  63. CTicketSchema* getTicketSchema(BSTR schemaName = NULL);
  64. // Return a description of the failure
  65. BSTR getFailureString();
  66. BOOL isValid() { return m_valid; }
  67. // 0 is "default language", ie the entry w/o an LCID. This does NOT do
  68. // the registry fallback, etc.
  69. void getDomainAttribute(LPCWSTR domain,
  70. LPCWSTR attr,
  71. DWORD valuebuflen,
  72. LPWSTR valuebuf,
  73. USHORT lcid = 0,
  74. BOOL bNoAlt = FALSE,
  75. BOOL bExactLcid = FALSE);
  76. // Get the domain list. You should delete[] the pointer you receive
  77. LPCWSTR* getDomains(int *numDomains);
  78. // Is the domain name passed in a valid domain authority?
  79. bool DomainExists(LPCWSTR domain);
  80. CNexusConfig* AddRef();
  81. void Release();
  82. BOOL Read(IXMLDocument* is);
  83. void Dump(BSTR* pbstrDump);
  84. protected:
  85. void setReason(LPWSTR reason);
  86. // profile schemata
  87. BSTR2PS m_profileSchemata;
  88. CProfileSchema* m_defaultProfileSchema;
  89. // ticket schemata
  90. BSTR2TS m_ticketSchemata;
  91. CTicketSchema* m_defaultTicketSchema;
  92. //
  93. BSTR2DA m_domainAttributes;
  94. BOOL m_valid;
  95. BSTR m_szReason;
  96. long m_refs;
  97. static PassportLock m_ReadLock;
  98. private:
  99. _bstr_t m_bstrVersion;
  100. };
  101. #endif // !defined(AFX_NEXUSCONFIG_H__74EB2516_E239_11D2_95E9_00C04F8E7A70__INCLUDED_)