⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loader_win32.h

📁 这是DVD中伺服部分的核心代码
💻 H
字号:
/******************************************************************************
*******************************************************************************
**                                                                           **
**  Copyright (c) 2006 Videon Central, Inc.                                  **
**  All rights reserved.                                                     **
**                                                                           **
**  The computer program contained herein contains proprietary information   **
**  which is the property of Videon Central, Inc.  The program may be used   **
**  and/or copied only with the written permission of Videon Central, Inc.   **
**  or in accordance with the terms and conditions stipulated in the         **
**  agreement/contract under which the programs have been supplied.          **
**                                                                           **
*******************************************************************************
******************************************************************************/
/**
 * @file loader_win32.h
 *
 * win32 loader implementation 
 *
 */

#ifndef __WIN32LOADER
#define __WIN32LOADER

struct WIN32LoaderData;

#define WIN32LOADER_SUCCESS     0
#define WIN32LOADER_FAILURE     -1


typedef enum 
{
    DISC_TYPE_NO_DISC,
    DISC_TYPE_DVD_ROM,
    DISC_TYPE_DVD_RAM,
    DISC_TYPE_DVD_R,
    DISC_TYPE_DVD_MINUS_RW,
    DISC_TYPE_DVD_PLUS_RW,
    DISC_TYPE_CDDA,
    DISC_TYPE_CDROM_XA,

} DiscType;


typedef enum 
{
    WIN32LOADER_TOC_CMD_TOC           = 0,
    WIN32LOADER_TOC_CMD_SESSION_INFO  = 1,
    WIN32LOADER_TOC_CMD_FULL_TOC      = 2,
    WIN32LOADER_TOC_CMD_CDTEXT        = 5

} WIN32LoaderTOCCommand;



typedef enum 
{
    WIN32LOADER_CD_SECTOR_CDDA = 1,
    WIN32LOADER_CD_SECTOR_MODE1 = 2,
    WIN32LOADER_CD_SECTOR_MODE2 = 3,
    WIN32LOADER_CD_SECTOR_MODE2_FORM1 = 4,
    WIN32LOADER_CD_SECTOR_MODE2_FORM2 = 5,

} WIN32LOADER_CD_SECTOR_TYPE;



typedef enum
{
    WIN32LOADER_SEEK_TYPE_CUR = 1,
    WIN32LOADER_SEEK_TYPE_END = 2,
    WIN32LOADER_SEEK_TYPE_SET = 3

} WIN32LOADER_SEEK_TYPE;


class WIN32Loader
{
    protected:

        WIN32LoaderData*     data;
        
    public:
                WIN32Loader         ( void );
                ~WIN32Loader        ( void );

        void    Initialize          ( void );
        void    Destroy             ( void );
        int     OpenTray            ( void );
        int     CloseTray           ( void );
        int     GetRegionCode       ( unsigned char* regionCode );
        int     GetDiscType         ( DiscType* discType );
        int     GetDVDDiscInfo      ( DiscType* discType, bool* encrypted );
        int     IsDVDDiscEncrypted  ( bool* encrypted );
        int     GetCDDiscInfo       ( DiscType* discType );

        int     ReadDVD             ( unsigned char* pbData, unsigned long int ulLBA, unsigned long int ulNumBlocks );
        int     ReadCD              ( unsigned char* pbData, unsigned long int bufferSize, WIN32LOADER_CD_SECTOR_TYPE sectorType, unsigned long int ulLBA, unsigned long int ulNumBlocks );
 
        int     GetAgid             ( void );
        int     InvalidateAgid      ( void );
        int     GetChallenge        ( unsigned char pbChallengeKey[10] );
        int     SendChallenge       ( unsigned char pbChallengeKey[10] );
        int     GetBusKey           ( unsigned char pbKey[5] );
        int     SendBusKey          ( unsigned char pbKey[5] );
        int     GetDiskKey          ( unsigned char pbKey[2048] );
        int     GetTitleKey         ( unsigned char pbKey[5], unsigned long int ulLBA );

        int     CDROMReadTOC        ( WIN32LoaderTOCCommand format, int msf, unsigned char requestedSession, unsigned char* buffer, unsigned long int bufferSize );
        int     ReadSubChannel      ( int fMSF, int fSubQ, unsigned char bFormat, unsigned char bTrack, unsigned char *pData, unsigned long int size);

        int     FileExists          ( const char * path, unsigned char* flag );
        int     FileOpen            ( const char * path, int* handle );
        int     FileClose           ( int handle );
        int     FileSeek            ( int handle, WIN32LOADER_SEEK_TYPE seekType, unsigned __int64 offset );    
        int     FileTell            ( int handle, unsigned __int64* position );
        int     FileSize            ( int handle, unsigned __int64* size );
        int     FileRead            ( int handle, void* buffer, unsigned long int size, unsigned long int* numberOfBytesRead );
        int     FileCheckEOF        ( int handle, unsigned char* eof );
};


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -