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.

223 lines
4.9 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // File: upg.h
  6. //
  7. // Contents:
  8. //
  9. // History:
  10. //
  11. //---------------------------------------------------------------------------
  12. #ifndef __TLSUPG4TO5_H__
  13. #define __TLSUPG4TO5_H__
  14. #include <nt.h>
  15. #include <ntrtl.h>
  16. #include <nturtl.h>
  17. #include <ntddkbd.h>
  18. #include <ntddmou.h>
  19. #include <windows.h>
  20. #include <winbase.h>
  21. #include <winerror.h>
  22. #include <stdio.h>
  23. #include <tchar.h>
  24. #include <esent.h>
  25. #include "lscommon.h"
  26. #include "secstore.h"
  27. #include "odbcinst.h"
  28. #include "hydra4db.h"
  29. #include "backup.h"
  30. #include "KPDesc.h"
  31. #include "Licensed.h"
  32. #include "licpack.h"
  33. #include "version.h"
  34. #include "workitem.h"
  35. #include "upgdef.h"
  36. //
  37. //
  38. //
  39. #define AllocateMemory(size) \
  40. LocalAlloc(LPTR, size)
  41. #define FreeMemory(ptr) \
  42. if(ptr) \
  43. { \
  44. LocalFree(ptr); \
  45. ptr=NULL; \
  46. }
  47. #define SAFESTRCPY(dest, source) \
  48. _tcsncpy(dest, source, min(_tcslen(source), sizeof(dest)/sizeof(TCHAR))); \
  49. dest[min(_tcslen(source), (sizeof(dest)/sizeof(TCHAR) -1))] = _TEXT('\0');
  50. //--------------------------------------------------------------------------
  51. //
  52. // Upgrade Error Code, should move into resource file.
  53. //
  54. #define UPGRADE_SETUP_ERROR_BASE 0xD0000000
  55. //
  56. // File not exist or directory not exist
  57. //
  58. #define ERROR_TARGETFILE_NOT_FOUND (UPGRADE_SETUP_ERROR_BASE)
  59. //
  60. // Destination file already exist
  61. //
  62. #define ERROR_DEST_FILE_EXIST (UPGRADE_SETUP_ERROR_BASE + 1)
  63. //
  64. // Source database file does not exist
  65. //
  66. #define ERROR_SRC_FILE_NOT_EXIST (UPGRADE_SETUP_ERROR_BASE + 2)
  67. //
  68. // Hydra ODBC datasource not exist
  69. //
  70. #define ERROR_ODBC_DATASOURCE_NOTEXIST (UPGRADE_SETUP_ERROR_BASE + 3)
  71. //
  72. // Invalid setup or unsupported version
  73. //
  74. #define ERROR_INVALID_NT4_SETUP (UPGRADE_SETUP_ERROR_BASE + 4)
  75. //
  76. // Internal Error in upgrade
  77. //
  78. #define ERROR_INTERNAL (UPGRADE_SETUP_ERROR_BASE + 5)
  79. //
  80. // Unsupport NT4 database version, for example, beta 2
  81. //
  82. #define ERROR_NOTSUPPORT_DB_VERSION (UPGRADE_SETUP_ERROR_BASE + 6)
  83. //
  84. // JetBlue database file exists
  85. //
  86. #define ERROR_JETBLUE_DBFILE_ALREADY_EXISTS (UPGRADE_SETUP_ERROR_BASE + 1)
  87. //
  88. // JetBlue database file exists and corrupted
  89. //
  90. #define ERROR_CORRUPT_JETBLUE_DBFILE (UPGRADE_SETUP_ERROR_BASE + 2)
  91. //
  92. // Can't delete ODBC datasource
  93. //
  94. #define ERROR_DELETE_ODBC_DSN (UPGRADE_SETUP_ERROR_BASE + 7)
  95. //---------------------------------------------------
  96. //
  97. // ODBC related error code
  98. //
  99. //---------------------------------------------------
  100. #define UPGRADE_ODBC_ERROR_BASE 0xD8000000
  101. //
  102. // General ODBC error
  103. //
  104. #define ERROR_ODBC_GENERAL (UPGRADE_ODBC_ERROR_BASE + 1)
  105. //
  106. // ODBC class internal error
  107. //
  108. #define ERROR_ODBC_INTERNAL (UPGRADE_ODBC_ERROR_BASE + 2)
  109. //
  110. // ODBC Record not found
  111. //
  112. #define ERROR_ODBC_NO_DATA_FOUND (UPGRADE_ODBC_ERROR_BASE + 3)
  113. //
  114. // SQLConnect() failed.
  115. //
  116. #define ERROR_ODBC_CONNECT (UPGRADE_ODBC_ERROR_BASE + 4)
  117. //
  118. // SQLAllocConnect() failed
  119. //
  120. #define ERROR_ODBC_ALLOC_CONNECT (UPGRADE_ODBC_ERROR_BASE + 5)
  121. //
  122. // SQLAllocEnv() failed
  123. //
  124. #define ERROR_ODBC_ALLOC_ENV (UPGRADE_ODBC_ERROR_BASE + 6)
  125. //
  126. // SQLAllocStmt() failed.
  127. //
  128. #define ERROR_ODBC_ALLOC_STMT (UPGRADE_ODBC_ERROR_BASE + 7)
  129. //
  130. // SQTransact() failed on commit
  131. //
  132. #define ERROR_ODBC_COMMIT (UPGRADE_ODBC_ERROR_BASE + 8)
  133. //
  134. // SQTransact() failed on rollback
  135. //
  136. #define ERROR_ODBC_ROLLBACK (UPGRADE_ODBC_ERROR_BASE + 9)
  137. //
  138. // Cant' allocate ODBC handle, all handle are in use.
  139. //
  140. #define ERROR_ODBC_ALLOCATE_HANDLE (UPGRADE_ODBC_ERROR_BASE + 10)
  141. //
  142. // SQLPrepare() failed
  143. //
  144. #define ERROR_ODBC_PREPARE (UPGRADE_ODBC_ERROR_BASE + 11)
  145. //
  146. // Execute() failed
  147. //
  148. #define ERROR_ODBC_EXECUTE (UPGRADE_ODBC_ERROR_BASE + 12)
  149. //
  150. // ExecDirect() failed
  151. //
  152. #define ERROR_ODBC_EXECDIRECT (UPGRADE_ODBC_ERROR_BASE + 13)
  153. //
  154. // BindCol failed.
  155. //
  156. #define ERROR_ODBC_BINDCOL (UPGRADE_ODBC_ERROR_BASE + 14)
  157. //
  158. // BindInputParm() failed.
  159. //
  160. #define ERROR_ODBC_BINDINPUTPARM (UPGRADE_ODBC_ERROR_BASE + 15)
  161. //
  162. // GetData() failed.
  163. //
  164. #define ERROR_ODBC_GETDATA (UPGRADE_ODBC_ERROR_BASE + 16)
  165. //
  166. // ParmData() failed.
  167. //
  168. #define ERROR_ODBC_PARMDATA (UPGRADE_ODBC_ERROR_BASE + 17)
  169. //
  170. // PutData() failed.
  171. //
  172. #define ERROR_ODBC_PUTDATA (UPGRADE_ODBC_ERROR_BASE + 18)
  173. //
  174. // Corrupted database
  175. //
  176. #define ERROR_ODBC_CORRUPTDATABASEFILE (UPGRADE_ODBC_ERROR_BASE + 19)
  177. //
  178. // SQLFtch() failed.
  179. //
  180. #define ERROR_ODBC_FETCH (UPGRADE_ODBC_ERROR_BASE + 20)
  181. #endif