Source code of Windows XP (NT5)
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.

796 lines
21 KiB

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