Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: I want to use the mini filter driver IRP_MJ_CREATE only for opening existing files(exe files). Pin
Randor 19-Aug-20 18:29
professional Randor 19-Aug-20 18:29 
GeneralRe: I want to use the mini filter driver IRP_MJ_CREATE only for opening existing files(exe files). Pin
Member 1487268119-Aug-20 18:55
Member 1487268119-Aug-20 18:55 
GeneralRe: I want to use the mini filter driver IRP_MJ_CREATE only for opening existing files(exe files). Pin
Randor 19-Aug-20 19:12
professional Randor 19-Aug-20 19:12 
GeneralRe: I want to use the mini filter driver IRP_MJ_CREATE only for opening existing files(exe files). Pin
Member 1487268119-Aug-20 20:07
Member 1487268119-Aug-20 20:07 
GeneralRe: I want to use the mini filter driver IRP_MJ_CREATE only for opening existing files(exe files). Pin
Randor 19-Aug-20 21:10
professional Randor 19-Aug-20 21:10 
GeneralRe: I want to use the mini filter driver IRP_MJ_CREATE only for opening existing files(exe files). Pin
Member 1487268119-Aug-20 21:20
Member 1487268119-Aug-20 21:20 
GeneralRe: I want to use the mini filter driver IRP_MJ_CREATE only for opening existing files(exe files). Pin
Stefan_Lang19-Aug-20 21:48
Stefan_Lang19-Aug-20 21:48 
QuestionHow to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
cazorla1914-Aug-20 3:30
cazorla1914-Aug-20 3:30 
I am trying out VirtualDisk APIs, So far I am able to Open a VHDX file, get some of the properties by using GetVirtualDiskInformation. But I am not able to get RCT information and ChangedAreas.

1)Opendisk is done with VIRTUAL_DISK_ACCESS_GET_INFO flag.

2)GetVirtualDiskInformation
a. Works fine when version flag is set to GET_VIRTUAL_DISK_INFO_SIZE, able to fetch sector size and other information
b. Gives ERROR_INSUFFICIENT_BUFFER(122) when version flag is set to GET_VIRTUAL_DISK_INFO_CHANGE_TRACKING_STATE to access diskInfo->ChangeTrackingState.MostRecentId

PGET_VIRTUAL_DISK_INFO diskInfo;
ULONG diskInfoSize = sizeof(GET_VIRTUAL_DISK_INFO);
std::wcout << "size of diskinfo structure " << diskInfoSize << std::endl;
diskInfo = (PGET_VIRTUAL_DISK_INFO)malloc(diskInfoSize);

diskInfo->Version = GET_VIRTUAL_DISK_INFO_SIZE;

res = GetVirtualDiskInformation(vhdHandle, &diskInfoSize, diskInfo, NULL);
long physicalSize = diskInfo->Size.PhysicalSize;
long virtualSize = diskInfo->Size.VirtualSize;
long sectorSize = diskInfo->Size.SectorSize;
long blockSize = diskInfo->Size.BlockSize;
std::wcout << "physicalSize :" << physicalSize << std::endl;
std::wcout << "virtualSize :" << virtualSize << std::endl;
std::wcout << "sectorSize :" << sectorSize << std::endl;
std::wcout << "blockSize :" << blockSize << std::endl;

diskInfo->Version = GET_VIRTUAL_DISK_INFO_CHANGE_TRACKING_STATE;

res = GetVirtualDiskInformation(vhdHandle, &diskInfoSize, diskInfo, NULL);
std::wcout << "\nrct id:" << diskInfo->ChangeTrackingState.MostRecentId << std::endl;


3)queryChangesVirtualDisk gives ACCESS DENIED.
ULONG64   byteOffset = 0L;
ULONG64   byteLength = 19327352832;
QUERY_CHANGES_VIRTUAL_DISK_RANGE* changedAreas = NULL;
ULONG     rangeCount = 0L;
ULONG64   processedLength = 0L;
res = QueryChangesVirtualDisk(vhdHandle, "rctX:c2eb01d9:ccb1:405d:acb6:f0e76d055906:00000001",
    byteOffset, byteLength,
    QUERY_CHANGES_VIRTUAL_DISK_FLAG_NONE,
    changedAreas, &rangeCount, &processedLength);


Can someone please give some ideas on what I am doing wrong?
AnswerRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
Gerry Schmitz14-Aug-20 5:04
mveGerry Schmitz14-Aug-20 5:04 
GeneralRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
cazorla1918-Aug-20 0:57
cazorla1918-Aug-20 0:57 
GeneralRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
Gerry Schmitz18-Aug-20 5:34
mveGerry Schmitz18-Aug-20 5:34 
AnswerRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
Randor 14-Aug-20 8:54
professional Randor 14-Aug-20 8:54 
GeneralRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
cazorla1918-Aug-20 0:55
cazorla1918-Aug-20 0:55 
GeneralRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
Randor 19-Aug-20 19:04
professional Randor 19-Aug-20 19:04 
QuestionRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
cazorla1919-Aug-20 20:26
cazorla1919-Aug-20 20:26 
AnswerRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
Randor 19-Aug-20 20:57
professional Randor 19-Aug-20 20:57 
GeneralRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
cazorla1919-Aug-20 21:29
cazorla1919-Aug-20 21:29 
GeneralRe: How to get allocated blocks for VHDx? queryChangesVirtualDisk gives ACCESS DENIED. Pin
Randor 19-Aug-20 21:47
professional Randor 19-Aug-20 21:47 
QuestionMicrosoft Media Foundation AAC Decoder using C++ Pin
sabid12-Aug-20 18:32
sabid12-Aug-20 18:32 
AnswerRe: Microsoft Media Foundation AAC Decoder using C++ Pin
Richard MacCutchan12-Aug-20 21:04
mveRichard MacCutchan12-Aug-20 21:04 
AnswerRe: Microsoft Media Foundation AAC Decoder using C++ Pin
11917640 Member 2-Sep-20 1:06
11917640 Member 2-Sep-20 1:06 
QuestionIs there an entry point for CppUnitTestFramework unit tests ? Pin
Maximilien11-Aug-20 10:01
Maximilien11-Aug-20 10:01 
AnswerRe: Is there an entry point for CppUnitTestFramework unit tests ? Pin
Richard MacCutchan11-Aug-20 22:23
mveRichard MacCutchan11-Aug-20 22:23 
GeneralRe: Is there an entry point for CppUnitTestFramework unit tests ? Pin
Maximilien12-Aug-20 7:31
Maximilien12-Aug-20 7:31 
Questioncomputer science Pin
Member 1491094810-Aug-20 0:26
Member 1491094810-Aug-20 0:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.