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.

149 lines
5.2 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. #define REGMERGE_95_SUPPRESS 0x00000001
  19. #define REGMERGE_95_RENAME_SUPPRESS 0x00000002
  20. #define REGMERGE_95_RENAME 0x00000004
  21. #define REGMERGE_NT_MASK 0x0000ff00
  22. #define REGMERGE_NT_SUPPRESS 0x00000100
  23. #define REGMERGE_NT_IGNORE_DEFAULTS 0x00000200
  24. #define REGMERGE_NT_PRIORITY_NT 0x00000400
  25. typedef enum {
  26. KEY_ONLY,
  27. KEY_TREE,
  28. TREE_OPTIONAL
  29. } TREE_STATE;
  30. BOOL
  31. IsRegObjectMarkedForOperationA (
  32. IN PCSTR Key,
  33. IN PCSTR Value, OPTIONAL
  34. IN TREE_STATE TreeState,
  35. IN DWORD OperationMask
  36. );
  37. BOOL
  38. IsRegObjectMarkedForOperationW (
  39. IN PCWSTR Key,
  40. IN PCWSTR Value, OPTIONAL
  41. IN TREE_STATE TreeState,
  42. IN DWORD OperationMask
  43. );
  44. BOOL
  45. MarkRegObjectForOperationA (
  46. IN PCSTR Key,
  47. IN PCSTR Value, OPTIONAL
  48. IN BOOL Tree,
  49. IN DWORD OperationMask
  50. );
  51. BOOL
  52. MarkRegObjectForOperationW (
  53. IN PCWSTR Key,
  54. IN PCWSTR Value, OPTIONAL
  55. IN BOOL Tree,
  56. IN DWORD OperationMask
  57. );
  58. BOOL
  59. MarkObjectForOperationA (
  60. IN PCSTR Object,
  61. IN DWORD OperationMask
  62. );
  63. BOOL
  64. MarkObjectForOperationW (
  65. IN PCWSTR Object,
  66. IN DWORD OperationMask
  67. );
  68. BOOL
  69. ForceWin9xSettingA (
  70. IN PCSTR SourceKey,
  71. IN PCSTR SourceValue,
  72. IN BOOL SourceTree,
  73. IN PCSTR DestinationKey,
  74. IN PCSTR DestinationValue,
  75. IN BOOL DestinationTree
  76. );
  77. BOOL
  78. ForceWin9xSettingW (
  79. IN PCWSTR SourceKey,
  80. IN PCWSTR SourceValue,
  81. IN BOOL SourceTree,
  82. IN PCWSTR DestinationKey,
  83. IN PCWSTR DestinationValue,
  84. IN BOOL DestinationTree
  85. );
  86. #ifdef UNICODE
  87. #define IsRegObjectMarkedForOperation IsRegObjectMarkedForOperationW
  88. #define MarkRegObjectForOperation MarkRegObjectForOperationW
  89. #define Suppress95RegSetting(k,v) MarkRegObjectForOperationW(k,v,TRUE,REGMERGE_95_SUPPRESS)
  90. #define SuppressNtRegSetting(k,v) MarkRegObjectForOperationW(k,v,TRUE,REG_NT_SUPPRESS)
  91. #define Is95RegObjectSuppressed(k,v) IsRegObjectMarkedForOperationW(k,v,TREE_OPTIONAL,REGMERGE_95_SUPPRESS)
  92. #define IsNtRegObjectSuppressed(k,v) IsRegObjectMarkedForOperationW(k,v,TREE_OPTIONAL,REGMERGE_NT_SUPPRESS)
  93. #define Is95RegKeySuppressed(k) IsRegObjectMarkedForOperationW(k,NULL,KEY_ONLY,REGMERGE_95_SUPPRESS)
  94. #define IsNtRegKeySuppressed(k) IsRegObjectMarkedForOperationW(k,NULL,KEY_ONLY,REGMERGE_NT_SUPPRESS)
  95. #define Is95RegKeyTreeSuppressed(k) IsRegObjectMarkedForOperationW(k,NULL,KEY_TREE,REGMERGE_95_SUPPRESS)
  96. #define IsNtRegKeyTreeSuppressed(k) IsRegObjectMarkedForOperationW(k,NULL,KEY_TREE,REGMERGE_NT_SUPPRESS)
  97. #define IsRegObjectInMemdb(k,v) IsRegObjectMarkedForOperationW(k,v,0xffffffff)
  98. #define MarkObjectForOperation MarkObjectForOperationW
  99. #define Suppress95Object(x) MarkObjectForOperationW(x,REGMERGE_95_SUPPRESS)
  100. #define SuppressNtObject(x) MarkObjectForOperationW(x,REGMERGE_NT_SUPPRESS)
  101. #define ForceWin9xSetting ForceWin9xSettingW
  102. #else
  103. #define IsRegObjectMarkedForOperation IsRegObjectMarkedForOperationA
  104. #define MarkRegObjectForOperation MarkRegObjectForOperationA
  105. #define Suppress95RegSetting(k,v) MarkRegObjectForOperationA(k,v,TRUE,REGMERGE_95_SUPPRESS)
  106. #define SuppressNtRegSetting(k,v) MarkRegObjectForOperationA(k,v,TRUE,REGMERGE_NT_SUPPRESS)
  107. #define Is95RegObjectSuppressed(k,v) IsRegObjectMarkedForOperationA(k,v,TREE_OPTIONAL,REGMERGE_95_SUPPRESS)
  108. #define IsNtRegObjectSuppressed(k,v) IsRegObjectMarkedForOperationA(k,v,TREE_OPTIONAL,REGMERGE_NT_SUPPRESS)
  109. #define Is95RegKeySuppressed(k) IsRegObjectMarkedForOperationA(k,NULL,KEY_ONLY,REGMERGE_95_SUPPRESS)
  110. #define IsNtRegKeySuppressed(k) IsRegObjectMarkedForOperationA(k,NULL,KEY_ONLY,REGMERGE_NT_SUPPRESS)
  111. #define Is95RegKeyTreeSuppressed(k) IsRegObjectMarkedForOperationA(k,NULL,KEY_TREE,REGMERGE_95_SUPPRESS)
  112. #define IsNtRegKeyTreeSuppressed(k) IsRegObjectMarkedForOperationA(k,NULL,KEY_TREE,REGMERGE_NT_SUPPRESS)
  113. #define IsRegObjectInMemdb(k,v) IsRegObjectMarkedForOperationA(k,v,0xffffffff)
  114. #define MarkObjectForOperation MarkObjectForOperationA
  115. #define Suppress95Object(x) MarkObjectForOperationA(x,REGMERGE_95_SUPPRESS)
  116. #define SuppressNtObject(x) MarkObjectForOperationA(x,REGMERGE_NT_SUPPRESS)
  117. #define ForceWin9xSetting ForceWin9xSettingA
  118. #endif