91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 47KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-08
  • 語言: 其他
  • 標簽: vhd??windows??api??

資源簡介

微軟官方的實例,使用windows api操作vhd,可以正常運行。

資源截圖

代碼片段和文件信息

/******************************?Module?Header?******************************\
Module?Name:??CppVhdAPI.cpp
Project:??????CppVhdAPI?(VHD?API?demo)
Copyright?(c)?Microsoft?Corporation.

Demonstrates?various?VHD?API?usage?such?as?VHD?creation?attaching?
detaching?and?getting?and?setting?disk?information.

This?source?is?subject?to?the?Microsoft?Public?License.
See?http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
All?other?rights?reserved.

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.
\***************************************************************************/

#include?
#include?
#define?DEFIND_GUID
#include?
#include?
#pragma?comment(lib?“VirtDisk.lib“)


#define?PHYS_PATH_LEN?1024+1
GUID?GUID_TEST?=?{12345678-1234-5678-1234-000000000000};
GUID?zGuid?=?GUID_NULL;


void?PrintErrorMessage(ULONG?ErrorId)
{
????PVOID?Message?=?NULL;
????FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER?|?
????????FORMAT_MESSAGE_FROM_SYSTEM?|
????????FORMAT_MESSAGE_IGNORE_INSERTS
????????NULL
????????ErrorId
????????0
????????(LPWSTR)&Message
????????16
????????NULL);

????wprintf(L“%s\n“?Message);
????LocalFree(Message);
}

void?usage()
{
????printf(“CppVhdAPI.exe?-[cxaomdgpe]?-f??-s?\n“);
????printf(“-c?CreateVirtualDisk............input:?-f??-s?\n“);
????printf(“-a?AttachVirtualDisk............input:?-f?\n“);
????printf(“-d?DetachVirtualDisk............input:?-f?\n“);
????printf(“-g?GetVirtualDiskInformation....input:?-f?\n“);
????printf(“-p?GetVirtualDiskPhysicalPath...input:?-f??--?note:?must?be?attached\n“);
????printf(“-e?SetVirtualDiskInformation....input:?-f??-u?\n“);
????printf(“Examples:\n“);
????printf(“??Create?a?3.6?Gb?VHD?named?‘mytest.vhd‘\n“);
????printf(“CppVhdAPI.exe?-c?-f?c:\\testdir\\mytest.vhd?-s?3600\n\n“);
????printf(“??Attach?a?VHD?named?‘mytest.vhd‘\n“);
????printf(“CppVhdAPI.exe?-a?-f?c:\\testdir\\mytest.vhd\n\n“);
????printf(“??Set?VHD?GUID?‘mytest.vhd‘\n“);
????printf(“CppVhdAPI.exe?-e?-f?c:\\testdir\\mytest.vhd?-u?{12345678-1234-5678-1234-000000000000}\n“);
}

BOOL?ValidateActionAndParameters(wchar_t?action?PCWSTR?pszFilename?ULONG?sizeInMb?PCWSTR?pszGuid)
{
????HRESULT?hr;

????switch?(action)
????{
????case?L‘c‘:??//?CreateVirtualDisk
????case?L‘x‘:??//?ExpandVirtualDisk
????????{
????????????//?Validate?file?name?and?size
????????????return?(wcslen(pszFilename)?&&?(sizeInMb));
????????}

????case?L‘e‘:??//?SetVirtualDiskInformation????
????????if?(wcslen(pszFilename)?&&?wcslen(pszGuid))
????????{
????????????//?Validate?filename?and?size
????????????hr?=?CLSIDFromString(pszGuid?&zGuid);
??????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????12415??2014-06-06?06:55??description.html
?????文件????????1670??2014-06-06?06:55??description\offline.js
?????文件???????????0??2014-06-06?06:55??description\Combined.css
?????文件???????????0??2014-06-06?06:55??description\67b74b86-a273-4ad7-9ed5-0f97276412eaCombined.css
?????文件???????10457??2014-06-06?06:55??description\Galleries.css
?????文件????????1727??2014-06-06?06:55??description\Layout.css
?????文件???????71647??2014-06-06?06:55??description\Brand.css
?????文件????????3369??2014-06-06?06:55??description\iframedescription.css
?????文件???????12978??2014-06-06?06:55??description\95e3bc78-76ea-4f7c-8b0e-445ca740f249image.png
?????文件???????14808??2014-06-06?06:55??license.rtf
?????文件?????????894??2014-06-06?06:55??C++\CppVhdAPI.sln
?????文件???????21904??2014-06-06?06:55??C++\CppVhdAPI\CppVhdAPI.cpp
?????文件????????3990??2014-06-06?06:55??C++\CppVhdAPI\CppVhdAPI.vcxproj
?????文件????????1024??2014-06-06?06:55??C++\CppVhdAPI\CppVhdAPI.vcxproj.filters
?????文件????????3570??2014-06-06?06:55??C++\CppVhdAPI\ReadMe.txt

評論

共有 條評論