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.

54 lines
2.5 KiB

  1. #ifndef __PSHELPER_H_INCLUDED
  2. #define __PSHELPER_H_INCLUDED
  3. #include <windows.h>
  4. #include "simstr.h"
  5. #include "simarray.h"
  6. namespace PropStorageHelpers
  7. {
  8. struct CPropertyRange
  9. {
  10. LONG nMin;
  11. LONG nMax;
  12. LONG nStep;
  13. };
  14. class CPropertyId
  15. {
  16. private:
  17. CSimpleStringWide m_strPropId;
  18. PROPID m_nPropId;
  19. bool m_bIsStringPropId;
  20. public:
  21. CPropertyId(void);
  22. CPropertyId( const CSimpleStringWide &strPropId );
  23. CPropertyId( PROPID propId );
  24. CPropertyId( const CPropertyId &other );
  25. ~CPropertyId(void);
  26. CPropertyId &operator=( const CPropertyId &other );
  27. CSimpleStringWide PropIdString(void) const;
  28. PROPID PropIdNumber(void) const;
  29. bool IsString(void) const;
  30. };
  31. bool GetProperty( IUnknown *pIUnknown, const CPropertyId &propertyName, PROPVARIANT &pPropVar );
  32. bool GetProperty( IUnknown *pIUnknown, const CPropertyId &propertyName, CSimpleStringWide &strPropertyValue );
  33. bool GetProperty( IUnknown *pIUnknown, const CPropertyId &propertyName, GUID &guidValue );
  34. bool GetProperty( IUnknown *pIUnknown, const CPropertyId &propertyName, LONG &nValue );
  35. bool SetProperty( IUnknown *pIUnknown, const CPropertyId &propertyName, PROPVARIANT &pPropVar, PROPID nNameFirst=2 );
  36. bool SetProperty( IUnknown *pIUnknown, const CPropertyId &propertyName, LONG nValue, PROPID nNameFirst=2 );
  37. bool SetProperty( IUnknown *pIUnknown, const CPropertyId &propertyName, const GUID &guidValue, PROPID nNameFirst=2 );
  38. bool GetPropertyAttributes( IUnknown *pIUnknown, const CPropertyId &propertyName, ULONG &nAccessFlags, PROPVARIANT &pvAttributes );
  39. bool GetPropertyAttributes( IUnknown *pIUnknown, const CPropertyId &propertyName, PROPVARIANT &pvAttributes );
  40. bool GetPropertyAccessFlags( IUnknown *pIUnknown, const CPropertyId &propertyName, ULONG &nAccessFlags );
  41. bool GetPropertyRange( IUnknown *pIUnknown, const CPropertyId &propertyName, CPropertyRange &propertyRange );
  42. bool GetPropertyList( IUnknown *pIUnknown, const CPropertyId &propertyName, CSimpleDynamicArray<LONG> &aProp );
  43. bool GetPropertyList( IUnknown *pIUnknown, const CPropertyId &propertyName, CSimpleDynamicArray<GUID> &aProp );
  44. bool GetPropertyFlags( IUnknown *pIUnknown, const CPropertyId &propertyName, LONG &nFlags );
  45. bool IsReadOnlyProperty( IUnknown *pIUnknown, const CPropertyId &propertyName );
  46. }
  47. #endif //__PSHELPER_H_INCLUDED