本文整理汇总了C++中COptions::get_Device方法的典型用法代码示例。如果您正苦于以下问题:C++ COptions::get_Device方法的具体用法?C++ COptions::get_Device怎么用?C++ COptions::get_Device使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COptions
的用法示例。
在下文中一共展示了COptions::get_Device方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _tmain
int _tmain(int argc, _TCHAR* argv[])
{
//::DebugBreak();
OutputWriter::SetVerbosityLevel(VERBOSITY_LEVEL_NORMAL);
OutputWriter::WriteLine(TEXT("ShadowSpawn (c) 2011 Craig Andera. [email protected]"),
VERBOSITY_THRESHOLD_UNLESS_SILENT);
OutputWriter::WriteLine(TEXT(""), VERBOSITY_THRESHOLD_UNLESS_SILENT);
bool bAbnormalAbort = true;
DWORD exitCode = 0;
int fileCount = 0;
LONGLONG byteCount = 0;
int directoryCount = 0;
int skipCount = 0;
SYSTEMTIME startTime;
try
{
COptions options = COptions::Parse(argc, argv);
if (options.get_Debug())
{
::DebugBreak();
}
OutputWriter::SetVerbosityLevel((VERBOSITY_LEVEL) options.get_VerbosityLevel());
for (int i = 0; i < argc; ++i)
{
CString message;
message.AppendFormat(TEXT("Argument %d: %s"), i, argv[i]);
OutputWriter::WriteLine(message, VERBOSITY_THRESHOLD_IF_VERBOSE);
}
if (!Utilities::DirectoryExists(options.get_Source()))
{
CString message;
message.AppendFormat(TEXT("Source path is not an existing directory: %s"), options.get_Source());
throw new CShadowSpawnException(message);
}
OutputWriter::WriteLine(TEXT("Calling CoInitialize"));
CHECK_HRESULT(::CoInitialize(NULL));
CHECK_HRESULT(
::CoInitializeSecurity(
NULL,
-1,
NULL,
NULL,
RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
RPC_C_IMP_LEVEL_IDENTIFY,
NULL,
EOAC_NONE,
NULL));
::GetSystemTime(&startTime);
CString startTimeString;
Utilities::FormatDateTime(&startTime, TEXT(" "), false, startTimeString);
CString message;
message.AppendFormat(TEXT("Shadowing %s at %s"),
options.get_Source(),
options.get_Device());
OutputWriter::WriteLine(message, VERBOSITY_THRESHOLD_NORMAL);
GUID systemProviderId = GetSystemProviderID();
OutputWriter::WriteLine(TEXT("Calling CreateVssBackupComponents"));
CHECK_HRESULT(::CreateVssBackupComponents(&pBackupComponents));
OutputWriter::WriteLine(TEXT("Calling InitializeForBackup"));
CHECK_HRESULT(pBackupComponents->InitializeForBackup());
CComPtr<IVssAsync> pWriterMetadataStatus;
OutputWriter::WriteLine(TEXT("Calling GatherWriterMetadata"));
CHECK_HRESULT(pBackupComponents->GatherWriterMetadata(&pWriterMetadataStatus));
OutputWriter::WriteLine(TEXT("Waiting for call to GatherWriterMetadata to finish..."));
CHECK_HRESULT(pWriterMetadataStatus->Wait());
HRESULT hrGatherStatus;
OutputWriter::WriteLine(TEXT("Calling QueryStatus for GatherWriterMetadata"));
CHECK_HRESULT(pWriterMetadataStatus->QueryStatus(&hrGatherStatus, NULL));
if (hrGatherStatus == VSS_S_ASYNC_CANCELLED)
{
throw new CShadowSpawnException(L"GatherWriterMetadata was cancelled.");
}
OutputWriter::WriteLine(TEXT("Call to GatherWriterMetadata finished."));
OutputWriter::WriteLine(TEXT("Calling GetWriterMetadataCount"));
vector<CWriter> writers;
UINT cWriters;
CHECK_HRESULT(pBackupComponents->GetWriterMetadataCount(&cWriters));
//.........这里部分代码省略.........