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.

61 lines
1.8 KiB

  1. /****************************************************************************
  2. *
  3. * File: reginfo.h
  4. * Project: DxDiag (DirectX Diagnostic Tool)
  5. * Author: Mike Anderson (manders@microsoft.com)
  6. * Purpose: Gather and hold registry information
  7. *
  8. * (C) Copyright 1998 Microsoft Corp. All rights reserved.
  9. *
  10. ****************************************************************************/
  11. #ifndef REGINFO_H
  12. #define REGINFO_H
  13. enum RegErrorType
  14. {
  15. RET_NOERROR = 0,
  16. RET_MISSINGKEY,
  17. RET_MISSINGVALUE,
  18. RET_VALUEWRONGTYPE,
  19. RET_VALUEWRONGDATA
  20. };
  21. struct RegError
  22. {
  23. HKEY m_hkeyRoot; // HKLM, HKCU, etc.
  24. TCHAR m_szKey[300];
  25. TCHAR m_szValue[100];
  26. RegErrorType m_ret;
  27. DWORD m_dwTypeExpected; // REG_DWORD, REG_SZ, or REG_BINARY
  28. DWORD m_dwTypeActual;
  29. // The following are used if m_dwType is REG_DWORD:
  30. DWORD m_dwExpected;
  31. DWORD m_dwActual;
  32. // The following are used if m_dwType is REG_SZ:
  33. TCHAR m_szExpected[200];
  34. TCHAR m_szActual[200];
  35. // The following are used if m_dwType is REG_BINARY:
  36. BYTE m_bExpected[200];
  37. BYTE m_bActual[200];
  38. DWORD m_dwExpectedSize;
  39. DWORD m_dwActualSize;
  40. RegError* m_pRegErrorNext;
  41. };
  42. enum CheckRegFlags
  43. {
  44. CRF_NONE = 0,
  45. CRF_LEAF = 1, // if string is a path, just compare against the leaf
  46. };
  47. HRESULT CheckRegDword(RegError** ppRegErrorFirst, HKEY hkeyRoot, TCHAR* pszKey, TCHAR* pszValue, DWORD dwExpected);
  48. HRESULT CheckRegString(RegError** ppRegErrorFirst, HKEY hkeyRoot, TCHAR* pszKey, TCHAR* pszValue, TCHAR* pszExpected, CheckRegFlags crf = CRF_NONE, HRESULT* phrError = NULL );
  49. HRESULT CheckRegBinary(RegError** ppRegErrorFirst, HKEY hkeyRoot, TCHAR* pszKey, TCHAR* pszValue, BYTE* pbDataExpected, DWORD dwSizeExpected);
  50. VOID DestroyReg( RegError** ppRegErrorFirst );
  51. #endif // REGINFO_H