home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / stierr.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  4.7 KB  |  213 lines

  1. /*++
  2.  
  3. Copyright (c) 1986-1997  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     stierr.h
  8.  
  9. Abstract:
  10.  
  11.     This module contains the user mode still image APIs error and status codes
  12.  
  13. Author:
  14.  
  15.  
  16. Revision History:
  17.  
  18.  
  19. --*/
  20.  
  21. #ifndef _STIERR_
  22. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  23. #define _STIERR_
  24.  
  25.  
  26. //
  27. // Generic test for success on any status value (non-negative numbers
  28. // indicate success).
  29. //
  30.  
  31. #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
  32.  
  33. //
  34. // Generic test for information on any status value.
  35. //
  36.  
  37. #define NT_INFORMATION(Status) ((ULONG)(Status) >> 30 == 1)
  38.  
  39. //
  40. // Generic test for warning on any status value.
  41. //
  42.  
  43. #define NT_WARNING(Status) ((ULONG)(Status) >> 30 == 2)
  44.  
  45. //
  46. // Generic test for error on any status value.
  47. //
  48.  
  49. #define NT_ERROR(Status) ((ULONG)(Status) >> 30 == 3)
  50.  
  51. //
  52. // Error codes are constructed as compound COM status codes
  53. //
  54.  
  55. /*
  56.  * The operation completed successfully
  57.  */
  58. #define STI_OK  S_OK
  59. #define STI_ERROR_NO_ERROR          STI_OK
  60.  
  61. /*
  62.  * The device exists but not currently attached to the system
  63.  */
  64. #define STI_NOTCONNECTED            S_FALSE
  65.  
  66. /*
  67.  * The requested change in device mode settings had no effect
  68.  */
  69. #define STI_CHANGENOEFFECT          S_FALSE
  70.  
  71. /*
  72.  * The application requires newer version
  73.  */
  74. #define STIERR_OLD_VERSION      \
  75.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_OLD_WIN_VERSION)
  76.  
  77. /*
  78.  * The application was written for pre-release version of provider DLL
  79.  */
  80. #define STIERR_BETA_VERSION     \
  81.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_RMODE_APP)
  82.  
  83. /*
  84.  * The requested object could not be created due to incompatible or mismatched driver
  85.  */
  86. #define STIERR_BADDRIVER        \
  87.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_BAD_DRIVER_LEVEL)
  88.  
  89. /*
  90.  * The device is not registered
  91.  */
  92. #define STIERR_DEVICENOTREG     REGDB_E_CLASSNOTREG
  93.  
  94. /*
  95.  * The requested container does not exist
  96.  */
  97. #define STIERR_OBJECTNOTFOUND \
  98.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_FILE_NOT_FOUND)
  99.  
  100. /*
  101.  * An invalid or not state matching parameter was passed to the API
  102.  */
  103. #define STIERR_INVALID_PARAM    E_INVALIDARG
  104.  
  105. /*
  106.  * The specified interface is not supported
  107.  */
  108. #define STIERR_NOINTERFACE      E_NOINTERFACE
  109.  
  110. /*
  111.  * The undetermined error occured
  112.  */
  113. #define STIERR_GENERIC          E_FAIL
  114.  
  115. /*
  116.  * There is not enough memory to perform requested operation
  117.  */
  118. #define STIERR_OUTOFMEMORY      E_OUTOFMEMORY
  119.  
  120. /*
  121.  * The application called unsupported (at this time)function
  122.  */
  123. #define STIERR_UNSUPPORTED      E_NOTIMPL
  124.  
  125. /*
  126.  * The application requires newer version
  127.  */
  128. #define STIERR_NOT_INITIALIZED     \
  129.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_NOT_READY)
  130.  
  131. /*
  132.  * The application requires newer version
  133.  */
  134. #define STIERR_ALREADY_INITIALIZED     \
  135.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_ALREADY_INITIALIZED)
  136.  
  137. /*
  138.  * The operation can not performed while device is locked
  139.  */
  140. #define STIERR_DEVICE_LOCKED    \
  141.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_LOCK_VIOLATION)
  142.  
  143. /*
  144.  * The specified propery can not be changed for this device
  145.  */
  146. #define STIERR_READONLY         E_ACCESSDENIED
  147.  
  148. /*
  149.  * The device already has notification handle associated with it
  150.  */
  151. #define STIERR_NOTINITIALIZED   E_ACCESSDENIED
  152.  
  153.  
  154. /*
  155.  * The device needs to be locked before attempting this operation
  156.  */
  157. #define STIERR_NEEDS_LOCK    \
  158.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_NOT_LOCKED)
  159.  
  160. /*
  161.  * The device is opened by another application in data mode
  162.  */
  163. #define STIERR_SHARING_VIOLATION    \
  164.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_SHARING_VIOLATION)
  165.  
  166.  
  167. /*
  168.  * Handle already set for this context
  169.  */
  170. #define STIERR_HANDLEEXISTS     \
  171.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_ALREADY_EXISTS)
  172.  
  173.  /*
  174.   * Device name is not recognized
  175.   */
  176. #define STIERR_INVALID_DEVICE_NAME     \
  177.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_INVALID_NAME)
  178.  
  179.  /*
  180.   * Device hardware type is not valid
  181.   */
  182. #define STIERR_INVALID_HW_TYPE     \
  183.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_INVALID_DATA)
  184.  
  185.  
  186.  /*
  187.   * Device hardware type is not valid
  188.   */
  189. #define STIERR_INVALID_HW_TYPE     \
  190.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_INVALID_DATA)
  191.  
  192.  /*
  193.   * No events available
  194.   */
  195. #define STIERR_NOEVENTS     \
  196.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_NO_MORE_ITEMS)
  197.  
  198.  /*
  199.   * Device appears as not ready
  200.   */
  201. #define STIERR_DEVICE_NOTREADY     \
  202.         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_NOT_READY)
  203.  
  204.  
  205. //#define STIERR_
  206.  
  207.  
  208. #pragma option pop /*P_O_Pop*/
  209. #endif // _STIERR_
  210.  
  211.  
  212.  
  213.