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.

822 lines
22 KiB

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