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.

158 lines
8.5 KiB

  1. //
  2. // MODULE: tslerror.h
  3. //
  4. // PURPOSE: Warning and error codes for the TSLauncher.
  5. //
  6. // PROJECT: Local Troubleshooter Launcher for the Device Manager
  7. //
  8. // COMPANY: Saltmine Creative, Inc. (206)-633-4743 [email protected]
  9. //
  10. // AUTHORS: Joe Mabel and Richard Meadows
  11. //
  12. // ORIGINAL DATE: 2-26-98
  13. //
  14. //
  15. // Version Date By Comments
  16. //--------------------------------------------------------------------
  17. // V0.1 - RM Original
  18. ///////////////////////
  19. #define TSL_OK 0
  20. #define TSL_ERROR_BAD_HANDLE 1 // Handle hTSL passed into function is bad.
  21. #define TSL_ERROR_OUT_OF_MEMORY 2 // Out-of-memory detected
  22. #define TSL_ERROR_OBJECT_GONE 3 // The LaunchServ returned a negative HRESULT.
  23. #define TSL_ERROR_GENERAL 4 // Can't launch a troubleshooter. There are
  24. // error statuses to be accessed by TSLStatus.
  25. #define TSL_ERROR_NO_NETWORK 5 // Can't identify an appropriate troubleshooting
  26. // network.
  27. #define TSL_ERROR_ILLFORMED_MACHINE_ID 6 // Machine ID is not correctly formed. Sniffing
  28. // disabled.
  29. #define TSL_ERROR_BAD_MACHINE_ID 7 // A machine ID was specified but can't be used.
  30. // Sniffing disabled.
  31. #define TSL_ERROR_ILLFORMED_DEVINST_ID 8 // Device Instance ID is not correctly formed.
  32. // Sniffing disabled.
  33. #define TSL_ERROR_BAD_DEVINST_ID 9 // Device Instance ID was specified but can't be
  34. // used. Sniffing disabled.
  35. #define TSL_ERROR_UNKNOWN_APP 10 // An unrecognized application was specified.
  36. #define TSL_ERROR_UNKNOWN_VER 11 // Unrecognized version (no such version
  37. // associated with application)
  38. #define TSL_ERROR_ASSERTION 13 // An assertion failed
  39. // The next several errors could be thought of as "hard failures of mapping", but we do not
  40. // treat them as hard errors because even if mapping fails totally, we may still be able to
  41. // launch to a generic troubleshooter.
  42. #define TSL_ERROR_MAP_BAD_SEEK 101 // failure while seeking in the mapping file.
  43. // Although, at a low level, a bad seek just indicates seeking to an inappropriate file
  44. // offset, in practice a bad seek would indicate a serious problem either in the mapping file
  45. // or in the code: we should only be seeking to offsets which the contents of the mapping file
  46. // told us to seek to.
  47. #define TSL_ERROR_MAP_BAD_READ 102 // failure while reading from the mapping file.
  48. // Although, at a low level, a bad read just indicates (for example) reading past EOF, in
  49. // practice a bad read would indicate a serious problem either in the mapping file or in
  50. // the code: we should only be reading (1) the header or (2) records which the contents of
  51. // the mapping file told us to read.
  52. #define TSL_ERROR_MAP_CANT_OPEN_MAP_FILE 103
  53. #define TSL_ERROR_MAP_BAD_HEAD_MAP_FILE 104 // failed to read even the header of the map file
  54. // The next several errors should never be seen by applications. They would mean that the
  55. // launch server is mis-using the mapping code.
  56. #define TSM_STAT_NEED_VER_TO_SET_DEF_VER 111 // Trying to apply a version default, but you
  57. // haven't yet successfully set a version
  58. // as a basis to look up the default
  59. #define TSM_STAT_NEED_APP_TO_SET_VER 112 // tried to look up version without previously
  60. // setting application
  61. #define TSM_STAT_UID_NOT_FOUND 113 // a string could not be mapped to a UID.
  62. // In the existing TSMapClient class,
  63. // this means that the name could not be found
  64. // in the region of the mapping file where
  65. // it belongs (e.g. that a version string is
  66. // not in the list of versions for the
  67. // current application.)
  68. // This should always be turned into something
  69. // more specific before it is passed to
  70. // higher-level code.
  71. #define TSL_MIN_WARNING 1000
  72. #define TSL_WARNING_NO_PROBLEM_NODE 1004 // Can't identify an appropriate problem node.
  73. // Troubleshooting will proceed from "first page"
  74. // for this troubleshooting network.
  75. #define TSL_WARNING_NO_NODE 1005 // A state value was specified for a nonexistent
  76. // node
  77. #define TSL_WARNING_NO_STATE 1006 // A non-existent state value was specified for an
  78. // otherwise valid node.
  79. #define TSL_WARNING_LANGUAGE 1007 // Can't apply specified language to this
  80. // particular problem (no language-appropriate
  81. // troubleshooting network). Successively default
  82. // to standard language of this machine and to
  83. // English.
  84. #define TSL_WARNING_NO_ONLINE 1008 // Can't obey stated preference for Online
  85. // Troubleshooter
  86. #define TSL_WARNING_ONLINE_ONLY 1009 // Can't obey stated preference against Online
  87. // Troubleshooter
  88. #define TSL_WARNING_GENERAL 1010 // Can launch a troubleshooter, but there are
  89. // warnings to be accessed by TSLStatus.
  90. #define TSL_WARNING_ILLFORMED_DEV_ID 1011 // Device ID is not correctly formed.
  91. #define TSL_WARNING_BAD_DEV_ID 1012 // A correctly formed but invalid device ID
  92. #define TSL_WARNING_ILLFORMED_CLASS_GUID 1013 // Device Class GUID is not correctly formed.
  93. #define TSL_WARNING_BAD_CLASS_GUID 1014 // A correctly formed but invalid device Class GUID
  94. #define TSL_WARNING_UNKNOWN_APPPROBLEM 1015 // App problem passed in, but this problem
  95. // name is nowhere in the mapping file.
  96. // Troubleshooting will proceed on the basis of
  97. // device information, ignoring specified problem
  98. #define TSL_WARNING_UNUSED_APPPROBLEM 1016 // App problem passed in, and the name is
  99. // recognized but can't be used in conjunction
  100. // with the device information given.
  101. // Troubleshooting will proceed on the basis of
  102. // device information, ignoring specified problem
  103. #define TSL_W_CONTAINER_WAIT_TIMED_OUT 1017 // The container did not respond within the time
  104. // out value specified in the go method.
  105. #define TSL_WARNING_END_OF_VER_CHAIN 1018 // Should never be seen by the calling app.
  106. // Indicates that we are at the end of the chain
  107. // in applying default versions.
  108. #define TSL_MAX_WARNING 1999
  109. // the range 2000-2099 is reserved for internal use by the mapping code.
  110. // statuses in this range should not ever be exposed outside of class TSMapRuntimeAbstract
  111. // and its subclasses.
  112. #define TSL_MIN_RESERVED_FOR_MAPPING 2000
  113. #define TSL_MAX_RESERVED_FOR_MAPPING 2099
  114. // Errors generated by LaunchServ. Need to start @ 4,000 to avoid confusion with
  115. // codes returned by the local troubleshooter.
  116. #define TSL_E_CONTAINER_REG 4000 // Could not find the path to hh.exe / iexplore.exe in the registry.
  117. #define TSL_E_CONTAINER_NF 4001 // Found the path to the browser, but it is not at that location.
  118. #define TSL_E_WEB_PAGE_REG 4002 // Could not find the path to the web page in the registry.
  119. #define TSL_E_WEB_PAGE_NF 4003 // Found the path to the web page, but it is not at that location.
  120. #define TSL_E_CREATE_PROC 4004 // Could not create the hh.exe / iexplore.exe process.
  121. #define TSL_E_MEM_EXCESSIVE 4005 // An unexpected amount of memory is required. i.e. a path name that is longer than MAX_PATH.
  122. #define TSL_E_MAPPING_DB_REG 4006 // Could not find the path to the binary mapping file in the registry.
  123. #define TSL_E_MAPPING_DB_NF 4007 // Found the path to the mapping file, but it is not at that location.
  124. #define TSL_E_NETWORK_REG 4008 // Could not find the path to the network resources (DSZ files).
  125. #define TSL_E_NETWORK_NF 4009 // Could not find a DSC or DSZ file with the network name.
  126. #define TSL_E_NODE_EMP 4010 // A call to set node had a null node name or node state.
  127. #define TSL_E_NO_DEFAULT_NET 4011 // The mapping class failed to get a network and there is not a default network defined in the registry.
  128. #define TSL_E_SNIFF_SCRIPT_REG 4012 // Could not find the path to the sniff script in the registry.
  129. #define TSL_E_COPY_SNIFF_SCRIPT 4013 // Could not create the hh.exe / iexplore.exe process.
  130. inline bool TSLIsHardError(DWORD dwStatus)
  131. {
  132. return (dwStatus == TSL_ERROR_BAD_HANDLE
  133. || dwStatus == TSL_ERROR_OUT_OF_MEMORY
  134. || dwStatus == TSL_ERROR_OBJECT_GONE);
  135. }
  136. inline bool TSLIsError(DWORD dwStatus)
  137. {
  138. return (TSL_OK != dwStatus && dwStatus < TSL_MIN_WARNING || dwStatus > TSL_MAX_WARNING);
  139. }
  140. inline bool TSLIsWarning(DWORD dwStatus)
  141. {
  142. return (dwStatus >= TSL_MIN_WARNING && dwStatus <= TSL_MAX_WARNING);
  143. }
  144. #define TSL_E_FAIL -1
  145. #define TSL_SERV_FAILED(hRes) (FAILED(hRes) && TSL_E_FAIL != hRes)