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.

130 lines
2.9 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation, 1998 - 1999
  4. Module Name:
  5. ChangeNotification.h
  6. Abstract:
  7. Declaration of the CChangeNotification class.
  8. Several of the MMC notification mechanisms accept on one or two parameters for
  9. sending information.
  10. For example, MMCPropertyChangeNotify accepts only one long param handle which
  11. can be used to send information back to the main snapin from the separate
  12. thread in which a property page runs.
  13. Sometimes, this isn't enough information, so this structure allows us
  14. to encapsulate more information to pass around.
  15. This is all inline -- there is no implementation file.
  16. Revision History:
  17. mmaguire 07/17/98 - based on Baogang Yao's original implementation
  18. --*/
  19. //////////////////////////////////////////////////////////////////////////////
  20. #if !defined(_CHANGE_NOTIFICATION_H_)
  21. #define _CHANGE_NOTIFICATION_H_
  22. //////////////////////////////////////////////////////////////////////////////
  23. // BEGIN INCLUDES
  24. //
  25. // where we can find what this class derives from:
  26. //
  27. //
  28. // where we can find what this class has or uses:
  29. //
  30. //
  31. // END INCLUDES
  32. //////////////////////////////////////////////////////////////////////////////
  33. // Notification flags:
  34. // No special handling required.
  35. const DWORD CHANGE_UPDATE_RESULT_NODE = 0x00;
  36. // The policy name for this node has been changed. This is used for renaming of policy.
  37. const DWORD CHANGE_PARENT_MUST_BE_UPDATED_TOO = 0x01;
  38. // The policy name for this node has been changed. This is used for renaming of policy.
  39. const DWORD CHANGE_NAME = 0x02;
  40. // Some information has changed -- e.g. Connect action finished. Make sure the result view
  41. // of the currently selected scope node is updated.
  42. const DWORD CHANGE_UPDATE_CHILDREN_OF_SELECTED_NODE = 0x04;
  43. // Make sure the result view of the currently selected scope node is updated.
  44. const DWORD CHANGE_UPDATE_CHILDREN_OF_THIS_NODE = 0x08;
  45. // Will require a parent redraw and some selection changes.
  46. const DWORD CHANGE_RESORT_PARENT = 0x10;
  47. class CChangeNotification
  48. {
  49. public:
  50. // What kind of notitification.
  51. DWORD m_dwFlags;
  52. // Which node was affected.
  53. CSnapInItem * m_pNode;
  54. // The parent node of the node which changed.
  55. CSnapInItem * m_pParentNode;
  56. // Extra data.
  57. DWORD m_dwParam;
  58. // A string -- can be used however needed.
  59. CComBSTR m_bstrStringInfo;
  60. // Constructor -- set ref count to 1.
  61. CChangeNotification( void )
  62. {
  63. m_lRefs = 1;
  64. }
  65. // COM-style lifetime management.
  66. LONG AddRef( void )
  67. {
  68. return InterlockedIncrement( &m_lRefs );
  69. }
  70. // COM-style lifetime management.
  71. LONG Release( void )
  72. {
  73. LONG lRefCount = InterlockedDecrement( &m_lRefs );
  74. if( 0 == lRefCount )
  75. {
  76. delete this;
  77. }
  78. return lRefCount;
  79. }
  80. private:
  81. LONG m_lRefs;
  82. };
  83. #endif // _CHANGE_NOTIFICATION_H_