亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? device.c

?? 君正早期ucos系統(只有早期的才不沒有打包成庫),MPLAYER,文件系統,圖片解碼,瀏覽,電子書,錄音,想學ucos,識貨的人就下吧 russblock fmradio explore set
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************** * device.h: DVD device access ***************************************************************************** * Copyright (C) 1998-2006 VideoLAN * $Id: device.c,v 1.3 2008/04/12 07:14:44 dsqiu Exp $ * * Authors: St閜hane Borel <stef@via.ecp.fr> *          Sam Hocevar <sam@zoy.org> *          H錵an Hjort <d95hjort@dtek.chalmers.se> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. *****************************************************************************//***************************************************************************** * Preamble *****************************************************************************/#include "config.h"#include <mplaylib.h>#include <mplaylib.h>#include <mplaylib.h>#ifdef HAVE_ERRNO_H#   include <errno.h>#endif#include <sys/types.h>#include <sys/stat.h>#ifdef HAVE_SYS_PARAM_H#   include <sys/param.h>#endif#include <fcntl.h>#ifdef HAVE_UNISTD_H#   include <unistd.h>#endif#ifdef HAVE_LIMITS_H#   include <limits.h>#endif#if defined( WIN32 ) && !defined( SYS_CYGWIN )#   include <io.h>                                                 /* read() */#else#   include <sys/uio.h>                                      /* struct iovec */#endif#ifdef DARWIN_DVD_IOCTL#   include <paths.h>#   include <CoreFoundation/CoreFoundation.h>#   include <IOKit/IOKitLib.h>#   include <IOKit/IOBSD.h>#   include <IOKit/storage/IOMedia.h>#   include <IOKit/storage/IOCDMedia.h>#   include <IOKit/storage/IODVDMedia.h>#endif#include "dvdcss/dvdcss.h"#include "common.h"#include "css.h"#include "libdvdcss.h"#include "ioctl.h"#include "device.h"#undef memcpy#define memcpy uc_memcpy/***************************************************************************** * Device reading prototypes *****************************************************************************/static int libc_open  ( dvdcss_t, char const * );static int libc_seek  ( dvdcss_t, int );static int libc_read  ( dvdcss_t, void *, int );static int libc_readv ( dvdcss_t, struct iovec *, int );#ifdef WIN32static int win2k_open ( dvdcss_t, char const * );static int aspi_open  ( dvdcss_t, char const * );static int win2k_seek ( dvdcss_t, int );static int aspi_seek  ( dvdcss_t, int );static int win2k_read ( dvdcss_t, void *, int );static int aspi_read  ( dvdcss_t, void *, int );static int win_readv  ( dvdcss_t, struct iovec *, int );static int aspi_read_internal  ( int, void *, int );#endifint _dvdcss_use_ioctls( dvdcss_t dvdcss ){#if defined( WIN32 )    if( dvdcss->b_file )    {        return 0;    }    /* FIXME: implement this for Windows */    if( WIN2K )    {        return 1;    }    else    {        return 1;    }#else    struct stat fileinfo;    int ret;    ret = fstat( dvdcss->i_fd, &fileinfo );    if( ret < 0 )    {        return 1;  /* What to do?  Be conservative and try to use the ioctls */    }    /* Complete this list and check that we test for the right things     * (I've assumed for all OSs that 'r', (raw) device, are char devices     *  and those that don't contain/use an 'r' in the name are block devices)     *     * Linux    needs a block device     * Solaris  needs a char device     * Darwin   needs a char device     * OpenBSD  needs a char device     * NetBSD   needs a char device     * FreeBSD  can use either the block or the char device     * BSD/OS   can use either the block or the char device     */    /* Check if this is a block/char device */    if( S_ISBLK( fileinfo.st_mode ) ||        S_ISCHR( fileinfo.st_mode ) )    {        return 1;    }    else    {        return 0;    }#endif}void _dvdcss_check ( dvdcss_t dvdcss ){#if defined( WIN32 )    DWORD drives;    int i;#elif defined( DARWIN_DVD_IOCTL )    io_object_t next_media;    mach_port_t master_port;    kern_return_t kern_result;    io_iterator_t media_iterator;    CFMutableDictionaryRef classes_to_match;#else    char *ppsz_devices[] = { "/dev/dvd", "/dev/cdrom", "/dev/hdc", NULL };    int i, i_fd;#endif    /* If the device name is non-null, return */    if( dvdcss->psz_device[0] )    {        return;    }#if defined( WIN32 )    drives = GetLogicalDrives();    for( i = 0; drives; i++ )    {        char psz_device[5];        DWORD cur = 1 << i;        UINT i_ret;        if( (drives & cur) == 0 )        {            continue;        }        drives &= ~cur;        sprintf( psz_device, "%c:\\", 'A' + i );        i_ret = GetDriveType( psz_device );        if( i_ret != DRIVE_CDROM )        {            continue;        }        /* Remove trailing backslash */        psz_device[2] = '\0';        /* FIXME: we want to differenciate between CD and DVD drives         * using DeviceIoControl() */        print_debug( dvdcss, "defaulting to drive `%s'", psz_device );        free( dvdcss->psz_device );        dvdcss->psz_device = strdup( psz_device );        return;    }#elif defined( DARWIN_DVD_IOCTL )    kern_result = IOMasterPort( MACH_PORT_NULL, &master_port );    if( kern_result != KERN_SUCCESS )    {        return;    }    classes_to_match = IOServiceMatching( kIODVDMediaClass );    if( classes_to_match == NULL )    {        return;    }    CFDictionarySetValue( classes_to_match, CFSTR( kIOMediaEjectableKey ),                          kCFBooleanTrue );    kern_result = IOServiceGetMatchingServices( master_port, classes_to_match,                                                &media_iterator );    if( kern_result != KERN_SUCCESS )    {        return;    }    next_media = IOIteratorNext( media_iterator );    for( ; ; )    {        char psz_buf[0x32];        size_t i_pathlen;        CFTypeRef psz_path;        next_media = IOIteratorNext( media_iterator );        if( next_media == 0 )        {            break;        }        psz_path = IORegistryEntryCreateCFProperty( next_media,                                                    CFSTR( kIOBSDNameKey ),                                                    kCFAllocatorDefault,                                                    0 );        if( psz_path == NULL )        {            IOObjectRelease( next_media );            continue;        }        snprintf( psz_buf, sizeof(psz_buf), "%s%c", _PATH_DEV, 'r' );        i_pathlen = strlen( psz_buf );        if( CFStringGetCString( psz_path,                                (char*)&psz_buf + i_pathlen,                                sizeof(psz_buf) - i_pathlen,                                kCFStringEncodingASCII ) )        {            print_debug( dvdcss, "defaulting to drive `%s'", psz_buf );            CFRelease( psz_path );            IOObjectRelease( next_media );            IOObjectRelease( media_iterator );            free( dvdcss->psz_device );            dvdcss->psz_device = strdup( psz_buf );            return;        }        CFRelease( psz_path );        IOObjectRelease( next_media );    }    IOObjectRelease( media_iterator );#else    for( i = 0; ppsz_devices[i]; i++ )    {        i_fd = open( ppsz_devices[i], 0 );        if( i_fd != -1 )        {            print_debug( dvdcss, "defaulting to drive `%s'", ppsz_devices[i] );            close( i_fd );            free( dvdcss->psz_device );            dvdcss->psz_device = strdup( ppsz_devices[i] );            return;        }    }#endif    print_error( dvdcss, "could not find a suitable default drive" );}int _dvdcss_open ( dvdcss_t dvdcss ){    char const *psz_device = dvdcss->psz_device;    print_debug( dvdcss, "opening target `%s'", psz_device );#if defined( WIN32 )    dvdcss->b_file = 1;    /* If device is "X:" or "X:\", we are not actually opening a file. */    if (psz_device[0] && psz_device[1] == ':' &&       (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3])))        dvdcss->b_file = 0;    /* Initialize readv temporary buffer */    dvdcss->p_readv_buffer   = NULL;    dvdcss->i_readv_buf_size = 0;    if( !dvdcss->b_file && WIN2K )    {        print_debug( dvdcss, "using Win2K API for access" );        dvdcss->pf_seek  = win2k_seek;        dvdcss->pf_read  = win2k_read;        dvdcss->pf_readv = win_readv;        return win2k_open( dvdcss, psz_device );    }    else if( !dvdcss->b_file )    {        print_debug( dvdcss, "using ASPI for access" );        dvdcss->pf_seek  = aspi_seek;        dvdcss->pf_read  = aspi_read;        dvdcss->pf_readv = win_readv;        return aspi_open( dvdcss, psz_device );    }    else#endif    {        print_debug( dvdcss, "using libc for access" );        dvdcss->pf_seek  = libc_seek;        dvdcss->pf_read  = libc_read;        dvdcss->pf_readv = libc_readv;        return libc_open( dvdcss, psz_device );    }}#ifndef WIN32int _dvdcss_raw_open ( dvdcss_t dvdcss, char const *psz_device ){    dvdcss->i_raw_fd = open( psz_device, 0 );    if( dvdcss->i_raw_fd == -1 )    {        print_debug( dvdcss, "cannot open %s (%s)",                             psz_device, strerror(errno) );        print_error( dvdcss, "failed to open raw device, but continuing" );        return -1;    }    else    {        dvdcss->i_read_fd = dvdcss->i_raw_fd;    }    return 0;}#endifint _dvdcss_close ( dvdcss_t dvdcss ){#if defined( WIN32 )    if( dvdcss->b_file )    {        close( dvdcss->i_fd );    }    else if( WIN2K )    {        CloseHandle( (HANDLE) dvdcss->i_fd );    }    else /* ASPI */    {        struct w32_aspidev *fd = (struct w32_aspidev *) dvdcss->i_fd;        /* Unload aspi and free w32_aspidev structure */        FreeLibrary( (HMODULE) fd->hASPI );        free( (void*) dvdcss->i_fd );    }    /* Free readv temporary buffer */    if( dvdcss->p_readv_buffer )    {        free( dvdcss->p_readv_buffer );        dvdcss->p_readv_buffer   = NULL;        dvdcss->i_readv_buf_size = 0;    }    return 0;#else    close( dvdcss->i_fd );    if( dvdcss->i_raw_fd >= 0 )    {        close( dvdcss->i_raw_fd );        dvdcss->i_raw_fd = -1;    }    return 0;#endif}/* Following functions are local *//***************************************************************************** * Open commands. *****************************************************************************/static int libc_open ( dvdcss_t dvdcss, char const *psz_device ){#if !defined( WIN32 )    dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, 0 );#else    dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, O_BINARY );#endif    if( dvdcss->i_fd == -1 )    {        print_debug( dvdcss, "cannot open %s (%s)",                             psz_device, strerror(errno) );        print_error( dvdcss, "failed to open device" );        return -1;    }    dvdcss->i_pos = 0;    return 0;}#if defined( WIN32 )static int win2k_open ( dvdcss_t dvdcss, char const *psz_device ){    char psz_dvd[7];    _snprintf( psz_dvd, 7, "\\\\.\\%c:", psz_device[0] );    /* To work around an M$ bug in IOCTL_DVD_READ_STRUCTURE, we need read     * _and_ write access to the device (so we can make SCSI Pass Through     * Requests). Unfortunately this is only allowed if you have     * administrator priviledges so we allow for a fallback method with     * only read access to the device (in this case ioctl_ReadCopyright()     * won't send back the right result).     * (See Microsoft Q241374: Read and Write Access Required for SCSI     * Pass Through Requests) */    dvdcss->i_fd = (int)                CreateFile( psz_dvd, GENERIC_READ | GENERIC_WRITE,                            FILE_SHARE_READ | FILE_SHARE_WRITE,                            NULL, OPEN_EXISTING,                            FILE_FLAG_RANDOM_ACCESS, NULL );    if( (HANDLE) dvdcss->i_fd == INVALID_HANDLE_VALUE )        dvdcss->i_fd = (int)                    CreateFile( psz_dvd, GENERIC_READ, FILE_SHARE_READ,                                NULL, OPEN_EXISTING,                                FILE_FLAG_RANDOM_ACCESS, NULL );    if( (HANDLE) dvdcss->i_fd == INVALID_HANDLE_VALUE )    {        print_error( dvdcss, "failed opening device" );        return -1;    }    dvdcss->i_pos = 0;    return 0;}static int aspi_open( dvdcss_t dvdcss, char const * psz_device ){    HMODULE hASPI;    DWORD dwSupportInfo;    struct w32_aspidev *fd;    int i, j, i_hostadapters;    GETASPI32SUPPORTINFO lpGetSupport;    SENDASPI32COMMAND lpSendCommand;    char c_drive = psz_device[0];    /* load aspi and init w32_aspidev structure */    hASPI = LoadLibrary( "wnaspi32.dll" );    if( hASPI == NULL )    {        print_error( dvdcss, "unable to load wnaspi32.dll" );        return -1;    }    lpGetSupport = (GETASPI32SUPPORTINFO) GetProcAddress( hASPI, "GetASPI32SupportInfo" );    lpSendCommand = (SENDASPI32COMMAND) GetProcAddress( hASPI, "SendASPI32Command" );    if(lpGetSupport == NULL || lpSendCommand == NULL )    {        print_error( dvdcss, "unable to get aspi function pointers" );        FreeLibrary( hASPI );        return -1;    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆一区二区三区| 婷婷六月综合网| 亚洲精品一区二区三区精华液| 成人99免费视频| 成人国产在线观看| 色激情天天射综合网| 色av成人天堂桃色av| 色妹子一区二区| 欧美午夜精品免费| 正在播放亚洲一区| 欧美精品一区二区三区很污很色的 | 久久久久久毛片| 亚洲精品在线免费观看视频| 久久久噜噜噜久久中文字幕色伊伊| 久久亚洲综合av| 中文字幕在线一区二区三区| 亚洲欧美电影院| 天天av天天翘天天综合网色鬼国产| 日韩av中文在线观看| 久久国产综合精品| 成人小视频在线| 日本韩国欧美在线| 日韩欧美亚洲国产另类| 国产日韩视频一区二区三区| 国产精品污污网站在线观看| 夜夜精品视频一区二区 | 欧美日韩成人高清| 精品区一区二区| 中文字幕中文字幕一区二区| 性做久久久久久免费观看| 天天操天天干天天综合网| 精品一区免费av| 色老综合老女人久久久| 日韩欧美国产wwwww| 国产精品国产自产拍高清av| 天堂久久一区二区三区| 国产精品18久久久久久vr| 91免费视频网址| 精品久久久影院| 亚洲一区国产视频| 国产一区二区91| 欧美日韩一级黄| 国产精品私人自拍| 欧美日本一区二区在线观看| 亚洲h精品动漫在线观看| 国产成人亚洲综合a∨猫咪| 欧美区一区二区三区| 欧美激情一区在线| 免费高清成人在线| 欧美三日本三级三级在线播放| 国产婷婷一区二区| 日韩精品乱码av一区二区| 91影院在线免费观看| 欧美成人综合网站| 丝袜国产日韩另类美女| 日本久久一区二区三区| 亚洲国产精品国自产拍av| 麻豆国产91在线播放| 欧美日韩精品欧美日韩精品一| 中文字幕不卡在线观看| 国产乱码精品一区二区三区五月婷 | 中文字幕日韩一区| 国产精品综合一区二区三区| 欧美精品久久一区| 亚洲一区二区三区四区五区中文| 成人高清视频在线| 国产精品久久久久久久岛一牛影视 | 色噜噜狠狠色综合中国| 中文字幕永久在线不卡| 国产精品99久久久久久久女警 | 51久久夜色精品国产麻豆| 中文字幕制服丝袜成人av| 国产.精品.日韩.另类.中文.在线.播放| 欧美一区二区视频观看视频| 三级久久三级久久| 6080国产精品一区二区| 亚洲超碰97人人做人人爱| 欧美天堂一区二区三区| 一卡二卡三卡日韩欧美| 欧美色综合天天久久综合精品| 亚洲女与黑人做爰| 色爱区综合激月婷婷| 一区二区三区久久| 欧美日韩精品是欧美日韩精品| 亚洲一区av在线| 欧美日韩成人综合在线一区二区| 亚洲第一福利视频在线| 欧美日韩精品欧美日韩精品一综合| 亚洲高清视频在线| 欧美一级一级性生活免费录像| 免费xxxx性欧美18vr| 26uuu色噜噜精品一区| 懂色av噜噜一区二区三区av| 欧美极品美女视频| 日本精品视频一区二区三区| 五月综合激情网| 日韩三级.com| 国产精品系列在线观看| 中文字幕综合网| 欧美唯美清纯偷拍| 久久99国内精品| 国产精品久久久久久一区二区三区 | 国产白丝精品91爽爽久久| 欧美精彩视频一区二区三区| 91影院在线免费观看| 成人在线一区二区三区| 亚洲欧洲美洲综合色网| 欧美日韩高清在线| 国产一二三精品| 亚洲色大成网站www久久九九| 欧美日韩国产小视频| 国产福利不卡视频| 午夜一区二区三区视频| 国产亚洲va综合人人澡精品 | 亚洲一级二级在线| 精品成人在线观看| 日本电影欧美片| 韩国av一区二区| 亚洲综合一二区| 国产免费久久精品| 3atv一区二区三区| 一本色道a无线码一区v| 国产一区二区三区免费| 亚洲国产成人高清精品| 中文字幕不卡三区| 日韩视频一区二区| 欧美性大战久久久久久久蜜臀| 国产一区二区三区久久悠悠色av| 亚洲制服丝袜av| 国产精品午夜在线观看| 精品日产卡一卡二卡麻豆| 欧美日韩亚洲丝袜制服| 不卡的av电影| 国产精品66部| 精品一二三四区| 午夜久久久影院| 国产精品国产三级国产a| 久久亚洲影视婷婷| 精品美女一区二区| 91精品国产综合久久久久久漫画 | 久久久亚洲欧洲日产国码αv| 色88888久久久久久影院按摩| 成人涩涩免费视频| 国产一区二区三区免费播放| 麻豆精品视频在线观看免费| 亚洲图片有声小说| 亚洲特级片在线| 亚洲欧美一区二区三区久本道91 | 欧美日韩久久一区| 91极品美女在线| 色噜噜狠狠色综合欧洲selulu| 91伊人久久大香线蕉| 91香蕉国产在线观看软件| 成人午夜伦理影院| av电影天堂一区二区在线| 成人免费看视频| 99久久国产综合精品女不卡| 成人高清视频在线观看| 99精品视频在线免费观看| 99久久国产免费看| 欧美唯美清纯偷拍| 日韩一区二区免费视频| 欧美成人aa大片| 日本一区二区三区久久久久久久久不 | 欧美一区2区视频在线观看| 欧美日韩精品免费观看视频| 欧美日韩国产大片| 日韩一区二区三区四区五区六区| 国产精品久久一级| 《视频一区视频二区| 亚洲一区二区精品久久av| 午夜一区二区三区视频| 日本大胆欧美人术艺术动态 | 99久久久国产精品| 色综合欧美在线视频区| 欧美精品v国产精品v日韩精品| 欧美日韩一区二区三区在线| 欧美一区午夜视频在线观看| 久久久精品蜜桃| 亚洲美女屁股眼交3| 午夜精品福利视频网站| 国产精品一卡二卡| 色香蕉久久蜜桃| 91精品国产手机| 国产精品免费看片| 亚洲成av人片一区二区梦乃| 韩国成人福利片在线播放| 99在线精品观看| 日韩欧美一区电影| 亚洲国产成人午夜在线一区| 亚洲成人一区在线| 国产福利一区二区| 欧美卡1卡2卡| 中文字幕的久久| 美女精品自拍一二三四| 色综合视频一区二区三区高清| 日韩欧美在线123| 亚洲理论在线观看| 国产河南妇女毛片精品久久久| 欧美日韩不卡在线|