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.

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