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.

128 lines
2.5 KiB

  1. //*************************************************************
  2. //
  3. // Copyright (c) Microsoft Corporation 1998-2001
  4. // All rights reserved
  5. //
  6. // conflict.hxx
  7. //
  8. //*************************************************************
  9. #if !defined (_CONFLICT_HXX_)
  10. #define _CONFLICT_HXX_
  11. #define REPORT_ATTRIBUTE_SET_STATUS( x , y ) \
  12. { \
  13. if (FAILED( y )) \
  14. { \
  15. DebugMsg((DM_VERBOSE, IDS_RSOP_SETVAL_FAIL, x, y)); \
  16. } \
  17. }
  18. #define RELATIVE_PATH_FORMAT RSOP_MANAGED_SOFTWARE_APPLICATION L"." \
  19. APP_ATTRIBUTE_ENTRYTYPE L"=%d," \
  20. RSOP_ATTRIBUTE_ID L"=\"%s\"," \
  21. APP_ATTRIBUTE_APPID L"=\"%s\"," \
  22. RSOP_ATTRIBUTE_PRECEDENCE L"=%d"
  23. class CAppInfo; // forward declaration
  24. class CManagedAppProcessor; // forward declaration
  25. class CConflict : public CListItem, public CPolicyRecord
  26. {
  27. public:
  28. friend class CConflictList;
  29. friend class CConflictTable;
  30. CConflict( CAppInfo* pAppInfo,
  31. CAppInfo* pWinner = NULL,
  32. DWORD dwReason = 0,
  33. LONG Precedence = 1 );
  34. ~CConflict();
  35. HRESULT
  36. Write();
  37. HRESULT
  38. GetPath( WCHAR* wszPath, DWORD* pchLength );
  39. HRESULT
  40. SetConflictId( WCHAR* pwszConflictId );
  41. WCHAR* GetConflictId()
  42. {
  43. return _pwszConflictId;
  44. }
  45. CAppInfo*
  46. GetApp()
  47. {
  48. return _pAppInfo;
  49. }
  50. HRESULT
  51. LogFailure();
  52. private:
  53. CAppInfo* _pAppInfo;
  54. WCHAR* _pwszConflictId; // Identifier for instances that are part of the same RSoP conflict list
  55. LONG _Precedence; // Rsop precedence -- only valid for read during Write method execution
  56. DWORD _PrecedenceReason;
  57. CAppInfo* _pWinner;
  58. };
  59. class CConflictList : public CList
  60. {
  61. public:
  62. ~CConflictList();
  63. LONG
  64. AddConflict( CAppInfo* pAppInfo, CAppInfo* pWinner, DWORD dwReason, LONG Precedence = 1 );
  65. };
  66. class CConflictTable
  67. {
  68. public:
  69. CConflictTable();
  70. LONG
  71. AddConflict(
  72. CAppInfo* pAppInfo,
  73. CAppInfo* pWinnner,
  74. DWORD dwReason,
  75. LONG Precedence = 1 );
  76. void
  77. Reset();
  78. CConflict*
  79. GetNextConflict( LONG* pCurrentPrecedence = NULL );
  80. LONG
  81. GenerateResultantConflictList( CConflictList* pConflictList );
  82. private:
  83. CConflictList _SupersededApps;
  84. CConflict* _pLastConflict;
  85. };
  86. #endif // _CONFLICT_HXX_