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.

272 lines
8.6 KiB

  1. //***************************************************************************
  2. //
  3. // File:
  4. //
  5. // Module: MS SNMP Provider
  6. //
  7. // Purpose:
  8. //
  9. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  10. //
  11. //***************************************************************************
  12. #ifndef _HANDLES_H_
  13. #define _HANDLES_H_
  14. class CSmirModuleHandle : public ISmirModHandle
  15. {
  16. private:
  17. friend CSmirAdministrator;
  18. friend CEnumSmirMod;
  19. friend CModHandleClassFactory;
  20. //reference count
  21. LONG m_cRef;
  22. //member variables
  23. BSTR m_szModuleOid;
  24. BSTR m_szName;
  25. BSTR m_szModuleId;
  26. BSTR m_szOrganisation;
  27. BSTR m_szContactInfo;
  28. BSTR m_szDescription;
  29. BSTR m_szRevision;
  30. BSTR m_szModImports;
  31. ULONG m_lSnmp_version;
  32. BSTR m_szLastUpdate;
  33. public:
  34. //IUnknown members
  35. STDMETHODIMP QueryInterface(IN REFIID,OUT PPVOID);
  36. STDMETHODIMP_(ULONG) AddRef();
  37. STDMETHODIMP_(ULONG) Release();
  38. STDMETHODIMP_(SCODE) GetName(OUT BSTR *pszName);
  39. STDMETHODIMP_(SCODE) GetModuleOID(OUT BSTR *pszModuleOid);
  40. STDMETHODIMP_(SCODE) GetModuleIdentity(OUT BSTR *pszModuleId);
  41. STDMETHODIMP_(SCODE) GetLastUpdate(OUT BSTR *plLastUpdate);
  42. STDMETHODIMP_(SCODE) GetOrganisation(OUT BSTR *pszOrganisation);
  43. STDMETHODIMP_(SCODE) GetContactInfo(OUT BSTR *pszContactInfo);
  44. STDMETHODIMP_(SCODE) GetDescription(OUT BSTR *pszDescription);
  45. STDMETHODIMP_(SCODE) GetRevision(OUT BSTR *pszRevision);
  46. STDMETHODIMP_(SCODE) GetSnmpVersion(OUT ULONG *plSnmp_version);
  47. STDMETHODIMP_(SCODE) GetModuleImports (BSTR*);
  48. STDMETHODIMP_(SCODE) SetName(IN BSTR pszName);
  49. STDMETHODIMP_(SCODE) SetModuleOID(IN BSTR pszModuleOid);
  50. STDMETHODIMP_(SCODE) SetModuleIdentity(OUT BSTR pszModuleId);
  51. STDMETHODIMP_(SCODE) SetLastUpdate(IN BSTR plLastUpdate);
  52. STDMETHODIMP_(SCODE) SetOrganisation(IN BSTR pszOrganisation);
  53. STDMETHODIMP_(SCODE) SetContactInfo(IN BSTR pszContactInfo);
  54. STDMETHODIMP_(SCODE) SetDescription(IN BSTR pszDescription);
  55. STDMETHODIMP_(SCODE) SetRevision(IN BSTR pszRevision);
  56. STDMETHODIMP_(SCODE) SetSnmpVersion(IN ULONG plSnmp_version);
  57. STDMETHODIMP_(SCODE) SetModuleImports (IN BSTR);
  58. //Class members
  59. CSmirModuleHandle();
  60. virtual ~ CSmirModuleHandle();
  61. const CSmirModuleHandle& operator>>(IWbemClassObject *pInst);
  62. const CSmirModuleHandle& operator<<(IWbemClassObject *pInst);
  63. const CSmirModuleHandle& operator>>(ISmirSerialiseHandle *pInst);
  64. HRESULT PutClassProperties (IWbemClassObject *pClass) ;
  65. operator void*();
  66. STDMETHODIMP_(SCODE) AddToDB( CSmir *a_Smir );
  67. STDMETHODIMP_(SCODE) DeleteFromDB( CSmir *a_Smir );
  68. private:
  69. //private copy constructors to prevent bcopy
  70. CSmirModuleHandle(CSmirModuleHandle&);
  71. const CSmirModuleHandle& operator=(CSmirModuleHandle &);
  72. };
  73. class CSmirGroupHandle : public ISmirGroupHandle
  74. {
  75. private:
  76. friend CSmirAdministrator;
  77. friend CEnumSmirGroup;
  78. friend CGroupHandleClassFactory;
  79. //reference count
  80. LONG m_cRef;
  81. BSTR m_szModuleName;
  82. BSTR m_szName;
  83. BSTR m_szGroupId;
  84. BSTR m_szDescription;
  85. BSTR m_szReference;
  86. BSTR m_szStatus;
  87. public:
  88. //IUnknown members
  89. STDMETHODIMP QueryInterface(IN REFIID,OUT PPVOID);
  90. STDMETHODIMP_(ULONG) AddRef();
  91. STDMETHODIMP_(ULONG) Release();
  92. STDMETHODIMP_(SCODE) GetModuleName(OUT BSTR *pszName);
  93. STDMETHODIMP_ (SCODE) GetName(OUT BSTR *);
  94. STDMETHODIMP_ (SCODE) GetGroupOID(OUT BSTR *);
  95. STDMETHODIMP_ (SCODE) GetStatus(OUT BSTR *);
  96. STDMETHODIMP_ (SCODE) GetDescription(OUT BSTR *);
  97. STDMETHODIMP_ (SCODE) GetReference(OUT BSTR *);
  98. STDMETHODIMP_(SCODE) SetModuleName(IN BSTR pszName);
  99. STDMETHODIMP_ (SCODE) SetName(IN BSTR );
  100. STDMETHODIMP_ (SCODE) SetGroupOID(IN BSTR );
  101. STDMETHODIMP_ (SCODE) SetStatus(IN BSTR );
  102. STDMETHODIMP_ (SCODE) SetDescription(IN BSTR );
  103. STDMETHODIMP_ (SCODE) SetReference(IN BSTR );
  104. //Class members
  105. const CSmirGroupHandle& operator>>(IWbemClassObject *pInst);
  106. const CSmirGroupHandle& operator<<(IWbemClassObject *pInst);
  107. const CSmirGroupHandle& operator>>(ISmirSerialiseHandle *pInst);
  108. HRESULT PutClassProperties (IWbemClassObject *pClass) ;
  109. operator void* ();
  110. CSmirGroupHandle();
  111. virtual ~ CSmirGroupHandle();
  112. STDMETHODIMP_(SCODE) AddToDB( CSmir *a_Smir , ISmirModHandle *hModule);
  113. STDMETHODIMP_(SCODE) DeleteFromDB( CSmir *a_Smir );
  114. private:
  115. //private copy constructors to prevent bcopy
  116. CSmirGroupHandle(CSmirGroupHandle&);
  117. const CSmirGroupHandle& operator=(CSmirGroupHandle &);
  118. };
  119. class CSmirClassHandle : public ISmirClassHandle
  120. {
  121. private:
  122. friend CSmirAdministrator;
  123. friend CEnumSmirClass;
  124. friend CClassHandleClassFactory;
  125. friend CModuleToClassAssociator;
  126. friend CGroupToClassAssociator;
  127. friend CSMIRToClassAssociator;
  128. //reference count
  129. LONG m_cRef;
  130. IWbemClassObject *m_pIMosClass;
  131. BSTR m_szModuleName;
  132. BSTR m_szGroupName;
  133. public:
  134. //IUnknown members
  135. STDMETHODIMP QueryInterface(IN REFIID,OUT PPVOID);
  136. STDMETHODIMP_(ULONG) AddRef();
  137. STDMETHODIMP_(ULONG) Release();
  138. STDMETHODIMP_(SCODE) GetModuleName(OUT BSTR *pszName);
  139. STDMETHODIMP_(SCODE) GetGroupName(OUT BSTR *pszName);
  140. STDMETHODIMP_(SCODE) SetModuleName(OUT BSTR pszName);
  141. STDMETHODIMP_(SCODE) SetGroupName(OUT BSTR pszName);
  142. STDMETHODIMP_(SCODE) GetWBEMClass(OUT IWbemClassObject **pObj);
  143. STDMETHODIMP_(SCODE) SetWBEMClass(IN IWbemClassObject *pObj);
  144. //Class members
  145. const CSmirClassHandle& operator>>(ISmirSerialiseHandle *pInst);
  146. operator void* ();
  147. CSmirClassHandle();
  148. virtual ~ CSmirClassHandle();
  149. STDMETHODIMP_(SCODE) AddToDB( CSmir *a_Smir , ISmirGroupHandle *hGroup);
  150. STDMETHODIMP_(SCODE) DeleteFromDB( CSmir *a_Smir );
  151. STDMETHODIMP_(SCODE) DeleteClassFromGroup( CSmir *a_Smir );
  152. private:
  153. //private copy constructors to prevent bcopy
  154. CSmirClassHandle(CSmirClassHandle&);
  155. const CSmirClassHandle& operator=(CSmirClassHandle &);
  156. };
  157. class CModuleToNotificationClassAssociator;
  158. class CModuleToExtNotificationClassAssociator;
  159. class CSmirNotificationClassHandle : public ISmirNotificationClassHandle
  160. {
  161. private:
  162. friend CSmirAdministrator;
  163. //friend CEnumNotificationClass;
  164. friend CNotificationClassHandleClassFactory;
  165. friend CModuleToNotificationClassAssociator;
  166. //reference count
  167. LONG m_cRef;
  168. IWbemClassObject *m_pIMosClass;
  169. BSTR m_szModuleName;
  170. public:
  171. //IUnknown members
  172. STDMETHODIMP QueryInterface(IN REFIID,OUT PPVOID);
  173. STDMETHODIMP_(ULONG) AddRef();
  174. STDMETHODIMP_(ULONG) Release();
  175. STDMETHODIMP_(SCODE) SetModule(THIS_ BSTR);
  176. STDMETHODIMP_(SCODE) GetModule(THIS_ BSTR*);
  177. STDMETHODIMP_(SCODE) GetWBEMNotificationClass (THIS_ OUT IWbemClassObject **pObj );
  178. STDMETHODIMP_(SCODE) SetWBEMNotificationClass(THIS_ IWbemClassObject *pObj);
  179. //Class members
  180. const CSmirNotificationClassHandle& operator>>(ISmirSerialiseHandle *pInst);
  181. operator void* ();
  182. CSmirNotificationClassHandle();
  183. virtual ~CSmirNotificationClassHandle();
  184. STDMETHODIMP_(SCODE) AddToDB( CSmir *a_Smir );
  185. STDMETHODIMP_(SCODE) DeleteFromDB( CSmir *a_Smir );
  186. private:
  187. //private copy constructors to prevent bcopy
  188. CSmirNotificationClassHandle(CSmirNotificationClassHandle&);
  189. const CSmirNotificationClassHandle& operator=(CSmirNotificationClassHandle &);
  190. };
  191. class CSmirExtNotificationClassHandle : public ISmirExtNotificationClassHandle
  192. {
  193. private:
  194. friend CSmirAdministrator;
  195. //friend CEnumExtNotificationClass;
  196. friend CExtNotificationClassHandleClassFactory;
  197. friend CModuleToExtNotificationClassAssociator;
  198. //reference count
  199. LONG m_cRef;
  200. IWbemClassObject *m_pIMosClass;
  201. BSTR m_szModuleName;
  202. public:
  203. //IUnknown members
  204. STDMETHODIMP QueryInterface(IN REFIID,OUT PPVOID);
  205. STDMETHODIMP_(ULONG) AddRef();
  206. STDMETHODIMP_(ULONG) Release();
  207. STDMETHODIMP_(SCODE) SetModule(THIS_ BSTR);
  208. STDMETHODIMP_(SCODE) GetModule(THIS_ BSTR*);
  209. STDMETHODIMP_(SCODE) GetWBEMExtNotificationClass(OUT IWbemClassObject **pObj);
  210. STDMETHODIMP_(SCODE) SetWBEMExtNotificationClass(THIS_ IWbemClassObject *pObj);
  211. //Class members
  212. const CSmirExtNotificationClassHandle& operator>>(ISmirSerialiseHandle *pInst);
  213. operator void* ();
  214. CSmirExtNotificationClassHandle();
  215. virtual ~CSmirExtNotificationClassHandle();
  216. STDMETHODIMP_(SCODE) AddToDB ( CSmir *a_Smir );
  217. STDMETHODIMP_(SCODE) DeleteFromDB ( CSmir *a_Smir );
  218. private:
  219. //private copy constructors to prevent bcopy
  220. CSmirExtNotificationClassHandle(CSmirExtNotificationClassHandle&);
  221. const CSmirExtNotificationClassHandle& operator=(CSmirExtNotificationClassHandle &);
  222. };
  223. #endif