home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cdrom.zip / DDK / BASE / SRC / VDEV / VCDROM / reqhdr.h < prev    next >
C/C++ Source or Header  |  1996-06-18  |  10KB  |  331 lines

  1. /**************************************************************************
  2.  *
  3.  * SOURCE FILE NAME = ReqHdr.h
  4.  *
  5.  * DESCRIPTIVE NAME = Request header structures
  6.  *
  7.  * DESCRIPTION VCDROM's DOS device driver request header structures
  8.  *
  9.  * Copyright : COPYRIGHT IBM CORPORATION, 1991, 1992
  10.  *             Copyright Microsoft Corporation, 1990
  11.  *             LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
  12.  *             REFER TO COPYRIGHT INSTRUCTION FORM#G120-2083
  13.  *             RESTRICTED MATERIALS OF IBM
  14.  *             IBM CONFIDENTIAL
  15.  *
  16.  * ENTRY POINTS:
  17.  *
  18.  * EXTERNAL REFERENCES:
  19.  *
  20.  * CHANGE ACTIVITY =
  21.  *  DATE      FLAG        APAR   CHANGE DESCRIPTION
  22.  *  --------  ----------  -----  --------------------------------------
  23.  *  mm/dd/yy  @Vr.mpppxx  xxxxx  xxxxxxx
  24.  *  08/16/91  @V2.0dtf00         Created.
  25.  *
  26.  *  03/24/93  @V2.1fjs00         Deleted OS/2 device driver error codes. Reduce
  27.  *                               maintenance by replacing with systemwide OS/2
  28.  *                               error include file.
  29.  *
  30.  ****************************************************************************/
  31.  
  32. /*
  33. ** macros
  34. */
  35. #define FP_SEG(fp) (*((unsigned short *)&(fp) + 1))
  36. #define FP_OFF(fp) (*((unsigned short *)&(fp)))
  37. #define RH(n)      (struct DosRh ## n *)
  38.  
  39. /*
  40. ** General OS/2 device driver error codes, a superset of the DOS codes
  41. */
  42. #define DEVIOCTL_ERROR     0xFF00
  43. #define ERROR              0x8000
  44. #define DEV_ERROR          0x4000
  45. #define BUSY               0x0200
  46. #define DONE               0x0100
  47.  
  48. /*
  49. ** Media changed codes
  50. */
  51. #define MEDIA_CHANGED          -1
  52. #define MEDIA_UNCERTAIN         0
  53. #define MEDIA_NOT_CHANGED       1
  54.  
  55. /*
  56. ** DOS device driver request packet structures
  57. */
  58. struct
  59. DosRh  {                                              /* request header */
  60.             UCHAR       length;
  61.             UCHAR       subunit;
  62.             UCHAR       command;
  63.             USHORT      status;
  64.             UCHAR       reserved[8];
  65. };
  66.  
  67.  
  68. struct
  69. DosRh0 {                                               /* initialize     */
  70.             struct
  71.             DosRh       rh;
  72.             UCHAR       number_of_units;
  73.             ULONG       end_address;
  74.             F16PVOID    bpb_array;
  75.             UCHAR       first_unit_number;
  76. };
  77.  
  78. struct
  79. DosRh1 {                                               /* media check    */
  80.             struct
  81.             DosRh       rh;
  82.             UCHAR       media_descriptor;
  83.             UCHAR       media_status;
  84.             F16PVOID    volume_ID;
  85. };
  86.  
  87. struct
  88. DosRh2 {                                               /* build BPB      */
  89.             struct
  90.             DosRh       rh;
  91.             UCHAR       media_descriptor;
  92.             F16PVOID    transfer_area;
  93.             F16PVOID    bpb;
  94. };
  95.  
  96. struct
  97. DosRh3 {                                               /* ioctl input    */
  98.             struct
  99.             DosRh       rh;
  100.             UCHAR       media_descriptor;
  101.             F16PVOID    control_block;
  102.             USHORT      control_block_size;
  103.             USHORT      start_sector;
  104.             F16PVOID    volume_ID;
  105.             ULONG       start_sector32;    /* for dos 4.0 w > 32mb partition */
  106.  };
  107.  
  108. struct
  109. DosRh4 {                                               /* input          */
  110.             struct
  111.             DosRh       rh;
  112.             UCHAR       media_descriptor;
  113.             F16PVOID    transfer_area;
  114.             USHORT      transfer_count;
  115.             USHORT      start_sector;
  116.             F16PVOID    volume_ID;
  117.             ULONG       start_sector32;    /* for dos 4.0 w > 32mb partition */
  118. };
  119.  
  120. struct
  121. DosRh5 {                                               /* peek input     */
  122.             struct
  123.             DosRh       rh;
  124.             UCHAR       character;
  125. };
  126.  
  127. struct
  128. DosRh6 {                                               /* input status   */
  129.             struct
  130.             DosRh       rh;
  131. };
  132.  
  133. struct
  134. DosRh7 {                                               /* input flush    */
  135.             struct
  136.             DosRh       rh;
  137. };
  138.  
  139. struct
  140. DosRh8 {                                               /* output         */
  141.             struct
  142.             DosRh       rh;
  143.             UCHAR       media_descriptor;
  144.             F16PVOID    transfer_area;
  145.             USHORT      transfer_count;
  146.             USHORT      start_sector;
  147.             F16PVOID    volume_ID;
  148.             ULONG       start_sector32;   /* for dos 4.0 w > 32mb partition */
  149. };
  150.  
  151. struct
  152. DosRh9 {                                               /* output verify  */
  153.             struct
  154.             DosRh       rh;
  155.             UCHAR       media_descriptor;
  156.             F16PVOID    transfer_area;
  157.             USHORT      transfer_count;
  158.             USHORT      start_sector;
  159.             F16PVOID    volume_ID;
  160.             ULONG       start_sector32;   /* for dos 4.0 w > 32mb partition */
  161. };
  162.  
  163. struct
  164. DosRh10 {                                               /* output status */
  165.             struct
  166.             DosRh       rh;
  167. };
  168.  
  169. struct
  170. DosRh11 {                                               /* output flush  */
  171.             struct
  172.             DosRh       rh;
  173. };
  174.  
  175. struct
  176. DosRh12 {                                               /* ioctl output   */
  177.             struct
  178.             DosRh       rh;
  179.             UCHAR       media_descriptor;
  180.             F16PVOID    control_block;
  181.             USHORT      control_block_size;
  182.             USHORT      start_sector;
  183.             F16PVOID    volume_ID;
  184.             ULONG       start_sector32;   /* for dos 4.0 w > 32mb partition */
  185. };
  186.  
  187. struct
  188. DosRh13 {                                              /* open           */
  189.             struct
  190.             DosRh       rh;
  191. };
  192.  
  193. struct
  194. DosRh14 {                                              /* close          */
  195.             struct
  196.             DosRh       rh;
  197. };
  198.  
  199. struct
  200. DosRh15 {                                              /* removable media */
  201.             struct
  202.             DosRh       rh;
  203. };
  204.  
  205. struct
  206. DosRh16 {                                              /* output until busy */
  207.             struct
  208.             DosRh       rh;
  209.             UCHAR       media_descriptor;
  210.             F16PVOID    transfer_area;
  211.             USHORT      transfer_count;
  212. };
  213.  
  214. struct
  215. DosRh19 {                                              /* generic ioctl  */
  216.             struct
  217.             DosRh       rh;
  218.             UCHAR       major_function;
  219.             UCHAR       minor_function;
  220.             USHORT      SI_contents;
  221.             USHORT      DI_contents;
  222.             F16PVOID    packet;
  223. };
  224.  
  225. struct
  226. DosRh23 {                                           /* get logical device */
  227.             struct
  228.             DosRh       rh;
  229.             UCHAR       logical_device;
  230.             UCHAR       command;
  231.             USHORT      status;
  232.             ULONG       reserved;
  233. };
  234.  
  235. struct
  236. DosRh24 {                                          /* set logical device */
  237.             struct
  238.             DosRh       rh;
  239.             UCHAR       logical_device;
  240.             UCHAR       command;
  241.             USHORT      status;
  242.             ULONG       reserved;
  243. };
  244.  
  245. /*
  246. ** Extended commands to support CDROM
  247. */
  248. struct
  249. DosRh128 {                                             /* read long      */
  250.             struct
  251.             DosRh       rh;
  252.             UCHAR       address_mode;
  253.             F16PVOID    transfer_area;
  254.             USHORT      transfer_count;
  255.             ULONG       start_sector;
  256.             UCHAR       read_mode;
  257.             UCHAR       interleave_size;
  258.             UCHAR       interleave_skip_factor;
  259. };
  260.  
  261. struct
  262. DosRh130 {                                         /* read long prefetch */
  263.             struct
  264.             DosRh       rh;
  265.             UCHAR       address_mode;
  266.             F16PVOID    transfer_area;
  267.             USHORT      transfer_count;
  268.             ULONG       start_sector;
  269.             UCHAR       read_mode;
  270.             UCHAR       interleave_size;
  271.             UCHAR       interleave_skip_factor;
  272. };
  273.  
  274. struct
  275. DosRh131 {                                             /* seek           */
  276.             struct
  277.             DosRh       rh;
  278.             UCHAR       address_mode;
  279.             F16PVOID    transfer_area;
  280.             USHORT      transfer_count;
  281.             ULONG       start_sector;
  282. };
  283.  
  284. struct
  285. DosRh132 {                                             /* play audio     */
  286.             struct
  287.             DosRh       rh;
  288.             UCHAR       address_mode;
  289.             ULONG       start_sector;
  290.             ULONG       number_of_sectors;
  291. };
  292.  
  293. struct
  294. DosRh133 {                                             /* stop audio     */
  295.             struct
  296.             DosRh       rh;
  297. };
  298.  
  299. struct
  300. DosRh134 {                                              /* write long    */
  301.             struct
  302.             DosRh       rh;
  303.             UCHAR       address_mode;
  304.             F16PVOID    transfer_area;
  305.             USHORT      transfer_count;
  306.             ULONG       start_sector;
  307.             UCHAR       write_mode;
  308.             UCHAR       interleave_size;
  309.             UCHAR       interleave_skip_factor;
  310. };
  311.  
  312. struct
  313. DosRh135 {                                          /* write long verify */
  314.             struct
  315.             DosRh       rh;
  316.             UCHAR       address_mode;
  317.             F16PVOID    transfer_area;
  318.             USHORT      transfer_count;
  319.             ULONG       start_sector;
  320.             UCHAR       write_mode;
  321.             UCHAR       interleave_size;
  322.             UCHAR       interleave_skip_factor;
  323. };
  324.  
  325. struct
  326. DosRh136 {                                             /* resume audio   */
  327.             struct
  328.             DosRh       rh;
  329. };
  330.  
  331.