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.

84 lines
2.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998
  5. //
  6. // File: rootnode.cxx
  7. //
  8. // Contents: snapin extension root node.
  9. //
  10. // History: 6-16-98 mohamedn created
  11. //
  12. //--------------------------------------------------------------------------
  13. #include <pch.cxx>
  14. #pragma hdrstop
  15. #include <rootnode.hxx>
  16. //+---------------------------------------------------------------------------
  17. //
  18. // Member: CRootNode::Display, public
  19. //
  20. // Synopsis: Inserts the root node item in the scope pane.
  21. //
  22. // Arguments: [hScopeItem] -- handle to parent scope item
  23. //
  24. // Returns: none.
  25. //
  26. // History: 01-Jul-1998 mohamedn created
  27. //
  28. //----------------------------------------------------------------------------
  29. void CRootNode::Display( HSCOPEITEM hScopeItem )
  30. {
  31. SCOPEDATAITEM item;
  32. RtlZeroMemory( &item, sizeof(item) );
  33. item.mask |= SDI_STR | SDI_IMAGE | SDI_OPENIMAGE;
  34. item.nImage = item.nOpenImage = ICON_APP;
  35. item.displayname = MMC_CALLBACK;
  36. item.mask |= SDI_PARAM;
  37. item.lParam = (LPARAM)this;
  38. item.relativeID = hScopeItem;
  39. HRESULT hr = _pScopePane->InsertItem( &item );
  40. if ( FAILED(hr) )
  41. {
  42. ciaDebugOut(( DEB_ERROR, "_pScopePane->InsertItem() Failed, hr: %x\n", hr ));
  43. THROW( CException(hr) );
  44. }
  45. _idScope = item.ID;
  46. _idParent = hScopeItem;
  47. }
  48. //+---------------------------------------------------------------------------
  49. //
  50. // Member: CRootNode::Delete, public
  51. //
  52. // Synopsis: Deletes root node from scope pane.
  53. //
  54. // History: 27-Jul-1998 KyleP Created
  55. //
  56. // Notes: Called when MMCN_REMOVE_CHILDREN sent to snap-in.
  57. //
  58. //----------------------------------------------------------------------------
  59. SCODE CRootNode::Delete()
  60. {
  61. SCODE sc = S_OK;
  62. if ( -1 != _idScope )
  63. {
  64. sc = _pScopePane->DeleteItem( _idScope, TRUE );
  65. _idScope = -1;
  66. _idParent = -1;
  67. }
  68. return sc;
  69. }