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.

111 lines
3.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000.
  5. //
  6. // File: dbprputl.hxx
  7. //
  8. // Contents: IDBProperties related utility functions and classes in the
  9. // client side.
  10. //
  11. // History: 1-13-97 srikants Created
  12. // 5-10-97 mohamedn fs/core property set split
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. extern const GUID guidCiFsExt;
  17. const cScopePropSets = 2;
  18. const cInitProps = 2;
  19. const cFsCiProps = 4;
  20. //+---------------------------------------------------------------------------
  21. //
  22. // Class: CGetDbProps
  23. //
  24. // Purpose: A wrapper around IDbProperties to retrieve the dbproperties
  25. // set by the FileSystem CI client.
  26. //
  27. // History: 1-13-97 srikants Created
  28. // 5-10-97 mohamedn fs/core property set split
  29. //
  30. //----------------------------------------------------------------------------
  31. class CGetDbProps
  32. {
  33. typedef XGrowable<WCHAR *, 5> XPathArray;
  34. public:
  35. enum EPropsToGet { eMachine = 0x1,
  36. eClientGuid = 0x2,
  37. eCatalog = 0x4,
  38. eScopesAndDepths = 0x8,
  39. eSecurity = 0x10,
  40. eQueryType = 0x20
  41. };
  42. CGetDbProps();
  43. void GetProperties( IDBProperties * pDbProperties, const ULONG fPropsToGet );
  44. WCHAR const * GetMachine(unsigned i = 0 ) const { return (_aMachines ? _aMachines[i] : 0); }
  45. GUID const * GetClientGuid() const
  46. {
  47. return _fGuidValid ? &_clientGuid : 0;
  48. }
  49. WCHAR const * GetCatalog(unsigned i = 0 ) const { return (_cCatalogs > 0 ? _xNotFunnyCatalogs[i] : 0); }
  50. WCHAR const * const * GetScopes() const { return ((WCHAR const * const *)_xNotFunnyPaths.Get()); }
  51. DWORD const * GetDepths() const { return (_aDepths ? _aDepths : 0); }
  52. ULONG GetScopeCount() const { return _cScopes;}
  53. ULONG GetCatalogCount() const { return _cCatalogs; }
  54. CiMetaData GetQueryType() const { return _type; }
  55. private:
  56. void ProcessPropSet( DBPROPSET & propSet );
  57. void ProcessDbInitPropSet( DBPROPSET & propSet );
  58. void ProcessCiFsExtPropSet( DBPROPSET & propSet );
  59. void _PreProcessForFunnyPaths( WCHAR * const * aPaths, DWORD _cPaths,
  60. XPathArray & xNotFunnyPaths );
  61. DWORD * _aDepths; // depths of scopes
  62. XPathArray _xNotFunnyPaths;
  63. XPathArray _xNotFunnyCatalogs;
  64. CiMetaData _type;
  65. ULONG _cDepths; // number of depths
  66. ULONG _cScopes; // Number of scopes specified
  67. ULONG _cCatalogs; // number of catalogs
  68. ULONG _cMachines; // number of machines
  69. ULONG _cGuids;
  70. WCHAR ** _aMachines; // pointer to machines
  71. GUID _clientGuid; // GUID of the client
  72. BOOL _fGuidValid; // Set to TRUE if _clientGuid is valid
  73. XArrayOLEInPlace<CDbPropSet> _xPropSet;
  74. //
  75. // default values
  76. //
  77. DWORD _aDefaultDepth[1];
  78. WCHAR * _aDefaultPath[1];
  79. };
  80. //
  81. // utility functions
  82. //
  83. WCHAR **GetWCharFromVariant( DBPROP & dbProp, ULONG *cElements );
  84. DWORD * GetDepthsFromVariant( DBPROP & dbProp, ULONG *cElements, ULONG mask );