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

📄 neroapi.h

📁 本源码是通过调用NeroAPI实现刻录功能
💻 H
📖 第 1 页 / 共 5 页
字号:


/*
// NeroAPI>6.0.0.10: Retrieve virtual multisession information for media supporting it.
// This function may be called for media having the NCDIMF_VIRTUALMULTISESSION flag
// set in their NERO_CD_INFO structure. Free result with NeroFreeMem()
//
// aDeviceHandle: result of NeroOpenDevice()
//         flags: currently unused, reserved for future extensions
//
// Returns NULL in case of error (e.g. non-VMS medium inserted)
//
// Virtual multisession is a technique to allow writing multisession discs on
// medium types that does not support normal multisession, e.g. DVD-+RW.
*/
NEROAPI_API NERO_VMS_INFO * NADLL_ATTR NeroGetVMSInfo(NERO_DEVICEHANDLE aDeviceHandle, DWORD dwFlags);


/*
// NeroAPI>=5.5.9.16: Get information about a disc image. Result must be released using NeroFreeMem().
//
// imagePath: path to the image file
// reserved: reserved for future usage
// 
// Returns NULL in case of error.
*/
NEROAPI_API NERO_CD_INFO * NADLL_ATTR NeroGetDiscImageInfo(const char *imagePath, void *reserved);

/*
// A progress display could look like this:
//
// +------------------------------------------------------+
// | Log of Operation:                                    |
// | +--------------------------------------------------+ |
// | | [icon] text                                      | |
// | | ...........                                      | |
// | |                                                  | |
// | +--------------------------------------------------+ |
// | Current Phase: text                                  |
// |      Progress: ********............................  |
// |                                                      |
// |                       ABORT                          |
// +------------------------------------------------------+
//
// The application may provide callback functions to set
// the different parts of this display. All of them may
// be NULL.
*/
typedef BOOL  (NERO_CALLBACK_ATTR *NERO_PROGRESS_CALLBACK)(void *pUserData, DWORD dwProgressInPercent); /* Will return TRUE if the user wants to abort */
typedef BOOL  (NERO_CALLBACK_ATTR *NERO_ABORTED_CALLBACK)(void *pUserData);                             /*  "     "     "    "  "    "    "    "   "   */
typedef enum
{
	NERO_TEXT_INFO,        /* informative text                     */
	NERO_TEXT_STOP,        /* some operation stopped prematurely   */
	NERO_TEXT_EXCLAMATION, /* important information                */
	NERO_TEXT_QUESTION,    /* a question which requires an answer  */
	NERO_TEXT_DRIVE,       /* a message concerning a CD-ROM drive or recorder */
	NERO_TEXT_FILE,        /* a message concerning a file          */
	NERO_TEXT_UNSPECIFIED  /* no type specified                    */
} NERO_TEXT_TYPE;       

typedef enum
{
	NERO_PHASE_UNSPECIFIED					=-1,
	NERO_PHASE_START_CACHE					=24,
	NERO_PHASE_DONE_CACHE					=25,
	NERO_PHASE_FAIL_CACHE					= 26,
	NERO_PHASE_ABORT_CACHE					= 27,
	NERO_PHASE_START_TEST					=28,
	NERO_PHASE_DONE_TEST					=29,
	NERO_PHASE_FAIL_TEST					= 30,
	NERO_PHASE_ABORT_TEST					= 31,
	NERO_PHASE_START_SIMULATE				=32,
	NERO_PHASE_DONE_SIMULATE				=33,
	NERO_PHASE_FAIL_SIMULATE				= 34,
	NERO_PHASE_ABORT_SIMULATE				= 35,
	NERO_PHASE_START_WRITE					=36,
	NERO_PHASE_DONE_WRITE					=37,
	NERO_PHASE_FAIL_WRITE					= 38,
	NERO_PHASE_ABORT_WRITE					= 39,
	NERO_PHASE_START_SIMULATE_NOSPD			=61,
	NERO_PHASE_DONE_SIMULATE_NOSPD			=62,
	NERO_PHASE_FAIL_SIMULATE_NOSPD			= 63,
	NERO_PHASE_ABORT_SIMULATE_NOSPD			= 64,
	NERO_PHASE_START_WRITE_NOSPD			=65,
	NERO_PHASE_DONE_WRITE_NOSPD				=66,
	NERO_PHASE_FAIL_WRITE_NOSPD				= 67,
	NERO_PHASE_ABORT_WRITE_NOSPD			= 68,
	NERO_PHASE_PREPARE_ITEMS				= 73,
	NERO_PHASE_VERIFY_COMPILATION			= 78,
	NERO_PHASE_VERIFY_ABORTED				= 79,
	NERO_PHASE_VERIFY_END_OK				= 80,
	NERO_PHASE_VERIFY_END_FAIL				= 81,
	NERO_PHASE_ENCODE_VIDEO					=82,
	NERO_PHASE_SEAMLESSLINK_ACTIVATED      = 87,  // deprecated, use NERO_PHASE_BUP_ACTIVATED below
	NERO_PHASE_BUP_ACTIVATED				=90,  // Generic: Buffer underun protection activated
	NERO_PHASE_START_FORMATTING				= 98, 
	NERO_PHASE_CONTINUE_FORMATTING			=99,
	NERO_PHASE_FORMATTING_SUCCESSFUL		=100,
	NERO_PHASE_FORMATTING_FAILED            =101,
	NERO_PHASE_PREPARE_CD					=105,
	NERO_PHASE_DONE_PREPARE_CD				=106,
	NERO_PHASE_FAIL_PREPARE_CD				=107,
	NERO_PHASE_ABORT_PREPARE_CD				=108,
	NERO_PHASE_DVDVIDEO_DETECTED			=111,
	NERO_PHASE_DVDVIDEO_REALLOC_STARTED		=112,
	NERO_PHASE_DVDVIDEO_REALLOC_COMPLETED	=113,
	NERO_PHASE_DVDVIDEO_REALLOC_NOTNEEDED	=114, // NeroAPI > 5.5.9.3
	NERO_PHASE_DVDVIDEO_REALLOC_FAILED		=115,  // NeroAPI > 5.5.9.3
	NERO_PHASE_DRM_CHECK_FAILURE			=169  // NeroAPI >= 6.3.0.6
} NERO_MAJOR_PHASE;

/* a one-line text to be displayed; text pointer becomes invalid after returning from this function */
typedef void  (NERO_CALLBACK_ATTR *NERO_ADD_LOG_LINE_CALLBACK)(void *pUserData, NERO_TEXT_TYPE type, const char *text); 

/* set the phase line; text pointer becomes invalid after returning from this function */
typedef void  (NERO_CALLBACK_ATTR *NERO_SET_PHASE_CALLBACK)(void *pUserData, const char *text);                         

/* Tell the main program whether the burn process can be interrupted or not */
typedef void (NERO_CALLBACK_ATTR *NERO_DISABLE_ABORT_CALLBACK)(void *pUserData,BOOL abortEnabled);

/* Let the application knows in which part of the burn process NeroAPI is */
typedef void (NERO_CALLBACK_ATTR *NERO_SET_MAJOR_PHASE_CALLBACK)(void *pUserData,NERO_MAJOR_PHASE phase,void *reserved);

typedef struct tag_NERO_PROGRESS
{
	NERO_PROGRESS_CALLBACK npProgressCallback;
	NERO_ABORTED_CALLBACK npAbortedCallback;
	NERO_ADD_LOG_LINE_CALLBACK npAddLogLineCallback;
	NERO_SET_PHASE_CALLBACK npSetPhaseCallback;
	void *npUserData;
	NERO_DISABLE_ABORT_CALLBACK npDisableAbortCallback;		/* Will be called only if the NBF_DISABLE_ABORT flags is given to the NeroBurn function */
	NERO_SET_MAJOR_PHASE_CALLBACK npSetMajorPhaseCallback;	
	NERO_PROGRESS_CALLBACK npSubTaskProgressCallback;		/* provide the write buffer fill level */
} NERO_PROGRESS;

/*
// NeroAPI >= 6.0.0.0
// creates a NERO_PROGRESS structure correctly initialised.
// Must be freed with NeroFreeMem when no longer needed.
*/
NEROAPI_API NERO_PROGRESS* NADLL_ATTR NeroCreateProgress();

/*
// Data exchange between application and NeroAPI is done with
// a function that gets a pointer to its own structure, a buffer
// pointer and the amount in bytes to be read or written. It
// shall return the actual amount of bytes transferred. Other
// functions indicate that the EOF file has been reached when
// reading or a serious error occured.
*/
typedef DWORD (NERO_CALLBACK_ATTR *NERO_IO_CALLBACK)(void *pUserData, BYTE *pBuffer, DWORD dwLen);
typedef BOOL (NERO_CALLBACK_ATTR *NERO_STATUS_CALLBACK)(void *pUserData);
typedef struct tag_NERO_IO
{
	void                 *nioUserData;
	NERO_IO_CALLBACK     nioIOCallback;
	NERO_STATUS_CALLBACK nioEOFCallback;          // shall return TRUE if further IO calls will always fail to transfer any data, i.e. EOF reached
	NERO_STATUS_CALLBACK nioErrorCallback;        // shall return TRUE if an error occured during an IO call
} NERO_IO;


/* A pointer on this structure will be passed with the DLG_WAITCD_MEDIA_INFO user dialog callback 
   (NeroAPI>=5.5.9.4)
*/

typedef struct 
{
	DWORD ndwmiSize;
	NERO_MEDIA_TYPE ndwmiLastDetectedMedia;
	NERO_MEDIA_SET	ndwmiRequestedMedia;
	const char *ndwmiLastDetectedMediaName;
	const char *ndwmiRequestedMediaName;
} NERO_DLG_WAITCD_MEDIA_INFO;



/*
// ISO track generation functions
*/

typedef struct tag_NERO_ISO_ITEM
{
	char fileName[252];						// Deprecated, use longFileName instead
	char *longFileName;				// File name on the burnt CD 
									// (will be freed in NeroFreeIsoItem if this item is a reference)

	BOOL isDirectory;						// Is this item a directory ?
	BOOL isReference;						// Is this item a reference to a file/directory of a previous session
    // when recording RockRidge, you can set the name of a directory to be used for
	// retrieving rockridge informations here
	char sourceFilePath[252];				// Deprecated, use longSourceFilePath instead
	const char *longSourceFilePath;			// Path to the file, including file name (ignored for a directory)
	struct tag_NERO_ISO_ITEM *subDirFirstItem;	// Point on the first item of the sub directory if the item is a directory 
											// Can be NULL if the directory is empty
											// (ignored for a file)
	struct tag_NERO_ISO_ITEM *nextItem;			// Next item in the current directory
	void *userData;							// Can be used to store additional informations

	// Used to reference a file from a previous session
	long dataStartSec;
	__int64 dataLength;
	struct tm entryTime;
    int itemSize;  							// Size of the structure
    struct CImportInfo *importinfo;			// ImportInfo
} NERO_ISO_ITEM;

typedef struct tag_NERO_IMPORT_DATA_TRACK_INFO
{
	DWORD nidtiSize;			// Must contain the size of the structure
	char *nidtipVolumeName;		// This must be released using NeroFreeMem
} NERO_IMPORT_DATA_TRACK_INFO;

// NeroCreateIsoItem: Allocate an instance from the NERO_ISO_ITEM structure
//    The itemSize member of the structure will be automatically be filled by this
//    function
#define NeroCreateIsoItem()	NeroCreateIsoItemOfSize(sizeof(NERO_ISO_ITEM))
NEROAPI_API NERO_ISO_ITEM * NADLL_ATTR NeroCreateIsoItemOfSize(size_t);

// Free an instance from the NERO_ISO_ITEM structure
// longFilename is only freed if this item is a reference, because only then is longFilename allocated by NeroAPI
NEROAPI_API void NADLL_ATTR NeroFreeIsoItem(NERO_ISO_ITEM *);

/*
// NeroAPI >= 6.0.0.0:
// Free an NERO_ISO_ITEM including all linked items
*/ 
NEROAPI_API void NADLL_ATTR NeroFreeIsoItemTree(NERO_ISO_ITEM*);
   
// NeroCopyIsoItem: Create a copy of an existing NERO_ISO_ITEM object.
//    This is a safe way to obtain an exact copy of NERO_ISO_ITEM objects imported
//    from a previous session
//    Note that the new NERO_ISO_ITEM's nextItem,userData and subDirFirstItem members are set to NULL
//    longFilename is only copied if this item is a reference, because only then is longFilename allocated by NeroAPI
//    Available for NeroAPI versions >5.5.9.9
NEROAPI_API NERO_ISO_ITEM * NADLL_ATTR NeroCopyIsoItem(const NERO_ISO_ITEM *iso_item);

// Create an ISO track from a NERO_ISO_ITEM tree
// NeroAPI >= 5.5.9.0:
// For special needs you have to give a pointer to NeroCITEArgs instead of name.
// See declaration of NeroCiteArgs below. Set flags to NCITEF_USE_STRUCT,
// to tell NeroCreateIsoTrackEx that name is a NeroCITEArgs struct and set the flags
// for the burn options with NeroCITEArgs::dwBurnOptions. root should also be NULL
// in this case.
NEROAPI_API
struct CNeroIsoTrack * NADLL_ATTR NeroCreateIsoTrackEx(NERO_ISO_ITEM *root,	// First item of the root directory
													 const char *name,				// Name of the CD
													 DWORD flags);					// See constants below


// this struct can be used to give some more parameters to NeroCreateIsoTrackEx:
// - If a CD shall have two different filesystems (e.g. HFS+ CDs), you can give
// the second filesystem with firstRootItem_wrapper.
// - give some information to be written to the volume descriptor
typedef struct tag_NERO_CITE_ARGS {
	int size; // ignored. Initialise whole struct with 0. The version of the
	          // struct will be taken from expected version of NeroAPI
	NERO_ISO_ITEM *firstRootItem;
	NERO_ISO_ITEM *firstRootItem_wrapper;
	const char    *name;
	DWORD          dwBurnOptions;
	// NeroAPI >= 5.5.9.26: 
	const char    *systemIdentifier; // system identifier
	const char    *volumeSet;
	const char    *publisher; // the publisher of this track
	const char    *dataPreparer; // the preparer of this track
	const char    *application; // the application, that created this track
	const char    *copyright; // copyright file
	const char    *abstract;  // abstract file
	const char    *bibliographic; // bibliographic file
} NERO_CITE_ARGS;

// definition for compatibility reasons
#define NeroCITEArgs NERO_CITE_ARGS

#define NCITEF_USE_JOLIET		(1<<0)
#define NCITEF_USE_MODE2		(1<<1)
#define NCITEF_USE_ROCKRIDGE	(1<<2)
#define NCITEF_CREATE_ISO_FS	(1<<3)
#define NCITEF_CREATE_UDF_FS	(1<<4)
#define NCITEF_CREATE_HFS_FS    (1<<5)
#define NCITEF_DVDVIDEO_REALLOC	(1<<6)	// NeroAPI>=5.5.7.8:  Perform reallocation of files in the VIDEO_TS directory; NeroAPI>=6.3.1.4: Also create layerbreak if writing on a double layer medium
#define NCITEF_USE_STRUCT	    (1<<7)	// NeroAPI>=5.5.9.0:  'name' points to an argument struct instead of name. If set, 'root' and other 'flags' are ignored.
#define NCITEF_RESERVED1        (1<<8)  // Reserved
#define NCITEF_USE_ALLSPACE	    (1<<9)	// NeroAPI>=5.5.9.17: Use all space available on the medium for the volume to be created. Supported for DVD+-RW only
#define NCITEF_RESERVED2	    (1<<10)	// Reserved
#define NCITEF_RESERVED3        (1<<11) // Reserved
#define NCITEF_RESERVED4		(1<<12) // Reserved
#define NCITEF_RELAX_JOLIET		(1<<13)	// NeroAPI>=6.0.0.0:Relax joliet filename length limitations -> allow a maximum of 109 characters per filename
#define NCITEF_DVDVIDEO_CMPT	(1<<14)	// NeroAPI>6.0.0.13:  Create DVD-Video compatible medium, NCITEF_CREATE_ISO_FS and NCITEF_CREATE_UDF_FS must be set,
                                        //                    NCITEF_DVDVIDEO_REALLOC may be set to reallocate DVD-Video .IFO pointers
										//					  Note that NeroAPI versions prior or equal to 6.0.0.13 will implicitly enable DVD-Video compatibility
										//					  when DVD-Video content is found within your compilation
#define NCITEF_RESERVED5		(1<<15)	// Reserved


// Free an ISO track previously allocated with NeroCreateIsoTrackEx

NEROAPI_API void NADLL_ATTR NeroFreeIsoTrack(struct CNeroIsoTrack *track);

typedef enum 
{
	NIDTR_NO_ERROR=0,
	NIDTR_GENERIC_ERROR, // undefined error
	NIDTR_DRIVE_ERROR, // get more details with NeroGetLastDriveError
	// filesystem errors below, maybe a corrupted filesystem etc.
	// If one of these is returned, parts of the filesystem may have
	// been imported nevertheless
	NIDTR_READ_ERROR, // error while reading from the disc
	NIDTR_INVALID_FS // errors in the filesystem on the disc	
} NERO_IMPORT_DATA_TRACK_RESULT;

⌨️ 快捷键说明

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