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.

107 lines
2.0 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. ipxconn.h
  7. Per-instance node data. This will hold the RPC handles in
  8. a central place.
  9. FILE HISTORY:
  10. */
  11. #ifndef _IPXCONN_H
  12. #define _IPXCONN_H
  13. #ifndef _INFO_H
  14. #include "info.h"
  15. #endif
  16. #ifndef _RTRUTIL_H
  17. #include "rtrutil.h"
  18. #endif
  19. #include "mprapi.h"
  20. class IPXConnection
  21. {
  22. public:
  23. IPXConnection();
  24. ~IPXConnection();
  25. ULONG AddRef();
  26. ULONG Release();
  27. void SetMachineName(LPCTSTR pszMachineName);
  28. LPCTSTR GetMachineName();
  29. HRESULT ConnectToMibServer();
  30. void DisconnectFromMibServer();
  31. HRESULT ConnectToMprServer();
  32. void DisconnectFromMprServer();
  33. HRESULT ConnectToConfigServer();
  34. void DisconnectFromConfigServer();
  35. void DisconnectAll();
  36. BOOL IsComputerAddedAsLocal();
  37. void SetComputerAddedAsLocal(BOOL fAddedAsLocal);
  38. MPR_SERVER_HANDLE GetMprHandle();
  39. MIB_SERVER_HANDLE GetMibHandle();
  40. MPR_CONFIG_HANDLE GetConfigHandle();
  41. private:
  42. long m_cRefCount;
  43. SPMprServerHandle m_sphMpr;
  44. SPMibServerHandle m_sphMib;
  45. SPMprConfigHandle m_sphConfig;
  46. CString m_stServerName;
  47. BOOL m_fComputerAddedAsLocal;
  48. };
  49. inline void IPXConnection::DisconnectFromMprServer()
  50. {
  51. m_sphMpr.Release();
  52. }
  53. inline void IPXConnection::DisconnectFromMibServer()
  54. {
  55. m_sphMib.Release();
  56. }
  57. inline void IPXConnection::DisconnectFromConfigServer()
  58. {
  59. m_sphConfig.Release();
  60. }
  61. inline MPR_SERVER_HANDLE IPXConnection::GetMprHandle()
  62. {
  63. if (!m_sphMpr)
  64. ConnectToMprServer();
  65. return m_sphMpr;
  66. }
  67. inline MIB_SERVER_HANDLE IPXConnection::GetMibHandle()
  68. {
  69. if (!m_sphMib)
  70. ConnectToMibServer();
  71. return m_sphMib;
  72. }
  73. inline MPR_CONFIG_HANDLE IPXConnection::GetConfigHandle()
  74. {
  75. if (!m_sphConfig)
  76. ConnectToConfigServer();
  77. return m_sphConfig;
  78. }
  79. #endif _IPXCONN_H