"Fossies" - the Fresh Open Source Software Archive

Member "libcdio-2.1.0/lib/driver/MSWindows/win32.h" (12 Aug 2018, 6393 Bytes) of package /linux/privat/libcdio-2.1.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "win32.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2   Copyright (C) 2004, 2005, 2008, 2014 Rocky Bernstein <rocky@gnu.org>
    3 
    4   This program is free software: you can redistribute it and/or modify
    5   it under the terms of the GNU General Public License as published by
    6   the Free Software Foundation, either version 3 of the License, or
    7   (at your option) any later version.
    8 
    9   This program is distributed in the hope that it will be useful,
   10   but WITHOUT ANY WARRANTY; without even the implied warranty of
   11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12   GNU General Public License for more details.
   13 
   14   You should have received a copy of the GNU General Public License
   15   along with this program.  If not, see <http://www.gnu.org/licenses/>.
   16 */
   17 
   18 #include "cdio_private.h"
   19 
   20 #pragma pack()
   21 
   22 typedef struct {
   23   lsn_t          start_lsn;
   24   UCHAR          Control : 4;
   25   UCHAR          Format;
   26 } track_info_t;
   27 
   28 typedef enum {
   29   _AM_NONE,
   30   _AM_IOCTL,
   31   _AM_ASPI,
   32   _AM_MMC_RDWR,
   33   _AM_MMC_RDWR_EXCL,
   34 } access_mode_t;
   35 
   36 typedef struct {
   37   /* Things common to all drivers like this.
   38      This must be first. */
   39   generic_img_private_t gen;
   40 
   41   access_mode_t access_mode;
   42 
   43   /* Some of the more OS specific things. */
   44     /* Entry info for each track, add 1 for leadout. */
   45   track_info_t  tocent[CDIO_CD_MAX_TRACKS+1];
   46 
   47   HANDLE h_device_handle; /* device descriptor */
   48   HMODULE hASPI;
   49   short i_sid;
   50   short i_lun;
   51   long  (*lpSendCommand)( void* );
   52 
   53   bool b_ioctl_init;
   54   bool b_aspi_init;
   55 
   56 } _img_private_t;
   57 
   58 /*!
   59   Pause playing CD through analog output
   60 
   61   @param p_cdio the CD object to be acted upon.
   62 */
   63 driver_return_code_t audio_pause_win32ioctl (void *p_user_data);
   64 
   65 /*!
   66   Playing starting at given MSF through analog output
   67 
   68   @param p_cdio the CD object to be acted upon.
   69 */
   70 driver_return_code_t audio_play_msf_win32ioctl (void *p_user_data,
   71                         msf_t *p_start_msf,
   72                         msf_t *p_end_msf);
   73 /*!
   74   Resume playing an audio CD.
   75 
   76   @param p_cdio the CD object to be acted upon.
   77 
   78 */
   79 driver_return_code_t audio_resume_win32ioctl (void *p_user_data);
   80 
   81 /*!
   82   Get disc type associated with cd object.
   83 */
   84 discmode_t get_discmode_win32ioctl (_img_private_t *p_env);
   85 
   86 /*!
   87   Get the volume settings of an audio CD.
   88 
   89   @param p_cdio the CD object to be acted upon.
   90 
   91 */
   92 driver_return_code_t
   93 audio_get_volume_win32ioctl ( void *p_user_data,
   94                   /*out*/ cdio_audio_volume_t *p_volume);
   95 
   96 /*!
   97   Read Audio Subchannel information
   98 
   99   @param p_cdio the CD object to be acted upon.
  100 
  101 */
  102 driver_return_code_t
  103 audio_read_subchannel_win32ioctl (void *p_user_data,
  104                   cdio_subchannel_t *p_subchannel);
  105 
  106 /*!
  107   Set the volume of an audio CD.
  108 
  109   @param p_cdio the CD object to be acted upon.
  110 
  111 */
  112 driver_return_code_t
  113 audio_stop_win32ioctl ( void *p_user_data );
  114 
  115 /*!
  116   Set the volume of an audio CD.
  117 
  118   @param p_cdio the CD object to be acted upon.
  119 
  120 */
  121 driver_return_code_t
  122 audio_set_volume_win32ioctl ( void *p_user_data,
  123                   cdio_audio_volume_t *p_volume);
  124 
  125 /*!
  126   Close the tray of a CD-ROM
  127 
  128   @param p_user_data the CD object to be acted upon.
  129 
  130 */
  131 driver_return_code_t close_tray_win32ioctl (const char *psz_win32_drive);
  132 
  133 /*!
  134    Reads an audio device using the DeviceIoControl method into data
  135    starting from lsn.  Returns 0 if no error.
  136 */
  137 int read_audio_sectors_win32ioctl (_img_private_t *p_obj, void *p_data, lsn_t lsn,
  138                    unsigned int nblocks);
  139 /*!
  140    Reads a single mode2 sector using the DeviceIoControl method into
  141    data starting from lsn. Returns 0 if no error.
  142  */
  143 int read_mode2_sector_win32ioctl (_img_private_t *p_env, void *p_data,
  144                   lsn_t lsn, bool b_form2);
  145 
  146 /*!
  147    Reads a single mode1 sector using the DeviceIoControl method into
  148    data starting from lsn. Returns 0 if no error.
  149  */
  150 int read_mode1_sector_win32ioctl (_img_private_t *p_env, void *p_data,
  151                   lsn_t lsn, bool b_form2);
  152 
  153 const char *is_cdrom_win32ioctl (const char drive_letter);
  154 
  155 /*!
  156   Run a SCSI MMC command.
  157 
  158   env           private CD structure
  159   i_timeout_ms  time in milliseconds we will wait for the command
  160                 to complete. If this value is -1, use the default
  161         time-out value.
  162   p_buf         Buffer for data, both sending and receiving
  163   i_buf         Size of buffer
  164   e_direction   direction the transfer is to go.
  165   cdb           CDB bytes. All values that are needed should be set on
  166                 input. We'll figure out what the right CDB length should be.
  167 
  168   Return 0 if command completed successfully.
  169  */
  170 int run_mmc_cmd_win32ioctl( void *p_user_data,
  171                 unsigned int i_timeout,
  172                 unsigned int i_cdb,
  173                 const mmc_cdb_t * p_cdb,
  174                 cdio_mmc_direction_t e_direction,
  175                 unsigned int i_buf, /*in/out*/ void *p_buf );
  176 
  177 /*!
  178   Initialize internal structures for CD device.
  179  */
  180 bool init_win32ioctl (_img_private_t *p_env);
  181 
  182 /*!
  183   Read and cache the CD's Track Table of Contents and track info.
  184   Return true if successful or false if an error.
  185 */
  186 bool read_toc_win32ioctl (_img_private_t *p_env);
  187 
  188 /*!
  189   Get the LSN of the first track of the last session of
  190   on the CD.
  191  */
  192 driver_return_code_t
  193 get_last_session_win32ioctl (void *p_user_data,
  194                              /*out*/ lsn_t *i_last_session);
  195 
  196 /*!
  197   Return the media catalog number MCN.
  198 
  199   Note: string is malloc'd so caller should free() then returned
  200   string when done with it.
  201 
  202  */
  203 char *get_mcn_win32ioctl (const _img_private_t *p_env);
  204 
  205 /*!
  206   Return the international standard recording code ISRC.
  207 
  208   Note: string is malloc'd so caller should free() then returned
  209   string when done with it.
  210 
  211  */
  212 char *get_track_isrc_win32ioctl (const _img_private_t *p_env,
  213                  track_t i_track);
  214 
  215 /*!
  216   Return the the kind of drive capabilities of device.
  217 
  218   Note: string is malloc'd so caller should free() then returned
  219   string when done with it.
  220 
  221  */
  222 void get_drive_cap_aspi (const _img_private_t *p_env,
  223              cdio_drive_read_cap_t  *p_read_cap,
  224              cdio_drive_write_cap_t *p_write_cap,
  225              cdio_drive_misc_cap_t  *p_misc_cap);
  226 
  227 /*!
  228   Return the the kind of drive capabilities of device.
  229 
  230   Note: string is malloc'd so caller should free() then returned
  231   string when done with it.
  232 
  233  */
  234 void get_drive_cap_win32ioctl (const _img_private_t *p_env,
  235                    cdio_drive_read_cap_t  *p_read_cap,
  236                    cdio_drive_write_cap_t *p_write_cap,
  237                    cdio_drive_misc_cap_t  *p_misc_cap);
  238 
  239 /*!
  240   Get the format (XA, DATA, AUDIO) of a track.
  241 */
  242 track_format_t get_track_format_win32ioctl(const _img_private_t *p_env,
  243                        track_t i_track);