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.

128 lines
4.6 KiB

  1. /* Copyright (c) Microsoft Corporation. All rights reserved. */
  2. #ifndef __IMAPIPUB_H_
  3. #define __IMAPIPUB_H_
  4. #if _MSC_VER > 1000
  5. #pragma once
  6. #endif
  7. #include <ntddstor.h> // STORAGE_BUS_TYPE, others...
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #define IMAPI_ALIGN DECLSPEC_ALIGN(16)
  12. /*
  13. ** Globally unique identifer for the interface class of our device.
  14. */
  15. // {1186654D-47B8-48b9-BEB9-7DF113AE3C67}
  16. static const GUID IMAPIDeviceInterfaceGuid =
  17. { 0x1186654d, 0x47b8, 0x48b9, { 0xbe, 0xb9, 0x7d, 0xf1, 0x13, 0xae, 0x3c, 0x67 } };
  18. #define IMAPIAPI_VERSION ((USHORT)0x3032)
  19. #define FILE_DEVICE_IMAPI 0x90DA
  20. #define FILE_BOTH_ACCESS (FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  21. /*
  22. ** ----------------------------------------------------------------------------
  23. ** IOCTL_IMAPIDRV_INIT
  24. ** ----------------------------------------------------------------------------
  25. */
  26. #define IOCTL_IMAPIDRV_INIT ((ULONG)CTL_CODE(FILE_DEVICE_IMAPI,0x800,METHOD_BUFFERED,FILE_BOTH_ACCESS))
  27. typedef struct _IMAPIDRV_INIT {
  28. // (OUT) The version number for this API. Use this version to make sure
  29. // the structures and IOCTLs are compatible.
  30. ULONG Version;
  31. // Not currently used.
  32. ULONG Reserved;
  33. } IMAPIDRV_INIT, *PIMAPIDRV_INIT;
  34. /*
  35. ** ----------------------------------------------------------------------------
  36. ** IOCTL_IMAPIDRV_ENUMERATE -
  37. ** This IOCTL returns information about a specific drive. It gives global info
  38. ** such as the driver's UniqueID for the device, and its Inquiry data, etc.,
  39. ** and it also gives an instantaneous snap-shot of the devices state information.
  40. ** This state information is accurate at the moment it is collected, but can
  41. ** change immediately. Therefore the state info is best used for making general
  42. ** decisions such as if the device is in use (bOpenedExclusive), wait a while
  43. ** before seeing if it is available.
  44. ** ----------------------------------------------------------------------------
  45. */
  46. #define IOCTL_IMAPIDRV_INFO ((ULONG)CTL_CODE(FILE_DEVICE_IMAPI,0x810,METHOD_BUFFERED,FILE_READ_ACCESS | FILE_WRITE_ACCESS))
  47. typedef enum _IMAPIDRV_DEVSTATE
  48. {
  49. eDevState_Started = 0x00, //IRP_MN_START_DEVICE
  50. eDevState_RemovePending = 0x01, //IRP_MN_QUERY_REMOVE_DEVICE,
  51. eDevState_Removed = 0x02, //IRP_MN_REMOVE_DEVICE,
  52. eDevState_Stopped = 0x04, //IRP_MN_STOP_DEVICE,
  53. eDevState_StopPending = 0x05, //IRP_MN_QUERY_STOP_DEVICE,
  54. eDevState_Unknown = 0xff
  55. }
  56. IMAPIDRV_DEVSTATE, *PIMAPIDRV_DEVSTATE;
  57. typedef struct _IMAPIDRV_DEVICE
  58. {
  59. ULONG DeviceType;
  60. STORAGE_BUS_TYPE BusType;
  61. USHORT BusMajorVersion; // bus-specific data
  62. USHORT BusMinorVersion; // bus-specific data
  63. ULONG AlignmentMask;
  64. ULONG MaximumTransferLength;
  65. ULONG MaximumPhysicalPages;
  66. ULONG BufferUnderrunFreeCapable; // whether the drive support B.U.F. operation
  67. ULONG bInitialized; // always non-zero - initialized
  68. ULONG bOpenedExclusive; // 0 - not opened, non-zero - currently open by someone
  69. ULONG bBurning; // 0 - no burn process active, non-zero - the drive has started a burn process
  70. IMAPIDRV_DEVSTATE curDeviceState; // started, removed, etc., state of device
  71. DWORD idwRecorderType; // CD-R == 0x01, CD-RW == 0x10
  72. ULONG maxWriteSpeed; // 1, 2, 3, meaning 1X, 2X, etc. where X == 150KB/s (typical audio CD stream rate)
  73. BYTE scsiInquiryData[36]; // first portion of data returned from Inquiry CDB // CPF - needs to be 36 long to include revision info
  74. }
  75. IMAPIDRV_DEVICE, *PIMAPIDRV_DEVICE;
  76. typedef struct _IMAPIDRV_INFO
  77. {
  78. ULONG Version;
  79. ULONG NumberOfDevices; // a current count of devices, may change at any time
  80. IMAPIDRV_DEVICE DeviceData;
  81. }
  82. IMAPIDRV_INFO, *PIMAPIDRV_INFO;
  83. // defines for idwRecorderType
  84. #define RECORDER_TYPE_CDR 0x00000001
  85. #define RECORDER_TYPE_CDRW 0x00000010
  86. /*
  87. ** ----------------------------------------------------------------------------
  88. ** IOCTL_IMAPIDRV_OPENEXCLUSIVE
  89. ** ----------------------------------------------------------------------------
  90. */
  91. #define IOCTL_IMAPIDRV_OPENEXCLUSIVE ((ULONG)CTL_CODE(FILE_DEVICE_IMAPI,0x820,METHOD_BUFFERED,FILE_BOTH_ACCESS))
  92. /*
  93. ** ----------------------------------------------------------------------------
  94. ** IOCTL_IMAPIDRV_CLOSE
  95. ** ----------------------------------------------------------------------------
  96. */
  97. #define IOCTL_IMAPIDRV_CLOSE ((ULONG)CTL_CODE(FILE_DEVICE_IMAPI,0x840,METHOD_BUFFERED,FILE_BOTH_ACCESS))
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101. #endif //__IMAPIPUB_H__