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.

204 lines
8.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation 1996-2001.
  5. //
  6. // File: ddwarn.h
  7. //
  8. // Contents: definition of CDlgDependencyWarn
  9. //
  10. //----------------------------------------------------------------------------
  11. #if !defined(AFX_DDWARN_H__A405CAFD_800F_11D2_812B_00C04FD92F7B__INCLUDED_)
  12. #define AFX_DDWARN_H__A405CAFD_800F_11D2_812B_00C04FD92F7B__INCLUDED_
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif // _MSC_VER > 1000
  16. #include "HelpDlg.h"
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CDlgDependencyWarn dialog
  19. //
  20. // DPCHECK_OPERATOR tells how to compare the values.
  21. //
  22. enum DPCHECK_OPERATOR
  23. {
  24. DPCHECK_CONFIGURED = 1, // The dependent item must be configured.
  25. // A default value must be specifide for the suggested item.
  26. DPCHECK_NOTCONFIGURED, // The dependent item must be not configured,
  27. // (only valid if the item itsel if not configured).
  28. DPCHECK_LESSEQUAL, // The dependent item must be less than or equal.
  29. DPCHECK_LESS, // The dependent item must be less than.
  30. DPCHECK_GREATEREQUAL, // The dependent item must be greater than or eqaul.
  31. DPCHECK_GREATER, // The dependent item must be greater.
  32. //The next two case are special cases for retention Method
  33. DPCHECK_RETENTION_METHOD_CONFIGURED, // The dependent item must be configured
  34. DPCHECK_RETENTION_METHOD_NOTCONFIGURED, // The dependent item must not be configured
  35. //The next two case are special cases for Retain *** Log for
  36. DPCHECK_RETAIN_FOR_CONFIGURED, //The dependent item must be configured
  37. DPCHECK_RETAIN_FOR_NOTCONFIGURED, //The dependent item must not be configured
  38. };
  39. //
  40. // Flags for Depenecy checking.
  41. // value is set to the items value.
  42. // DPCHECK_VALIDFOR_NC - The test is valid for not configured [uDepends] items,
  43. // by default checks are not valid for not configured items.
  44. // DPCHECK_FOREVER - The item can be configured for FOREVER
  45. // DPCHECK_NEVER - Treat configured to never (0) as not configured
  46. // DPCHECK_INVERSE - Conversion is done by devision not multiplication.
  47. // seconds - days would be an inverse where
  48. //
  49. #define DPCHECK_VALIDFOR_NC 0x10000000
  50. #define DPCHECK_FOREVER 0x20000000
  51. #define DPCHECK_INVERSE 0x40000000
  52. #define DPCHECK_NEVER 0x80000000
  53. //
  54. // Used for creating a dependency list. For it to work correctly you must
  55. // create the list so that
  56. // uID - is a valid ID for the result item you are checking
  57. // uDepends - is a valid ID for a result item in the same Folder.
  58. // uDependencyCount - is the total dependencies for this item.
  59. // uDefault - Only used if uOpFlags has DPCHECK_CONFIGURED
  60. // uOpFlags - The test you want to perform and any other special flags.
  61. // The low order word is the operation to perform.
  62. // The high order word is used for special flags.
  63. //
  64. typedef struct _tag_DEPENDENCYLIST
  65. {
  66. UINT uID; // The ID we are checking
  67. UINT uDepends; // The ID of the dependent item.
  68. UINT uDependencyCount; // The number of sequential dependencies.
  69. UINT uDefault; // The default value to use if there are no good values.
  70. UINT uConversion; // Conversion number. The dependent values are converted
  71. // items value.
  72. UINT uOpFlags; // What kind of check to perfrom and other flags.
  73. } DEPENDENCYLIST, *PDEPENDENCYLIST;
  74. //
  75. // Min max information for the dependency checks.
  76. //
  77. typedef struct _tag_DEPENDENCYMINMAX
  78. {
  79. UINT uID; // The ID of the item.
  80. UINT uMin; // Minimum value.
  81. UINT uMax; // Maximum value.
  82. UINT uInc; // Increment value.
  83. } DEPENDENCYMINMAX, *PDEPENDENCYMINMAX;
  84. //
  85. // This structure will be created by the Dependency check, The caller can
  86. // enumerate through the dialog failed list to see which items failed.
  87. // The [dwSuggested] member will be set to the value that should be set for the
  88. // [pResult] item.
  89. // GetFailedCount() - Returns number of items that failed the dependency check
  90. // GetFailedInfo(int i) - Returns a pointer to this structure.
  91. //
  92. typedef struct _tag_DEPENDENCYFAILED
  93. {
  94. const DEPENDENCYLIST *pList; // The attributes of the item
  95. CResult *pResult; // The CResult associated with this item.
  96. LONG_PTR dwSuggested; // The suggested setting for this value.
  97. }DEPENDENCYFAILED, *PDEPENDENCYFAILED;
  98. ///////////////////////////////////////////////////////////////////////////////////////////
  99. // CDlgDependencyWarn Class declaration.
  100. // Usage: First call CheckDendencies with some valid values. If CheckDendencies returns
  101. // ERROR_MORE_DATA, then [m_aFailedList] has failed items. If you want to display the
  102. // information to the user you can call DoModal() for the dialog box. DoModal will return
  103. // IDOK if the user presses 'Auto set' or IDCANCEL if the user presses Cancel. You
  104. // can then enumerate through the failed list through a for loop with the count of
  105. // dependecies returned by GetFailedCount(), then get each failed item by calling
  106. // GetFailedInfo() which returns a PDEPENDENCYFAILED item.
  107. //
  108. class CDlgDependencyWarn : public CHelpDialog
  109. {
  110. // Construction
  111. public:
  112. CDlgDependencyWarn(CWnd* pParent = NULL); // standard constructor
  113. virtual ~CDlgDependencyWarn(); // Destructor
  114. DWORD
  115. InitializeDependencies(
  116. CSnapin *pSnapin, // The snapin who owns the CResult item.
  117. CResult *pResult, // The CResult item we are checking
  118. PDEPENDENCYLIST pList = NULL,
  119. int iCount = 0
  120. );
  121. DWORD
  122. CheckDependencies(
  123. DWORD dwValue // The value we are checking.
  124. );
  125. CResult *
  126. GetResultItem(
  127. CResult *pBase, // Need this to find the CFolder container
  128. UINT uID // The ID to search for.
  129. );
  130. const PDEPENDENCYFAILED
  131. GetFailedInfo(int i) // Get a specifide failed dependcies.
  132. { return m_aFailedList[i]; };
  133. int
  134. GetFailedCount() //
  135. { return (int)m_aFailedList.GetSize(); };
  136. BOOL
  137. GetResultItemString(
  138. CString &str,
  139. int iCol,
  140. CResult *pResult,
  141. LONG_PTR dwValue = NULL
  142. );
  143. // Dialog Data
  144. //{{AFX_DATA(CDlgDependencyWarn)
  145. enum { IDD = IDD_WARNING_DIALOG };
  146. // NOTE: the ClassWizard will add data members here
  147. //}}AFX_DATA
  148. // Overrides
  149. // ClassWizard generated virtual function overrides
  150. //{{AFX_VIRTUAL(CDlgDependencyWarn)
  151. protected:
  152. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  153. //}}AFX_VIRTUAL
  154. // Implementation
  155. protected:
  156. // Generated message map functions
  157. //{{AFX_MSG(CDlgDependencyWarn)
  158. virtual BOOL OnInitDialog();
  159. //}}AFX_MSG
  160. DECLARE_MESSAGE_MAP()
  161. WTL::CImageList m_imgList;
  162. CTypedPtrArray< CPtrArray, PDEPENDENCYFAILED> m_aFailedList;
  163. CTypedPtrArray< CPtrArray, CResult *> m_aDependsList;
  164. LONG_PTR m_dwValue;
  165. CResult *m_pResult;
  166. CSnapin *m_pSnapin;
  167. PDEPENDENCYLIST m_pList;
  168. int m_iCount;
  169. public:
  170. static DEPENDENCYMINMAX m_aMinMaxInfo[];
  171. static const DEPENDENCYMINMAX *LookupMinMaxInfo(UINT uID);
  172. };
  173. //{{AFX_INSERT_LOCATION}}
  174. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  175. #endif // !defined(AFX_DDWARN_H__A405CAFD_800F_11D2_812B_00C04FD92F7B__INCLUDED_)