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.

132 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. regtool.h
  5. Abstract:
  6. This is the include file for the REGTOOL.DLL registry helper.
  7. Author:
  8. Steve Wood (stevewo) 16-Nov-1995
  9. Revision History:
  10. --*/
  11. //
  12. // Routines for accessing registry. Allows code to access any of the following
  13. // registry locations with the same code:
  14. //
  15. // Windows NT registry on local machine
  16. // Windows NT registry on remote machine
  17. // Windows NT hive files
  18. //
  19. #define REG_TARGET_DISCONNECTED 0
  20. #define REG_TARGET_LOCAL_REGISTRY 1
  21. #define REG_TARGET_REMOTE_REGISTRY 2
  22. #define REG_TARGET_HIVE_REGISTRY 4
  23. typedef struct _REG_CONTEXT_OPEN_HIVE_KEY {
  24. struct _REG_CONTEXT_OPEN_HIVE_KEY *Next;
  25. HKEY KeyHandle;
  26. ULONG ReferenceCount;
  27. } REG_CONTEXT_OPEN_HIVE_KEY, *PREG_CONTEXT_OPEN_HIVE_KEY;
  28. typedef struct _REG_CONTEXT {
  29. struct _REG_CONTEXT *Next;
  30. ULONG Target;
  31. HKEY MachineRoot;
  32. HKEY UsersRoot;
  33. HKEY CurrentUserRoot;
  34. WCHAR MachinePath[ MAX_PATH ];
  35. WCHAR UsersPath[ MAX_PATH ];
  36. WCHAR CurrentUserPath[ MAX_PATH ];
  37. ULONG MachinePathLength;
  38. ULONG UsersPathLength;
  39. ULONG CurrentUserPathLength;
  40. HKEY HiveRootHandle;
  41. OBJECT_ATTRIBUTES HiveRootKey;
  42. PREG_CONTEXT_OPEN_HIVE_KEY OpenHiveKeys;
  43. } REG_CONTEXT, *PREG_CONTEXT;
  44. BOOLEAN
  45. RTEnableBackupRestorePrivilege( void );
  46. void
  47. RTDisableBackupRestorePrivilege( void );
  48. LONG
  49. RTConnectToRegistry(
  50. IN PWSTR MachineName,
  51. IN PWSTR HiveFileName,
  52. IN PWSTR HiveRootName,
  53. OUT PWSTR *DefaultRootKeyName,
  54. OUT PREG_CONTEXT RegistryContext
  55. );
  56. LONG
  57. RTDisconnectFromRegistry(
  58. IN PREG_CONTEXT RegistryContext
  59. );
  60. LONG
  61. RTCreateKey(
  62. IN PREG_CONTEXT RegistryContext,
  63. IN HKEY RootKeyHandle,
  64. IN PCWSTR SubKeyName,
  65. IN ACCESS_MASK DesiredAccess,
  66. IN ULONG CreateOptions,
  67. IN PVOID SecurityDescriptor,
  68. OUT PHKEY ReturnedKeyHandle,
  69. OUT PULONG Disposition
  70. );
  71. LONG
  72. RTOpenKey(
  73. IN PREG_CONTEXT RegistryContext,
  74. IN HKEY RootKeyHandle,
  75. IN PCWSTR SubKeyName,
  76. IN ACCESS_MASK DesiredAccess,
  77. IN ULONG OpenOptions,
  78. OUT PHKEY ReturnedKeyHandle
  79. );
  80. #define HKEY_REGISTRY_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x8000000A) )
  81. LONG
  82. RTCloseKey(
  83. IN PREG_CONTEXT RegistryContext,
  84. IN HKEY KeyHandle
  85. );
  86. LONG
  87. RTEnumerateValueKey(
  88. IN PREG_CONTEXT RegistryContext,
  89. IN HKEY KeyHandle,
  90. IN ULONG Index,
  91. OUT PULONG ValueType,
  92. IN OUT PULONG ValueNameLength,
  93. OUT PWSTR ValueName,
  94. IN OUT PULONG ValueDataLength,
  95. OUT PVOID ValueData
  96. );
  97. LONG
  98. RTQueryValueKey(
  99. IN PREG_CONTEXT RegistryContext,
  100. IN HKEY KeyHandle,
  101. IN PWSTR ValueName,
  102. OUT PULONG ValueType,
  103. IN OUT PULONG ValueDataLength,
  104. OUT PVOID ValueData
  105. );