Recently we started using new Resilient Change Tracking (RCT 2016) APIs. We are facing issue with QueryChangesVirtualDisk API. We are following steps as mentioned in MSDN. Anyone has any suggestions if it is working for them?
PCWSTR changeTrackingId = virtualDiskInfo->ChangeTrackingState.MostRecentId;
ULONG64 byteOffset = 0L;
ULONG64 byteLength = virtualDiskInfoSize;
PQUERY_CHANGES_VIRTUAL_DISK_RANGE pQueryChangeRange = NULL;
ULONG rangeCount = 0L;
ULONG64 processedLength = 0L;
openStatus = QueryChangesVirtualDisk(
vhdHandle, changeTrackingId, byteOffset, byteLength, QUERY_CHANGES_VIRTUAL_DISK_FLAG_NONE, pQueryChangeRange, &rangeCount, &processedLength );
if (openStatus != ERROR_SUCCESS)
{
wprintf(L"Failed to call method(QueryChangesVirtualDisk), Erorr code: %ld\n", openStatus);
wprintf(L"Virtual disk path: %s\n", virtualDiskPath);
wprintf(L"%s\n", changeTrackingId);
wprintf(L"Start offset: %llu\n", byteOffset);
wprintf(L"End offset: %lu\n", virtualDiskInfoSize);
getchar();
return 1;
}
cout << "Succeeded to call method(QueryChangesVirtualDisk)." << endl;
if (vhdHandle != NULL)
{
CloseHandle(vhdHandle);
}
What I have tried:
After my test, the handle of the open virtual disk is changed from VIRTUAL_DISK_ACCEES_GET_INFO to VIRTUAL_DISK_ACCESS_ALL, it's work. But here is a new problem: the virtual machine can't boot or the virtual machine is powered on, QueryChangesVirtualDisk() returns 32 (0x20)( the file is in proceeding).