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.

127 lines
4.2 KiB

  1. /*****************************************************************************
  2. Copyright information : Copyright (c) 1998-1999 Microsoft Corporation
  3. File Name : CmdAlias.h
  4. Project Name : WMI Command Line
  5. Author Name : Ch.Sriramachandramurthy
  6. Date of Creation (dd/mm/yy) : 27th-September-2000
  7. Version Number : 1.0
  8. Brief Description : This file consist of class declaration of
  9. class CmdAlias
  10. Revision History : None
  11. Last Modified By : C V Nandi
  12. Last Modified Date : 16-March-2001
  13. *****************************************************************************/
  14. /*----------------------------------------------------------------------------
  15. Class Name : CCmdAlias
  16. Class Type : Concrete
  17. Brief Description : This class encapsulates the functionality needed for
  18. accessing the alias information from the WMI.
  19. Super Classes : None
  20. Sub Classes : None
  21. Classes Used : None
  22. Interfaces Used : WMI COM Interfaces
  23. ---------------------------------------------------------------------------*/
  24. // Forward declaration of the classes
  25. class CParsedInfo;
  26. class CCmdAlias
  27. {
  28. public:
  29. // Construction
  30. CCmdAlias();
  31. // Destruction
  32. ~CCmdAlias();
  33. // Restrict Assignment
  34. CCmdAlias& operator=(CCmdAlias& rAliasObj);
  35. // Attributes
  36. private:
  37. // Points to the alias definitions namespace.
  38. IWbemServices* m_pIAliasNS;
  39. // Pointer to localized Namespace.
  40. IWbemServices* m_pILocalizedNS;
  41. // Trace flag.
  42. BOOL m_bTrace;
  43. // Error log option.
  44. ERRLOGOPT m_eloErrLogOpt;
  45. // Operations
  46. private:
  47. // Obtain the alias connection information like
  48. // 1. namespace 2. user 3. password
  49. // 4. locale 5. server 6. authority
  50. RETCODE ObtainAliasConnectionInfo(CParsedInfo& rParsedInfo,
  51. IWbemClassObject* pIObj);
  52. // Obtain Qualifiers associated with the IWbemClassObject.
  53. HRESULT GetQualifiers(IWbemClassObject *pIWbemClassObject,
  54. PROPERTYDETAILS& rPropDet,
  55. CParsedInfo& rParsedInfo);
  56. public:
  57. // Obtains all the Friendly Names and descriptions
  58. HRESULT ObtainAliasFriendlyNames(CParsedInfo& rParsedInfo);
  59. // Obtains the verbs and their details
  60. // associated with the alias object
  61. HRESULT ObtainAliasVerbDetails(CParsedInfo& rParsedInfo);
  62. // Obtains the verbs and their descriptions
  63. // associated with the alias object
  64. // pbCheckWritePropsAvailInAndOut == TRUE then functions checks for
  65. // availibility of properties and returns in the same
  66. // pbCheckWritePropsAvailInAndOut parameter.
  67. HRESULT ObtainAliasPropDetails(CParsedInfo& rParsedInfo,
  68. BOOL *pbCheckWritePropsAvailInAndOut = NULL,
  69. BOOL *pbCheckFULLPropsAvailInAndOut = NULL);
  70. // Obtains the properties for the Format associated with the alias object.
  71. // If bCheckForListFrmsAvail == TRUE then functions checks only for
  72. // availibilty of list formats with the alias.
  73. BOOL ObtainAliasFormat(CParsedInfo& rParsedInfo,
  74. BOOL bCheckForListFrmsAvail = FALSE);
  75. // Obtains the formats available for a given alias.
  76. HRESULT PopulateAliasFormatMap(CParsedInfo& rParsedInfo);
  77. // Connects to WMI with alias namespace .
  78. HRESULT ConnectToAlias(CParsedInfo& rParsedInfo,
  79. IWbemLocator* pIWbemLocator);
  80. // Obtain the alias information like
  81. // 1. alias PWhere expression value
  82. // 2. alias Target string
  83. RETCODE ObtainAliasInfo(CParsedInfo& rParsedInfo);
  84. // Get Description from object.
  85. HRESULT GetDescOfObject(IWbemClassObject* pIWbemClassObject,
  86. _bstr_t& bstrDescription,
  87. CParsedInfo& rParsedInfo,
  88. BOOL bLocalizeFlag = FALSE);
  89. // Obtains the Translate Table Entries.
  90. BOOL ObtainTranslateTableEntries(CParsedInfo& rParsedInfo);
  91. // Obtains translate table entries from alias definition.
  92. HRESULT ObtainTranslateTables(CParsedInfo& rParsedInfo);
  93. // Get the localized description values
  94. HRESULT GetLocalizedDesc(_bstr_t bstrRelPath,
  95. _bstr_t& bstrDesc,
  96. CParsedInfo& rParsedInfo);
  97. // Connect to the localized namespace.
  98. HRESULT ConnectToLocalizedNS(CParsedInfo&, IWbemLocator* pILocator);
  99. // Checks whether method are available with alias or not.
  100. BOOL AreMethodsAvailable(CParsedInfo& rParsedInfo);
  101. //Uninitializes the the member variables
  102. void Uninitialize(BOOL bFinal = FALSE);
  103. };