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.

177 lines
4.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: infopriv.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _INFOPRIV_H_
  11. #define _INFOPRIV_H_
  12. #include "setupapi.h"
  13. HRESULT RasPhoneBookRemoveInterface(LPCTSTR pszMachine, LPCTSTR pszIf);
  14. /*---------------------------------------------------------------------------
  15. Class: CNetcardRegistryHelper
  16. This class is provided for NT4/NT5 registry compatibility.
  17. This is a temporary class. Change to use the NetCfg APIs once
  18. they are in place, that is once they can be remoted.
  19. ---------------------------------------------------------------------------*/
  20. class CNetcardRegistryHelper
  21. {
  22. public:
  23. CNetcardRegistryHelper();
  24. ~CNetcardRegistryHelper();
  25. void Initialize(BOOL fNt4, HKEY hkeyBase,
  26. LPCTSTR pszKeyBase, LPCTSTR pszMachineName);
  27. DWORD ReadServiceName();
  28. LPCTSTR GetServiceName();
  29. DWORD ReadTitle();
  30. LPCTSTR GetTitle();
  31. DWORD ReadDeviceName();
  32. LPCTSTR GetDeviceName();
  33. private:
  34. void FreeDevInfo();
  35. DWORD PrivateInit();
  36. DWORD ReadRegistryCString(LPCTSTR pszKey,
  37. LPCTSTR pszValue,
  38. HKEY hkey,
  39. CString *pstDest);
  40. CString m_stTitle; // string holding title
  41. CString m_stKeyBase; // string holding name of key in hkeyBase (NT5)
  42. CString m_stDeviceName;
  43. HKEY m_hkeyBase;
  44. // Used for Connection info
  45. HKEY m_hkeyConnection;
  46. // Keys only used for NT4 only
  47. HKEY m_hkeyService; // hkey where the service value is held
  48. CString m_stService; // string holding service name
  49. HKEY m_hkeyTitle; // hkey where the title value is held
  50. // Values used for NT5 only
  51. HDEVINFO m_hDevInfo;
  52. CString m_stMachineName;
  53. BOOL m_fInit;
  54. BOOL m_fNt4;
  55. };
  56. class CWeakRef
  57. {
  58. public:
  59. CWeakRef();
  60. virtual ~CWeakRef() {};
  61. virtual void ReviveStrongRef() {};
  62. virtual void OnLastStrongRef() {};
  63. STDMETHOD_(ULONG, AddRef)();
  64. STDMETHOD_(ULONG, Release)();
  65. STDMETHOD(AddWeakRef)();
  66. STDMETHOD(ReleaseWeakRef)();
  67. protected:
  68. // Total number of references (strong and weak) on this object
  69. LONG m_cRef;
  70. // Number of weak references on this object
  71. LONG m_cRefWeak;
  72. // Is there a strong reference on this object?
  73. BOOL m_fStrongRef;
  74. // Has the object been told to destruct? If so, it will do
  75. // should call Destruct() in OnLastStrongRef().
  76. BOOL m_fDestruct;
  77. // Are we in the process of calling OnLastStrongRef(). If we
  78. // are, then additional calls to AddRef() do not cause us
  79. // to wake up again.
  80. BOOL m_fInShutdown;
  81. };
  82. #define IMPLEMENT_WEAKREF_ADDREF_RELEASE(klass) \
  83. STDMETHODIMP_(ULONG) klass::AddRef() \
  84. { \
  85. return CWeakRef::AddRef(); \
  86. } \
  87. STDMETHODIMP_(ULONG) klass::Release() \
  88. { \
  89. return CWeakRef::Release(); \
  90. } \
  91. STDMETHODIMP klass::AddWeakRef() \
  92. { \
  93. return CWeakRef::AddWeakRef(); \
  94. } \
  95. STDMETHODIMP klass::ReleaseWeakRef() \
  96. { \
  97. return CWeakRef::ReleaseWeakRef(); \
  98. } \
  99. #define CONVERT_TO_STRONGREF(p) \
  100. (p)->AddRef(); \
  101. (p)->ReleaseWeakRef(); \
  102. #define CONVERT_TO_WEAKREF(p) \
  103. (p)->AddWeakRef(); \
  104. (p)->Release(); \
  105. interface IRouterInfo;
  106. interface IRtrMgrInfo;
  107. interface IInterfaceInfo;
  108. interface IRtrMgrInterfaceInfo;
  109. interface IRtrMgrProtocolInterfaceInfo;
  110. HRESULT CreateRouterDataObject(LPCTSTR pszMachineName,
  111. DATA_OBJECT_TYPES type,
  112. MMC_COOKIE cookie,
  113. ITFSComponentData *pTFSCompData,
  114. IDataObject **ppDataObject,
  115. CDynamicExtensions * pDynExt /* = NULL */,
  116. BOOL fAddedAsLocal);
  117. HRESULT CreateDataObjectFromRouterInfo(IRouterInfo *pInfo,
  118. LPCTSTR pszMachineName,
  119. DATA_OBJECT_TYPES type,
  120. MMC_COOKIE cookie,
  121. ITFSComponentData *pTFSCompData,
  122. IDataObject **ppDataObject,
  123. CDynamicExtensions * pDynExt /* = NULL */,
  124. BOOL fAddedAsLocal);
  125. HRESULT CreateDataObjectFromRtrMgrInfo(IRtrMgrInfo *pInfo,
  126. IDataObject **ppDataObject);
  127. HRESULT CreateDataObjectFromInterfaceInfo(IInterfaceInfo *pInfo,
  128. DATA_OBJECT_TYPES type,
  129. MMC_COOKIE cookie,
  130. ITFSComponentData *pTFSCompData,
  131. IDataObject **ppDataObject);
  132. HRESULT CreateDataObjectFromRtrMgrInterfaceInfo(IRtrMgrInterfaceInfo *pInfo,
  133. IDataObject **ppDataObject);
  134. HRESULT CreateDataObjectFromRtrMgrProtocolInterfaceInfo(IRtrMgrProtocolInterfaceInfo *pInfo,
  135. IDataObject **ppDataObject);
  136. #endif