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.

70 lines
2.3 KiB

  1. /*-----------------------------------------------------------------------------
  2. *
  3. * File: wiautil.h
  4. * Author: Samuel Clement (samclem)
  5. * Date: Mon Aug 16 13:22:36 1999
  6. *
  7. * Copyright (c) 1999 Microsoft Corporation
  8. *
  9. * Description:
  10. * This contains the declaration of the wia util functions
  11. *
  12. * History:
  13. * 16 Aug 1999: Created.
  14. *----------------------------------------------------------------------------*/
  15. #ifndef _WIAUTIL_H_
  16. #define _WIAUTIL_H_
  17. // this is the structure of a string table. A string table is used to look
  18. // up a string for a specified value. And to look up the value for a specified
  19. // string. This supports assigning a string to range of numbers.
  20. struct STRINGTABLE
  21. {
  22. DWORD dwStartRange;
  23. DWORD dwEndRange;
  24. WCHAR* pwchValue;
  25. };
  26. // define a new string table with name "x"
  27. #define STRING_TABLE(x) \
  28. static const STRINGTABLE x[] = { \
  29. { 0, 0, NULL },
  30. // define a new string table with name "x" and the default value of "str"
  31. #define STRING_TABLE_DEF( x, str ) \
  32. static const STRINGTABLE x[] = { \
  33. { 0, 0, ( L ## str ) },
  34. // add an entry to the string table.
  35. #define STRING_ENTRY( s, str ) \
  36. { (s), (s), ( L ## str ) },
  37. // Add a ranged entry to the string table
  38. #define STRING_ENTRY2( s, e, str ) \
  39. { (s), (e), ( L ## str ) },
  40. // end the string table
  41. #define END_STRING_TABLE() \
  42. { 0, 0, NULL } \
  43. };
  44. // returns the string for the specified value, or the default
  45. // value if not found. If no default was supplied then this
  46. // returns NULL.
  47. WCHAR* GetStringForVal( const STRINGTABLE* pStrTable, DWORD dwVal );
  48. // this retrieves the desired property from the IWiaPropertyStorage, it will fill
  49. // the variant passed it. It doesn't have to be initialized.
  50. HRESULT GetWiaProperty( IWiaPropertyStorage* pStg, PROPID propid, PROPVARIANT* pvaProp );
  51. // this will retrieve the desired property from the IWiaPropertyStorage and
  52. // coherce the type to a BSTR and allocate one for the out param pbstrProp.
  53. HRESULT GetWiaPropertyBSTR( IWiaPropertyStorage* pStg, PROPID propid, BSTR* pbstrProp );
  54. // Conversion methods which copy a PROPVARIANT from a variant
  55. // structure
  56. HRESULT PropVariantToVariant( const PROPVARIANT* pvaProp, VARIANT* pvaOut );
  57. HRESULT VariantToPropVariant( const VARIANT* pvaIn, PROPVARIANT* pvaProp );
  58. #endif //_WIAUTIL_H_