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.

106 lines
2.9 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 1998-2000 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: RegUtil.h
  6. // Author: Charles Ma, 10/20/2000
  7. //
  8. // Revision History:
  9. //
  10. //
  11. //
  12. // Description:
  13. //
  14. // IU registry utility library
  15. //
  16. //=======================================================================
  17. #ifndef __REG_UTIL_H_ENCLUDED__
  18. // ----------------------------------------------------------------------
  19. //
  20. // define the enum used for version status checking
  21. //
  22. // ----------------------------------------------------------------------
  23. enum _VER_STATUS {
  24. DETX_LOWER = -2,
  25. DETX_LOWER_OR_EQUAL = -1,
  26. DETX_SAME = 0,
  27. DETX_HIGHER_OR_EQUAL = +1,
  28. DETX_HIGHER = +2
  29. };
  30. // ----------------------------------------------------------------------
  31. //
  32. // public function to tell is a reg key exists
  33. //
  34. // ----------------------------------------------------------------------
  35. BOOL RegKeyExists(
  36. LPCTSTR lpsKeyPath, // key path
  37. LPCTSTR lpsValName // optional value name
  38. );
  39. // ----------------------------------------------------------------------
  40. //
  41. // public function to tell is a reg value in reg matches given value
  42. //
  43. // ----------------------------------------------------------------------
  44. BOOL RegKeyValueMatch(
  45. LPCTSTR lpsKeyPath, // key path
  46. LPCTSTR lpsValName, // optional value name
  47. LPCTSTR lpsValue // value value
  48. );
  49. // ----------------------------------------------------------------------
  50. //
  51. // public function to tell if a reg key has a string type value
  52. // that contains given string
  53. //
  54. // ----------------------------------------------------------------------
  55. BOOL RegKeySubstring(
  56. LPCTSTR lpsKeyPath, // key path
  57. LPCTSTR lpsValName, // optional value name
  58. LPCTSTR lpsSubString // substring to see if contained in value
  59. );
  60. // ----------------------------------------------------------------------
  61. //
  62. // public function to tell if a reg key has a version to compare
  63. // and the compare results
  64. //
  65. // ----------------------------------------------------------------------
  66. BOOL RegKeyVersion(
  67. LPCTSTR lpsKeyPath, // key path
  68. LPCTSTR lpsValName, // optional value name
  69. LPCTSTR lpsVersion, // version in string to compare
  70. _VER_STATUS CompareVerb // how to compair
  71. );
  72. // ----------------------------------------------------------------------------------
  73. //
  74. // public function to find out the file path based on reg
  75. // assumption:
  76. // lpsFilePath points to a buffer at least MAX_PATH long.
  77. //
  78. // ----------------------------------------------------------------------------------
  79. BOOL GetFilePathFromReg(
  80. LPCTSTR lpsKeyPath, // key path
  81. LPCTSTR lpsValName, // optional value name
  82. LPCTSTR lpsRelativePath,// optional additonal relative path to add to path in reg
  83. LPCTSTR lpsFileName, // optional file name to append to path
  84. LPTSTR lpsFilePath
  85. );
  86. #define __REG_UTIL_H_ENCLUDED__
  87. #endif //__REG_UTIL_H_ENCLUDED__