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.

144 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. Imports.h
  5. Abstract:
  6. This file allows us to include standard system header files in the
  7. regrpc.idl file. The regrpc.idl file imports a file called
  8. imports.idl. This allows the regrpc.idl file to use the types defined
  9. in these header files. It also causes the following line to be added
  10. in the MIDL generated header file:
  11. #include "imports.h"
  12. Thus these types are available to the RPC stub routines as well.
  13. Author:
  14. David J. Gilman (davegi) 28-Jan-1992
  15. --*/
  16. #ifndef __IMPORTS_H__
  17. #define __IMPORTS_H__
  18. #include <nt.h>
  19. #include <ntrtl.h>
  20. #include <nturtl.h>
  21. #include <windef.h>
  22. #include <winbase.h>
  23. #include <winreg.h>
  24. typedef struct _RVALENT { // Remote Value entry for RegQueryMultipleValues
  25. PUNICODE_STRING rv_valuename;
  26. DWORD rv_valuelen;
  27. DWORD rv_valueptr;
  28. DWORD rv_type;
  29. } RVALENT;
  30. typedef RVALENT *PRVALENT;
  31. //
  32. // NT 3.1, 3.5 and 3.51 have no implementation of BaseRegGetVersion so this
  33. // number is irrelevant to them.
  34. //
  35. // For a Win95 registry REMOTE_REGISTRY_VERSION should be == 4. Unfortunately,
  36. // someone a bit confused by the concept of a pointer mis-implented the
  37. // Win95 BaseRegGetVersion and it does not actually return a version number.
  38. // So we detect Win95 by assuming anything that succeeds but returns
  39. // a dwVersion outside the range 5-10.
  40. //
  41. // For an NT 4.0 registry, REMOTE_REGISTRY_VERSION==5.
  42. //
  43. // Win95 has the following bugs than NT 4.0 works around on the client side:
  44. // - BaseRegQueryInfoKey does not account for Unicode value names & data correctly
  45. // - BaseRegEnumValue returns value data length that is one WCHAR more than it
  46. // really should be for REG_SZ, REG_MULTI_SZ, and REG_EXPAND_SZ types.
  47. //
  48. #define WIN95_REMOTE_REGISTRY_VERSION 4
  49. #define REMOTE_REGISTRY_VERSION 5
  50. #define IsWin95Server(h,v) ((BaseRegGetVersion(h,&v)==ERROR_SUCCESS) && \
  51. ((v < 5) || (v > 10)))
  52. //
  53. // BOOL
  54. // IsPredefinedRegistryHandle(
  55. // IN RPC_HKEY Handle
  56. // );
  57. //
  58. #define IsPredefinedRegistryHandle( h ) \
  59. (( ( h == HKEY_CLASSES_ROOT ) \
  60. || ( h == HKEY_CURRENT_USER ) \
  61. || ( h == HKEY_LOCAL_MACHINE ) \
  62. || ( h == HKEY_PERFORMANCE_DATA ) \
  63. || ( h == HKEY_PERFORMANCE_TEXT ) \
  64. || ( h == HKEY_PERFORMANCE_NLSTEXT ) \
  65. || ( h == HKEY_USERS ) \
  66. || ( h == HKEY_CURRENT_CONFIG ) \
  67. || ( h == HKEY_DYN_DATA )) \
  68. ? TRUE \
  69. : FALSE )
  70. //
  71. // RPC constants.
  72. //
  73. #define INTERFACE_NAME L"winreg"
  74. #define BIND_SECURITY L"Security=Impersonation Dynamic False"
  75. //
  76. // External synchronization event.
  77. //
  78. #define PUBLIC_EVENT "Microsoft.RPC_Registry_Server"
  79. //
  80. // Force the implementation of the API to be explicit (i.e wrt ANSI or
  81. // UNICODE) about what other Registry APIs are called.
  82. //
  83. #undef RegCloseKey
  84. #undef RegConnectRegistry
  85. #undef RegCreateKey
  86. #undef RegCreateKeyEx
  87. #undef RegDeleteKey
  88. #undef RegDeleteValue
  89. #undef RegEnumKey
  90. #undef RegEnumKeyEx
  91. #undef RegEnumValue
  92. #undef RegFlushKey
  93. #undef RegGetKeySecurity
  94. #undef RegNotifyChangeKeyValue
  95. #undef RegOpenKey
  96. #undef RegOpenKeyEx
  97. #undef RegQueryInfoKey
  98. #undef RegQueryValue
  99. #undef RegQueryValueEx
  100. #undef RegRestoreKey
  101. #undef RegSaveKey
  102. #undef RegSaveKeyEx
  103. #undef RegSetKeySecurity
  104. #undef RegSetValue
  105. #undef RegSetValueEx
  106. //
  107. // Additional type for string arrays.
  108. //
  109. typedef CHAR STR;
  110. //
  111. // Default values for Win 3.1 requested access.
  112. //
  113. #define WIN31_REGSAM MAXIMUM_ALLOWED
  114. #endif //__IMPORTS_H__