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.

1233 lines
39 KiB

  1. /*++
  2. Copyright (C) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. provprop.cpp
  5. Abstract:
  6. Implementation of the trace providers general property page.
  7. --*/
  8. #include "stdafx.h"
  9. #include <pdh.h> // For xxx_TIME_VALUE
  10. #include "smlogs.h"
  11. #include "smcfgmsg.h"
  12. #include "provdlg.h"
  13. #include "warndlg.h"
  14. #include "enabldlg.h"
  15. #include "provprop.h"
  16. #include <pdhp.h>
  17. #include "dialogs.h"
  18. #include "smlogres.h"
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24. USE_HANDLE_MACROS("SMLOGCFG(provprop.cpp)");
  25. static ULONG
  26. s_aulHelpIds[] =
  27. {
  28. IDC_PROV_FILENAME_DISPLAY, IDH_PROV_FILENAME_DISPLAY,
  29. IDC_PROV_PROVIDER_LIST, IDH_PROV_PROVIDER_LIST,
  30. IDC_PROV_ADD_BTN, IDH_PROV_ADD_BTN,
  31. IDC_PROV_REMOVE_BTN, IDH_PROV_REMOVE_BTN,
  32. IDC_PROV_KERNEL_BTN, IDH_PROV_KERNEL_BTN,
  33. IDC_PROV_OTHER_BTN, IDH_PROV_OTHER_BTN,
  34. IDC_PROV_K_PROCESS_CHK, IDH_PROV_K_PROCESS_CHK,
  35. IDC_PROV_K_THREAD_CHK, IDH_PROV_K_THREAD_CHK,
  36. IDC_PROV_K_DISK_IO_CHK, IDH_PROV_K_DISK_IO_CHK,
  37. IDC_PROV_K_NETWORK_CHK, IDH_PROV_K_NETWORK_CHK,
  38. IDC_PROV_K_SOFT_PF_CHK, IDH_PROV_K_SOFT_PF_CHK,
  39. IDC_PROV_K_FILE_IO_CHK, IDH_PROV_K_FILE_IO_CHK,
  40. IDC_PROV_SHOW_PROVIDERS_BTN, IDH_PROV_SHOW_PROVIDERS_BTN,
  41. IDC_RUNAS_EDIT, IDH_RUNAS_EDIT,
  42. IDC_SETPWD_BTN, IDH_SETPWD_BTN,
  43. 0,0
  44. };
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CProvidersProperty property page
  47. IMPLEMENT_DYNCREATE(CProvidersProperty, CSmPropertyPage)
  48. CProvidersProperty::CProvidersProperty(MMC_COOKIE lCookie, LONG_PTR hConsole)
  49. : CSmPropertyPage ( CProvidersProperty::IDD, hConsole )
  50. // lCookie is really the pointer to the Log Query object
  51. {
  52. // ::OutputDebugStringA("\nCProvidersProperty::CProvidersProperty");
  53. // save pointers from arg list
  54. m_pTraceLogQuery = reinterpret_cast <CSmTraceLogQuery *>(lCookie);
  55. ASSERT ( m_pTraceLogQuery->CastToTraceLogQuery() );
  56. m_pQuery = dynamic_cast <CSmLogQuery*>(m_pTraceLogQuery);
  57. m_dwMaxHorizListExtent = 0;
  58. m_dwTraceMode = eTraceModeApplication;
  59. // EnableAutomation();
  60. //{{AFX_DATA_INIT(CProvidersProperty)
  61. m_bNonsystemProvidersExist = TRUE;
  62. m_bEnableProcessTrace = FALSE;
  63. m_bEnableThreadTrace = FALSE;
  64. m_bEnableDiskIoTrace = FALSE;
  65. m_bEnableNetworkTcpipTrace = FALSE;
  66. m_bEnableMemMgmtTrace = FALSE;
  67. m_bEnableFileIoTrace = FALSE;
  68. //}}AFX_DATA_INIT
  69. }
  70. CProvidersProperty::CProvidersProperty() : CSmPropertyPage(CProvidersProperty::IDD)
  71. {
  72. ASSERT (FALSE); // the constructor w/ args should be used instead
  73. EnableAutomation();
  74. //{{AFX_DATA_INIT(CProvidersProperty)
  75. m_bNonsystemProvidersExist = TRUE;
  76. m_bEnableProcessTrace = FALSE;
  77. m_bEnableThreadTrace = FALSE;
  78. m_bEnableDiskIoTrace = FALSE;
  79. m_bEnableNetworkTcpipTrace = FALSE;
  80. m_bEnableMemMgmtTrace = FALSE;
  81. m_bEnableFileIoTrace = FALSE;
  82. //}}AFX_DATA_INIT
  83. m_pTraceLogQuery = NULL;
  84. }
  85. CProvidersProperty::~CProvidersProperty()
  86. {
  87. // ::OutputDebugStringA("\nCProvidersProperty::~CProvidersProperty");
  88. }
  89. void CProvidersProperty::OnFinalRelease()
  90. {
  91. // When the last reference for an automation object is released
  92. // OnFinalRelease is called. The base class will automatically
  93. // deletes the object. Add additional cleanup required for your
  94. // object before calling the base class.
  95. CPropertyPage::OnFinalRelease();
  96. }
  97. void CProvidersProperty::DoDataExchange(CDataExchange* pDX)
  98. {
  99. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  100. DoProvidersDataExchange ( pDX );
  101. TraceModeRadioExchange ( pDX );
  102. CPropertyPage::DoDataExchange(pDX);
  103. //{{AFX_DATA_MAP(CProvidersProperty)
  104. DDX_Text(pDX, IDC_PROV_LOG_SCHED_TEXT, m_strStartText);
  105. DDX_Text(pDX, IDC_RUNAS_EDIT, m_strUserDisplay );
  106. DDX_Check(pDX, IDC_PROV_K_PROCESS_CHK, m_bEnableProcessTrace);
  107. DDX_Check(pDX, IDC_PROV_K_THREAD_CHK, m_bEnableThreadTrace);
  108. DDX_Check(pDX, IDC_PROV_K_DISK_IO_CHK, m_bEnableDiskIoTrace);
  109. DDX_Check(pDX, IDC_PROV_K_NETWORK_CHK, m_bEnableNetworkTcpipTrace);
  110. DDX_Check(pDX, IDC_PROV_K_SOFT_PF_CHK, m_bEnableMemMgmtTrace);
  111. DDX_Check(pDX, IDC_PROV_K_FILE_IO_CHK, m_bEnableFileIoTrace);
  112. //}}AFX_DATA_MAP
  113. }
  114. BEGIN_MESSAGE_MAP(CProvidersProperty, CSmPropertyPage)
  115. //{{AFX_MSG_MAP(CProvidersProperty)
  116. ON_BN_CLICKED(IDC_PROV_KERNEL_BTN, OnProvTraceModeRdo)
  117. ON_BN_CLICKED(IDC_PROV_OTHER_BTN, OnProvTraceModeRdo)
  118. ON_BN_CLICKED(IDC_PROV_SHOW_PROVIDERS_BTN, OnProvShowProvBtn)
  119. ON_BN_CLICKED(IDC_PROV_ADD_BTN, OnProvAddBtn)
  120. ON_BN_CLICKED(IDC_PROV_REMOVE_BTN, OnProvRemoveBtn)
  121. ON_LBN_DBLCLK(IDC_PROV_PROVIDER_LIST, OnDblclkProvProviderList)
  122. ON_LBN_SELCANCEL(IDC_PROV_PROVIDER_LIST, OnSelcancelProvProviderList)
  123. ON_LBN_SELCHANGE(IDC_PROV_PROVIDER_LIST, OnSelchangeProvProviderList)
  124. ON_BN_CLICKED(IDC_PROV_K_PROCESS_CHK, OnProvKernelEnableCheck)
  125. ON_BN_CLICKED(IDC_PROV_K_THREAD_CHK, OnProvKernelEnableCheck)
  126. ON_EN_CHANGE( IDC_RUNAS_EDIT, OnChangeUser )
  127. ON_BN_CLICKED(IDC_PROV_K_DISK_IO_CHK, OnProvKernelEnableCheck)
  128. ON_BN_CLICKED(IDC_PROV_K_NETWORK_CHK, OnProvKernelEnableCheck)
  129. ON_BN_CLICKED(IDC_PROV_K_FILE_IO_CHK, OnProvKernelEnableCheck)
  130. ON_BN_CLICKED(IDC_PROV_K_SOFT_PF_CHK, OnProvKernelEnableCheck)
  131. ON_BN_CLICKED(IDC_SETPWD_BTN, OnPwdBtn)
  132. ON_WM_DESTROY()
  133. //}}AFX_MSG_MAP
  134. END_MESSAGE_MAP()
  135. BEGIN_DISPATCH_MAP(CProvidersProperty, CSmPropertyPage)
  136. //{{AFX_DISPATCH_MAP(CProvidersProperty)
  137. // NOTE - the ClassWizard will add and remove mapping macros here.
  138. //}}AFX_DISPATCH_MAP
  139. END_DISPATCH_MAP()
  140. // Note: we add support for IID_IProvidersProperty to support typesafe binding
  141. // from VBA. This IID must match the GUID that is attached to the
  142. // dispinterface in the .ODL file.
  143. // {65154EA9-BDBE-11D1-BF99-00C04F94A83A}
  144. static const IID IID_IProvidersProperty =
  145. { 0x65154ea9, 0xbdbe, 0x11d1, { 0xbf, 0x99, 0x0, 0xc0, 0x4f, 0x94, 0xa8, 0x3a } };
  146. BEGIN_INTERFACE_MAP(CProvidersProperty, CSmPropertyPage)
  147. INTERFACE_PART(CProvidersProperty, IID_IProvidersProperty, Dispatch)
  148. END_INTERFACE_MAP()
  149. /////////////////////////////////////////////////////////////////////////////
  150. // CProvidersProperty message handlers
  151. void
  152. CProvidersProperty::OnChangeUser()
  153. {
  154. //
  155. // If you can not access remote WBEM, you can not modify RunAs info,
  156. // changing the user name is not allowed.
  157. //
  158. if (m_bCanAccessRemoteWbem) {
  159. // When the user hits OK in the password dialog,
  160. // the user name might not have changed.
  161. UpdateData ( TRUE );
  162. m_strUserDisplay.TrimLeft();
  163. m_strUserDisplay.TrimRight();
  164. if ( 0 != m_strUserSaved.Compare ( m_strUserDisplay ) ) {
  165. m_pTraceLogQuery->m_fDirtyPassword = PASSWORD_DIRTY;
  166. SetModifiedPage(TRUE);
  167. }
  168. else {
  169. m_pTraceLogQuery->m_fDirtyPassword &= ~PASSWORD_DIRTY;
  170. }
  171. //
  172. // If default user is typed, never need to set password
  173. //
  174. if (m_strUserDisplay.IsEmpty() || m_strUserDisplay.GetAt(0) == L'<') {
  175. if (m_bPwdButtonEnabled) {
  176. GetDlgItem(IDC_SETPWD_BTN)->EnableWindow(FALSE);
  177. m_bPwdButtonEnabled = FALSE;
  178. }
  179. }
  180. else {
  181. if (!m_bPwdButtonEnabled) {
  182. GetDlgItem(IDC_SETPWD_BTN)->EnableWindow(TRUE);
  183. m_bPwdButtonEnabled = TRUE;
  184. }
  185. }
  186. }
  187. else {
  188. //
  189. // We can not modify the RunAs info, then display
  190. // an error message and retore the original user name in RunAs
  191. //
  192. UpdateData(TRUE);
  193. if (ConnectRemoteWbemFail(m_pTraceLogQuery, FALSE)) {
  194. GetDlgItem(IDC_RUNAS_EDIT)->SetWindowText(m_strUserSaved);
  195. }
  196. }
  197. }
  198. void CProvidersProperty::OnPwdBtn()
  199. {
  200. CString strTempUser;
  201. UpdateData();
  202. if (!m_bCanAccessRemoteWbem) {
  203. ConnectRemoteWbemFail(m_pTraceLogQuery, TRUE);
  204. return;
  205. }
  206. MFC_TRY
  207. strTempUser = m_strUserDisplay;
  208. m_strUserDisplay.TrimLeft();
  209. m_strUserDisplay.TrimRight();
  210. m_pTraceLogQuery->m_strUser = m_strUserDisplay;
  211. SetRunAs(m_pTraceLogQuery);
  212. m_strUserDisplay = m_pTraceLogQuery->m_strUser;
  213. if ( 0 != strTempUser.CompareNoCase ( m_strUserDisplay ) ) {
  214. SetDlgItemText ( IDC_RUNAS_EDIT, m_strUserDisplay );
  215. }
  216. MFC_CATCH_MINIMUM;
  217. }
  218. void
  219. CProvidersProperty::OnProvAddBtn()
  220. {
  221. ImplementAdd();
  222. }
  223. void
  224. CProvidersProperty::OnProvRemoveBtn()
  225. {
  226. CListBox *plbProviderList;
  227. CDC* pCDC = NULL;
  228. LONG lThisItem;
  229. BOOL bDone;
  230. LONG lOrigCaret = 0;
  231. LONG lItemStatus;
  232. LONG lItemCount;
  233. BOOL bChanged = FALSE;
  234. DWORD dwItemExtent;
  235. CString strItemText;
  236. plbProviderList = (CListBox *)GetDlgItem(IDC_PROV_PROVIDER_LIST);
  237. // delete all selected items in the list box and
  238. // set the cursor to the item above the original caret position
  239. // or the first or last if that is out of the new range
  240. if ( NULL != plbProviderList ) {
  241. pCDC = plbProviderList->GetDC();
  242. if ( NULL != pCDC ) {
  243. lOrigCaret = plbProviderList->GetCaretIndex();
  244. lThisItem = 0;
  245. bDone = FALSE;
  246. // clear the max extent
  247. m_dwMaxHorizListExtent = 0;
  248. // clear the value
  249. do {
  250. lItemStatus = plbProviderList->GetSel(lThisItem);
  251. if (lItemStatus > 0) {
  252. // then it's selected so delete it
  253. INT iProvIndex = (INT)plbProviderList->GetItemData ( lThisItem );
  254. m_arrGenProviders[iProvIndex] = CSmTraceLogQuery::eNotInQuery;
  255. plbProviderList->DeleteString ( lThisItem );
  256. bChanged = TRUE;
  257. } else if (lItemStatus == 0) {
  258. // get the text length of this item since it will stay
  259. plbProviderList->GetText(lThisItem, strItemText);
  260. dwItemExtent = (DWORD)(pCDC->GetTextExtent(strItemText)).cx;
  261. if (dwItemExtent > m_dwMaxHorizListExtent) {
  262. m_dwMaxHorizListExtent = dwItemExtent;
  263. }
  264. // then it's not selected so go to the next one
  265. lThisItem++;
  266. } else {
  267. // we've run out so exit
  268. bDone = TRUE;
  269. }
  270. } while (!bDone);
  271. }
  272. if ( NULL != pCDC ) {
  273. plbProviderList->ReleaseDC(pCDC);
  274. pCDC = NULL;
  275. }
  276. // update the text extent of the list box
  277. plbProviderList->SetHorizontalExtent(m_dwMaxHorizListExtent);
  278. // see how many entries are left and update the
  279. // caret position and the remove button state
  280. lItemCount = plbProviderList->GetCount();
  281. if (lItemCount > 0) {
  282. // the update the caret
  283. if (lOrigCaret >= lItemCount) {
  284. lOrigCaret = lItemCount-1;
  285. } else {
  286. // caret should be within the list
  287. }
  288. plbProviderList->SetSel(lOrigCaret);
  289. plbProviderList->SetCaretIndex(lOrigCaret);
  290. } else {
  291. // the list is empty so remove caret, selection
  292. plbProviderList->SetSel(-1);
  293. if ( eTraceModeApplication == m_dwTraceMode )
  294. GetDlgItem(IDC_PROV_ADD_BTN)->SetFocus();
  295. }
  296. SetTraceModeState();
  297. SetModifiedPage(bChanged);
  298. }
  299. }
  300. void CProvidersProperty::OnDblclkProvProviderList()
  301. {
  302. ImplementAdd();
  303. }
  304. void CProvidersProperty::OnSelcancelProvProviderList()
  305. {
  306. SetAddRemoveBtnState();
  307. }
  308. void CProvidersProperty::OnSelchangeProvProviderList()
  309. {
  310. SetAddRemoveBtnState();
  311. }
  312. void
  313. CProvidersProperty::DoProvidersDataExchange ( CDataExchange* pDX)
  314. {
  315. CListBox* plbInQueryProviders = (CListBox *)GetDlgItem(IDC_PROV_PROVIDER_LIST);
  316. long lNumProviders;
  317. CDC* pCDC = NULL;
  318. if ( m_bNonsystemProvidersExist && NULL != plbInQueryProviders ) {
  319. pCDC = plbInQueryProviders->GetDC();
  320. if ( NULL != pCDC ) {
  321. if ( TRUE == pDX->m_bSaveAndValidate ) {
  322. // update the provider array based on list box contents.
  323. lNumProviders = plbInQueryProviders->GetCount();
  324. if (lNumProviders != LB_ERR) {
  325. long lThisProvider;
  326. INT iProvIndex;
  327. // Reset InQuery array, retaining state for eInactive providers.
  328. m_pTraceLogQuery->GetInQueryProviders ( m_arrGenProviders );
  329. // Reset eInQuery to eNotInQuery, in case some were removed from the query.
  330. for ( iProvIndex = 0; iProvIndex < m_arrGenProviders.GetSize(); iProvIndex++ ) {
  331. if ( CSmTraceLogQuery::eInQuery == m_arrGenProviders[iProvIndex] )
  332. m_arrGenProviders[iProvIndex] = CSmTraceLogQuery::eNotInQuery;
  333. }
  334. lThisProvider = 0;
  335. while (lThisProvider < lNumProviders) {
  336. iProvIndex = (INT)plbInQueryProviders->GetItemData( lThisProvider );
  337. m_arrGenProviders[iProvIndex] = CSmTraceLogQuery::eInQuery;
  338. lThisProvider++;
  339. }
  340. }
  341. } else {
  342. // Reset the list box.
  343. CString strProviderName;
  344. INT iProvIndex;
  345. DWORD dwItemExtent;
  346. ASSERT( NULL != m_pTraceLogQuery );
  347. //load nonsystem provider list box from string in provider list
  348. plbInQueryProviders->ResetContent();
  349. for ( iProvIndex = 0; iProvIndex < m_arrGenProviders.GetSize(); iProvIndex++ ) {
  350. if ( CSmTraceLogQuery::eInQuery == m_arrGenProviders[iProvIndex] ) {
  351. INT iAddIndex;
  352. GetProviderDescription( iProvIndex, strProviderName );
  353. iAddIndex = plbInQueryProviders->AddString ( strProviderName );
  354. plbInQueryProviders->SetItemData ( iAddIndex, ( DWORD ) iProvIndex );
  355. // update list box extent
  356. dwItemExtent = (DWORD)(pCDC->GetTextExtent(strProviderName)).cx;
  357. if (dwItemExtent > m_dwMaxHorizListExtent) {
  358. m_dwMaxHorizListExtent = dwItemExtent;
  359. plbInQueryProviders->SetHorizontalExtent(dwItemExtent);
  360. }
  361. }
  362. }
  363. }
  364. }
  365. if ( NULL != pCDC ) {
  366. plbInQueryProviders->ReleaseDC(pCDC);
  367. pCDC = NULL;
  368. }
  369. }
  370. }
  371. BOOL
  372. CProvidersProperty::IsValidLocalData( )
  373. {
  374. BOOL bIsValid = TRUE;
  375. ResourceStateManager rsm;
  376. if ( eTraceModeKernel == m_dwTraceMode ) {
  377. DWORD dwKernelFlags = 0;
  378. // Ensure that the user has enabled at least one of the 4 basic Kernel traces.
  379. if ( m_bEnableProcessTrace ) {
  380. dwKernelFlags |= SLQ_TLI_ENABLE_PROCESS_TRACE;
  381. }
  382. if ( m_bEnableThreadTrace ) {
  383. dwKernelFlags |= SLQ_TLI_ENABLE_THREAD_TRACE;
  384. }
  385. if ( m_bEnableDiskIoTrace ) {
  386. dwKernelFlags |= SLQ_TLI_ENABLE_DISKIO_TRACE;
  387. }
  388. if ( m_bEnableNetworkTcpipTrace ) {
  389. dwKernelFlags |= SLQ_TLI_ENABLE_NETWORK_TCPIP_TRACE;
  390. }
  391. if ( 0 == dwKernelFlags ) {
  392. CString strMsg;
  393. strMsg.LoadString ( IDS_KERNEL_PROVIDERS_REQUIRED );
  394. MessageBox ( strMsg, m_pTraceLogQuery->GetLogName(), MB_OK | MB_ICONERROR);
  395. SetFocusAnyPage ( IDC_PROV_KERNEL_BTN );
  396. bIsValid = FALSE;
  397. }
  398. } else {
  399. CListBox * plbInQueryProviders = (CListBox *)GetDlgItem(IDC_PROV_PROVIDER_LIST);
  400. if ( !m_bNonsystemProvidersExist || 0 == plbInQueryProviders->GetCount() ) {
  401. CString strMsg;
  402. strMsg.LoadString ( IDS_APP_PROVIDERS_REQUIRED );
  403. MessageBox ( strMsg, m_pTraceLogQuery->GetLogName(), MB_OK | MB_ICONERROR);
  404. SetFocusAnyPage ( IDC_PROV_ADD_BTN );
  405. bIsValid = FALSE;
  406. }
  407. }
  408. return bIsValid;
  409. }
  410. void
  411. CProvidersProperty::OnProvTraceModeRdo()
  412. {
  413. UpdateData ( TRUE );
  414. SetModifiedPage ( TRUE );
  415. }
  416. void
  417. CProvidersProperty::OnCancel()
  418. {
  419. m_pTraceLogQuery->SyncPropPageSharedData(); // clear memory shared between property pages.
  420. }
  421. BOOL
  422. CProvidersProperty::OnApply()
  423. {
  424. BOOL bContinue = TRUE;
  425. bContinue = UpdateData ( TRUE );
  426. if ( bContinue ) {
  427. bContinue = IsValidData(m_pTraceLogQuery, VALIDATE_APPLY );
  428. }
  429. // Write the data to the query.
  430. if ( bContinue ) {
  431. if ( eTraceModeKernel == m_dwTraceMode ) {
  432. DWORD dwKernelFlags = 0;
  433. INT iProvIndex;
  434. if ( m_bEnableProcessTrace ) {
  435. dwKernelFlags |= SLQ_TLI_ENABLE_PROCESS_TRACE;
  436. }
  437. if ( m_bEnableThreadTrace ) {
  438. dwKernelFlags |= SLQ_TLI_ENABLE_THREAD_TRACE;
  439. }
  440. if ( m_bEnableDiskIoTrace ) {
  441. dwKernelFlags |= SLQ_TLI_ENABLE_DISKIO_TRACE;
  442. }
  443. if ( m_bEnableNetworkTcpipTrace ) {
  444. dwKernelFlags |= SLQ_TLI_ENABLE_NETWORK_TCPIP_TRACE;
  445. }
  446. // Ensure that the user has enabled at least one of the 4 basic Kernel traces.
  447. ASSERT ( 0 != dwKernelFlags );
  448. if ( m_bEnableMemMgmtTrace ) {
  449. dwKernelFlags |= SLQ_TLI_ENABLE_MEMMAN_TRACE;
  450. }
  451. if ( m_bEnableFileIoTrace ) {
  452. dwKernelFlags |= SLQ_TLI_ENABLE_FILEIO_TRACE;
  453. }
  454. m_pTraceLogQuery->SetKernelFlags (dwKernelFlags);
  455. // Erase all InQuery providers.
  456. for ( iProvIndex = 0; iProvIndex < m_arrGenProviders.GetSize(); iProvIndex++ ) {
  457. if ( CSmTraceLogQuery::eInQuery == m_arrGenProviders[iProvIndex] )
  458. m_arrGenProviders[iProvIndex] = CSmTraceLogQuery::eNotInQuery;
  459. }
  460. m_pTraceLogQuery->SetInQueryProviders ( m_arrGenProviders );
  461. } else {
  462. CListBox * plbInQueryProviders = (CListBox *)GetDlgItem(IDC_PROV_PROVIDER_LIST);
  463. ASSERT ( 0 < plbInQueryProviders->GetCount() );
  464. m_pTraceLogQuery->SetInQueryProviders ( m_arrGenProviders );
  465. // Reset kernel flags
  466. m_pTraceLogQuery->SetKernelFlags (0);
  467. }
  468. }
  469. if ( bContinue ) {
  470. // ApplyRunAs must be called before UpdateService
  471. bContinue = ApplyRunAs(m_pTraceLogQuery);
  472. }
  473. if ( bContinue ){
  474. bContinue = CSmPropertyPage::OnApply();
  475. }
  476. if ( bContinue ) {
  477. // Save property page shared data.
  478. m_pTraceLogQuery->UpdatePropPageSharedData();
  479. bContinue = UpdateService ( m_pTraceLogQuery, TRUE );
  480. }
  481. return bContinue;
  482. }
  483. BOOL CProvidersProperty::OnInitDialog()
  484. {
  485. DWORD dwStatus;
  486. DWORD dwKernelFlags;
  487. CListBox * plbInQueryProviders;
  488. BOOL bDeleteInactiveProviders = FALSE;
  489. INT iIndex;
  490. ResourceStateManager rsm;
  491. //
  492. // Here m_pTraceLogQuery should not be NULL, if it is,
  493. // There must be something wrong.
  494. //
  495. if ( NULL == m_pTraceLogQuery ) {
  496. return TRUE;
  497. }
  498. m_bCanAccessRemoteWbem = m_pTraceLogQuery->GetLogService()->CanAccessWbemRemote();
  499. m_pTraceLogQuery->SetActivePropertyPage( this );
  500. dwStatus = m_pTraceLogQuery->InitGenProvidersArray();
  501. if ( SMCFG_INACTIVE_PROVIDER == dwStatus ) {
  502. CString strMessage;
  503. CString strSysMessage;
  504. INT_PTR iResult;
  505. FormatSmLogCfgMessage (
  506. strMessage,
  507. m_hModule,
  508. SMCFG_INACTIVE_PROVIDER,
  509. m_pTraceLogQuery->GetLogName() );
  510. iIndex = m_pTraceLogQuery->GetFirstInactiveIndex();
  511. while ( -1 != iIndex ) {
  512. CString strNextName;
  513. GetProviderDescription( iIndex, strNextName );
  514. strMessage += L"\n ";
  515. strMessage += strNextName;
  516. iIndex = m_pTraceLogQuery->GetNextInactiveIndex();
  517. }
  518. iResult = MessageBox(
  519. (LPCWSTR)strMessage,
  520. m_pTraceLogQuery->GetLogName(),
  521. MB_YESNO | MB_ICONWARNING
  522. );
  523. if ( IDYES == iResult ) {
  524. bDeleteInactiveProviders = TRUE;
  525. }
  526. }
  527. // Continue even if no active providers exist.
  528. plbInQueryProviders = (CListBox *)GetDlgItem(IDC_PROV_PROVIDER_LIST);
  529. // Initialize from model.
  530. dwStatus = m_pTraceLogQuery->GetInQueryProviders ( m_arrGenProviders );
  531. if ( bDeleteInactiveProviders ) {
  532. // Delete all inactive providers
  533. iIndex = m_pTraceLogQuery->GetFirstInactiveIndex();
  534. while ( -1 != iIndex ) {
  535. m_arrGenProviders[iIndex] = CSmTraceLogQuery::eNotInQuery;
  536. iIndex = m_pTraceLogQuery->GetNextInactiveIndex();
  537. }
  538. }
  539. m_bNonsystemProvidersExist = FALSE;
  540. for ( iIndex = 0; iIndex < m_arrGenProviders.GetSize(); iIndex++ ) {
  541. if ( m_pTraceLogQuery->IsActiveProvider ( iIndex ) ) {
  542. m_bNonsystemProvidersExist = TRUE;
  543. break;
  544. }
  545. }
  546. m_pTraceLogQuery->GetKernelFlags (dwKernelFlags);
  547. if ( (dwKernelFlags & SLQ_TLI_ENABLE_KERNEL_TRACE) != 0) {
  548. // NT5 Beta2 Kernel trace flag in use to cover all four basic trace.
  549. m_bEnableProcessTrace = TRUE;
  550. m_bEnableThreadTrace = TRUE;
  551. m_bEnableDiskIoTrace = TRUE;
  552. m_bEnableNetworkTcpipTrace = TRUE;
  553. } else {
  554. m_bEnableProcessTrace = (BOOL)((dwKernelFlags & SLQ_TLI_ENABLE_PROCESS_TRACE) != 0);
  555. m_bEnableThreadTrace = (BOOL)((dwKernelFlags & SLQ_TLI_ENABLE_THREAD_TRACE) != 0);
  556. m_bEnableDiskIoTrace = (BOOL)((dwKernelFlags & SLQ_TLI_ENABLE_DISKIO_TRACE) != 0);
  557. m_bEnableNetworkTcpipTrace = (BOOL)((dwKernelFlags & SLQ_TLI_ENABLE_NETWORK_TCPIP_TRACE) != 0);
  558. }
  559. m_bEnableMemMgmtTrace = (BOOL)((dwKernelFlags & SLQ_TLI_ENABLE_MEMMAN_TRACE) != 0);
  560. m_bEnableFileIoTrace = (BOOL)((dwKernelFlags & SLQ_TLI_ENABLE_FILEIO_TRACE) != 0);
  561. m_dwTraceMode = ( 0 != dwKernelFlags ) ? eTraceModeKernel : eTraceModeApplication;
  562. if ( eTraceModeApplication == m_dwTraceMode ) {
  563. // If initial mode is set to Application, initialize the Kernel
  564. // trace events to the default.
  565. m_bEnableProcessTrace = TRUE;
  566. m_bEnableThreadTrace = TRUE;
  567. m_bEnableDiskIoTrace = TRUE;
  568. m_bEnableNetworkTcpipTrace = TRUE;
  569. }
  570. CSmPropertyPage::OnInitDialog();
  571. SetHelpIds ( (DWORD*)&s_aulHelpIds );
  572. Initialize( m_pTraceLogQuery );
  573. m_strUserDisplay = m_pTraceLogQuery->m_strUser;
  574. m_strUserSaved = m_strUserDisplay;
  575. SetDetailsGroupBoxMode();
  576. SetTraceModeState();
  577. if ( m_bNonsystemProvidersExist ) {
  578. if ( 0 < plbInQueryProviders->GetCount() ) {
  579. // select first entry
  580. plbInQueryProviders->SetSel (0, TRUE);
  581. plbInQueryProviders->SetCaretIndex (0, TRUE);
  582. } else {
  583. plbInQueryProviders->SetSel (-1, TRUE);
  584. GetDlgItem(IDC_PROV_ADD_BTN)->SetFocus();
  585. }
  586. } else {
  587. CString strNoProviders;
  588. strNoProviders.LoadString( IDS_PROV_NO_PROVIDERS );
  589. plbInQueryProviders->AddString( strNoProviders );
  590. plbInQueryProviders->EnableWindow(FALSE);
  591. GetDlgItem(IDC_PROV_REMOVE_BTN)->EnableWindow(FALSE);
  592. GetDlgItem(IDC_PROV_ADD_BTN)->EnableWindow(FALSE);
  593. }
  594. if (m_pTraceLogQuery->GetLogService()->TargetOs() == OS_WIN2K) {
  595. GetDlgItem(IDC_RUNAS_STATIC)->EnableWindow(FALSE);
  596. GetDlgItem(IDC_RUNAS_EDIT)->EnableWindow(FALSE);
  597. }
  598. if (m_pTraceLogQuery->GetLogService()->TargetOs() == OS_WIN2K ||
  599. m_strUserDisplay.IsEmpty() || m_strUserDisplay.GetAt(0) == L'<') {
  600. GetDlgItem(IDC_SETPWD_BTN)->EnableWindow(FALSE);
  601. m_bPwdButtonEnabled = FALSE;
  602. }
  603. return TRUE; // return TRUE unless you set the focus to a control
  604. // EXCEPTION: OCX Property Pages should return FALSE
  605. }
  606. void CProvidersProperty::PostNcDestroy()
  607. {
  608. // delete this;
  609. if ( NULL != m_pTraceLogQuery ) {
  610. m_pTraceLogQuery->SetActivePropertyPage( NULL );
  611. }
  612. CPropertyPage::PostNcDestroy();
  613. }
  614. //
  615. // Helper functions.
  616. //
  617. void
  618. CProvidersProperty::SetAddRemoveBtnState ( void )
  619. {
  620. if ( m_bNonsystemProvidersExist ) {
  621. if ( eTraceModeKernel == m_dwTraceMode ) {
  622. GetDlgItem(IDC_PROV_REMOVE_BTN)->EnableWindow(FALSE);
  623. GetDlgItem(IDC_PROV_ADD_BTN)->EnableWindow(FALSE);
  624. } else {
  625. CListBox * plbInQueryProviders = (CListBox *)GetDlgItem(IDC_PROV_PROVIDER_LIST);
  626. INT iTotalCount;
  627. iTotalCount = plbInQueryProviders->GetCount();
  628. if ( 0 < plbInQueryProviders->GetSelCount() ) {
  629. GetDlgItem(IDC_PROV_REMOVE_BTN)->EnableWindow(TRUE);
  630. } else {
  631. GetDlgItem(IDC_PROV_REMOVE_BTN)->EnableWindow(FALSE);
  632. }
  633. if ( iTotalCount < m_arrGenProviders.GetSize() ) {
  634. GetDlgItem(IDC_PROV_ADD_BTN)->EnableWindow(TRUE);
  635. } else {
  636. GetDlgItem(IDC_PROV_ADD_BTN)->EnableWindow(FALSE);
  637. }
  638. if ( 0 == iTotalCount ) {
  639. plbInQueryProviders->SetSel(-1);
  640. }
  641. }
  642. }
  643. }
  644. //
  645. // Return the description for the trace provider specified by
  646. // InQuery array index.
  647. //
  648. DWORD
  649. CProvidersProperty::GetProviderDescription ( INT iProvIndex, CString& rstrDesc )
  650. {
  651. ASSERT ( NULL != m_pTraceLogQuery );
  652. rstrDesc = m_pTraceLogQuery->GetProviderDescription ( iProvIndex );
  653. // If the description is empty, build name from guid.
  654. if ( rstrDesc.IsEmpty() ) {
  655. CString strGuid;
  656. ASSERT( !m_pTraceLogQuery->IsActiveProvider( iProvIndex) );
  657. strGuid = m_pTraceLogQuery->GetProviderGuid( iProvIndex );
  658. rstrDesc.Format ( IDS_PROV_UNKNOWN, strGuid );
  659. }
  660. return ERROR_SUCCESS;
  661. }
  662. BOOL
  663. CProvidersProperty::IsEnabledProvider( INT iIndex )
  664. {
  665. ASSERT ( NULL != m_pTraceLogQuery );
  666. return ( m_pTraceLogQuery->IsEnabledProvider ( iIndex ) );
  667. }
  668. BOOL
  669. CProvidersProperty::IsActiveProvider( INT iIndex )
  670. {
  671. ASSERT ( NULL != m_pTraceLogQuery );
  672. return ( m_pTraceLogQuery->IsActiveProvider ( iIndex ) );
  673. }
  674. LPCWSTR
  675. CProvidersProperty::GetKernelProviderDescription( void )
  676. {
  677. ASSERT ( NULL != m_pTraceLogQuery );
  678. return ( m_pTraceLogQuery->GetKernelProviderDescription ( ) );
  679. }
  680. BOOL
  681. CProvidersProperty::GetKernelProviderEnabled( void )
  682. {
  683. ASSERT ( NULL != m_pTraceLogQuery );
  684. return ( m_pTraceLogQuery->GetKernelProviderEnabled ( ) );
  685. }
  686. //
  687. // Update the provided InQuery array to match the stored version.
  688. //
  689. DWORD
  690. CProvidersProperty::GetInQueryProviders( CArray<CSmTraceLogQuery::eProviderState, CSmTraceLogQuery::eProviderState&>& rarrOut )
  691. {
  692. DWORD dwStatus = ERROR_SUCCESS;
  693. int iIndex;
  694. rarrOut.RemoveAll();
  695. rarrOut.SetSize( m_arrGenProviders.GetSize() );
  696. for ( iIndex = 0; iIndex < rarrOut.GetSize(); iIndex++ ) {
  697. rarrOut[iIndex] = m_arrGenProviders[iIndex];
  698. }
  699. return dwStatus;
  700. }
  701. //
  702. // Load the stored InQuery providers array
  703. // based on the provided version.
  704. //
  705. DWORD
  706. CProvidersProperty::SetInQueryProviders( CArray<CSmTraceLogQuery::eProviderState, CSmTraceLogQuery::eProviderState&>& rarrIn )
  707. {
  708. DWORD dwStatus = ERROR_SUCCESS;
  709. int iProvIndex;
  710. m_arrGenProviders.RemoveAll();
  711. m_arrGenProviders.SetSize( rarrIn.GetSize() );
  712. for ( iProvIndex = 0; iProvIndex < m_arrGenProviders.GetSize(); iProvIndex++ ) {
  713. m_arrGenProviders[iProvIndex] = rarrIn[iProvIndex];
  714. }
  715. return dwStatus;
  716. }
  717. void
  718. CProvidersProperty::ImplementAdd( void )
  719. {
  720. INT_PTR iReturn = IDCANCEL;
  721. {
  722. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  723. CProviderListDlg dlgAddProviders(this);
  724. // Workaround for popup to store pointer to this page.
  725. dlgAddProviders.SetProvidersPage( this );
  726. iReturn = dlgAddProviders.DoModal();
  727. }
  728. if ( IDOK == iReturn ) {
  729. LONG lBeforeCount;
  730. LONG lAfterCount;
  731. CListBox *plbProviderList;
  732. plbProviderList = (CListBox *)GetDlgItem(IDC_PROV_PROVIDER_LIST);
  733. // Providers array is modified by the add dialog OnOK procedure.
  734. lBeforeCount = plbProviderList->GetCount();
  735. UpdateData ( FALSE );
  736. lAfterCount = plbProviderList->GetCount();
  737. SetAddRemoveBtnState();
  738. if ( lAfterCount > lBeforeCount ) {
  739. SetModifiedPage ( TRUE );
  740. }
  741. }
  742. }
  743. void
  744. CProvidersProperty::UpdateLogStartString ()
  745. {
  746. eStartType eCurrentStartType;
  747. int nResId = 0;
  748. ResourceStateManager rsm;
  749. eCurrentStartType = DetermineCurrentStartType();
  750. if ( eStartManually == eCurrentStartType ) {
  751. nResId = IDS_LOG_START_MANUALLY;
  752. } else if ( eStartImmediately == eCurrentStartType ) {
  753. nResId = IDS_LOG_START_IMMED;
  754. } else if ( eStartSched == eCurrentStartType ) {
  755. nResId = IDS_LOG_START_SCHED;
  756. }
  757. if ( 0 != nResId ) {
  758. m_strStartText.LoadString(nResId);
  759. } else {
  760. m_strStartText.Empty();
  761. }
  762. return;
  763. }
  764. void
  765. CProvidersProperty::UpdateFileNameString ()
  766. {
  767. m_strFileNameDisplay.Empty();
  768. CreateSampleFileName (
  769. m_pTraceLogQuery->GetLogName(),
  770. m_pTraceLogQuery->GetLogService()->GetMachineName(),
  771. m_SharedData.strFolderName,
  772. m_SharedData.strFileBaseName,
  773. m_SharedData.strSqlName,
  774. m_SharedData.dwSuffix,
  775. m_SharedData.dwLogFileType,
  776. m_SharedData.dwSerialNumber,
  777. m_strFileNameDisplay);
  778. SetDlgItemText( IDC_PROV_FILENAME_DISPLAY, m_strFileNameDisplay );
  779. // Clear the selection
  780. ((CEdit*)GetDlgItem( IDC_PROV_FILENAME_DISPLAY ))->SetSel ( -1, 0 );
  781. return;
  782. }
  783. BOOL
  784. CProvidersProperty::OnSetActive()
  785. {
  786. BOOL bReturn;
  787. bReturn = CSmPropertyPage::OnSetActive();
  788. if (!bReturn) return FALSE;
  789. ResourceStateManager rsm;
  790. m_pTraceLogQuery->GetPropPageSharedData ( &m_SharedData );
  791. UpdateFileNameString();
  792. UpdateLogStartString();
  793. m_strUserDisplay = m_pTraceLogQuery->m_strUser;
  794. UpdateData(FALSE); //to load the edit & combo box
  795. return TRUE;
  796. }
  797. BOOL
  798. CProvidersProperty::OnKillActive()
  799. {
  800. BOOL bContinue = TRUE;
  801. bContinue = CPropertyPage::OnKillActive();
  802. if ( bContinue ) {
  803. m_pTraceLogQuery->m_strUser = m_strUserDisplay;
  804. bContinue = IsValidData(m_pTraceLogQuery, VALIDATE_FOCUS );
  805. }
  806. // The providers page does not modify shared data, so no reason to update it.
  807. if ( bContinue ) {
  808. SetIsActive ( FALSE );
  809. }
  810. return bContinue;
  811. }
  812. void
  813. CProvidersProperty::OnProvKernelEnableCheck()
  814. {
  815. BOOL bMemFlag = m_bEnableMemMgmtTrace;
  816. BOOL bFileFlag = m_bEnableFileIoTrace;
  817. UpdateData(TRUE);
  818. SetModifiedPage(TRUE);
  819. bMemFlag = (!bMemFlag && m_bEnableMemMgmtTrace);
  820. bFileFlag = (!bFileFlag && m_bEnableFileIoTrace);
  821. if (bMemFlag || bFileFlag) {
  822. long nErr;
  823. HKEY hKey = NULL;
  824. DWORD dwWarnFlag;
  825. DWORD dwDataType = 0;
  826. DWORD dwDataSize = 0;
  827. DWORD dwDisposition;
  828. // User has checked expensive file io flag
  829. // check registry setting to see if we need to pop up warning dialog
  830. nErr = RegOpenKey( HKEY_CURRENT_USER,
  831. L"Software\\Microsoft\\PerformanceLogsandAlerts",
  832. &hKey
  833. );
  834. dwWarnFlag = 0;
  835. if( nErr == ERROR_SUCCESS ) {
  836. dwDataSize = sizeof(DWORD);
  837. nErr = RegQueryValueExW(
  838. hKey,
  839. (bMemFlag ? L"NoWarnPageFault" : L"NoWarnFileIo"),
  840. NULL,
  841. &dwDataType,
  842. (LPBYTE) &dwWarnFlag,
  843. (LPDWORD) &dwDataSize
  844. );
  845. if ( (dwDataType != REG_DWORD) || (dwDataSize != sizeof(DWORD)))
  846. dwWarnFlag = 0;
  847. nErr = RegCloseKey( hKey );
  848. hKey = NULL;
  849. if( ERROR_SUCCESS != nErr ) {
  850. DisplayError( GetLastError(), L"Close PerfLog user key failed" );
  851. }
  852. }
  853. if (!dwWarnFlag || nErr != ERROR_SUCCESS) {
  854. // Pop a dialog here. Need to do a RegQuerySetValue dialog is checked to keep quiet
  855. // bMemFlag & bFileFlag gives a clue about what it is doing
  856. CWarnDlg WarnDlg;
  857. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  858. WarnDlg.SetProvidersPage( this );
  859. if (IDOK == WarnDlg.DoModal()){
  860. if (WarnDlg.m_CheckNoMore){
  861. dwWarnFlag = WarnDlg.m_CheckNoMore;
  862. nErr = RegCreateKeyEx( HKEY_CURRENT_USER,
  863. L"Software\\Microsoft\\PerformanceLogsAndAlerts",
  864. 0,
  865. L"REG_DWORD",
  866. REG_OPTION_NON_VOLATILE,
  867. KEY_READ | KEY_WRITE,
  868. NULL,
  869. &hKey,
  870. &dwDisposition);
  871. /*
  872. if(ERROR_SUCCESS == nErr){
  873. if (dwDisposition == REG_CREATED_NEW_KEY){
  874. //just in case I need this
  875. }else if (dwDisposition == REG_OPENED_EXISTING_KEY){
  876. //Just in case I need this
  877. }
  878. }
  879. */
  880. if( nErr == ERROR_SUCCESS ) {
  881. dwDataSize = sizeof(DWORD);
  882. nErr = RegSetValueEx(hKey,
  883. (bMemFlag ? L"NoWarnPageFault" : L"NoWarnFileIo" ),
  884. NULL,
  885. REG_DWORD,
  886. (LPBYTE) &dwWarnFlag,
  887. dwDataSize
  888. );
  889. if( ERROR_SUCCESS != nErr ) {
  890. DisplayError( GetLastError(), L"Set PerfLog User warn value failed" );
  891. }
  892. nErr = RegCloseKey( hKey );
  893. hKey = NULL;
  894. if( ERROR_SUCCESS != nErr ) {
  895. DisplayError( GetLastError(), L"Close PerfLog user key failed" );
  896. }
  897. }
  898. }
  899. }
  900. }
  901. }
  902. }
  903. void
  904. CProvidersProperty::OnProvShowProvBtn()
  905. {
  906. CActiveProviderDlg ProvLstDlg;
  907. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  908. ProvLstDlg.SetProvidersPage( this );
  909. ProvLstDlg.DoModal();
  910. }
  911. /*
  912. void
  913. CProvidersProperty::OnProvDetailsBtn()
  914. {
  915. SetDetailsGroupBoxMode();
  916. }
  917. */
  918. BOOL
  919. CProvidersProperty::SetDetailsGroupBoxMode()
  920. {
  921. UINT nWindowState;
  922. ResourceStateManager rsm;
  923. nWindowState = SW_SHOW;
  924. GetDlgItem(IDC_PROV_K_PROCESS_CHK)->ShowWindow(nWindowState);
  925. GetDlgItem(IDC_PROV_K_THREAD_CHK)->ShowWindow(nWindowState);
  926. GetDlgItem(IDC_PROV_K_DISK_IO_CHK)->ShowWindow(nWindowState);
  927. GetDlgItem(IDC_PROV_K_NETWORK_CHK)->ShowWindow(nWindowState);
  928. GetDlgItem(IDC_PROV_K_SOFT_PF_CHK)->ShowWindow(nWindowState);
  929. GetDlgItem(IDC_PROV_K_FILE_IO_CHK)->ShowWindow(nWindowState);
  930. return TRUE;
  931. }
  932. void
  933. CProvidersProperty::TraceModeRadioExchange(CDataExchange* pDX)
  934. {
  935. if ( !pDX->m_bSaveAndValidate ) {
  936. // Load control value from data
  937. switch ( m_dwTraceMode ) {
  938. case eTraceModeKernel:
  939. m_nTraceModeRdo = 0;
  940. break;
  941. case eTraceModeApplication:
  942. m_nTraceModeRdo = 1;
  943. break;
  944. default:
  945. ;
  946. break;
  947. }
  948. }
  949. DDX_Radio(pDX, IDC_PROV_KERNEL_BTN, m_nTraceModeRdo);
  950. if ( pDX->m_bSaveAndValidate ) {
  951. switch ( m_nTraceModeRdo ) {
  952. case 0:
  953. m_dwTraceMode = eTraceModeKernel;
  954. break;
  955. case 1:
  956. m_dwTraceMode = eTraceModeApplication;
  957. break;
  958. default:
  959. ;
  960. break;
  961. }
  962. SetTraceModeState();
  963. }
  964. }
  965. void
  966. CProvidersProperty::SetTraceModeState ( void )
  967. {
  968. BOOL bEnable;
  969. bEnable = (eTraceModeKernel == m_dwTraceMode) ? TRUE : FALSE;
  970. // Kernel trace controls
  971. // GetDlgItem(IDC_PROV_SHOW_ADV_BTN)->EnableWindow(bEnable);
  972. GetDlgItem(IDC_PROV_K_PROCESS_CHK)->EnableWindow(bEnable);
  973. GetDlgItem(IDC_PROV_K_THREAD_CHK)->EnableWindow(bEnable);
  974. GetDlgItem(IDC_PROV_K_DISK_IO_CHK)->EnableWindow(bEnable);
  975. GetDlgItem(IDC_PROV_K_NETWORK_CHK)->EnableWindow(bEnable);
  976. GetDlgItem(IDC_PROV_K_SOFT_PF_CHK)->EnableWindow(bEnable);
  977. GetDlgItem(IDC_PROV_K_FILE_IO_CHK)->EnableWindow(bEnable);
  978. if ( m_bNonsystemProvidersExist ) {
  979. bEnable = !bEnable;
  980. // Application trace controls
  981. GetDlgItem(IDC_PROV_PROVIDER_LIST)->EnableWindow(bEnable);
  982. SetAddRemoveBtnState();
  983. }
  984. }
  985. DWORD
  986. CProvidersProperty::GetGenProviderCount ( INT& iCount )
  987. {
  988. return m_pTraceLogQuery->GetGenProviderCount( iCount );
  989. }
  990. void CProvidersProperty::GetMachineDisplayName ( CString& rstrMachineName )
  991. {
  992. m_pTraceLogQuery->GetMachineDisplayName( rstrMachineName );
  993. return;
  994. }
  995. CSmTraceLogQuery*
  996. CProvidersProperty::GetTraceQuery ( void )
  997. {
  998. return m_pTraceLogQuery;
  999. }