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.

200 lines
4.8 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. // When we need to increase the buffer to add one character, increase it by
  21. // (1/4)K so that we won't have to repeatly allocate for every new key stroke.
  22. #define ALLOCATION_INCR 256
  23. // These file types are in the same order as the filer list in regedit.rc
  24. // The list must start at 1
  25. #define FILE_TYPE_REGEDIT5 1
  26. #define FILE_TYPE_REGEDT32 2
  27. #define FILE_TYPE_TEXT 3
  28. #define FILE_TYPE_REGEDIT4 4
  29. #ifndef REG_SZ
  30. #define REG_SZ 0x0001
  31. #endif
  32. #ifndef REG_BINARY
  33. #define REG_BINARY 0x0003
  34. #endif
  35. #ifndef REG_DWORD
  36. #define REG_DWORD 0x0004
  37. #endif
  38. #ifndef FALSE
  39. #define FALSE 0
  40. #endif
  41. #ifndef TRUE
  42. #define TRUE ~FALSE
  43. #endif
  44. /* following equates are also defined in Windows.h. To avoid warnings
  45. * we should make these equates conditional
  46. */
  47. #ifndef ERROR_SUCCESS
  48. #define ERROR_SUCCESS 0L
  49. #endif
  50. #ifndef ERROR_FILE_NOT_FOUND
  51. #define ERROR_FILE_NOT_FOUND 2L
  52. #endif
  53. #ifndef ERROR_ACCESS_DENIED
  54. #define ERROR_ACCESS_DENIED 5L
  55. #endif
  56. #ifndef ERROR_BADDB
  57. #define ERROR_BADDB 1009L
  58. #endif
  59. #ifndef ERROR_MORE_DATA
  60. #define ERROR_MORE_DATA 234L
  61. #endif
  62. #ifndef ERROR_BADKEY
  63. #define ERROR_BADKEY 1010L
  64. #endif
  65. #ifndef ERROR_CANTOPEN
  66. #define ERROR_CANTOPEN 1011L
  67. #endif
  68. #ifndef ERROR_CANTREAD
  69. #define ERROR_CANTREAD 1012L
  70. #define ERROR_CANTWRITE 1013L
  71. #endif
  72. #ifndef ERROR_REGISTRY_CORRUPT
  73. #define ERROR_REGISTRY_CORRUPT 1015L
  74. #define ERROR_REGISTRY_IO_FAILED 1016L
  75. #endif
  76. #ifndef ERROR_KEY_DELETED
  77. #define ERROR_KEY_DELETED 1018L
  78. #endif
  79. #ifndef ERROR_OUTOFMEMORY
  80. #define ERROR_OUTOFMEMORY 14L
  81. #endif
  82. #ifndef ERROR_INVALID_PARAMETER
  83. #define ERROR_INVALID_PARAMETER 87L
  84. #endif
  85. #ifndef ERROR_LOCK_FAILED
  86. #define ERROR_LOCK_FAILED 167L
  87. #endif
  88. #ifndef ERROR_NO_MORE_ITEMS
  89. #define ERROR_NO_MORE_ITEMS 259L
  90. #endif
  91. // INTERNAL
  92. #ifndef ERROR_CANTOPEN16_FILENOTFOUND32
  93. #define ERROR_CANTOPEN16_FILENOTFOUND32 0xffff0000
  94. #define ERROR_CANTREAD16_FILENOTFOUND32 0xffff0001
  95. #endif
  96. #ifndef HKEY_CLASSES_ROOT
  97. #define HKEY_CLASSES_ROOT ((HKEY)0x80000000)
  98. #endif
  99. #ifndef HKEY_CURRENT_USER
  100. #define HKEY_CURRENT_USER ((HKEY)0x80000001)
  101. #endif
  102. #ifndef HKEY_LOCAL_MACHINE
  103. #define HKEY_LOCAL_MACHINE ((HKEY)0x80000002)
  104. #endif
  105. #ifndef HKEY_USERS
  106. #define HKEY_USERS ((HKEY)0x80000003)
  107. #endif
  108. #ifndef HKEY_PERFORMANCE_DATA
  109. #define HKEY_PERFORMANCE_DATA ((HKEY)0x80000004)
  110. #endif
  111. #ifndef HKEY_CURRENT_CONFIG
  112. #define HKEY_CURRENT_CONFIG ((HKEY)0x80000005)
  113. #endif
  114. #ifndef HKEY_DYN_DATA
  115. #define HKEY_DYN_DATA ((HKEY)0x80000006)
  116. #endif
  117. // INTERNAL
  118. #ifndef HKEY_PREDEF_KEYS
  119. #define HKEY_PREDEF_KEYS 7
  120. #endif
  121. #define MAXREGFILES HKEY_PREDEF_KEYS
  122. // sub function indices for Registry services in VMM for 16 bit callers
  123. #define RegOpenKey_Idx 0x100
  124. #define RegCreateKey_Idx 0x101
  125. #define RegCloseKey_Idx 0x102
  126. #define RegDeleteKey_Idx 0x103
  127. #define RegSetValue_Idx 0x104
  128. #define RegQueryValue_Idx 0x105
  129. #define RegEnumKey_Idx 0x106
  130. #define RegDeleteValue_Idx 0x107
  131. #define RegEnumValue_Idx 0x108
  132. #define RegQueryValueEx_Idx 0x109
  133. #define RegSetValueEx_Idx 0x10A
  134. #define RegFlushKey_Idx 0x10B
  135. #define RegLoadKey_Idx 0x10C
  136. #define RegUnLoadKey_Idx 0x10D
  137. #define RegSaveKey_Idx 0x10E
  138. #define RegRestore_Idx 0x10F
  139. #define RegRemapPreDefKey_Idx 0x110
  140. // Data structure passed to SYSDM.CPL DMRegistryError function
  141. // After UI, the function is to call
  142. // RegRestore(DWORD iLevel, LPREGQRSTR lpRgRstr)
  143. //
  144. struct Reg_Query_Restore_s {
  145. DWORD dwRQR_Err; // Error code
  146. DWORD hRQR_RootKey; // Root key for file
  147. DWORD dwRQR_Reference; // Reference data for RegRestore
  148. TCHAR szRQR_SubKey[MAXKEYNAME]; // Subkey (for hives) or NULL string
  149. TCHAR szRQR_FileName[MAX_PATH]; // File name of bad file
  150. };
  151. typedef struct Reg_Query_Restore_s REGQRSTR;
  152. typedef REGQRSTR FAR * LPREGQRSTR;
  153. // END INTERNAL