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.

120 lines
3.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997 - 1998
  5. //
  6. // File: B I N D O B J . H
  7. //
  8. // Contents: Declaration of base class for RAS binding objects.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 11 Jun 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. //nclude <notifval.h>
  17. #include "netcfgx.h"
  18. #include "resource.h"
  19. //#include "rasaf.h"
  20. //nclude "rasdata.h"
  21. #include "ncutil.h"
  22. class CRasBindObject
  23. {
  24. public:
  25. // Make these members public for now. Since this object
  26. // is instantiated from the modem class installer. We
  27. // need to set the INetCfg member.
  28. //
  29. INetCfg* m_pnc;
  30. CRasBindObject ();
  31. ~CRasBindObject ()
  32. {
  33. ReleaseObj (m_pnc);
  34. m_pnc = NULL;
  35. }
  36. // You must call ReleaseOtherComponents after calling this.
  37. HRESULT HrFindOtherComponents ();
  38. // You can only call this once per call to HrFindOtherComponents.
  39. VOID ReleaseOtherComponents () NOTHROW;
  40. protected:
  41. // We keep an array of INetCfgComponent pointers. This enum
  42. // defines the indicies of the array. The static arrays of
  43. // class guids and component ids identify the respecitive components.
  44. // HrFindOtherComonents initializes the array of component pointers
  45. // and ReleaseOtherComponents releases them. Note, however, that this
  46. // action is refcounted. This is because we are re-entrant.
  47. // HrFindOtherComponents only finds the components if the refcount is
  48. // zero. After every call, it increments the refcount.
  49. // ReleaseOtherComponents always decrements the refcount and only
  50. // releases the components if the refcount is zero.
  51. //
  52. enum OTHER_COMPONENTS
  53. {
  54. c_ipnccRasCli = 0,
  55. c_ipnccRasSrv,
  56. c_ipnccRasRtr,
  57. c_ipnccIp,
  58. c_ipnccIpx,
  59. c_ipnccNbf,
  60. c_ipnccAtalk,
  61. c_ipnccNetMon,
  62. c_ipnccNdisWan,
  63. c_cOtherComponents,
  64. };
  65. static const GUID* c_apguidComponentClasses [c_cOtherComponents];
  66. static const LPCTSTR c_apszComponentIds [c_cOtherComponents];
  67. INetCfgComponent* m_apnccOther [c_cOtherComponents];
  68. ULONG m_ulOtherComponents;
  69. protected:
  70. INetCfgComponent* PnccRasCli () NOTHROW;
  71. INetCfgComponent* PnccRasSrv () NOTHROW;
  72. INetCfgComponent* PnccIp () NOTHROW;
  73. INetCfgComponent* PnccIpx () NOTHROW;
  74. };
  75. extern const TCHAR c_szInfId_MS_NdisWanAtalk[];
  76. extern const TCHAR c_szInfId_MS_NdisWanIpIn[];
  77. extern const TCHAR c_szInfId_MS_NdisWanIpOut[];
  78. extern const TCHAR c_szInfId_MS_NdisWanIpx[];
  79. extern const TCHAR c_szInfId_MS_NdisWanNbfIn[];
  80. extern const TCHAR c_szInfId_MS_NdisWanNbfOut[];
  81. extern const TCHAR c_szInfId_MS_NdisWanBh[];
  82. inline
  83. INetCfgComponent*
  84. CRasBindObject::PnccRasCli () NOTHROW
  85. {
  86. return m_apnccOther [c_ipnccRasCli];
  87. }
  88. inline
  89. INetCfgComponent*
  90. CRasBindObject::PnccRasSrv () NOTHROW
  91. {
  92. return m_apnccOther [c_ipnccRasSrv];
  93. }
  94. inline
  95. INetCfgComponent*
  96. CRasBindObject::PnccIp () NOTHROW
  97. {
  98. return m_apnccOther [c_ipnccIp];
  99. }
  100. inline
  101. INetCfgComponent*
  102. CRasBindObject::PnccIpx () NOTHROW
  103. {
  104. return m_apnccOther [c_ipnccIpx];
  105. }