home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / ceddcdvd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  6.1 KB  |  236 lines

  1. /*++ BUILD Version: 0001    // Increment this if a change has global effects
  2.  
  3. Copyright (c) 1990-1998  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     ceddcdvd.h
  8.  
  9. Abstract:
  10.  
  11.     This module contains structures and definitions
  12.     associated with DVD ioctls.
  13.     
  14.     This module is used in conjunction with ntddcdrm.h which contains the 
  15.     cdrom specific ioctls which will work on CDVD drives
  16.  
  17. Author:
  18.  
  19.     Peter Wieland
  20.  
  21. Revision History:
  22.  
  23. --*/
  24.  
  25. //
  26. // Disable warning C4200: nonstandard extension used : zero-sized array in struct/union
  27. //
  28. #pragma warning(disable:4200)
  29.  
  30. //
  31. // NtDeviceIoControlFile IoControlCode values for this device.
  32. //
  33. // Warning:  Remember that the low two bits of the code specify how the
  34. //           buffers are passed to the driver!
  35. //
  36.  
  37. #define IOCTL_DVD_BASE                 FILE_DEVICE_DVD
  38.  
  39. //
  40. // CDVD Device Control Functions
  41. //
  42. // Warning: Ioctls from 200 through 300 are used for the old common class
  43. // driver ioctls and should not be used for device specific functionality
  44. //
  45.  
  46. //
  47. // Copyright ioctls
  48. //
  49.  
  50. #define IOCTL_DVD_START_SESSION     CTL_CODE(IOCTL_DVD_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
  51. #define IOCTL_DVD_READ_KEY          CTL_CODE(IOCTL_DVD_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
  52. #define IOCTL_DVD_SEND_KEY          CTL_CODE(IOCTL_DVD_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
  53. #define IOCTL_DVD_END_SESSION       CTL_CODE(IOCTL_DVD_BASE, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS)
  54.  
  55. //
  56. // DVD Structure queries
  57. // 
  58.  
  59. #define IOCTL_DVD_READ_STRUCTURE    CTL_CODE(IOCTL_DVD_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
  60.  
  61. //
  62. // The following file contains the IOCTL_STORAGE class ioctl definitions
  63. //
  64.  
  65. #define IOCTL_STORAGE_SET_READ_AHEAD        CTL_CODE(IOCTL_STORAGE_BASE, 0x0100, METHOD_BUFFERED, FILE_READ_ACCESS)
  66.  
  67. #include <ceddstor.h>
  68.  
  69. typedef enum {
  70.     DvdChallengeKey = 0x01,
  71.     DvdBusKey1,
  72.     DvdBusKey2,
  73.     DvdTitleKey,
  74.     DvdDiskKey = 0x80
  75. } DVD_KEY_TYPE;
  76.  
  77. typedef ULONG DVD_SESSION_ID, *PDVD_SESSION_ID;
  78.  
  79. typedef struct _DVD_COPY_PROTECT_KEY {
  80.     ULONG KeyLength;
  81.     DVD_SESSION_ID SessionId;
  82.     DVD_KEY_TYPE KeyType;
  83.     union {
  84.         LARGE_INTEGER TitleOffset;
  85.     } Parameters;
  86.     ULONG KeyFlags;
  87.     UCHAR KeyData[0];
  88. } DVD_COPY_PROTECT_KEY, *PDVD_COPY_PROTECT_KEY;
  89.  
  90. //
  91. // Predefined (Mt. Fuji) key sizes 
  92. // Add sizeof(DVD_COPY_PROTECT_KEY) to get allocation size for 
  93. // the full key structure
  94. //
  95.  
  96. #define DVD_CHALLENGE_KEY_LENGTH    (12 + sizeof(DVD_COPY_PROTECT_KEY))
  97. #define DVD_BUS_KEY_LENGTH          (8 + sizeof(DVD_COPY_PROTECT_KEY))
  98. #define DVD_TITLE_KEY_LENGTH        (8 + sizeof(DVD_COPY_PROTECT_KEY))
  99. #define DVD_DISK_KEY_LENGTH      (2048 + sizeof(DVD_COPY_PROTECT_KEY))
  100.  
  101. //
  102. // Used with IOCTL_DVD_END_SESSION to end all DVD sessions at once
  103. //
  104.  
  105. #define DVD_END_ALL_SESSIONS ((DVD_SESSION_ID) 0xffffffff)
  106.  
  107. //
  108. // CGMS Copy Protection Flags
  109. //
  110.  
  111. #define DVD_CGMS_RESERVED_MASK      0x00000078
  112.  
  113. #define DVD_CGMS_COPY_PROTECT_MASK  0x00000018
  114. #define DVD_CGMS_COPY_PERMITTED     0x00000000
  115. #define DVD_CGMS_COPY_ONCE          0x00000010
  116. #define DVD_CGMS_NO_COPY            0x00000018
  117.  
  118. #define DVD_COPYRIGHT_MASK          0x00000040
  119. #define DVD_NOT_COPYRIGHTED         0x00000000
  120. #define DVD_COPYRIGHTED             0x00000040
  121.  
  122. #define DVD_SECTOR_PROTECT_MASK     0x00000020
  123. #define DVD_SECTOR_NOT_PROTECTED    0x00000000
  124. #define DVD_SECTOR_PROTECTED        0x00000020
  125.  
  126. /*++
  127.  
  128. IOCTL_STORAGE_SET_READ_AHEAD        
  129.  
  130. Requests that the storage device skip to TargetAddress once it has run across
  131. TriggerAddress during the course of it's read-ahead caching operations.
  132.  
  133. Input:
  134.  
  135.     a STORAGE_SET_READ_AHEAD structure which contains:
  136.         * the trigger address
  137.         * the target address
  138.         
  139. Output:
  140.  
  141.     none
  142.     
  143. --*/
  144.  
  145. typedef struct _STORAGE_SET_READ_AHEAD {
  146.     LARGE_INTEGER TriggerAddress;
  147.     LARGE_INTEGER TargetAddress;
  148. } STORAGE_SET_READ_AHEAD, *PSTORAGE_SET_READ_AHEAD;
  149.  
  150. /*++
  151.  
  152. IOCTL_DVD_READ_STRUCTURE
  153.  
  154. Issues a READ_DVD_STRUCTURE command to the drive.  
  155.  
  156. Input:
  157.  
  158.     a DVD_READ_STRUCTURE describing what information is requested
  159.  
  160. Output:
  161.  
  162.     a DVD Layer Descriptor as defined below
  163.     
  164. --*/
  165.  
  166. typedef enum DVD_STRUCTURE_FORMAT {
  167.     DvdPhysicalDescriptor,
  168.     DvdCopyrightDescriptor,
  169.     DvdDiskKeyDescriptor,
  170.     DvdBCADescriptor,
  171.     DvdManufacturerDescriptor,
  172.     DvdMaxDescriptor
  173. } DVD_STRUCTURE_FORMAT, *PDVD_STRUCTURE_FORMAT;
  174.  
  175. typedef struct DVD_READ_STRUCTURE {
  176.     DVD_STRUCTURE_FORMAT Format;
  177.  
  178.     LARGE_INTEGER BlockByteOffset;
  179.  
  180.     UCHAR LayerNumber;
  181.  
  182.     DVD_SESSION_ID SessionId;
  183.         
  184. } DVD_READ_STRUCTURE, *PDVD_READ_STRUCTURE;
  185.  
  186. typedef struct _DVD_DESCRIPTOR_HEADER {
  187.     USHORT Length;
  188.     UCHAR Reserved[2];
  189.     UCHAR Data[0];
  190. } DVD_DESCRIPTOR_HEADER, *PDVD_DESCRIPTOR_HEADER;
  191.  
  192. typedef struct _DVD_LAYER_DESCRIPTOR {
  193.     USHORT Length;
  194.     UCHAR Reserved1;
  195.     UCHAR Reserved2;
  196.     UCHAR BookVersion : 4;
  197.     UCHAR BookType : 4;
  198.     UCHAR MinimumRate : 4;
  199.     UCHAR DiskSize : 4;
  200.     UCHAR LayerType : 4;
  201.     UCHAR TrackPath : 1;
  202.     UCHAR NumberOfLayers : 2;
  203.     UCHAR Reserved3 : 1;
  204.     UCHAR TrackDensity : 4;
  205.     UCHAR LinearDensity : 4;
  206.     ULONG StartingDataSector;
  207.     ULONG EndDataSector;
  208.     ULONG EndLayerZeroSector;
  209.     UCHAR Reserved4 : 7;
  210.     UCHAR BCAFlag : 1;
  211.     UCHAR Reserved5;
  212. } DVD_LAYER_DESCRIPTOR, *PDVD_LAYER_DESCRIPTOR;
  213.  
  214. typedef struct _DVD_COPYRIGHT_DESCRIPTOR {
  215.     UCHAR CopyrightProtectionType;
  216.     UCHAR RegionManagementInformation;
  217.     USHORT Reserved;
  218. } DVD_COPYRIGHT_DESCRIPTOR, *PDVD_COPYRIGHT_DESCRIPTOR;
  219.  
  220. typedef struct _DVD_DISK_KEY_DESCRIPTOR {
  221.     UCHAR DiskKeyData[2048];
  222. } DVD_DISK_KEY_DESCRIPTOR, *PDVD_DISK_KEY_DESCRIPTOR;
  223.  
  224. typedef struct _DVD_BCA_DESCRIPTOR {
  225.     UCHAR BCAInformation[0];
  226. } DVD_BCA_DESCRIPTOR, *PDVD_BCA_DESCRIPTOR;
  227.  
  228. typedef struct _DVD_MANUFACTURER_DESCRIPTOR {
  229.     UCHAR ManufacturingInformation[2048];
  230. } DVD_MANUFACTURER_DESCRIPTOR, *PDVD_MANUFACTURER_DESCRIPTOR;
  231.  
  232. //
  233. // Reenable warning C4200: nonstandard extension used : zero-sized array in struct/union
  234. //
  235. #pragma warning(default:4200)
  236.