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.

809 lines
22 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 2002 **/
  4. /**********************************************************************/
  5. /*
  6. provider.cpp
  7. Main Mode SA node handler
  8. FILE HISTORY:
  9. */
  10. #include "stdafx.h"
  11. #include "server.h"
  12. #include "MmSA.h"
  13. #include "MmSApp.h"
  14. #include "SpdUtil.h"
  15. /*---------------------------------------------------------------------------
  16. Class CMmSAHandler implementation
  17. ---------------------------------------------------------------------------*/
  18. /*---------------------------------------------------------------------------
  19. Constructor and destructor
  20. Description
  21. Author: NSun
  22. ---------------------------------------------------------------------------*/
  23. CMmSAHandler::CMmSAHandler
  24. (
  25. ITFSComponentData * pComponentData
  26. ) : CIpsmHandler(pComponentData)
  27. {
  28. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  29. }
  30. CMmSAHandler::~CMmSAHandler()
  31. {
  32. }
  33. /*!--------------------------------------------------------------------------
  34. CMmSAHandler::InitializeNode
  35. Initializes node specific data
  36. Author: NSun
  37. ---------------------------------------------------------------------------*/
  38. HRESULT
  39. CMmSAHandler::InitializeNode
  40. (
  41. ITFSNode * pNode
  42. )
  43. {
  44. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  45. CString strTemp;
  46. strTemp.LoadString(IDS_MM_SA_NODE);
  47. SetDisplayName(strTemp);
  48. // Make the node immediately visible
  49. pNode->SetVisibilityState(TFS_VIS_SHOW);
  50. pNode->SetData(TFS_DATA_COOKIE, (LPARAM) pNode);
  51. pNode->SetData(TFS_DATA_IMAGEINDEX, ICON_IDX_FOLDER_CLOSED);
  52. pNode->SetData(TFS_DATA_OPENIMAGEINDEX, ICON_IDX_FOLDER_OPEN);
  53. pNode->SetData(TFS_DATA_USER, (LPARAM) this);
  54. pNode->SetData(TFS_DATA_TYPE, IPSECMON_MM_SA);
  55. pNode->SetData(TFS_DATA_SCOPE_LEAF_NODE, TRUE);
  56. SetColumnStringIDs(&aColumns[IPSECMON_MM_SA][0]);
  57. SetColumnWidths(&aColumnWidths[IPSECMON_MM_SA][0]);
  58. return hrOK;
  59. }
  60. /*---------------------------------------------------------------------------
  61. CMmSAHandler::GetImageIndex
  62. -
  63. Author: NSun
  64. ---------------------------------------------------------------------------*/
  65. int
  66. CMmSAHandler::GetImageIndex(BOOL bOpenImage)
  67. {
  68. int nIndex = -1;
  69. return nIndex;
  70. }
  71. /*---------------------------------------------------------------------------
  72. Overridden base handler functions
  73. ---------------------------------------------------------------------------*/
  74. /*---------------------------------------------------------------------------
  75. CMmSAHandler::OnAddMenuItems
  76. Adds context menu items for the SA scope pane node
  77. Author: NSun
  78. ---------------------------------------------------------------------------*/
  79. STDMETHODIMP
  80. CMmSAHandler::OnAddMenuItems
  81. (
  82. ITFSNode * pNode,
  83. LPCONTEXTMENUCALLBACK pContextMenuCallback,
  84. LPDATAOBJECT lpDataObject,
  85. DATA_OBJECT_TYPES type,
  86. DWORD dwType,
  87. long * pInsertionAllowed
  88. )
  89. {
  90. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  91. LONG fFlags = 0, fLoadingFlags = 0;
  92. HRESULT hr = S_OK;
  93. CString strMenuItem;
  94. if (type == CCT_SCOPE)
  95. {
  96. if (*pInsertionAllowed & CCM_INSERTIONALLOWED_TOP)
  97. {
  98. }
  99. }
  100. return hr;
  101. }
  102. /*!--------------------------------------------------------------------------
  103. CMmSAHandler::AddMenuItems
  104. Adds context menu items for virtual list box (result pane) items
  105. Author: NSun
  106. ---------------------------------------------------------------------------*/
  107. STDMETHODIMP
  108. CMmSAHandler::AddMenuItems
  109. (
  110. ITFSComponent * pComponent,
  111. MMC_COOKIE cookie,
  112. LPDATAOBJECT pDataObject,
  113. LPCONTEXTMENUCALLBACK pContextMenuCallback,
  114. long * pInsertionAllowed
  115. )
  116. {
  117. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  118. HRESULT hr = hrOK;
  119. CString strMenuItem;
  120. SPINTERNAL spInternal;
  121. LONG fFlags = 0;
  122. spInternal = ExtractInternalFormat(pDataObject);
  123. // virtual listbox notifications come to the handler of the node that is selected.
  124. // check to see if this notification is for a virtual listbox item or this SA
  125. // node itself.
  126. if (*pInsertionAllowed & CCM_INSERTIONALLOWED_VIEW)
  127. {
  128. //load and view menu items here
  129. }
  130. return hr;
  131. }
  132. /*!--------------------------------------------------------------------------
  133. CMmSAHandler::OnRefresh
  134. Default implementation for the refresh functionality
  135. Author: NSun
  136. ---------------------------------------------------------------------------*/
  137. HRESULT
  138. CMmSAHandler::OnRefresh
  139. (
  140. ITFSNode * pNode,
  141. LPDATAOBJECT pDataObject,
  142. DWORD dwType,
  143. LPARAM arg,
  144. LPARAM param
  145. )
  146. {
  147. HRESULT hr = S_OK;
  148. int i = 0;
  149. SPIConsole spConsole;
  150. CORg(CHandler::OnRefresh(pNode, pDataObject, dwType, arg, param));
  151. CORg(m_spSpdInfo->EnumMmSAs());
  152. i = m_spSpdInfo->GetMmSACount();
  153. // now notify the virtual listbox
  154. CORg ( m_spNodeMgr->GetConsole(&spConsole) );
  155. CORg ( spConsole->UpdateAllViews(pDataObject, i, RESULT_PANE_SET_VIRTUAL_LB_SIZE));
  156. Error:
  157. return hr;
  158. }
  159. /*---------------------------------------------------------------------------
  160. CMmSAHandler::OnCommand
  161. Handles context menu commands for SA scope pane node
  162. Author: NSun
  163. ---------------------------------------------------------------------------*/
  164. STDMETHODIMP
  165. CMmSAHandler::OnCommand
  166. (
  167. ITFSNode * pNode,
  168. long nCommandId,
  169. DATA_OBJECT_TYPES type,
  170. LPDATAOBJECT pDataObject,
  171. DWORD dwType
  172. )
  173. {
  174. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  175. //handle the scope context menu commands here
  176. return S_OK;
  177. }
  178. /*!--------------------------------------------------------------------------
  179. CMmSAHandler::Command
  180. Handles context menu commands for virtual listbox items
  181. Author: NSun
  182. ---------------------------------------------------------------------------*/
  183. STDMETHODIMP
  184. CMmSAHandler::Command
  185. (
  186. ITFSComponent * pComponent,
  187. MMC_COOKIE cookie,
  188. int nCommandID,
  189. LPDATAOBJECT pDataObject
  190. )
  191. {
  192. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  193. HRESULT hr = S_OK;
  194. SPITFSNode spNode;
  195. m_spResultNodeMgr->FindNode(cookie, &spNode);
  196. // handle result context menu and view menus here
  197. return hr;
  198. }
  199. /*---------------------------------------------------------------------------
  200. CMmSAHandler::OnPropertyChange
  201. Description
  202. Author: NSun
  203. ---------------------------------------------------------------------------*/
  204. HRESULT
  205. CMmSAHandler::OnPropertyChange
  206. (
  207. ITFSNode * pNode,
  208. LPDATAOBJECT pDataobject,
  209. DWORD dwType,
  210. LPARAM arg,
  211. LPARAM lParam
  212. )
  213. {
  214. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  215. //CServerProperties * pServerProp = reinterpret_cast<CServerProperties *>(lParam);
  216. LONG_PTR changeMask = 0;
  217. // tell the property page to do whatever now that we are back on the
  218. // main thread
  219. //pServerProp->OnPropertyChange(TRUE, &changeMask);
  220. //pServerProp->AcknowledgeNotify();
  221. if (changeMask)
  222. pNode->ChangeNode(changeMask);
  223. return hrOK;
  224. }
  225. /*---------------------------------------------------------------------------
  226. CMmSAHandler::OnExpand
  227. Handles enumeration of a scope item
  228. Author: NSun
  229. ---------------------------------------------------------------------------*/
  230. HRESULT
  231. CMmSAHandler::OnExpand
  232. (
  233. ITFSNode * pNode,
  234. LPDATAOBJECT pDataObject,
  235. DWORD dwType,
  236. LPARAM arg,
  237. LPARAM param
  238. )
  239. {
  240. HRESULT hr = hrOK;
  241. if (m_bExpanded)
  242. return hr;
  243. // do the default handling
  244. CORg (CIpsmHandler::OnExpand(pNode, pDataObject, dwType, arg, param));
  245. Error:
  246. return hr;
  247. }
  248. /*!--------------------------------------------------------------------------
  249. CMmSAHandler::OnResultSelect
  250. Handles the MMCN_SELECT notifcation
  251. Author: NSun
  252. ---------------------------------------------------------------------------*/
  253. HRESULT
  254. CMmSAHandler::OnResultSelect
  255. (
  256. ITFSComponent * pComponent,
  257. LPDATAOBJECT pDataObject,
  258. MMC_COOKIE cookie,
  259. LPARAM arg,
  260. LPARAM lParam
  261. )
  262. {
  263. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  264. HRESULT hr = hrOK;
  265. SPINTERNAL spInternal;
  266. SPIConsole spConsole;
  267. SPIConsoleVerb spConsoleVerb;
  268. SPITFSNode spNode;
  269. BOOL bStates[ARRAYLEN(g_ConsoleVerbs)];
  270. int i;
  271. LONG_PTR dwNodeType;
  272. BOOL fSelect = HIWORD(arg);
  273. IConsole2 *pConsole2 = NULL;
  274. //get pConsole2 for writing to the status bar, if fails not to worry
  275. pComponent->GetConsole(&pConsole2);
  276. // virtual listbox notifications come to the handler of the node that is selected.
  277. // check to see if this notification is for a virtual listbox item or the active
  278. // registrations node itself.
  279. CORg (pComponent->GetConsoleVerb(&spConsoleVerb));
  280. m_verbDefault = MMC_VERB_OPEN;
  281. if (!fSelect)
  282. {
  283. if(pConsole2) {
  284. pConsole2->SetStatusText(_T(""));
  285. pConsole2->Release();
  286. }
  287. return hr;
  288. }
  289. if (m_spSpdInfo)
  290. {
  291. DWORD dwInitInfo;
  292. dwInitInfo=m_spSpdInfo->GetInitInfo();
  293. if (!(dwInitInfo & MON_MM_SA)) {
  294. CORg(m_spSpdInfo->EnumMmSAs());
  295. m_spSpdInfo->SetInitInfo(dwInitInfo | MON_MM_SA);
  296. }
  297. m_spSpdInfo->SetActiveInfo(MON_MM_SA);
  298. // Get the current count
  299. i = m_spSpdInfo->GetMmSACount();
  300. // now notify the virtual listbox
  301. CORg ( m_spNodeMgr->GetConsole(&spConsole) );
  302. CORg ( spConsole->UpdateAllViews(pDataObject, i, RESULT_PANE_SET_VIRTUAL_LB_SIZE) );
  303. if(pConsole2)
  304. {
  305. CString strTemp;
  306. WCHAR szTemp[20];
  307. wsprintf(szTemp, L"%d", i);
  308. AfxFormatString1(strTemp, IDS_STATUS_NUM_ITEMS, szTemp);
  309. LPCTSTR szNumItems = (LPCTSTR) strTemp;
  310. pConsole2->SetStatusText((LPOLESTR)szNumItems);
  311. pConsole2->Release();
  312. }
  313. }
  314. // now update the verbs...
  315. spInternal = ExtractInternalFormat(pDataObject);
  316. Assert(spInternal);
  317. if (spInternal->HasVirtualIndex())
  318. {
  319. //TODO add to here if we want to have some result console verbs
  320. // we gotta do special stuff for the virtual index items
  321. dwNodeType = IPSECMON_MM_SA_ITEM;
  322. for (i = 0; i < ARRAYLEN(g_ConsoleVerbs); bStates[i++] = FALSE);
  323. //enable the "properties" menu
  324. bStates[MMC_VERB_PROPERTIES & 0x000F] = TRUE;
  325. m_verbDefault = MMC_VERB_PROPERTIES;
  326. }
  327. else
  328. {
  329. // enable/disable delete depending if the node supports it
  330. CORg (m_spNodeMgr->FindNode(cookie, &spNode));
  331. dwNodeType = spNode->GetData(TFS_DATA_TYPE);
  332. for (i = 0; i < ARRAYLEN(g_ConsoleVerbs); bStates[i++] = TRUE);
  333. //hide "delete" context menu
  334. bStates[MMC_VERB_DELETE & 0x000F] = FALSE;
  335. }
  336. EnableVerbs(spConsoleVerb, g_ConsoleVerbStates[dwNodeType], bStates);
  337. COM_PROTECT_ERROR_LABEL;
  338. return hr;
  339. }
  340. /*!--------------------------------------------------------------------------
  341. CMmSAHandler::OnDelete
  342. The base handler calls this when MMC sends a MMCN_DELETE for a
  343. scope pane item. We just call our delete command handler.
  344. Author: NSun
  345. ---------------------------------------------------------------------------*/
  346. HRESULT
  347. CMmSAHandler::OnDelete
  348. (
  349. ITFSNode * pNode,
  350. LPARAM arg,
  351. LPARAM lParam
  352. )
  353. {
  354. return S_FALSE;
  355. }
  356. /*!--------------------------------------------------------------------------
  357. CMmSAHandler::HasPropertyPages
  358. Handle the result notification
  359. Author: NSun
  360. ---------------------------------------------------------------------------*/
  361. STDMETHODIMP
  362. CMmSAHandler::HasPropertyPages(
  363. ITFSComponent *pComponent,
  364. MMC_COOKIE cookie,
  365. LPDATAOBJECT pDataObject)
  366. {
  367. return hrOK;
  368. }
  369. /*!--------------------------------------------------------------------------
  370. CMmSAHandler::HasPropertyPages
  371. Handle the result notification. Create the filter property sheet
  372. Author: NSun
  373. ---------------------------------------------------------------------------*/
  374. STDMETHODIMP CMmSAHandler::CreatePropertyPages
  375. (
  376. ITFSComponent * pComponent,
  377. MMC_COOKIE cookie,
  378. LPPROPERTYSHEETCALLBACK lpProvider,
  379. LPDATAOBJECT pDataObject,
  380. LONG_PTR handle
  381. )
  382. {
  383. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  384. HRESULT hr = hrOK;
  385. SPINTERNAL spInternal;
  386. SPITFSNode spNode;
  387. int nIndex;
  388. SPIComponentData spComponentData;
  389. CMmSA sa;
  390. CMmSAProperties * pProp;
  391. Assert(m_spNodeMgr);
  392. CORg( m_spNodeMgr->FindNode(cookie, &spNode) );
  393. CORg( m_spNodeMgr->GetComponentData(&spComponentData) );
  394. spInternal = ExtractInternalFormat(pDataObject);
  395. // virtual listbox notifications come to the handler of the node that is selected.
  396. // assert that this notification is for a virtual listbox item
  397. Assert(spInternal);
  398. if (!spInternal->HasVirtualIndex())
  399. return hr;
  400. nIndex = spInternal->GetVirtualIndex();
  401. CORg(m_spSpdInfo->GetMmSAInfo(nIndex, &sa));
  402. pProp = new CMmSAProperties(
  403. spNode,
  404. spComponentData,
  405. m_spTFSCompData,
  406. &sa,
  407. m_spSpdInfo,
  408. NULL);
  409. hr = pProp->CreateModelessSheet(lpProvider, handle);
  410. COM_PROTECT_ERROR_LABEL;
  411. return hr;
  412. }
  413. /*---------------------------------------------------------------------------
  414. CMmSAHandler::OnGetResultViewType
  415. Return the result view that this node is going to support
  416. Author: NSun
  417. ---------------------------------------------------------------------------*/
  418. HRESULT
  419. CMmSAHandler::OnGetResultViewType
  420. (
  421. ITFSComponent * pComponent,
  422. MMC_COOKIE cookie,
  423. LPOLESTR * ppViewType,
  424. long * pViewOptions
  425. )
  426. {
  427. if (cookie != NULL)
  428. {
  429. *pViewOptions = MMC_VIEW_OPTIONS_OWNERDATALIST;
  430. }
  431. return S_FALSE;
  432. }
  433. /*---------------------------------------------------------------------------
  434. CMmSAHandler::GetVirtualImage
  435. Returns the image index for virtual listbox items
  436. Author: NSun
  437. ---------------------------------------------------------------------------*/
  438. int
  439. CMmSAHandler::GetVirtualImage
  440. (
  441. int nIndex
  442. )
  443. {
  444. return ICON_IDX_FILTER;
  445. }
  446. /*---------------------------------------------------------------------------
  447. CMmSAHandler::GetVirtualString
  448. returns a pointer to the string for virtual listbox items
  449. Author: NSun
  450. ---------------------------------------------------------------------------*/
  451. LPCWSTR
  452. CMmSAHandler::GetVirtualString
  453. (
  454. int nIndex,
  455. int nCol
  456. )
  457. {
  458. HRESULT hr = S_OK;
  459. static CString strTemp;
  460. strTemp.Empty();
  461. if (nCol >= DimensionOf(aColumns[IPSECMON_MM_SA]))
  462. return NULL;
  463. CMmSA sa;
  464. CORg(m_spSpdInfo->GetMmSAInfo(nIndex, &sa));
  465. switch (aColumns[IPSECMON_MM_SA][nCol])
  466. {
  467. case IDS_COL_MM_SA_ME:
  468. AddressToString(sa.m_MeAddr, &strTemp);
  469. return strTemp;
  470. break;
  471. case IDS_COL_MM_SA_PEER:
  472. AddressToString(sa.m_PeerAddr, &strTemp);
  473. return strTemp;
  474. break;
  475. case IDS_COL_MM_SA_MYID:
  476. strTemp = sa.m_stMyId;
  477. return strTemp;
  478. break;
  479. case IDS_COL_MM_SA_PEERID:
  480. strTemp = sa.m_stPeerId;
  481. return strTemp;
  482. break;
  483. case IDS_COL_MM_SA_AUTH:
  484. MmAuthToString(sa.m_Auth, &strTemp);
  485. return strTemp;
  486. break;
  487. case IDS_COL_MM_SA_ENCRYPITON:
  488. DoiEspAlgorithmToString(sa.m_SelectedOffer.m_EncryptionAlgorithm, &strTemp);
  489. return strTemp;
  490. break;
  491. case IDS_COL_MM_SA_INTEGRITY:
  492. DoiAuthAlgorithmToString(sa.m_SelectedOffer.m_HashingAlgorithm, &strTemp);
  493. return strTemp;
  494. break;
  495. case IDS_COL_MM_SA_DH:
  496. DhGroupToString(sa.m_SelectedOffer.m_dwDHGroup, &strTemp);
  497. return strTemp;
  498. break;
  499. default:
  500. Panic0("CMmSAHandler::GetVirtualString - Unknown column!\n");
  501. break;
  502. }
  503. COM_PROTECT_ERROR_LABEL;
  504. return NULL;
  505. }
  506. /*---------------------------------------------------------------------------
  507. CMmSAHandler::CacheHint
  508. MMC tells us which items it will need before it requests things
  509. Author: NSun
  510. ---------------------------------------------------------------------------*/
  511. STDMETHODIMP
  512. CMmSAHandler::CacheHint
  513. (
  514. int nStartIndex,
  515. int nEndIndex
  516. )
  517. {
  518. HRESULT hr = hrOK;;
  519. Trace2("CacheHint - Start %d, End %d\n", nStartIndex, nEndIndex);
  520. return hr;
  521. }
  522. /*---------------------------------------------------------------------------
  523. CMmSAHandler::SortItems
  524. We are responsible for sorting of virtual listbox items
  525. Author: NSun
  526. ---------------------------------------------------------------------------*/
  527. STDMETHODIMP
  528. CMmSAHandler::SortItems
  529. (
  530. int nColumn,
  531. DWORD dwSortOptions,
  532. LPARAM lUserParam
  533. )
  534. {
  535. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  536. if (nColumn >= DimensionOf(aColumns[IPSECMON_MM_SA]))
  537. return E_INVALIDARG;
  538. BEGIN_WAIT_CURSOR
  539. DWORD dwIndexType = aColumns[IPSECMON_MM_SA][nColumn];
  540. m_spSpdInfo->SortMmSAs(dwIndexType, dwSortOptions);
  541. END_WAIT_CURSOR
  542. return hrOK;
  543. }
  544. /*!--------------------------------------------------------------------------
  545. CMmSAHandler::OnResultUpdateView
  546. Implementation of ITFSResultHandler::OnResultUpdateView
  547. Author: NSun
  548. ---------------------------------------------------------------------------*/
  549. HRESULT CMmSAHandler::OnResultUpdateView
  550. (
  551. ITFSComponent *pComponent,
  552. LPDATAOBJECT pDataObject,
  553. LPARAM data,
  554. LONG_PTR hint
  555. )
  556. {
  557. HRESULT hr = hrOK;
  558. SPITFSNode spSelectedNode;
  559. pComponent->GetSelectedNode(&spSelectedNode);
  560. if (spSelectedNode == NULL)
  561. return S_OK; // no selection for our IComponentData
  562. if ( hint == IPSECMON_UPDATE_STATUS )
  563. {
  564. SPINTERNAL spInternal = ExtractInternalFormat(pDataObject);
  565. ITFSNode * pNode = reinterpret_cast<ITFSNode *>(spInternal->m_cookie);
  566. SPITFSNode spSelectedNode;
  567. pComponent->GetSelectedNode(&spSelectedNode);
  568. if (pNode == spSelectedNode)
  569. {
  570. // if we are the selected node, then we need to update
  571. SPIResultData spResultData;
  572. CORg (pComponent->GetResultData(&spResultData));
  573. CORg (spResultData->SetItemCount((int) data, MMCLV_UPDATE_NOSCROLL));
  574. }
  575. }
  576. else
  577. {
  578. // we don't handle this message, let the base class do it.
  579. return CIpsmHandler::OnResultUpdateView(pComponent, pDataObject, data, hint);
  580. }
  581. COM_PROTECT_ERROR_LABEL;
  582. return hr;
  583. }
  584. /*!--------------------------------------------------------------------------
  585. CMmSAHandler::LoadColumns
  586. Set the correct column header and then call the base class
  587. Author: NSun
  588. ---------------------------------------------------------------------------*/
  589. HRESULT
  590. CMmSAHandler::LoadColumns
  591. (
  592. ITFSComponent * pComponent,
  593. MMC_COOKIE cookie,
  594. LPARAM arg,
  595. LPARAM lParam
  596. )
  597. {
  598. //set column info
  599. return CIpsmHandler::LoadColumns(pComponent, cookie, arg, lParam);
  600. }
  601. /*---------------------------------------------------------------------------
  602. Command handlers
  603. ---------------------------------------------------------------------------*/
  604. /*---------------------------------------------------------------------------
  605. CMmSAHandler::OnDelete
  606. Removes a service SA
  607. Author: NSun
  608. ---------------------------------------------------------------------------*/
  609. HRESULT
  610. CMmSAHandler::OnDelete
  611. (
  612. ITFSNode * pNode
  613. )
  614. {
  615. HRESULT hr = S_FALSE;
  616. return hr;
  617. }
  618. /*---------------------------------------------------------------------------
  619. CMmSAHandler::UpdateStatus
  620. -
  621. Author: NSun
  622. ---------------------------------------------------------------------------*/
  623. HRESULT
  624. CMmSAHandler::UpdateStatus
  625. (
  626. ITFSNode * pNode
  627. )
  628. {
  629. HRESULT hr = hrOK;
  630. SPIComponentData spComponentData;
  631. SPIConsole spConsole;
  632. IDataObject * pDataObject;
  633. SPIDataObject spDataObject;
  634. int i = 0;
  635. Trace0("CMmSAHandler::UpdateStatus - Updating status for Filter");
  636. // force the listbox to update. We do this by setting the count and
  637. // telling it to invalidate the data
  638. CORg(m_spNodeMgr->GetComponentData(&spComponentData));
  639. CORg(m_spNodeMgr->GetConsole(&spConsole));
  640. // grab a data object to use
  641. CORg(spComponentData->QueryDataObject((MMC_COOKIE) pNode, CCT_RESULT, &pDataObject) );
  642. spDataObject = pDataObject;
  643. i = m_spSpdInfo->GetMmSACount();
  644. CORg(spConsole->UpdateAllViews(pDataObject, i, IPSECMON_UPDATE_STATUS));
  645. COM_PROTECT_ERROR_LABEL;
  646. return hr;
  647. }
  648. /*---------------------------------------------------------------------------
  649. Misc functions
  650. ---------------------------------------------------------------------------*/
  651. /*---------------------------------------------------------------------------
  652. CMmSAHandler::InitData
  653. Initializes data for this node
  654. Author: NSun
  655. ---------------------------------------------------------------------------*/
  656. HRESULT
  657. CMmSAHandler::InitData
  658. (
  659. ISpdInfo * pSpdInfo
  660. )
  661. {
  662. m_spSpdInfo.Set(pSpdInfo);
  663. return hrOK;
  664. }