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.

147 lines
3.5 KiB

  1. //
  2. // Driver Verifier UI
  3. // Copyright (c) Microsoft Corporation, 1999
  4. //
  5. //
  6. //
  7. // module: VerfPage.cpp
  8. // author: DMihai
  9. // created: 11/1/00
  10. //
  11. // Description:
  12. //
  13. #include "stdafx.h"
  14. #include "verifier.h"
  15. #include "VerfPage.h"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. //
  22. // Previous page IDs - used for implementing the "back"
  23. // button functionality
  24. //
  25. CPtrArray g_aPageIds;
  26. //
  27. // The one and only "slow progress" dialog
  28. //
  29. CSlowProgressDlg g_SlowProgressDlg;
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CVerifierPropertyPage property page
  32. IMPLEMENT_DYNAMIC(CVerifierPropertyPage, CPropertyPage)
  33. CVerifierPropertyPage::CVerifierPropertyPage(ULONG uDialogId) :
  34. CPropertyPage( uDialogId )
  35. {
  36. //{{AFX_DATA_INIT(CVerifierPropertyPage)
  37. // NOTE: the ClassWizard will add member initialization here
  38. //}}AFX_DATA_INIT
  39. }
  40. CVerifierPropertyPage::~CVerifierPropertyPage()
  41. {
  42. }
  43. BEGIN_MESSAGE_MAP(CVerifierPropertyPage, CPropertyPage)
  44. //{{AFX_MSG_MAP(CVerifierPropertyPage)
  45. ON_WM_HELPINFO()
  46. //}}AFX_MSG_MAP
  47. END_MESSAGE_MAP()
  48. /////////////////////////////////////////////////////////////////////////////
  49. ULONG CVerifierPropertyPage::GetDialogId() const
  50. {
  51. //
  52. // Oops, how did we get here ?!?
  53. // This is a virtual pure function.
  54. //
  55. //ASSERT( FALSE );
  56. return 0;
  57. }
  58. /////////////////////////////////////////////////////////////////////////////
  59. //
  60. // Return the previous page ID, based on our history array
  61. // and remove it from the array because will activate. Called
  62. // by our property pages when the "back" button is clicked
  63. //
  64. ULONG CVerifierPropertyPage::GetAndRemovePreviousDialogId()
  65. {
  66. ULONG uPrevId;
  67. INT_PTR nPageIdsArraySize;
  68. nPageIdsArraySize = g_aPageIds.GetSize();
  69. ASSERT( nPageIdsArraySize > 0 );
  70. uPrevId = PtrToUlong( g_aPageIds.GetAt( nPageIdsArraySize - 1 ) );
  71. g_aPageIds.RemoveAt( nPageIdsArraySize - 1 );
  72. return uPrevId;
  73. }
  74. /////////////////////////////////////////////////////////////////////////////
  75. //
  76. // Property pages derived from this class should notify us
  77. // whenever we go to a next page to record the current page ID in
  78. // the global array g_aPageIds
  79. //
  80. VOID CVerifierPropertyPage::GoingToNextPageNotify( LRESULT lNextPageId )
  81. {
  82. ULONG uMyDialogId;
  83. if( -1 != lNextPageId )
  84. {
  85. //
  86. // Will go to the next page. Add our ID to the global IDs array
  87. // used for implementing the "back" button functionality.
  88. //
  89. uMyDialogId = GetDialogId();
  90. ASSERT( ( 0 == g_aPageIds.GetSize() ) || ( ULongToPtr( uMyDialogId ) != g_aPageIds.GetAt( g_aPageIds.GetSize() - 1 ) ) );
  91. g_aPageIds.Add( ULongToPtr( uMyDialogId ) );
  92. }
  93. }
  94. /////////////////////////////////////////////////////////////////////////////
  95. //
  96. // Use this to kill any currently running worker threads
  97. //
  98. BOOL CVerifierPropertyPage::OnQueryCancel( )
  99. {
  100. g_SlowProgressDlg.KillWorkerThread();
  101. return TRUE;
  102. }
  103. /////////////////////////////////////////////////////////////////////////////
  104. LRESULT CVerifierPropertyPage::OnWizardBack()
  105. {
  106. return GetAndRemovePreviousDialogId();
  107. }
  108. /////////////////////////////////////////////////////////////////////////////
  109. // CVerifierPropertyPage message handlers
  110. BOOL CVerifierPropertyPage::OnHelpInfo(HELPINFO* pHelpInfo)
  111. {
  112. return TRUE;
  113. }