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.

130 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. Localreg.h
  5. Abstract:
  6. This file is used to make small changes to the Winreg Base entry
  7. points so that they compile as local or remote functions.
  8. Author:
  9. David J. Gilman (davegi) 26-Aug-1992
  10. Notes:
  11. The mapping from BaseRegNotifyChangeKeyValue to
  12. LocalBaseRegNotifyChangeKeyValue is missing because in the
  13. local case the call to NJt is made by the client.
  14. --*/
  15. #if defined( LOCAL )
  16. //
  17. // Change the 'server' enrty point names for the local functions.
  18. //
  19. //
  20. // Base functions.
  21. //
  22. #define BaseRegDeleteKey LocalBaseRegDeleteKey
  23. #define BaseRegDeleteValue LocalBaseRegDeleteValue
  24. #define BaseRegEnumKey LocalBaseRegEnumKey
  25. #define BaseRegEnumValue LocalBaseRegEnumValue
  26. #define BaseRegCloseKey LocalBaseRegCloseKey
  27. #define BaseRegCreateKey LocalBaseRegCreateKey
  28. #define BaseRegFlushKey LocalBaseRegFlushKey
  29. #define BaseRegOpenKey LocalBaseRegOpenKey
  30. #define BaseRegLoadKey LocalBaseRegLoadKey
  31. #define BaseRegUnLoadKey LocalBaseRegUnLoadKey
  32. #define BaseRegReplaceKey LocalBaseRegReplaceKey
  33. #define BaseRegQueryInfoKey LocalBaseRegQueryInfoKey
  34. #define BaseRegQueryValue LocalBaseRegQueryValue
  35. #define BaseRegGetKeySecurity LocalBaseRegGetKeySecurity
  36. #define BaseRegSetKeySecurity LocalBaseRegSetKeySecurity
  37. #define BaseRegRestoreKey LocalBaseRegRestoreKey
  38. #define BaseRegSaveKey LocalBaseRegSaveKey
  39. #define BaseRegSaveKeyEx LocalBaseRegSaveKeyEx
  40. #define BaseRegSetValue LocalBaseRegSetValue
  41. #define BaseRegQueryMultipleValues LocalBaseRegQueryMultipleValues
  42. #define BaseRegGetVersion LocalBaseRegGetVersion
  43. //
  44. // Predefined handle functions.
  45. //
  46. #define OpenClassesRoot LocalOpenClassesRoot
  47. #define OpenCurrentUser LocalOpenCurrentUser
  48. #define OpenLocalMachine LocalOpenLocalMachine
  49. #define OpenUsers LocalOpenUsers
  50. #define OpenPerformanceData LocalOpenPerformanceData
  51. #define OpenPerformanceText LocalOpenPerformanceText
  52. #define OpenPerformanceNlsText LocalOpenPerformanceNlsText
  53. #define OpenCurrentConfig LocalOpenCurrentConfig
  54. #define OpenDynData LocalOpenDynData
  55. //
  56. // Initialization and cleanup functions.
  57. //
  58. #define InitializeRegCreateKey LocalInitializeRegCreateKey
  59. #define CleanupRegCreateKey LocalCleanupRegCreateKey
  60. //
  61. // No RPC Impersonation needed in the local case.
  62. //
  63. #define RPC_IMPERSONATE_CLIENT( Handle )
  64. #define RPC_REVERT_TO_SELF()
  65. #define REGSEC_CHECK_HANDLE( Handle ) ( 0 )
  66. #define REGSEC_FLAG_HANDLE( Handle, Flag ) ( Handle )
  67. #define REGSEC_TEST_HANDLE( Handle, Flag ) ( Handle )
  68. #define REGSEC_CLEAR_HANDLE( Handle ) ( Handle )
  69. #define REGSEC_CHECK_REMOTE( Key ) ( 1 )
  70. #define REGSEC_CHECK_PATH( Key, Path ) ( 1 )
  71. #else
  72. //
  73. // Impersonate the client.
  74. //
  75. #define RPC_IMPERSONATE_CLIENT( Handle ) \
  76. { \
  77. RPC_STATUS _rpcstatus = RpcImpersonateClient( NULL ); \
  78. if (_rpcstatus != ERROR_SUCCESS) { \
  79. return(_rpcstatus); \
  80. } \
  81. }
  82. #define RPC_REVERT_TO_SELF() RpcRevertToSelf()
  83. #define CHECK_MACHINE_PATHS 0x00000001
  84. #define CHECK_USER_PATHS 0x00000002
  85. #define REGSEC_CHECK_HANDLE( Handle ) ((LONG)(ULONG_PTR) (Handle) & (CHECK_MACHINE_PATHS | CHECK_USER_PATHS))
  86. #define REGSEC_FLAG_HANDLE( Handle, Flag ) LongToHandle(HandleToLong(Handle) | Flag)
  87. #define REGSEC_TEST_HANDLE( Handle, Flag ) ((LONG)(ULONG_PTR) (Handle) & Flag )
  88. #define REGSEC_CLEAR_HANDLE( Handle ) LongToHandle(HandleToLong(Handle) & ~(CHECK_MACHINE_PATHS | CHECK_USER_PATHS))
  89. #define REGSEC_CHECK_REMOTE( Key ) ( RegSecCheckRemoteAccess( Key ) )
  90. #define REGSEC_CHECK_PATH( Key, Path ) ( RegSecCheckPath( Key, Path ) )
  91. #endif // LOCAL
  92. NTSTATUS RelinkMachineKey(
  93. LPWSTR lpSubDirName,
  94. PUNICODE_STRING lpSubKey,
  95. HKEY hKey );