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.

122 lines
1.9 KiB

  1. /*++
  2. Copyright (C) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. smnode.cpp
  5. Abstract:
  6. Implements the MMC user interface node base class.
  7. --*/
  8. #include "Stdafx.h"
  9. #include "smnode.h"
  10. USE_HANDLE_MACROS("SMLOGCFG(smnode.cpp)");
  11. //
  12. // Constructor
  13. CSmNode::CSmNode()
  14. : m_pParentNode ( NULL )
  15. {
  16. return;
  17. }
  18. //
  19. // Destructor
  20. CSmNode::~CSmNode()
  21. {
  22. return;
  23. }
  24. const CString&
  25. CSmNode::GetDisplayName()
  26. {
  27. return m_strName;
  28. }
  29. const CString&
  30. CSmNode::GetMachineName()
  31. {
  32. return m_strMachineName;
  33. }
  34. const CString&
  35. CSmNode::GetMachineDisplayName()
  36. {
  37. return m_strMachineDisplayName;
  38. }
  39. const CString&
  40. CSmNode::GetDescription()
  41. {
  42. return m_strDesc;
  43. }
  44. const CString&
  45. CSmNode::GetType()
  46. {
  47. return m_strType;
  48. }
  49. DWORD
  50. CSmNode::SetDisplayName( const CString& rstrName )
  51. {
  52. DWORD dwStatus = ERROR_SUCCESS;
  53. MFC_TRY
  54. m_strName = rstrName;
  55. MFC_CATCH_DWSTATUS
  56. return dwStatus;
  57. }
  58. DWORD
  59. CSmNode::SetMachineName( const CString& rstrMachineName )
  60. {
  61. DWORD dwStatus = ERROR_SUCCESS;
  62. MFC_TRY
  63. m_strMachineName = rstrMachineName;
  64. if ( !rstrMachineName.IsEmpty() ) {
  65. m_strMachineDisplayName = rstrMachineName;
  66. } else {
  67. m_strMachineDisplayName.LoadString ( IDS_LOCAL );
  68. }
  69. MFC_CATCH_DWSTATUS
  70. return dwStatus;
  71. }
  72. void
  73. CSmNode::SetDescription( const CString& rstrDesc )
  74. {
  75. // This method is only called within the node constructor,
  76. // so throw any errors
  77. m_strDesc = rstrDesc;
  78. return;
  79. }
  80. DWORD
  81. CSmNode::SetType( const CString& rstrType )
  82. {
  83. DWORD dwStatus = ERROR_SUCCESS;
  84. MFC_TRY
  85. m_strType = rstrType;
  86. MFC_CATCH_DWSTATUS
  87. return dwStatus;
  88. }
  89. BOOL
  90. CSmNode::IsLocalMachine( void )
  91. {
  92. BOOL bLocal = m_strMachineName.IsEmpty();
  93. return bLocal;
  94. }