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.

192 lines
4.3 KiB

  1. /* Do not include this before Windows.h */
  2. /* ASM
  3. ; DO NOT INCLUDE THIS BEFORE WINDOWS.INC
  4. */
  5. #define Dereference(x) x=x;
  6. /*XLATOFF*/
  7. #pragma warning (disable:4209) // turn off redefinition warning (with vmm.h)
  8. /*XLATON*/
  9. #ifndef _WINREG_
  10. // WINREG.H uses DECLARE_HANDLE(HKEY) giving incompatible types.
  11. typedef DWORD HKEY;
  12. #endif
  13. /*XLATOFF*/
  14. #pragma warning (default:4209) // turn on redefinition warning (with vmm.h)
  15. /*XLATON*/
  16. #define MAXKEYNAME 256
  17. // Max length of a key name string
  18. #define MAXVALUENAME_LENGTH MAXKEYNAME
  19. // Max length of a value name string
  20. #define MAXDATA_LENGTH 16L*1024L
  21. // Max length of a value data item
  22. #ifndef REG_SZ
  23. #define REG_SZ 0x0001
  24. #endif
  25. #ifndef REG_BINARY
  26. #define REG_BINARY 0x0003
  27. #endif
  28. #ifndef REG_DWORD
  29. #define REG_DWORD 0x0004
  30. #endif
  31. #ifndef FALSE
  32. #define FALSE 0
  33. #endif
  34. #ifndef TRUE
  35. #define TRUE ~FALSE
  36. #endif
  37. /* following equates are also defined in Windows.h. To avoid warnings
  38. * we should make these equates conditional
  39. */
  40. #ifndef ERROR_SUCCESS
  41. #define ERROR_SUCCESS 0L
  42. #endif
  43. #ifndef ERROR_FILE_NOT_FOUND
  44. #define ERROR_FILE_NOT_FOUND 2L
  45. #endif
  46. #ifndef ERROR_ACCESS_DENIED
  47. #define ERROR_ACCESS_DENIED 5L
  48. #endif
  49. #ifndef ERROR_BADDB
  50. #define ERROR_BADDB 1009L
  51. #endif
  52. #ifndef ERROR_MORE_DATA
  53. #define ERROR_MORE_DATA 234L
  54. #endif
  55. #ifndef ERROR_BADKEY
  56. #define ERROR_BADKEY 1010L
  57. #endif
  58. #ifndef ERROR_CANTOPEN
  59. #define ERROR_CANTOPEN 1011L
  60. #endif
  61. #ifndef ERROR_CANTREAD
  62. #define ERROR_CANTREAD 1012L
  63. #define ERROR_CANTWRITE 1013L
  64. #endif
  65. #ifndef ERROR_REGISTRY_CORRUPT
  66. #define ERROR_REGISTRY_CORRUPT 1015L
  67. #define ERROR_REGISTRY_IO_FAILED 1016L
  68. #endif
  69. #ifndef ERROR_KEY_DELETED
  70. #define ERROR_KEY_DELETED 1018L
  71. #endif
  72. #ifndef ERROR_OUTOFMEMORY
  73. #define ERROR_OUTOFMEMORY 14L
  74. #endif
  75. #ifndef ERROR_INVALID_PARAMETER
  76. #define ERROR_INVALID_PARAMETER 87L
  77. #endif
  78. #ifndef ERROR_LOCK_FAILED
  79. #define ERROR_LOCK_FAILED 167L
  80. #endif
  81. #ifndef ERROR_NO_MORE_ITEMS
  82. #define ERROR_NO_MORE_ITEMS 259L
  83. #endif
  84. // INTERNAL
  85. #ifndef ERROR_CANTOPEN16_FILENOTFOUND32
  86. #define ERROR_CANTOPEN16_FILENOTFOUND32 0xffff0000
  87. #define ERROR_CANTREAD16_FILENOTFOUND32 0xffff0001
  88. #endif
  89. #ifndef HKEY_CLASSES_ROOT
  90. #define HKEY_CLASSES_ROOT ((HKEY)0x80000000)
  91. #endif
  92. #ifndef HKEY_CURRENT_USER
  93. #define HKEY_CURRENT_USER ((HKEY)0x80000001)
  94. #endif
  95. #ifndef HKEY_LOCAL_MACHINE
  96. #define HKEY_LOCAL_MACHINE ((HKEY)0x80000002)
  97. #endif
  98. #ifndef HKEY_USERS
  99. #define HKEY_USERS ((HKEY)0x80000003)
  100. #endif
  101. #ifndef HKEY_PERFORMANCE_DATA
  102. #define HKEY_PERFORMANCE_DATA ((HKEY)0x80000004)
  103. #endif
  104. #ifndef HKEY_CURRENT_CONFIG
  105. #define HKEY_CURRENT_CONFIG ((HKEY)0x80000005)
  106. #endif
  107. #ifndef HKEY_DYN_DATA
  108. #define HKEY_DYN_DATA ((HKEY)0x80000006)
  109. #endif
  110. // INTERNAL
  111. #ifndef HKEY_PREDEF_KEYS
  112. #define HKEY_PREDEF_KEYS 7
  113. #endif
  114. #define MAXREGFILES HKEY_PREDEF_KEYS
  115. // sub function indices for Registry services in VMM for 16 bit callers
  116. #define RegOpenKey_Idx 0x100
  117. #define RegCreateKey_Idx 0x101
  118. #define RegCloseKey_Idx 0x102
  119. #define RegDeleteKey_Idx 0x103
  120. #define RegSetValue_Idx 0x104
  121. #define RegQueryValue_Idx 0x105
  122. #define RegEnumKey_Idx 0x106
  123. #define RegDeleteValue_Idx 0x107
  124. #define RegEnumValue_Idx 0x108
  125. #define RegQueryValueEx_Idx 0x109
  126. #define RegSetValueEx_Idx 0x10A
  127. #define RegFlushKey_Idx 0x10B
  128. #define RegLoadKey_Idx 0x10C
  129. #define RegUnLoadKey_Idx 0x10D
  130. #define RegSaveKey_Idx 0x10E
  131. #define RegRestore_Idx 0x10F
  132. #define RegRemapPreDefKey_Idx 0x110
  133. // Data structure passed to SYSDM.CPL DMRegistryError function
  134. // After UI, the function is to call
  135. // RegRestore(DWORD iLevel, LPREGQRSTR lpRgRstr)
  136. //
  137. struct Reg_Query_Restore_s {
  138. DWORD dwRQR_Err; // Error code
  139. DWORD hRQR_RootKey; // Root key for file
  140. DWORD dwRQR_Reference; // Reference data for RegRestore
  141. TCHAR szRQR_SubKey[MAXKEYNAME]; // Subkey (for hives) or NULL string
  142. TCHAR szRQR_FileName[MAX_PATH]; // File name of bad file
  143. };
  144. typedef struct Reg_Query_Restore_s REGQRSTR;
  145. typedef REGQRSTR FAR * LPREGQRSTR;
  146. // END INTERNAL