ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

ntddcdrm.h

Go to the documentation of this file.
00001 
00024 /* Created by Casper S. Hornstrup <chorns@users.sourceforge.net> */
00025 #ifndef __NTDDCDRM_H
00026 #define __NTDDCDRM_H
00027 #if 0 // Added to make MSVC happy.
00028 #pragma GCC system_header
00029 #include <_mingw.h>
00030 #endif
00031 
00032 /*
00033  * CDROM IOCTL interface.
00034  */
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 #if 0 // Added to make MSVC happy.
00041 #include "ntddk.h"
00042 #include "ntddstor.h"
00043 #endif
00044 
00045 #define IOCTL_CDROM_BASE                  FILE_DEVICE_CD_ROM
00046 
00047 #define IOCTL_CDROM_CHECK_VERIFY \
00048   CTL_CODE(IOCTL_CDROM_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
00049 
00050 #define IOCTL_CDROM_FIND_NEW_DEVICES \
00051   CTL_CODE(IOCTL_CDROM_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
00052 
00053 #define IOCTL_CDROM_GET_CONTROL \
00054   CTL_CODE(IOCTL_CDROM_BASE, 0x000D, METHOD_BUFFERED, FILE_READ_ACCESS)
00055 
00056 #define IOCTL_CDROM_GET_DRIVE_GEOMETRY \
00057   CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS)
00058 
00059 #define IOCTL_CDROM_GET_LAST_SESSION \
00060   CTL_CODE(IOCTL_CDROM_BASE, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS)
00061 
00062 #define IOCTL_CDROM_GET_VOLUME \
00063   CTL_CODE(IOCTL_CDROM_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
00064 
00065 #define IOCTL_CDROM_PAUSE_AUDIO \
00066   CTL_CODE(IOCTL_CDROM_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
00067 
00068 #define IOCTL_CDROM_PLAY_AUDIO_MSF \
00069   CTL_CODE(IOCTL_CDROM_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
00070 
00071 #define IOCTL_CDROM_RAW_READ \
00072   CTL_CODE(IOCTL_CDROM_BASE, 0x000F, METHOD_OUT_DIRECT,  FILE_READ_ACCESS)
00073 
00074 #define IOCTL_CDROM_READ_Q_CHANNEL \
00075   CTL_CODE(IOCTL_CDROM_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS)
00076 
00077 #define IOCTL_CDROM_READ_TOC \
00078   CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
00079 
00080 #define IOCTL_CDROM_READ_TOC_EX \
00081   CTL_CODE(IOCTL_CDROM_BASE, 0x0015, METHOD_BUFFERED, FILE_READ_ACCESS)
00082 
00083 #define IOCTL_CDROM_RESUME_AUDIO \
00084   CTL_CODE(IOCTL_CDROM_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
00085 
00086 #define IOCTL_CDROM_SEEK_AUDIO_MSF \
00087   CTL_CODE(IOCTL_CDROM_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
00088 
00089 #define IOCTL_CDROM_SET_VOLUME \
00090   CTL_CODE(IOCTL_CDROM_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
00091 
00092 #define IOCTL_CDROM_SIMBAD \
00093   CTL_CODE(IOCTL_CDROM_BASE, 0x1003, METHOD_BUFFERED, FILE_READ_ACCESS)
00094 
00095 #define IOCTL_CDROM_STOP_AUDIO \
00096   CTL_CODE(IOCTL_CDROM_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
00097 
00098 
00099 #define MAXIMUM_NUMBER_TRACKS             100
00100 #define MAXIMUM_CDROM_SIZE                804
00101 #define MINIMUM_CDROM_READ_TOC_EX_SIZE    2
00102 
00103 typedef struct _TRACK_DATA {
00104   UCHAR  Reserved;
00105   UCHAR  Control : 4;
00106   UCHAR  Adr : 4;
00107   UCHAR  TrackNumber;
00108   UCHAR  Reserved1;
00109   UCHAR  Address[4];
00110 } TRACK_DATA, *PTRACK_DATA;
00111 
00112 /* CDROM_DISK_DATA.DiskData flags */
00113 #define CDROM_DISK_AUDIO_TRACK            0x00000001
00114 #define CDROM_DISK_DATA_TRACK             0x00000002
00115 
00116 typedef struct _CDROM_DISK_DATA {
00117   ULONG  DiskData;
00118 } CDROM_DISK_DATA, *PCDROM_DISK_DATA;
00119 
00120 typedef struct _CDROM_PLAY_AUDIO_MSF {
00121   UCHAR  StartingM;
00122   UCHAR  StartingS;
00123   UCHAR  StartingF;
00124   UCHAR  EndingM;
00125   UCHAR  EndingS;
00126   UCHAR  EndingF;
00127 } CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF;
00128 
00129 /* CDROM_READ_TOC_EX.Format constants */
00130 #define CDROM_READ_TOC_EX_FORMAT_TOC      0x00
00131 #define CDROM_READ_TOC_EX_FORMAT_SESSION  0x01
00132 #define CDROM_READ_TOC_EX_FORMAT_FULL_TOC 0x02
00133 #define CDROM_READ_TOC_EX_FORMAT_PMA      0x03
00134 #define CDROM_READ_TOC_EX_FORMAT_ATIP     0x04
00135 #define CDROM_READ_TOC_EX_FORMAT_CDTEXT   0x05
00136 
00137 typedef struct _CDROM_READ_TOC_EX {
00138   UCHAR  Format : 4;
00139   UCHAR  Reserved1 : 3;
00140   UCHAR  Msf : 1;
00141   UCHAR  SessionTrack;
00142   UCHAR  Reserved2;
00143   UCHAR  Reserved3;
00144 } CDROM_READ_TOC_EX, *PCDROM_READ_TOC_EX;
00145 
00146 typedef struct _CDROM_SEEK_AUDIO_MSF {
00147   UCHAR  M;
00148   UCHAR  S;
00149   UCHAR  F;
00150 } CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
00151 
00152 /* CDROM_SUB_Q_DATA_FORMAT.Format constants */
00153 #define IOCTL_CDROM_SUB_Q_CHANNEL         0x00
00154 #define IOCTL_CDROM_CURRENT_POSITION      0x01
00155 #define IOCTL_CDROM_MEDIA_CATALOG         0x02
00156 #define IOCTL_CDROM_TRACK_ISRC            0x03
00157 
00158 typedef struct _CDROM_SUB_Q_DATA_FORMAT {
00159   UCHAR Format;
00160   UCHAR Track;
00161 } CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
00162 
00163 typedef struct _CDROM_TOC {
00164   UCHAR  Length[2];
00165   UCHAR  FirstTrack;
00166   UCHAR  LastTrack;
00167   TRACK_DATA  TrackData[MAXIMUM_NUMBER_TRACKS];
00168 } CDROM_TOC, *PCDROM_TOC;
00169 
00170 #define CDROM_TOC_SIZE sizeof(CDROM_TOC)
00171 
00172 typedef struct _CDROM_TOC_ATIP_DATA_BLOCK {
00173   UCHAR  CdrwReferenceSpeed : 3;
00174   UCHAR  Reserved3 : 1;
00175   UCHAR  WritePower : 3;
00176   UCHAR  True1 : 1;
00177   UCHAR  Reserved4 : 6;
00178   UCHAR  UnrestrictedUse : 1;
00179   UCHAR  Reserved5 : 1;
00180   UCHAR  A3Valid : 1;
00181   UCHAR  A2Valid : 1;
00182   UCHAR  A1Valid : 1;
00183   UCHAR  Reserved6 : 3;
00184   UCHAR  IsCdrw : 1;
00185   UCHAR  True2 : 1;
00186   UCHAR  Reserved7;
00187   UCHAR  LeadInMsf[3];
00188   UCHAR  Reserved8;
00189   UCHAR  LeadOutMsf[3];
00190   UCHAR  Reserved9;
00191   UCHAR  A1Values[3];
00192   UCHAR  Reserved10;
00193   UCHAR  A2Values[3];
00194   UCHAR  Reserved11;
00195   UCHAR  A3Values[3];
00196   UCHAR  Reserved12;
00197 } CDROM_TOC_ATIP_DATA_BLOCK, *PCDROM_TOC_ATIP_DATA_BLOCK;
00198 
00199 #if 0 // Added to make MSVC happy.
00200 typedef struct _CDROM_TOC_ATIP_DATA {
00201   UCHAR  Length[2];
00202   UCHAR  Reserved1;
00203   UCHAR  Reserved2;
00204   CDROM_TOC_ATIP_DATA_BLOCK  Descriptors[0];
00205   CDROM_TOC_ATIP_DATA_BLOCK  Descriptors[1];
00206 } CDROM_TOC_ATIP_DATA, *PCDROM_TOC_ATIP_DATA;
00207 #endif
00208 
00209 /* CDROM_TOC_CD_TEXT_DATA_BLOCK.PackType constants */
00210 #define CDROM_CD_TEXT_PACK_ALBUM_NAME 0x80
00211 #define CDROM_CD_TEXT_PACK_PERFORMER  0x81
00212 #define CDROM_CD_TEXT_PACK_SONGWRITER 0x82
00213 #define CDROM_CD_TEXT_PACK_COMPOSER   0x83
00214 #define CDROM_CD_TEXT_PACK_ARRANGER   0x84
00215 #define CDROM_CD_TEXT_PACK_MESSAGES   0x85
00216 #define CDROM_CD_TEXT_PACK_DISC_ID    0x86
00217 #define CDROM_CD_TEXT_PACK_GENRE      0x87
00218 #define CDROM_CD_TEXT_PACK_TOC_INFO   0x88
00219 #define CDROM_CD_TEXT_PACK_TOC_INFO2  0x89
00220 #define CDROM_CD_TEXT_PACK_UPC_EAN    0x8e
00221 #define CDROM_CD_TEXT_PACK_SIZE_INFO  0x8f
00222 
00223 #if 0 // Added to make MSVC happy.
00224 typedef struct _CDROM_TOC_CD_TEXT_DATA_BLOCK {
00225   UCHAR  PackType;
00226   UCHAR  TrackNumber : 7;
00227   UCHAR  ExtensionFlag : 1;
00228   UCHAR  SequenceNumber;
00229   UCHAR  CharacterPosition : 4;
00230   UCHAR  BlockNumber : 3;
00231   UCHAR  Unicode : 1;
00232   _ANONYMOUS_UNION union {
00233     UCHAR  Text[12];
00234     WCHAR  WText[6];
00235   } DUMMYUNIONNAME;
00236   UCHAR  CRC[2];
00237 } CDROM_TOC_CD_TEXT_DATA_BLOCK, *PCDROM_TOC_CD_TEXT_DATA_BLOCK;
00238 
00239 typedef struct _CDROM_TOC_CD_TEXT_DATA {
00240   UCHAR  Length[2];
00241   UCHAR  Reserved1;
00242   UCHAR  Reserved2;
00243   CDROM_TOC_CD_TEXT_DATA_BLOCK  Descriptors[0];
00244 } CDROM_TOC_CD_TEXT_DATA, *PCDROM_TOC_CD_TEXT_DATA;
00245 #endif
00246 
00247 /* CDROM_TOC_FULL_TOC_DATA_BLOCK.Adr constants */
00248 #define ADR_NO_MODE_INFORMATION           0x0
00249 #define ADR_ENCODES_CURRENT_POSITION      0x1
00250 #define ADR_ENCODES_MEDIA_CATALOG         0x2
00251 #define ADR_ENCODES_ISRC                  0x3
00252 
00253 typedef struct _CDROM_TOC_FULL_TOC_DATA_BLOCK {
00254   UCHAR  SessionNumber;
00255   UCHAR  Control : 4;
00256   UCHAR  Adr : 4;
00257   UCHAR  Reserved1;
00258   UCHAR  Point;
00259   UCHAR  MsfExtra[3];
00260   UCHAR  Zero;
00261   UCHAR  Msf[3];
00262 } CDROM_TOC_FULL_TOC_DATA_BLOCK, *PCDROM_TOC_FULL_TOC_DATA_BLOCK;
00263 
00264 #if 0 // Added to make MSVC happy.
00265 typedef struct _CDROM_TOC_FULL_TOC_DATA {
00266   UCHAR  Length[2];
00267   UCHAR  FirstCompleteSession;
00268   UCHAR  LastCompleteSession;
00269   CDROM_TOC_FULL_TOC_DATA_BLOCK  Descriptors[0];
00270 } CDROM_TOC_FULL_TOC_DATA, *PCDROM_TOC_FULL_TOC_DATA;
00271 
00272 typedef struct _CDROM_TOC_PMA_DATA {
00273   UCHAR  Length[2];
00274   UCHAR  Reserved1;
00275   UCHAR  Reserved2;
00276   CDROM_TOC_FULL_TOC_DATA_BLOCK  Descriptors[0];
00277 } CDROM_TOC_PMA_DATA, *PCDROM_TOC_PMA_DATA;
00278 #endif
00279 
00280 /* SUB_Q_HEADER.AudioStatus constants */
00281 #define AUDIO_STATUS_NOT_SUPPORTED  0x00
00282 #define AUDIO_STATUS_IN_PROGRESS    0x11
00283 #define AUDIO_STATUS_PAUSED         0x12
00284 #define AUDIO_STATUS_PLAY_COMPLETE  0x13
00285 #define AUDIO_STATUS_PLAY_ERROR     0x14
00286 #define AUDIO_STATUS_NO_STATUS      0x15
00287 
00288 typedef struct _SUB_Q_HEADER {
00289   UCHAR  Reserved;
00290   UCHAR  AudioStatus;
00291   UCHAR  DataLength[2];
00292 } SUB_Q_HEADER, *PSUB_Q_HEADER;
00293 
00294 typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
00295   SUB_Q_HEADER  Header;
00296   UCHAR  FormatCode;
00297   UCHAR  Reserved[3];
00298   UCHAR  Reserved1 : 7;
00299   UCHAR  Mcval :1;
00300   UCHAR  MediaCatalog[15];
00301 } SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
00302 
00303 typedef struct _SUB_Q_TRACK_ISRC {
00304   SUB_Q_HEADER  Header;
00305   UCHAR  FormatCode;
00306   UCHAR  Reserved0;
00307   UCHAR  Track;
00308   UCHAR  Reserved1;
00309   UCHAR  Reserved2 : 7;
00310   UCHAR  Tcval : 1;
00311   UCHAR  TrackIsrc[15];
00312 } SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
00313 
00314 typedef struct _SUB_Q_CURRENT_POSITION {
00315   SUB_Q_HEADER  Header;
00316   UCHAR  FormatCode;
00317   UCHAR  Control : 4;
00318   UCHAR  ADR : 4;
00319   UCHAR  TrackNumber;
00320   UCHAR  IndexNumber;
00321   UCHAR  AbsoluteAddress[4];
00322   UCHAR  TrackRelativeAddress[4];
00323 } SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
00324 
00325 typedef union _SUB_Q_CHANNEL_DATA {
00326   SUB_Q_CURRENT_POSITION  CurrentPosition;
00327   SUB_Q_MEDIA_CATALOG_NUMBER  MediaCatalog;
00328   SUB_Q_TRACK_ISRC  TrackIsrc;
00329 } SUB_Q_CHANNEL_DATA, *PSUB_Q_CHANNEL_DATA;
00330 
00331 /* CDROM_AUDIO_CONTROL.LbaFormat constants */
00332 #define AUDIO_WITH_PREEMPHASIS            0x1
00333 #define DIGITAL_COPY_PERMITTED            0x2
00334 #define AUDIO_DATA_TRACK                  0x4
00335 #define TWO_FOUR_CHANNEL_AUDIO            0x8
00336 
00337 typedef struct _CDROM_AUDIO_CONTROL {
00338     UCHAR  LbaFormat;
00339     USHORT  LogicalBlocksPerSecond;
00340 } CDROM_AUDIO_CONTROL, *PCDROM_AUDIO_CONTROL;
00341 
00342 typedef struct _VOLUME_CONTROL {
00343   UCHAR  PortVolume[4];
00344 } VOLUME_CONTROL, *PVOLUME_CONTROL;
00345 
00346 typedef enum _TRACK_MODE_TYPE {
00347     YellowMode2,
00348     XAForm2,
00349     CDDA
00350 } TRACK_MODE_TYPE, *PTRACK_MODE_TYPE;
00351 
00352 typedef struct __RAW_READ_INFO {
00353     LARGE_INTEGER  DiskOffset;
00354     ULONG  SectorCount;
00355     TRACK_MODE_TYPE  TrackMode;
00356 } RAW_READ_INFO, *PRAW_READ_INFO;
00357 
00358 #ifdef __cplusplus
00359 }
00360 #endif
00361 
00362 #endif /* __NTDDCDRM_H */


Generated on Sat Sep 14 2019 05:00:55 for ResidualVM by doxygen 1.7.1
curved edge   curved edge