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.

110 lines
3.2 KiB

  1. #ifndef _MCT_H
  2. #define _MCT_H
  3. typedef DWORD MCT_STATUS;
  4. VOID
  5. mctDebugPrint(
  6. ULONG DebugPrintLevel,
  7. PCHAR DebugMessage,
  8. ...
  9. );
  10. //
  11. // Switch chars for calling Changer IOCTLs
  12. //
  13. #define INIT_ELEMENT_STATUS 'i'
  14. #define GET_ELEMENT_STATUS 'e'
  15. #define GET_PARAMETERS 'p'
  16. #define GET_STATUS 's'
  17. #define GET_PRODUCT_DATA 'd'
  18. #define SET_ACCESS 'a'
  19. #define SET_POSITION 'o'
  20. #define EXCHANGE_MEDIUM 'x'
  21. #define MOVE_MEDIUM 'm'
  22. #define REINITIALIZE_TRANSPORT 'r'
  23. #define QUERY_VOLUME_TAG 'q'
  24. //
  25. // Changer Element Types
  26. //
  27. #define CHANGER_ALL_ELEMENTS 'A'
  28. #define CHANGER_SLOT 'S'
  29. #define CHANGER_DRIVE 'D'
  30. #define CHANGER_TRANSPORT 'T'
  31. #define CHANGER_KEYPAD 'K'
  32. #define CHANGER_IEPORT 'I'
  33. #define CHANGER_DOOR 'O'
  34. //
  35. // Control codes for SetAccess
  36. //
  37. #define CHANGER_EXTEND_IEPORT 'E'
  38. #define CHANGER_RETRACT_IEPORT 'R'
  39. #define CHANGER_LOCK_ELEMENT 'L'
  40. #define CHANGER_UNLOCK_ELEMENT 'U'
  41. //
  42. // MCT_STATUS Codes
  43. //
  44. #define MCT_STATUS_SUCCESS 0
  45. #define MCT_STATUS_FAILED 1
  46. #define PRINT_MOVE_CAPABILITIES(Element, Name) \
  47. if ((Element) != 0) { \
  48. printf("\n Changer can move from %s to :\n", Name); \
  49. if ((Element) & CHANGER_TO_TRANSPORT) \
  50. printf("\t\t Transport\n"); \
  51. if ((Element) & CHANGER_TO_SLOT) \
  52. printf("\t\t Slot\n"); \
  53. if ((Element) & CHANGER_TO_IEPORT) \
  54. printf("\t\t IEPort\n"); \
  55. if ((Element) & CHANGER_TO_DRIVE) \
  56. printf("\t\t Drive\n"); \
  57. printf("\n"); \
  58. }
  59. #define PRINT_EXCHANGE_CAPABILITIES(Element, Name) \
  60. if ((Element) != 0) { \
  61. printf("\n Changer can exchange between %s and :\n", Name); \
  62. if ((Element) & CHANGER_TO_TRANSPORT) \
  63. printf("\t\t Transport\n"); \
  64. if ((Element) & CHANGER_TO_SLOT) \
  65. printf("\t\t Slot\n"); \
  66. if ((Element) & CHANGER_TO_IEPORT) \
  67. printf("\t\t IEPort\n"); \
  68. if ((Element) & CHANGER_TO_DRIVE) \
  69. printf("\t\t Drive\n"); \
  70. printf("\n"); \
  71. }
  72. #define PRINT_LOCK_UNLOCK_CAPABILITY(Value, Element, Name) \
  73. if ((Value) & Element) { \
  74. printf(" Changer is Capable of Locking\\Unlocking %s.\n", Name); \
  75. }
  76. #define PRINT_POSITION_CAPABILITY(Value, Element, Name) \
  77. if ((Value) & Element) { \
  78. printf(" Changer is Capable of positioning transport to %s.\n", Name); \
  79. }
  80. //
  81. // Function prototypes
  82. //
  83. VOID mctPrintUsage();
  84. BOOLEAN mctOpenChanger();
  85. VOID mctCloseChanger();
  86. MCT_STATUS mctInitElementStatus();
  87. MCT_STATUS mctGetElementStatus(CHAR, USHORT);
  88. MCT_STATUS mctGetParameters(BOOLEAN);
  89. MCT_STATUS mctGetStatus();
  90. MCT_STATUS mctGetProductData();
  91. MCT_STATUS mctSetAccess(CHAR, USHORT, CHAR);
  92. MCT_STATUS mctSetPosition(CHAR, USHORT);
  93. MCT_STATUS mctExchangeMedium(CHAR, USHORT, CHAR, USHORT,
  94. CHAR, USHORT, CHAR, USHORT);
  95. MCT_STATUS mctMoveMedium(CHAR, USHORT, CHAR, USHORT, CHAR, USHORT);
  96. MCT_STATUS mctReinitTransport();
  97. MCT_STATUS mctQueryVolumeTag();
  98. #endif // _MCT_H