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.

413 lines
18 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Microsoft WMIOLE DB Provider
  4. // (C) Copyright 1999 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // UtilProp.h - Header file for classes for managing properties
  7. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  8. #ifndef _UTILPROP_H_
  9. #define _UTILPROP_H_
  10. extern const GUID DBPROPSET_WMIOLEDB_DBINIT;
  11. extern const GUID DBPROPSET_WMIOLEDB_ROWSET;
  12. extern const GUID DBPROPSET_WMIOLEDB_COLUMN;
  13. extern const GUID DBPROPSET_WMIOLEDB_COMMAND;
  14. ////////////////////////////////////////////////////////////////////////
  15. // PRivileges property values
  16. ////////////////////////////////////////////////////////////////////////
  17. #define DBPROPVAL_CREATE_TOKEN 0x01
  18. #define DBPROPVAL_ASSIGNPRIMARYTOKEN 0x02
  19. #define DBPROPVAL_LOCK_MEMORY 0x04
  20. #define DBPROPVAL_INCREASE_QUOTA 0x08
  21. #define DBPROPVAL_MACHINE_ACCOUNT 0x10
  22. #define DBPROPVAL_TCB 0x20
  23. #define DBPROPVAL_SECURITY 0x40
  24. #define DBPROPVAL_TAKE_OWNERSHIP 0x80
  25. #define DBPROPVAL_LOAD_DRIVER 0x100
  26. #define DBPROPVAL_SYSTEM_PROFILE 0x200
  27. #define DBPROPVAL_SYSTEMTIME 0x400
  28. #define DBPROPVAL_PROF_SINGLE_PROCESS 0x800
  29. #define DBPROPVAL_INC_BASE_PRIORITY 0x1000
  30. #define DBPROPVAL_CREATE_PAGEFILE 0x2000
  31. #define DBPROPVAL_CREATE_PERMANENT 0x4000
  32. #define DBPROPVAL_BACKUP 0x8000
  33. #define DBPROPVAL_RESTORE 0x10000
  34. #define DBPROPVAL_SHUTDOWN 0x20000
  35. #define DBPROPVAL_DEBUG 0x40000
  36. #define DBPROPVAL_AUDIT 0x80000
  37. #define DBPROPVAL_SYSTEM_ENVIRONMENT 0x100000
  38. #define DBPROPVAL_CHANGE_NOTIFY 0x200000
  39. #define DBPROPVAL_REMOTE_SHUTDOWN 0x400000
  40. #define DBPROPVAL_UNDOCK 0x800000
  41. #define DBPROPVAL_SYNC_AGENT 0x1000000
  42. #define DBPROPVAL_ENABLE_DELEGATION 0x2000000
  43. #define NUMBEROF_PRIVELAGES 26
  44. #define NUMBEROF_SEARCHPREF 14
  45. //DBPROP_WMIOLEDB_OBJECTTYPE property values
  46. #define DBPROPVAL_NOOBJ 0
  47. #define DBPROPVAL_SCOPEOBJ 1
  48. #define DBPROPVAL_CONTAINEROBJ 2
  49. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  50. //
  51. // simple table used to store property information. Used in
  52. // our read-only implementation of IDBProperties::GetPropertyInfo and IRowsetInfo::GetProperties
  53. //
  54. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  55. struct _tagPROPSTRUCT
  56. {
  57. DBPROPID dwPropertyID;
  58. DBPROPFLAGS dwFlags;
  59. VARTYPE vtType;
  60. BOOL boolVal;
  61. SLONG longVal;
  62. PWSTR pwstrVal;
  63. PWSTR pwstrDescBuffer;
  64. ~_tagPROPSTRUCT()
  65. {
  66. // Only for Datasource , string will allocated by the utility
  67. if( vtType == VT_BSTR && pwstrVal != NULL && DBPROP_INIT_DATASOURCE == dwPropertyID )
  68. {
  69. // SysFreeString((BSTR)pwstrVal);
  70. SAFE_DELETE_ARRAY(pwstrVal);
  71. pwstrVal = NULL;
  72. }
  73. }
  74. };
  75. typedef _tagPROPSTRUCT PROPSTRUCT;
  76. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  77. // Property ID of the WMIOLEDB custom properties
  78. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  79. #define DBPROP_WMIOLEDB_FETCHDEEP 0x1000
  80. #define DBPROP_WMIOLEDB_QUALIFIERS 0x1001
  81. #define DBPROP_WMIOLEDB_QUALIFIERFLAVOR 0x1002
  82. #define DBPROP_WMIOLEDB_SYSTEMPROPERTIES 0x1003
  83. #define DBPROP_WMIOLEDB_OBJECTTYPE 0x1005
  84. #define DBPROP_WMIOLEDB_PREV_CREATE_TOKEN 0x1006
  85. #define DBPROP_WMIOLEDB_PREV_ASSIGNPRIMARYTOKEN 0x1007
  86. #define DBPROP_WMIOLEDB_PREV_LOCK_MEMORY 0x1008
  87. #define DBPROP_WMIOLEDB_PREV_INCREASE_QUOTA 0x1009
  88. #define DBPROP_WMIOLEDB_PREV_MACHINE_ACCOUNT 0x100a
  89. #define DBPROP_WMIOLEDB_PREV_TCB 0x100b
  90. #define DBPROP_WMIOLEDB_PREV_SECURITY 0x100c
  91. #define DBPROP_WMIOLEDB_PREV_TAKE_OWNERSHIP 0x100d
  92. #define DBPROP_WMIOLEDB_PREV_LOAD_DRIVER 0x100e
  93. #define DBPROP_WMIOLEDB_PREV_SYSTEM_PROFILE 0x100f
  94. #define DBPROP_WMIOLEDB_PREV_SYSTEMTIME 0x1010
  95. #define DBPROP_WMIOLEDB_PREV_PROF_SINGLE_PROCESS 0x1011
  96. #define DBPROP_WMIOLEDB_PREV_INC_BASE_PRIORITY 0x1012
  97. #define DBPROP_WMIOLEDB_PREV_CREATE_PAGEFILE 0x1013
  98. #define DBPROP_WMIOLEDB_PREV_CREATE_PERMANENT 0x1014
  99. #define DBPROP_WMIOLEDB_PREV_BACKUP 0x1015
  100. #define DBPROP_WMIOLEDB_PREV_RESTORE 0x1016
  101. #define DBPROP_WMIOLEDB_PREV_SHUTDOWN 0x1017
  102. #define DBPROP_WMIOLEDB_PREV_DEBUG 0x1018
  103. #define DBPROP_WMIOLEDB_PREV_AUDIT 0x1019
  104. #define DBPROP_WMIOLEDB_PREV_SYSTEM_ENVIRONMENT 0x101a
  105. #define DBPROP_WMIOLEDB_PREV_CHANGE_NOTIFY 0x101b
  106. #define DBPROP_WMIOLEDB_PREV_REMOTE_SHUTDOWN 0x101c
  107. #define DBPROP_WMIOLEDB_PREV_UNDOCK 0x101d
  108. #define DBPROP_WMIOLEDB_PREV_SYNC_AGENT 0x101e
  109. #define DBPROP_WMIOLEDB_PREV_ENABLE_DELEGATION 0x101f
  110. #define DBPROP_WMIOLEDB_DS_DEREFALIAS 0x1020
  111. #define DBPROP_WMIOLEDB_DS_SIZELIMIT 0x1021
  112. #define DBPROP_WMIOLEDB_DS_PAGEDTIMELIMIT 0x1022
  113. #define DBPROP_WMIOLEDB_DS_TOMBSTONE 0x1023
  114. #define DBPROP_WMIOLEDB_DS_SEARCHSCOPE 0x1024
  115. #define DBPROP_WMIOLEDB_DS_TIMEOUT 0x1025
  116. #define DBPROP_WMIOLEDB_DS_PAGESIZE 0x1026
  117. #define DBPROP_WMIOLEDB_DS_TIMELIMIT 0x1027
  118. #define DBPROP_WMIOLEDB_DS_CHASEREF 0x1028
  119. #define DBPROP_WMIOLEDB_DS_ATTRIBUTES 0x1029
  120. #define DBPROP_WMIOLEDB_DS_CACHERESULTS 0x102a
  121. #define DBPROP_WMIOLEDB_DS_FILTER 0x102b
  122. #define DBPROP_WMIOLEDB_DS_ATTRIBONLY 0x102c
  123. #define DBPROP_WMIOLEDB_DS_ASYNCH 0x102d
  124. #define DBPROP_WMIOLEDB_ISMETHOD 0x102e
  125. #define DBPROP_WMIOLEDB_AUTHORITY 0x102f
  126. #define DBPROP_WMIOLEDB_QUERYLANGUAGE 0x1030
  127. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  128. // DBPROP_WMIOLEDB_QUALIFIERS property values
  129. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  130. #define DBPROP_WM_CLASSQUALIFIERS 0x1
  131. #define DBPROP_WM_PROPERTYQUALIFIERS 0x2
  132. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  133. // DBPROP_WMIOLEDB_QUALIFIERFLAVOR property values
  134. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  135. #define DBPROPVAL_FLAVOR_PROPOGAGTE_TO_INSTANCE WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE
  136. #define DBPROPVAL_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS
  137. #define DBPROPVAL_FLAVOR_NOT_OVERRIDABLE WBEM_FLAVOR_NOT_OVERRIDABLE
  138. #define DBPROPVAL_FLAVOR_OVERRIDABLE WBEM_FLAVOR_OVERRIDABLE
  139. #define DBPROPVAL_FLAVOR_AMENDED WBEM_FLAVOR_AMENDED
  140. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  141. // flags for IDBProperties::GetPropertyInfo
  142. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  143. #define FLAGS_ROWSETRO (DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ)
  144. #define FLAGS_ROWSETRW (DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE)
  145. #define FLAGS_DATASRCINF (DBPROPFLAGS_DATASOURCEINFO | DBPROPFLAGS_READ)
  146. #define FLAGS_DBINITRW (DBPROPFLAGS_DBINIT | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE)
  147. #define FLAGS_COLUMNSRW (DBPROPFLAGS_COLUMN | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE)
  148. enum PROPERTYTYPE
  149. {
  150. DATASOURCEPROP,
  151. SESSIONPROP,
  152. ROWSETPROP,
  153. COMMANDPROP,
  154. BINDERPROP,
  155. COLUMNPROP,
  156. };
  157. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  158. // Number of supported properties per property set
  159. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  160. #define NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES 9
  161. #define NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES 10
  162. #define NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES 25
  163. #define NUMBER_OF_SUPPORTED_WMIOLEDB_ROWSET_PROPERTIES 18
  164. #define NUMBER_OF_SUPPORTED_WMIOLEDB_COMMAND_PROPERTIES 0
  165. #define NUMBER_OF_SUPPORTED_WMIOLEDB_DBINIT_PROPERTIES 29
  166. #define NUMBER_OF_SUPPORTED_SESSION_PROPERTIES 0
  167. #define NUMBER_OF_SUPPORTED_COLUMN_PROPERTIES 3
  168. #define NUMBER_OF_SUPPORTED_WMIOLEDB_COLUMN_PROPERTIES 1
  169. #define NUMBER_OF_PREVILAGE_PROPERTIES 26
  170. #define START_OF_PREVILAGE_PROPERTIES START_OF_SUPPORTED_WMIOLEDB_DBINIT_PROPERTIES + 2 // 2 other
  171. // WMIOLEDB_INIT properties
  172. #define NUMBER_OF_SUPPORTED_PROPERTY_SETS 7
  173. #define START_OF_SUPPORTED_DBINIT_PROPERTIES 0
  174. #define START_OF_SUPPORTED_WMIOLEDB_DBINIT_PROPERTIES NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES
  175. #define START_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES (START_OF_SUPPORTED_WMIOLEDB_DBINIT_PROPERTIES +NUMBER_OF_SUPPORTED_WMIOLEDB_DBINIT_PROPERTIES)
  176. #define START_OF_SUPPORTED_SESSION_PROPERTIES (START_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES + NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES)
  177. #define START_OF_SUPPORTED_WMIOLEDB_COMMAND_PROPERTIES (START_OF_SUPPORTED_SESSION_PROPERTIES + NUMBER_OF_SUPPORTED_SESSION_PROPERTIES)
  178. #define START_OF_SUPPORTED_ROWSET_PROPERTIES (START_OF_SUPPORTED_WMIOLEDB_COMMAND_PROPERTIES + NUMBER_OF_SUPPORTED_WMIOLEDB_COMMAND_PROPERTIES)
  179. #define START_OF_SUPPORTED_WMIOLEDB_ROWSET_PROPERTIES (START_OF_SUPPORTED_ROWSET_PROPERTIES + NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES)
  180. #define START_OF_SUPPORTED_COLUMN_PROPERTIES (START_OF_SUPPORTED_WMIOLEDB_ROWSET_PROPERTIES + NUMBER_OF_SUPPORTED_WMIOLEDB_ROWSET_PROPERTIES)
  181. #define START_OF_SUPPORTED_WMIOLEDB_COLUMN_PROPERTIES (START_OF_SUPPORTED_COLUMN_PROPERTIES + NUMBER_OF_SUPPORTED_COLUMN_PROPERTIES)
  182. #define NUMBER_OF_SUPPORTED_PROPERTIES \
  183. ( NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES + \
  184. NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES + \
  185. NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES + \
  186. NUMBER_OF_SUPPORTED_WMIOLEDB_DBINIT_PROPERTIES + \
  187. NUMBER_OF_SUPPORTED_SESSION_PROPERTIES + \
  188. NUMBER_OF_SUPPORTED_WMIOLEDB_COMMAND_PROPERTIES + \
  189. NUMBER_OF_SUPPORTED_WMIOLEDB_ROWSET_PROPERTIES + \
  190. NUMBER_OF_SUPPORTED_COLUMN_PROPERTIES + \
  191. NUMBER_OF_SUPPORTED_WMIOLEDB_COLUMN_PROPERTIES)
  192. //////////////////////////////////////////////////////////////////////////
  193. // Index of properties returned by function GetConnectionInitProperties
  194. //////////////////////////////////////////////////////////////////////////
  195. #define IDX_DBPROP_INIT_DATASOURCE 0
  196. #define IDX_DBPROP_INIT_PROTECTION_LEVEL 1
  197. #define IDX_DBPROP_INIT_IMPERSONATION_LEVEL 2
  198. #define IDX_DBPROP_AUTH_USERID 3
  199. #define IDX_DBPROP_AUTH_PASSWORD 4
  200. #define IDX_DBPROP_INIT_LCID 5
  201. #define IDX_DBPROP_WMIOLEDB_AUTHORITY 6
  202. #define NUMBER_OF_CONNECTIONINIT_PROP 7
  203. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  204. // Flags for different Rowset Properties
  205. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  206. #define CANHOLDROWS 0x1
  207. #define CANSCROLLBACKWARDS 0x2
  208. #define CANFETCHBACKWARDS 0x4
  209. #define OTHERUPDATEDELETE 0x8
  210. #define OWNINSERT 0x10
  211. #define REMOVEDELETED 0x20
  212. #define OTHERINSERT 0x40
  213. #define OWNUPDATEDELETE 0x80
  214. #define LITERALIDENTITY 0x100
  215. #define IROWSETCHANGE 0x200
  216. #define BOOKMARKPROP 0x400
  217. #define FETCHDEEP 0x800
  218. #define IROWSETLOCATE 0x1000
  219. #define IGETROW 0x2000
  220. #define IROWSETREFRESH 0x4000
  221. #define ICHAPTEREDROWSET 0x8000
  222. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  223. // description size
  224. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  225. #define CCH_GETPROPERTYINFO_DESCRIP_BUFFER_SIZE 50
  226. #define MAXOPENROWS 2048
  227. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  228. // flags for Get and Set Properties
  229. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  230. const DWORD PROPSET_DSO = 0x0001;
  231. const DWORD PROPSET_INIT = 0x0002;
  232. const DWORD PROPSET_DSOINIT = PROPSET_DSO | PROPSET_INIT;
  233. const DWORD PROPSET_SESSION = 0x0004;
  234. const DWORD PROPSET_ROWSET = 0x0008;
  235. const DWORD PROPSET_COLUMN = 0x0010;
  236. const DWORD PROPSET_COMMAND = 0x0020;
  237. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  238. class CPropertyMemoryMgr
  239. {
  240. public:
  241. //================================================================================
  242. //
  243. //================================================================================
  244. HRESULT AllocDESCRIPTBuffer(WCHAR *& pDescBuffer, WCHAR** ppDescBuffer, ULONG cProperties);
  245. HRESULT AllocDBPROPINFOSET(DBPROPINFOSET *& pPropInfoSet, const ULONG cProps);
  246. HRESULT AllocDBPROPINFO(DBPROPINFO *& pPropInfo, DBPROPINFOSET * pPropInfoSet,ULONG ulPropSets);
  247. HRESULT AllocDBPROPSET(DBPROPSET*& ppPropSet, const ULONG cPropSets);
  248. HRESULT AllocateDBPROP(DBPROP*& ppProp, const ULONG cProperties);
  249. HRESULT AllocDBCOLUMNDESC(DBCOLUMNDESC*& ppCOLUMNDESC, const ULONG cColumnDescs);
  250. void FreeDBPROPINFOSET(DBPROPINFOSET *& pPropInfoSet, const ULONG cProps);
  251. void FreeDESCRIPTBuffer(WCHAR *& pDescBuffer, WCHAR** ppDescBuffer);
  252. void FreeDBPROPINFO(DBPROPINFO *& pPropInfo, const ULONG cProps);
  253. // static void FreeDBPROPSET( ULONG cPropertySets, DBPROPSET *& prgPropertySets);
  254. void FreeDBCOLUMNDESC(DBCOLUMNDESC rgColumnDescs[], LONG cColumns);
  255. HRESULT CopyDBPROPSET(DBPROPSET*& pDestination, DBPROPSET*& pSource);
  256. HRESULT CopyDBCOLUMNDESC(DBCOLUMNDESC*& pDestination, DBCOLUMNDESC*& pSource);
  257. HRESULT SetDefaultValueForStringProperties(PROPSTRUCT * prgPropeties,ULONG cProperties);
  258. static void CPropertyMemoryMgr::FreeDBPROPSET( ULONG cPropertySets, DBPROPSET *& prgPropertySets)
  259. {
  260. //==============================================================================
  261. // Free the memory
  262. //==============================================================================
  263. if (prgPropertySets){
  264. for( ULONG i = 0; i < cPropertySets; i++ ){
  265. for(ULONG ulIndex=0; ulIndex<prgPropertySets[i].cProperties; ulIndex++){
  266. VariantClear(&prgPropertySets[i].rgProperties[ulIndex].vValue);
  267. }
  268. g_pIMalloc->Free(prgPropertySets[i].rgProperties);
  269. }
  270. g_pIMalloc->Free(prgPropertySets);
  271. }
  272. }
  273. };
  274. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  275. class CUtilProp
  276. {
  277. protected:
  278. PROPSTRUCT * m_prgproperties;
  279. PROPERTYTYPE m_propType ;
  280. ULONG m_cProperties;
  281. ULONG m_nPropStartIndex ;
  282. HRESULT CheckPropertyIDSets ( BOOL & fIsNotSpecialGUID, BOOL & fIsSpecialGUID, ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[] ) ;
  283. BOOL GetPropIndex( DBPROPID dwPropertyID,ULONG* pulIndex); //Gets index of entry for a given property in property set
  284. BOOL GetPropIndexFromAllSupportedProps( DBPROPID dwPropertyID,ULONG* pulIndex); //Gets index of entry for a given property in global property table
  285. BOOL LoadDBPROPINFO(PROPSTRUCT* pPropStruct,DBPROPINFO* pPropInfo ); //Loads fields of DBPROPINFO struct. Helper for GetPropertyInfo
  286. BOOL LoadDBPROP(PROPSTRUCT* pPropStruct,DBPROP* pPropSupport); //Loads fields of DBPROP struct. Helper for GetProperties
  287. HRESULT IsValidValue(DBPROP* pDBProp ); //Checks to see if the value is valid. Helper for SetProperties
  288. BOOL IsPropertySetSupported(const GUID guidPropset);
  289. ULONG GetNumberofPropInfoToBeReturned( BOOL bDSOInitialized,
  290. ULONG cPropertyIDSets,
  291. const DBPROPIDSET rgPropertyIDSets[]);
  292. void FillPropertySets(BOOL fDSOInitialized,
  293. const DBPROPIDSET rgPropIDSets[],
  294. ULONG cPropIDSets,
  295. DBPROPINFOSET* pPropInfoSet,
  296. ULONG &cProperties);
  297. public:
  298. CUtilProp();
  299. CUtilProp(PROPERTYTYPE propType);
  300. ~CUtilProp(void);
  301. CPropertyMemoryMgr m_PropMemMgr;
  302. HRESULT FInit(PROPERTYTYPE propType);
  303. HRESULT SetPropertiesArgChk(const ULONG cProperties, const DBPROPSET rgProperties[] ,BOOL bDSOInitialized = TRUE);
  304. HRESULT GetPropertiesArgChk( DWORD dwBitMask, const ULONG cPropertySets, const DBPROPIDSET rgPropertySets[],
  305. ULONG* pcProperties, DBPROPSET** prgProperties,BOOL bDSOInitialized = TRUE);
  306. STDMETHODIMP GetProperties ( DWORD dwBitMask, ULONG cPropertySets, const DBPROPIDSET rgPropertySets[],
  307. ULONG* pcProperties, DBPROPSET** prgProperties );
  308. STDMETHODIMP GetPropertyInfo (BOOL fDSOInitialized, ULONG cPropertySets, const DBPROPIDSET rgPropertySets[],
  309. ULONG* pcPropertyInfoSets, DBPROPINFOSET** prgPropertyInfoSets,WCHAR** ppDescBuffer);
  310. STDMETHODIMP SetProperties( const DWORD dwBitMask, const ULONG cProperties,DBPROPSET rgProperties[]);
  311. // DWORD GetImpLevel(DWORD dwImpPropVal);
  312. // DWORD GetAuthnLevel(DWORD dwAuthnPropVal);
  313. HRESULT ResetProperties();
  314. ULONG GetNumberOfPropertySets(BOOL fDSOInitialized,const DBPROPIDSET rgPropIDSets[],ULONG cPropIDSets);
  315. ULONG GetNumberOfPropertySets(BOOL fDSOInitialized,DWORD dwBitMask);
  316. HRESULT IsValidPropertySet(BOOL fDSOInitialized,const GUID guidPropset);
  317. HRESULT FillPropStruct(BOOL fDSOInitialized,DWORD dwBitMask,DBPROPSET* pPropSet);
  318. HRESULT GetConnectionInitProperties(DBPROPSET** pprgPropertySets);
  319. HRESULT SetDefaultValueForStringProperties(PROPSTRUCT * prgPropeties,ULONG cProperties);
  320. };
  321. typedef CUtilProp *PCUTILPROP;
  322. class CPreviligeToken
  323. {
  324. TOKEN_PRIVILEGES *m_pPrevTokenPrev;
  325. int m_nMemAllocated;
  326. void OpenToken(HANDLE &hToken);
  327. public:
  328. CPreviligeToken();
  329. ~CPreviligeToken();
  330. // NTRaid: 136443
  331. // 07/05/00
  332. HRESULT FInit();
  333. BOOL AdjustTokenPrivileges(ULONG cProps , DBPROP rgProp[]);
  334. void SetDBPROPForPrivileges(ULONG cProps , DBPROP *rgProp);
  335. void ConvertDBPropToPriveleges(ULONG cProps , DBPROP rgProp[]);
  336. BOOL AdjustTokenPrivileges(ULONG ulProperty);
  337. void SetDBPROPForPrivileges(ULONG &ulProperty);
  338. void ConvertDBPropToPriveleges(ULONG ulProperty);
  339. void GetCurrentPrivelegeToken();
  340. BOOL GetPropIndex (ULONG cProps ,DBPROP rgProp[],DBPROPID dwPropertyID,LONG* pulIndex);
  341. };
  342. #endif