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.

139 lines
4.8 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. regops.h
  5. Abstract:
  6. This file declares routines to mark operations on the registry.
  7. During the Win9x side of processing, registry operations are
  8. recorded in memdb to suppress Win9x settings, or to overwrite
  9. NT settings. The memdb entries are queried during the registry
  10. merge in GUI mode.
  11. Use the macros at the bottom of this file.
  12. Author:
  13. Marc R. Whitten (marcw) 18-Aug-1997
  14. Revision History:
  15. <alias> <date> <comments>
  16. --*/
  17. #pragma once
  18. #include "merge.h"
  19. typedef enum {
  20. KEY_ONLY,
  21. KEY_TREE,
  22. TREE_OPTIONAL
  23. } TREE_STATE;
  24. BOOL
  25. IsRegObjectMarkedForOperationA (
  26. IN PCSTR Key,
  27. IN PCSTR Value, OPTIONAL
  28. IN TREE_STATE TreeState,
  29. IN DWORD OperationMask
  30. );
  31. BOOL
  32. IsRegObjectMarkedForOperationW (
  33. IN PCWSTR Key,
  34. IN PCWSTR Value, OPTIONAL
  35. IN TREE_STATE TreeState,
  36. IN DWORD OperationMask
  37. );
  38. BOOL
  39. MarkRegObjectForOperationA (
  40. IN PCSTR Key,
  41. IN PCSTR Value, OPTIONAL
  42. IN BOOL Tree,
  43. IN DWORD OperationMask
  44. );
  45. BOOL
  46. MarkRegObjectForOperationW (
  47. IN PCWSTR Key,
  48. IN PCWSTR Value, OPTIONAL
  49. IN BOOL Tree,
  50. IN DWORD OperationMask
  51. );
  52. BOOL
  53. MarkObjectForOperationA (
  54. IN PCSTR Object,
  55. IN DWORD OperationMask
  56. );
  57. BOOL
  58. MarkObjectForOperationW (
  59. IN PCWSTR Object,
  60. IN DWORD OperationMask
  61. );
  62. BOOL
  63. ForceWin9xSettingA (
  64. IN PCSTR SourceKey,
  65. IN PCSTR SourceValue,
  66. IN BOOL SourceTree,
  67. IN PCSTR DestinationKey,
  68. IN PCSTR DestinationValue,
  69. IN BOOL DestinationTree
  70. );
  71. BOOL
  72. ForceWin9xSettingW (
  73. IN PCWSTR SourceKey,
  74. IN PCWSTR SourceValue,
  75. IN BOOL SourceTree,
  76. IN PCWSTR DestinationKey,
  77. IN PCWSTR DestinationValue,
  78. IN BOOL DestinationTree
  79. );
  80. #ifdef UNICODE
  81. #define IsRegObjectMarkedForOperation IsRegObjectMarkedForOperationW
  82. #define MarkRegObjectForOperation MarkRegObjectForOperationW
  83. #define Suppress95RegSetting(k,v) MarkRegObjectForOperationW(k,v,TRUE,REGMERGE_95_SUPPRESS)
  84. #define SuppressNtRegSetting(k,v) MarkRegObjectForOperationW(k,v,TRUE,REG_NT_SUPPRESS)
  85. #define Is95RegObjectSuppressed(k,v) IsRegObjectMarkedForOperationW(k,v,TREE_OPTIONAL,REGMERGE_95_SUPPRESS)
  86. #define IsNtRegObjectSuppressed(k,v) IsRegObjectMarkedForOperationW(k,v,TREE_OPTIONAL,REGMERGE_NT_SUPPRESS)
  87. #define Is95RegKeySuppressed(k) IsRegObjectMarkedForOperationW(k,NULL,KEY_ONLY,REGMERGE_95_SUPPRESS)
  88. #define IsNtRegKeySuppressed(k) IsRegObjectMarkedForOperationW(k,NULL,KEY_ONLY,REGMERGE_NT_SUPPRESS)
  89. #define Is95RegKeyTreeSuppressed(k) IsRegObjectMarkedForOperationW(k,NULL,KEY_TREE,REGMERGE_95_SUPPRESS)
  90. #define IsNtRegKeyTreeSuppressed(k) IsRegObjectMarkedForOperationW(k,NULL,KEY_TREE,REGMERGE_NT_SUPPRESS)
  91. #define IsRegObjectInMemdb(k,v) IsRegObjectMarkedForOperationW(k,v,0xffffffff)
  92. #define MarkObjectForOperation MarkObjectForOperationW
  93. #define Suppress95Object(x) MarkObjectForOperationW(x,REGMERGE_95_SUPPRESS)
  94. #define SuppressNtObject(x) MarkObjectForOperationW(x,REGMERGE_NT_SUPPRESS)
  95. #define ForceWin9xSetting ForceWin9xSettingW
  96. #else
  97. #define IsRegObjectMarkedForOperation IsRegObjectMarkedForOperationA
  98. #define MarkRegObjectForOperation MarkRegObjectForOperationA
  99. #define Suppress95RegSetting(k,v) MarkRegObjectForOperationA(k,v,TRUE,REGMERGE_95_SUPPRESS)
  100. #define SuppressNtRegSetting(k,v) MarkRegObjectForOperationA(k,v,TRUE,REGMERGE_NT_SUPPRESS)
  101. #define Is95RegObjectSuppressed(k,v) IsRegObjectMarkedForOperationA(k,v,TREE_OPTIONAL,REGMERGE_95_SUPPRESS)
  102. #define IsNtRegObjectSuppressed(k,v) IsRegObjectMarkedForOperationA(k,v,TREE_OPTIONAL,REGMERGE_NT_SUPPRESS)
  103. #define Is95RegKeySuppressed(k) IsRegObjectMarkedForOperationA(k,NULL,KEY_ONLY,REGMERGE_95_SUPPRESS)
  104. #define IsNtRegKeySuppressed(k) IsRegObjectMarkedForOperationA(k,NULL,KEY_ONLY,REGMERGE_NT_SUPPRESS)
  105. #define Is95RegKeyTreeSuppressed(k) IsRegObjectMarkedForOperationA(k,NULL,KEY_TREE,REGMERGE_95_SUPPRESS)
  106. #define IsNtRegKeyTreeSuppressed(k) IsRegObjectMarkedForOperationA(k,NULL,KEY_TREE,REGMERGE_NT_SUPPRESS)
  107. #define IsRegObjectInMemdb(k,v) IsRegObjectMarkedForOperationA(k,v,0xffffffff)
  108. #define MarkObjectForOperation MarkObjectForOperationA
  109. #define Suppress95Object(x) MarkObjectForOperationA(x,REGMERGE_95_SUPPRESS)
  110. #define SuppressNtObject(x) MarkObjectForOperationA(x,REGMERGE_NT_SUPPRESS)
  111. #define ForceWin9xSetting ForceWin9xSettingA
  112. #endif