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.

153 lines
4.4 KiB

  1. //============================================================================
  2. // Copyright (C) Microsoft Corporation, 1997 - 1999
  3. //
  4. // File: ipxserviceprop.h
  5. //
  6. // History:
  7. // 12/07/90 Deon Brewis Created.
  8. //
  9. // IPX Static Service property sheet and property pages
  10. //
  11. //============================================================================
  12. #ifndef _NBPROP_H
  13. #define _NBPROP_H
  14. #ifndef _INFO_H
  15. #include "info.h"
  16. #endif
  17. #ifndef _RTRSHEET_H
  18. #include "rtrsheet.h"
  19. #endif
  20. #ifndef _SRVIEW_H
  21. #include "snview.h"
  22. #endif
  23. // ---------------------------------------------------------------------------
  24. // Forward declarations
  25. // ---------------------------------------------------------------------------
  26. class IPXConnection;
  27. class IpxStaticNBNamePropertySheet;
  28. // ---------------------------------------------------------------------------
  29. // class: SafeIPXSNListEntry
  30. //
  31. // IpxSSListEntry is not thread safe or something else is wrong with the TFS
  32. // implementation of smart pointers. Anyway, it does not work in property pages.
  33. // Grrr.... Had to change SPInterfaceInfo m_spIf to CComPtr<IInterfaceInfo>.
  34. // It seems to work now.
  35. //
  36. // Author: deonb
  37. // ---------------------------------------------------------------------------
  38. class SafeIPXSNListEntry
  39. {
  40. public:
  41. CComPtr<IInterfaceInfo> m_spIf;
  42. IPX_STATIC_NETBIOS_NAME_INFO m_name;
  43. void LoadFrom(BaseIPXResultNodeData *pNodeData);
  44. void SaveTo(BaseIPXResultNodeData *pNodeData);
  45. };
  46. // ---------------------------------------------------------------------------
  47. // class: IpxStaticNBNamePropertyPage
  48. // This class handles the IPX Static Route properties
  49. //
  50. // Author: deonb
  51. // ---------------------------------------------------------------------------
  52. class IpxStaticNBNamePropertyPage :
  53. public RtrPropertyPage
  54. {
  55. public:
  56. IpxStaticNBNamePropertyPage(UINT nIDTemplate, UINT nIDCaption = 0)
  57. : RtrPropertyPage(nIDTemplate, nIDCaption)
  58. {};
  59. ~IpxStaticNBNamePropertyPage();
  60. HRESULT Init(BaseIPXResultNodeData *pNodeData,
  61. IpxStaticNBNamePropertySheet * pIPXPropSheet);
  62. HRESULT RemoveStaticNetBIOSName(SafeIPXSNListEntry *pSNEntry, IInfoBase *pInfo);
  63. HRESULT ModifyNameInfo(ITFSNode *pNode,
  64. SafeIPXSNListEntry *pSNEntry,
  65. SafeIPXSNListEntry *pSNEntryOld);
  66. protected:
  67. // Override the OnApply() so that we can grab our data from the
  68. // controls in the dialog.
  69. virtual BOOL OnApply();
  70. SafeIPXSNListEntry m_SNEntry;
  71. SafeIPXSNListEntry m_InitSNEntry;
  72. IpxStaticNBNamePropertySheet *m_pIPXPropSheet;
  73. //{{AFX_VIRTUAL(IpxStaticNBNamePropertyPage)
  74. protected:
  75. virtual VOID DoDataExchange(CDataExchange *pDX);
  76. //}}AFX_VIRTUAL
  77. //{{AFX_DATA(IpxStaticNBNamePropertyPage)
  78. CSpinButtonCtrl m_spinHopCount;
  79. //}}AFX_DATA
  80. //{{AFX_MSG(IpxStaticNBNamePropertyPage)
  81. virtual BOOL OnInitDialog();
  82. //}}AFX_MSG
  83. //{{AFX_MSG(IpxStaticNBNamePropertyPage
  84. afx_msg void OnChangeButton();
  85. afx_msg void OnInputFilters();
  86. afx_msg void OnOutputFilters();
  87. //}}AFX_MSG
  88. DECLARE_MESSAGE_MAP()
  89. };
  90. // ---------------------------------------------------------------------------
  91. // Class: IpxStaticNBNamePropertySheet
  92. //
  93. // This is the property sheet support class for the properties page of
  94. // IPX Static Route items.
  95. //
  96. // Author: deonb
  97. //---------------------------------------------------------------------------
  98. class IpxStaticNBNamePropertySheet :
  99. public RtrPropertySheet
  100. {
  101. public:
  102. IpxStaticNBNamePropertySheet(ITFSNode *pNode,
  103. IComponentData *pComponentData,
  104. ITFSComponentData *pTFSCompData,
  105. LPCTSTR pszSheetName,
  106. CWnd *pParent = NULL,
  107. UINT iPage=0,
  108. BOOL fScopePane = TRUE);
  109. HRESULT Init(BaseIPXResultNodeData * pNodeData,
  110. IInterfaceInfo * spInterfaceInfo);
  111. virtual BOOL SaveSheetData();
  112. virtual void CancelSheetData();
  113. BaseIPXResultNodeData * m_pNodeData;
  114. CComPtr<IInterfaceInfo> m_spInterfaceInfo;
  115. CComPtr<ITFSNode> m_spNode;
  116. protected:
  117. IpxStaticNBNamePropertyPage m_pageGeneral;
  118. };
  119. // ---------------------------------------------------------------------------
  120. // AddStaticRoute function updated to use a SafeIPXSNListEntry
  121. // ---------------------------------------------------------------------------
  122. HRESULT AddStaticNetBIOSName(SafeIPXSNListEntry *pSNEntryNew,
  123. IInfoBase *pInfoBase,
  124. InfoBlock *pBlock);
  125. #endif _NBPROP_H