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.

108 lines
3.3 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 2000
  4. *
  5. * TITLE: WiaUtil.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: OrenR
  10. *
  11. * DATE: 2000/11/07
  12. *
  13. * DESCRIPTION: Provides supporting DShow utility functions used to build
  14. * preview graph
  15. *
  16. *****************************************************************************/
  17. #ifndef _WIAUTIL_H_
  18. #define _WIAUTIL_H_
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CWiaUtil
  21. class CWiaUtil
  22. {
  23. public:
  24. static HRESULT CreateWiaDevMgr(IWiaDevMgr **ppDevMgr);
  25. static HRESULT CreateRootItem(IWiaDevMgr *pDevMgr,
  26. const CSimpleString *pstrWiaDeviceId,
  27. IWiaItem **ppRootItem);
  28. static HRESULT FindWiaIdByDShowId(const CSimpleString *pstrDShowId,
  29. CSimpleString *pstrWiaId,
  30. IWiaItem **ppRootItem = NULL);
  31. static HRESULT GetProperty(IWiaPropertyStorage *pPropStorage,
  32. PROPID nPropID,
  33. LONG *pnValue);
  34. static HRESULT GetProperty(IWiaPropertyStorage *pPropStorage,
  35. PROPID nPropID,
  36. CSimpleStringWide *pstrPropertyValue);
  37. static HRESULT SetProperty(IWiaPropertyStorage *pPropStorage,
  38. PROPID nPropID,
  39. LONG nValue);
  40. static HRESULT SetProperty(IWiaPropertyStorage *pPropStorage,
  41. PROPID nPropID,
  42. const CSimpleString *pstrPropVal);
  43. static HRESULT GetUseVMR(BOOL *pbUseVMR);
  44. private:
  45. static HRESULT SetProperty(IWiaPropertyStorage *pPropStorage,
  46. PROPID nPropID,
  47. const PROPVARIANT *ppv,
  48. PROPID nNameFirst);
  49. static HRESULT GetProperty(IWiaPropertyStorage *pPropStorage,
  50. PROPID nPropID,
  51. PROPVARIANT *pPropVar);
  52. };
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CRegistry
  55. class CRegistry
  56. {
  57. public:
  58. CRegistry(HKEY hRoot,
  59. const TCHAR *pszKeyPath);
  60. virtual ~CRegistry();
  61. HRESULT GetDWORD(const TCHAR *pszVarName,
  62. DWORD *pdwValue,
  63. BOOL bSetIfNotExist = FALSE);
  64. HRESULT SetDWORD(const TCHAR *pszVarName,
  65. DWORD dwValue);
  66. HRESULT GetString(const TCHAR *pszVarName,
  67. TCHAR *pszValue,
  68. DWORD cchValue,
  69. BOOL bSetIfNotExist = FALSE);
  70. HRESULT SetString(const TCHAR *pszVarName,
  71. TCHAR *pszValue);
  72. operator HKEY() const
  73. {
  74. return m_hRootKey;
  75. }
  76. private:
  77. HKEY m_hRootKey;
  78. BOOL m_bReadOnlyKey;
  79. };
  80. #endif // _WIAUTIL_H_