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.

866 lines
24 KiB

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