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.

118 lines
3.2 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright (c) 1998-1999 Microsoft Corporation
  4. //
  5. // File: parsedn.h
  6. //
  7. // Description :
  8. // The implementation of IParseDisplayName
  9. //
  10. //***************************************************************************
  11. #ifndef _PARSEDN_H_
  12. #define _PARSEDN_H_
  13. //***************************************************************************
  14. //
  15. // Class : CWbemParseDN
  16. //
  17. // Description :
  18. // Implements the IParseDisplayName interface, which parses
  19. // CIM object paths and returns a pointer to the requested object
  20. //
  21. // Public Methods :
  22. // IUnknown Methods
  23. // IParseDisplayName Methods
  24. // Constructor, Destructor
  25. // CreateProvider - creates an object of this class
  26. //
  27. // Public Data Members :
  28. //
  29. //***************************************************************************
  30. class CWbemParseDN : public IParseDisplayName
  31. {
  32. private:
  33. long m_cRef;
  34. static bool ParseAuthAndImpersonLevel (
  35. LPWSTR lpszInputString,
  36. ULONG* pchEaten,
  37. bool &authnSpecified,
  38. enum WbemAuthenticationLevelEnum *lpeAuthLevel,
  39. bool &impSpecified,
  40. enum WbemImpersonationLevelEnum *lpeImpersonLevel,
  41. CSWbemPrivilegeSet &privilegeSet,
  42. BSTR &bsAuthority);
  43. static bool ParseImpersonationLevel (
  44. LPWSTR lpszInputString,
  45. ULONG* pchEaten,
  46. enum WbemImpersonationLevelEnum *lpeImpersonLevel);
  47. static bool ParseAuthenticationLevel (
  48. LPWSTR lpszInputString,
  49. ULONG* pchEaten,
  50. enum WbemAuthenticationLevelEnum *lpeAuthLevel);
  51. static bool ParsePrivilegeSet (
  52. LPWSTR lpszInputString,
  53. ULONG *pchEaten,
  54. CSWbemPrivilegeSet &privilegeSet);
  55. static bool ParseAuthority (
  56. LPWSTR lpszInputString,
  57. ULONG *pchEaten,
  58. BSTR &bsAuthority);
  59. public:
  60. //IUnknown members
  61. STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  62. STDMETHODIMP_(ULONG) AddRef(void);
  63. STDMETHODIMP_(ULONG) Release(void);
  64. //IParseDisplayName members
  65. STDMETHODIMP ParseDisplayName (IBindCtx* pbc,
  66. LPOLESTR szDisplayName,
  67. ULONG* pchEaten,
  68. IMoniker** ppmk);
  69. CWbemParseDN::CWbemParseDN();
  70. virtual CWbemParseDN::~CWbemParseDN();
  71. // Used for parsing the authentication and impersonation levels.
  72. static bool ParseSecurity (
  73. LPWSTR lpszInputString,
  74. ULONG* pchEaten,
  75. bool &authnSpecified,
  76. enum WbemAuthenticationLevelEnum *lpeAuthLevel,
  77. bool &impSpecified,
  78. enum WbemImpersonationLevelEnum *lpeImpersonLevel,
  79. CSWbemPrivilegeSet &privilegeSet,
  80. BSTR &bsAuthority);
  81. // Used for parsing the locale setting.
  82. static bool ParseLocale (
  83. LPWSTR lpszInputString,
  84. ULONG *pchEaten,
  85. BSTR &bsLocale);
  86. // Used to return security specification as a string
  87. static wchar_t *GetSecurityString (
  88. bool authnSpecified,
  89. enum WbemAuthenticationLevelEnum authnLevel,
  90. bool impSpecified,
  91. enum WbemImpersonationLevelEnum impLevel,
  92. CSWbemPrivilegeSet &privilegeSet,
  93. BSTR &bsAuthority
  94. );
  95. // Used to return locale specification as a string
  96. static wchar_t *GetLocaleString (
  97. BSTR bsLocale
  98. );
  99. };
  100. #endif //_PARSEDN_H_