commandlistdrives.cpp

来自「把doc文档转成pdf后刻录成CD,用VC++开发,用了Nero的SDK和CXI」· C++ 代码 · 共 94 行

CPP
94
字号
/******************************************************************************
|* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|* PARTICULAR PURPOSE.
|* 
|* Copyright 1995-2004 Ahead Software AG. All Rights Reserved.
|*-----------------------------------------------------------------------------
|* NeroSDK / NeroCmd
|*
|* PROGRAM: CommandListDrives.cpp
|*
|* PURPOSE: List available drives and their characteristics
******************************************************************************/


#include "stdafx.h"
#include "BurnContext.h"

#include "../Scan2PDFDefs.h"

// This function performs listing of all available drives with their
// main characteristics. m_NeroDeviceInfos has been filled by a call
// GetAvailableDrives during NeroAPI initialization in main().

CExitCode CBurnContext::CommandListDrives (const PARAMETERS & params)
{
	theConf.m_DriveList="";
	
	/*
	printf (
			"Drv: Adapter                      Underrun Protection Technology  # type     ID\n"
			"-------------------------------------------------------------------------------\n");
	*/

	for (int i = 0; i < (int)(m_NeroDeviceInfos->nsdisNumDevInfos); i ++)
	{
		// Use a helper variable for better code readability

		NERO_SCSI_DEVICE_INFO tempNSDI = m_NeroDeviceInfos->nsdisDevInfos[i];

		// Check whether the drive has a Windows drive letter,
		// use '?' if it is not available.

		char cDriveLetter;
		if (0 != tempNSDI.nsdiDriveLetter)
		{
			cDriveLetter = tempNSDI.nsdiDriveLetter;
		}
		else
		{
			cDriveLetter = '?';
		}
		
		LPCSTR psUnderrunProtName;

		// Check for buffer underrun protection.
		// 
		if (tempNSDI.nsdiCapabilities & NSDI_BUF_UNDERRUN_PROT)
		{
			// If it exists, use the name provided by NeroAPI or a generic
			// string otherwise.
			// 
			psUnderrunProtName = (tempNSDI.nsdiBufUnderrunProtName[0] != '\0')? tempNSDI.nsdiBufUnderrunProtName: "<supported>";
		}
		else
		{
			// There is on underrun protection.
			// 
			psUnderrunProtName = "<none>";
		}
		
		// Print one line for every device

		/*
		printf ("%c %-31s %-31s %2d %-7s %2d\n",
			cDriveLetter,
			tempNSDI.nsdiDeviceName,
			psUnderrunProtName,
			tempNSDI.nsdiHostAdapterNo,
			tempNSDI.nsdiHostAdapterName,
			tempNSDI.nsdiDeviceID);
		*/

		CString Temp;
		Temp.Format("%c %-31s\n", cDriveLetter, tempNSDI.nsdiDeviceName);
		theConf.m_DriveList+=Temp;
	}
	printf ("\n");

	return EXITCODE_OK;
}

⌨️ 快捷键说明

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