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.

342 lines
11 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1999.
  5. //
  6. // File: proputl.hxx
  7. //
  8. // Contents: Header for property handling routines
  9. //
  10. // Classes: CMRowsetProps : public CUtlProps
  11. // CMDSProps : public CUtlProps
  12. // CMSessProps : public CUtlProps
  13. // CMDSPropInfo : public CUtlPropInfo
  14. //
  15. // History: 10-28-97 danleg Created from monarch utlprop.h
  16. //
  17. //----------------------------------------------------------------------------
  18. #pragma once
  19. #include "propbase.hxx" // base class CUtlProp, CUtlPropInfo
  20. #include <parsver.hxx> // CImpIParserVerify
  21. #include <proprst.hxx> // CMRowsteProps
  22. //+-------------------------------------------------------------------------
  23. //
  24. // Class: CMDSProps
  25. //
  26. // Purpose: Properties for Datasource
  27. //
  28. // History: 11-12-97 danleg Created from Monarch
  29. //
  30. //--------------------------------------------------------------------------
  31. class CMDSProps : public CUtlProps
  32. {
  33. public:
  34. //
  35. // Ctor / Dtor
  36. //
  37. CMDSProps(CImpIParserVerify* pIPVerify);
  38. // Validate a Catalog
  39. SCODE ValidateCatalog ( VARIANT * pVariant );
  40. // Validate an LCID
  41. SCODE ValidateLocale ( VARIANT * pVariant );
  42. // Expose the appropriate # of propsets for before and after Initialize
  43. void ExposeMinimalSets();
  44. SCODE ExposeMaximalSets();
  45. //
  46. // Constants
  47. //
  48. // List of property offsets.
  49. // Note that this must match up with the static array.
  50. enum EID {
  51. // s_rgdbPropInit[] =
  52. //eid_AUTH_CACHE_AUTHINFO,
  53. //eid_AUTH_ENCRYPT_PASSWORD,
  54. eid_AUTH_INTEGRATED,
  55. //eid_AUTH_MASK_PASSWORD,
  56. //eid_AUTH_PASSWORD,
  57. //eid_AUTH_PERSIST_ENCRYPTED,
  58. //eid_AUTH_PERSIST_SENSITIVE_AUTHINFO,
  59. //eid_AUTH_USERID,
  60. //eid_INIT_ASYNCH,
  61. //eid_INIT_CATALOG,
  62. eid_INIT_DATASOURCE,
  63. eid_INIT_HWND,
  64. //eid_INIT_IMPERSONATION_LEVEL,
  65. eid_INIT_LCID,
  66. eid_INIT_LOCATION,
  67. //eid_INIT_MODE,
  68. eid_INIT_OLEDBSERVICES,
  69. eid_INIT_PROMPT,
  70. //eid_INIT_PROTECTION_LEVEL,
  71. //eid_INIT_PROVIDERSTRING,
  72. //eid_INIT_TIMEOUT,
  73. //eid_INIT_CATALOG,
  74. eid_INIT_PROPS_NUM,
  75. // s_rgdbPropDSInfo[] =
  76. eid_ACTIVESESSIONS = 0,
  77. eid_BYREFACCESSORS,
  78. eid_CATALOGLOCATION,
  79. eid_CATALOGTERM,
  80. eid_CATALOGUSAGE,
  81. eid_COLUMNDEFINITION,
  82. eid_DATASOURCEREADONLY,
  83. eid_DBMSNAME,
  84. eid_DBMSVER,
  85. eid_DSOTHREADMODEL,
  86. eid_GROUPBY,
  87. eid_HETEROGENEOUSTABLES,
  88. eid_MAXOPENCHAPTERS,
  89. eid_MAXROWSIZE,
  90. eid_MAXTABLESINSELECT,
  91. eid_MULTIPLEPARAMSETS,
  92. eid_MULTIPLERESULTS,
  93. eid_MULTIPLESTORAGEOBJECTS,
  94. eid_NULLCOLLATION,
  95. eid_OLEOBJECTS,
  96. eid_ORDERBYCOLUMNSINSELECT,
  97. eid_OUTPUTPARAMETERAVAILABILITY,
  98. eid_PERSISTENTIDTYPE,
  99. eid_PROVIDERFRIENDLYNAME,
  100. eid_PROVIDERNAME,
  101. eid_PROVIDEROLEDBVER,
  102. eid_PROVIDERVER,
  103. eid_ROWSETCONVERSIONSONCOMMAND,
  104. eid_SQLSUPPORT,
  105. eid_STRUCTUREDSTORAGE,
  106. eid_SUBQUERIES,
  107. eid_SUPPORTEDTXNDDL,
  108. eid_SUPPORTEDTXNISOLEVELS,
  109. eid_SUPPORTEDTXNISORETAIN,
  110. eid_DSINFO_PROPS_NUM, // Total # of entries
  111. // s_rgdbPropsDS[] =
  112. eid_CURRENTCATALOG = 0,
  113. eid_RESETDATASOURCE,
  114. eid_DS_PROPS_NUM,
  115. eid_DBPROPVAL_AUTH_INTEGRATED = 0,
  116. eid_DBPROPVAL_INIT_DATASOURCE,
  117. eid_DBPROPVAL_INIT_HWND,
  118. eid_DBPROPVAL_INIT_LCID,
  119. eid_DBPROPVAL_INIT_LOCATION,
  120. eid_DBPROPVAL_INIT_OLEDBSERVICES,
  121. eid_DBPROPVAL_INIT_PROMPT,
  122. //eid_DBPROPVAL_INIT_PROVIDERSTRING,
  123. eid_DBPROPVAL_CURRENTCATALOG = 0,
  124. eid_DBPROPVAL_RESETDATASOURCE,
  125. eid_DBPROPVAL_NUM, // Total # of DBPROPVAL entries
  126. // Which PropSet is DBINIT stuff in.
  127. eid_DBPROPSET_DBINIT=0,
  128. eid_DBPROPSET_DATASOURCEINFO,
  129. eid_DBPROPSET_DATASOURCE,
  130. eid_DBPROPSET_NUM, // Total # of DBPROPSET entries
  131. };
  132. private:
  133. //
  134. // Methods
  135. //
  136. // Given a propset and propid, return the default value
  137. SCODE GetDefaultValue ( ULONG iCurSet,
  138. DBPROPID dwPropId,
  139. DWORD * pdwOption,
  140. VARIANT * pvValue );
  141. // Given a propset and propid, determine if the value is valid
  142. SCODE IsValidValue ( ULONG iCurSet,
  143. DBPROP * pDBProp );
  144. // Initialize the properties this class manages
  145. SCODE InitAvailUPropSets(
  146. ULONG * pcUPropSet,
  147. UPROPSET ** ppUPropSet,
  148. ULONG * pcElemPer );
  149. // Initialize the properties this class supports
  150. SCODE InitUPropSetsSupported( DWORD * rgdwSupported );
  151. void HandleCatalog ( VARIANT * pvValue );
  152. //
  153. // Data member
  154. //
  155. XInterface<CImpIParserVerify> _xIPVerify;
  156. };
  157. //+-------------------------------------------------------------------------
  158. //
  159. // Class: CMSessProps
  160. //
  161. // Purpose: Properties for Session
  162. //
  163. // History: 11-12-97 danleg Created from Monarch
  164. //
  165. //--------------------------------------------------------------------------
  166. class CMSessProps : public CUtlProps
  167. {
  168. public:
  169. //
  170. // Ctor
  171. //
  172. CMSessProps() { FInit(); }
  173. // List of property offsets.
  174. // Note that this must match up with the static array.
  175. enum EID {
  176. // s_rgdbPropSESS[] =
  177. eid_SESS_AUTOCOMMITISOLEVELS,
  178. eid_SESS_PROPS_NUM, // Number of total entries.
  179. // Which PropSet is DBINIT stuff in.
  180. eid_DBPROPSET_SESSION=0,
  181. eid_DBPROPSET_NUM, // Number of total entries.
  182. };
  183. private:
  184. // Given a propset and propid, return the default value
  185. SCODE GetDefaultValue ( ULONG iCurSet,
  186. DBPROPID dwPropId,
  187. DWORD * pdwOption,
  188. VARIANT * pvValue );
  189. // Given a propset and propid, determine if the value is valid
  190. SCODE IsValidValue ( ULONG iCurSet,
  191. DBPROP * pDBProp );
  192. // Initialize the properties this class manages
  193. SCODE InitAvailUPropSets(
  194. ULONG * pcUPropSet,
  195. UPROPSET ** ppUPropSet,
  196. ULONG * pcElemPer );
  197. // Initialize the properties this class supports
  198. SCODE InitUPropSetsSupported( DWORD * rgdwSupported );
  199. };
  200. //+-------------------------------------------------------------------------
  201. //
  202. // Class: CMDSPropInfo
  203. //
  204. // Purpose: Property info for Datasource
  205. //
  206. // History: 11-12-97 danleg Created from Monarch
  207. //
  208. //--------------------------------------------------------------------------
  209. class CMDSPropInfo : public CUtlPropInfo
  210. {
  211. public:
  212. //
  213. // Ctor
  214. //
  215. CMDSPropInfo() { FInit(); }
  216. // Expose appropriate # of propsets for before and after Initialize
  217. void ExposeMinimalSets() { SetUPropSetCount( eid_DBPROPSET_NUM_INITPROPSETS+1 ); }
  218. void ExposeMaximalSets() { SetUPropSetCount( eid_DBPROPSET_NUM ); }
  219. // List of property offsets.
  220. // Note that this must match up with the static array.
  221. enum EID {
  222. // s_rgdbPropDSInfo[] =
  223. eid_ACTIVESESSIONS = 0,
  224. eid_BYREFACCESSORS,
  225. eid_CATALOGLOCATION,
  226. eid_CATALOGTERM,
  227. eid_CATALOGUSAGE,
  228. eid_COLUMNDEFINITION,
  229. eid_DATASOURCEREADONLY,
  230. eid_DBMSNAME,
  231. eid_DBMSVER,
  232. eid_DSOTHREADMODEL,
  233. eid_GROUPBY,
  234. eid_HETEROGENEOUSTABLES,
  235. eid_MAXOPENCHAPTERS,
  236. eid_MAXROWSIZE,
  237. eid_MAXTABLESINSELECT,
  238. eid_MULTIPLEPARAMSETS,
  239. eid_MULTIPLERESULTS,
  240. eid_MULTIPLESTORAGEOBJECTS,
  241. eid_NULLCOLLATION,
  242. eid_OLEOBJECTS,
  243. eid_ORDERBYCOLUMNSINSELECT,
  244. eid_OUTPUTPARAMETERAVAILABILITY,
  245. eid_PERSISTENTIDTYPE,
  246. eid_PROVIDERFRIENDLYNAME,
  247. eid_PROVIDERNAME,
  248. eid_PROVIDEROLEDBVER,
  249. eid_PROVIDERVER,
  250. eid_ROWSETCONVERSIONSONCOMMAND,
  251. eid_SQLSUPPORT,
  252. eid_STRUCTUREDSTORAGE,
  253. eid_SUBQUERIES,
  254. eid_SUPPORTEDTXNDDL,
  255. eid_SUPPORTEDTXNISOLEVELS,
  256. eid_SUPPORTEDTXNISORETAIN,
  257. eid_DSINFO_PROPS_NUM, // Number of elements
  258. // initialization property sets
  259. eid_DBPROPSET_DBINIT=0,
  260. // any future init propsets go here
  261. eid_DBPROPSET_NUM_INITPROPSETS=0, // Index of last init propset
  262. eid_DBPROPSET_DATASOURCEINFO,
  263. eid_DBPROPSET_DATASOURCE,
  264. eid_DBPROPSET_SESSION,
  265. eid_DBPROPSET_ROWSET,
  266. eid_DBPROPSET_MSIDXS_ROWSET_EXT,
  267. eid_DBPROPSET_QUERY_EXT,
  268. eid_DBPROPSET_NUM, // Total number of propsets
  269. };
  270. private:
  271. //
  272. // Data members
  273. //
  274. DWORD _rgdwSupported[DWORDSNEEDEDTOTAL];
  275. // Configuration Flags
  276. DWORD _dwFlags;
  277. // Allows base class to associate pointers.
  278. SCODE InitAvailUPropSets(
  279. ULONG * pcUPropSet,
  280. UPROPSET ** ppUPropSet,
  281. ULONG * pcElemPer );
  282. // Initialize the properties supported
  283. SCODE InitUPropSetsSupported( DWORD * rgdwSupported );
  284. // Load a description string
  285. ULONG LoadDescription ( LPCWSTR pwszDesc,
  286. PWSTR pwszBuff,
  287. ULONG cchBuff );
  288. };