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.

313 lines
11 KiB

  1. //
  2. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  3. //
  4. // ***************************************************************************
  5. //
  6. // Original Author: Rajesh Rao
  7. //
  8. // $Author: rajeshr $
  9. // $Date: 6/11/98 4:43p $
  10. // $Workfile:adsiprop.h $
  11. //
  12. // $Modtime: 6/11/98 11:21a $
  13. // $Revision: 1 $
  14. // $Nokeywords: $
  15. //
  16. //
  17. // Description: Contains the declaration for the CADSIProperty which encapsulates an ADSI property. The syntax of an ADSI Property
  18. // is based on the values of the following 3 attributes:
  19. // Attribute Syntax : This is an OID
  20. // OMSyntax: This is an integer
  21. // OMObjectClass : This is an octet string
  22. // For all the syntaxes in the AD, the value om Attribute Syntax is enough for our purposes of
  23. // mapping to a CIM Syntax since values of instances of these properties come mapped to the same
  24. // ADS_TYPE if the value of their OMSyntax is same. Except for the syntaxes Object(OR-Name) and DN_With_Binary
  25. // which have the same value for OMSyntax and Attribute Syntax, but are differentiated based on the value
  26. // of the OMObjectClass. Hence instead of storing the value of OMObjectClass (which is an LPBYTE value) for
  27. // every attribute, we just store one BOOLEAN value isORName which tells us whether the syntax is OR-Name or DN_With_Binary.
  28. // Call it a hack, optimization whatever.
  29. //
  30. //***************************************************************************
  31. #ifndef ADSI_PROPERTY_H
  32. #define ADSI_PROPERTY_H
  33. class CADSIProperty : public CRefCountedObject
  34. {
  35. public:
  36. //***************************************************************************
  37. //
  38. // CADSIProperty::CADSIProperty
  39. //
  40. // Purpose : Constructor
  41. //
  42. // Parameters:
  43. //
  44. // None
  45. //***************************************************************************
  46. CADSIProperty();
  47. //***************************************************************************
  48. //
  49. // CADSIProperty::CADSIProperty
  50. //
  51. // Purpose : Constructor
  52. //
  53. // Parameters:
  54. // lpszWBEMPropertyName : The WBEM name of the property being created. A copy of this is made
  55. // lpszADSIPropertyName : The ADSI name of the property being created. A copy of this is made
  56. //***************************************************************************
  57. CADSIProperty(LPCWSTR lpszWBEMPropertyName, LPCWSTR lpszADSIPropertyName);
  58. //***************************************************************************
  59. //
  60. // CADSIProperty :: ~CADSIProperty
  61. //
  62. // Purpose : Destructor
  63. //***************************************************************************
  64. virtual ~CADSIProperty();
  65. //***************************************************************************
  66. //
  67. // CADSIProperty :: GetWBEMPropertyName
  68. //
  69. // Purpose : Returns the WBEM property name of this property
  70. //***************************************************************************
  71. LPCWSTR GetWBEMPropertyName();
  72. //***************************************************************************
  73. //
  74. // CADSIProperty :: SetWBEMPropertyName
  75. //
  76. // Purpose : Sets the WBEM name of this property
  77. //***************************************************************************
  78. void SetWBEMPropertyName(LPCWSTR lpszWBEMName);
  79. //***************************************************************************
  80. //
  81. // CADSIProperty :: GetADSIPropertyName
  82. //
  83. // Purpose : Returns the ADSI property name of this property
  84. //***************************************************************************
  85. LPCWSTR GetADSIPropertyName();
  86. //***************************************************************************
  87. //
  88. // CADSIProperty :: SetADSIPropertyName
  89. //
  90. // Purpose : Sets the ADSI name of this property
  91. //***************************************************************************
  92. void SetADSIPropertyName(LPCWSTR lpszADSIName);
  93. //***************************************************************************
  94. //
  95. // CADSIProperty :: GetSyntaxOID
  96. //
  97. // Purpose : Returns the ADSI Syntax OID of this property
  98. //***************************************************************************
  99. LPCWSTR GetSyntaxOID();
  100. //***************************************************************************
  101. //
  102. // CADSIProperty :: SetSyntaxOID
  103. //
  104. // Purpose : Sets the ADSI Syntax OID of this property
  105. //***************************************************************************
  106. void SetSyntaxOID(LPCWSTR lpszSystaxOID);
  107. //***************************************************************************
  108. //
  109. // CADSIProperty :: IsORName
  110. //
  111. // Purpose : Returns whether the property has a syntax of Object(OR-Name).
  112. //***************************************************************************
  113. BOOLEAN IsORName();
  114. //***************************************************************************
  115. //
  116. // CADSIProperty :: SetORName
  117. //
  118. // Purpose : Sets the m_bORName property of this property
  119. //***************************************************************************
  120. void SetORName(BOOLEAN bORName);
  121. //***************************************************************************
  122. //
  123. // CADSIProperty :: IsMultiValued
  124. //
  125. // Purpose : Returns whether the property is multi valued
  126. //***************************************************************************
  127. BOOLEAN IsMultiValued();
  128. //***************************************************************************
  129. //
  130. // CADSIProperty :: SetMultiValued
  131. //
  132. // Purpose : Sets the multi-valued property of this property
  133. //***************************************************************************
  134. void SetMultiValued(BOOLEAN bMultiValued);
  135. //***************************************************************************
  136. //
  137. // CADSIProperty :: IsSystemOnly
  138. //
  139. // Purpose : Returns whether the property is SystemOnly
  140. //***************************************************************************
  141. BOOLEAN IsSystemOnly();
  142. //***************************************************************************
  143. //
  144. // CADSIProperty :: SetSystemOnly
  145. //
  146. // Purpose : Sets the SystemOnly property of this property
  147. //***************************************************************************
  148. void SetSystemOnly(BOOLEAN bSystemOnly);
  149. //***************************************************************************
  150. //
  151. // CADSIProperty :: GetSearchFlags
  152. //
  153. // Purpose : Returns the SearchFlags property of the property
  154. //***************************************************************************
  155. DWORD GetSearchFlags();
  156. //***************************************************************************
  157. //
  158. // CADSIProperty :: SetSearchFlags
  159. //
  160. // Purpose : Sets the SearchFlags property of this property
  161. //***************************************************************************
  162. void SetSearchFlags(DWORD dwSearchFlags);
  163. //***************************************************************************
  164. //
  165. // CADSIProperty :: GetOMSyntax
  166. //
  167. // Purpose : Returns the OMSyntax property of the property
  168. //***************************************************************************
  169. DWORD GetOMSyntax();
  170. //***************************************************************************
  171. //
  172. // CADSIProperty :: SetOMSyntax
  173. //
  174. // Purpose : Sets the OMSyntax property of this property
  175. //***************************************************************************
  176. void SetOMSyntax(DWORD dwOMSyntax);
  177. //***************************************************************************
  178. //
  179. // CADSIProperty :: GetMAPI_ID
  180. //
  181. // Purpose : Returns the MAPI_ID property of the property
  182. //***************************************************************************
  183. DWORD GetMAPI_ID();
  184. //***************************************************************************
  185. //
  186. // CADSIProperty :: SetMAPI_ID
  187. //
  188. // Purpose : Sets the MAPI_ID property of this property
  189. //***************************************************************************
  190. void SetMAPI_ID(DWORD dwMAPI_ID);
  191. //***************************************************************************
  192. //
  193. // CADSIProperty :: GetAttributeID
  194. //
  195. // Purpose : Returns the Attribute ID of this property
  196. //***************************************************************************
  197. LPCWSTR GetAttributeID();
  198. //***************************************************************************
  199. //
  200. // CADSIProperty :: SetAttributeID
  201. //
  202. // Purpose : Sets the Attribute ID of this property
  203. //***************************************************************************
  204. void SetAttributeID(LPCWSTR lpszAttributeID);
  205. //***************************************************************************
  206. //
  207. // CADSIProperty :: GetCommonName
  208. //
  209. // Purpose : Returns the Common Name of this property
  210. //***************************************************************************
  211. LPCWSTR GetCommonName();
  212. //***************************************************************************
  213. //
  214. // CADSIProperty :: SetCommonName
  215. //
  216. // Purpose : Sets the CommonName of this property
  217. //***************************************************************************
  218. void SetCommonName(LPCWSTR lpszCommonName);
  219. //***************************************************************************
  220. //
  221. // CADSIProperty :: GetDirectoryObject
  222. //
  223. // Purpose : Returns the ADSI object pertaining to this property
  224. // It is the user's duty to release it when done
  225. //
  226. // Parameters:
  227. // None
  228. //
  229. // Return Value:
  230. // The ADSI object interface pertaining to this property
  231. //***************************************************************************
  232. IDirectoryObject *GetDirectoryObject();
  233. //***************************************************************************
  234. //
  235. // CADSIProperty :: SetDirectoryObject
  236. //
  237. // Purpose : Sets the ADSI object pertaining to this property
  238. //
  239. // Parameter : The directory object pertaining to this property
  240. //***************************************************************************
  241. void SetDirectoryObject(IDirectoryObject *pDirectoryObject);
  242. protected:
  243. // The WBEM name of this property
  244. LPWSTR m_lpszWBEMPropertyName;
  245. // The ADSI interface for the object representing this property
  246. IDirectoryObject * m_pDirectoryObject;
  247. // The Syntax OID
  248. LPWSTR m_lpszSyntaxOID;
  249. // Used to differentiate between the syntaxes Object(OR-Name) and DN_with_Binary
  250. // See the beginning of this file for a detailed explanation of this.
  251. BOOLEAN m_bORName;
  252. // Whether it is multi valued
  253. BOOLEAN m_bMultiValued;
  254. // The Attribute ID
  255. LPWSTR m_lpszAttributeID;
  256. // The Common Name
  257. LPWSTR m_lpszCommonName;
  258. // Whether this property is SystemOnly
  259. BOOLEAN m_bSystemOnly;
  260. // Search Flags
  261. DWORD m_dwSearchFlags;
  262. // MAPI ID
  263. DWORD m_dwMAPI_ID;
  264. // OM Syntax
  265. DWORD m_dwOMSyntax;
  266. };
  267. #endif /* ADSI_PROPERTY_H */