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.

71 lines
1.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: dbprpini.hxx
  7. //
  8. // Contents: A wrapper class to get DB_INIT_PROPSET properties.
  9. //
  10. // History: 1-16-97 srikants Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #pragma once
  14. class CGetDbInitProps
  15. {
  16. public:
  17. enum { cInitProps = 2 };
  18. enum EPropsToGet { eMachine = 0x1,
  19. eClientGuid = 0x2
  20. };
  21. CGetDbInitProps() : _pwszMachine(0), _fGuidValid(FALSE)
  22. {
  23. }
  24. ~CGetDbInitProps()
  25. {
  26. _Cleanup();
  27. }
  28. void GetProperties( IDBProperties * pDbProperties, const ULONG fPropsToGet );
  29. WCHAR const * GetMachine() const { return _pwszMachine; }
  30. GUID const * GetClientGuid() const
  31. {
  32. return _fGuidValid ? &_guid : 0;
  33. }
  34. static WCHAR * AcquireBStr( CDbProp & dbProp );
  35. static WCHAR * AcquireWideStr( CDbProp & dbProp );
  36. protected:
  37. void _Cleanup()
  38. {
  39. if ( _pwszMachine )
  40. {
  41. deleteOLE( _pwszMachine ); _pwszMachine = 0;
  42. }
  43. _fGuidValid = FALSE;
  44. }
  45. void _ProcessDbInitPropSet( DBPROPSET & propSet );
  46. WCHAR * _pwszMachine; // Name of the machine (Actually a BSTR)
  47. BOOL _fGuidValid;
  48. GUID _guid;
  49. };