QueryChangesVirtualDisk() is returning Access_Denied (5)?












0















// QueryChangesVirtualDisk
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, // A handle to the open VHD
changeTrackingId, // A pointer to a string that specifies the change tracking identifier
byteOffset, // Specifies the distance from the start of the VHD to the beginning of the area of the VHD
byteLength, // Specifies the length of the area of the VHD that you want to check for changes
QUERY_CHANGES_VIRTUAL_DISK_FLAG_NONE, // Reserved
pQueryChangeRange, // Indicates the areas of the virtual disk that have changed
&rangeCount, // The number of QUERY_CHANGES_VIRTUAL_DISK_RANGE structures that the array that the Ranges parameter points to can hold
&processedLength // Indicates the total number of bytes that the method processed
);

if (openStatus != ERROR_SUCCESS)
{
wprintf(L"Failed to call method(QueryChangesVirtualDisk), Erorr code: %ldn", openStatus);
wprintf(L"Virtual disk path: %sn", virtualDiskPath);
wprintf(L"%sn", changeTrackingId);
wprintf(L"Start offset: %llun", byteOffset);
wprintf(L"End offset: %lun", virtualDiskInfoSize);
getchar();
return 1;
}

cout << "Succeeded to call method(QueryChangesVirtualDisk)." << endl;

if (vhdHandle != NULL)
{
CloseHandle(vhdHandle);
}


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?










share|improve this question

























  • reference:docs.microsoft.com/en-us/windows/desktop/api/virtdisk/…

    – Chaplin Hwang
    Nov 21 '18 at 9:29
















0















// QueryChangesVirtualDisk
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, // A handle to the open VHD
changeTrackingId, // A pointer to a string that specifies the change tracking identifier
byteOffset, // Specifies the distance from the start of the VHD to the beginning of the area of the VHD
byteLength, // Specifies the length of the area of the VHD that you want to check for changes
QUERY_CHANGES_VIRTUAL_DISK_FLAG_NONE, // Reserved
pQueryChangeRange, // Indicates the areas of the virtual disk that have changed
&rangeCount, // The number of QUERY_CHANGES_VIRTUAL_DISK_RANGE structures that the array that the Ranges parameter points to can hold
&processedLength // Indicates the total number of bytes that the method processed
);

if (openStatus != ERROR_SUCCESS)
{
wprintf(L"Failed to call method(QueryChangesVirtualDisk), Erorr code: %ldn", openStatus);
wprintf(L"Virtual disk path: %sn", virtualDiskPath);
wprintf(L"%sn", changeTrackingId);
wprintf(L"Start offset: %llun", byteOffset);
wprintf(L"End offset: %lun", virtualDiskInfoSize);
getchar();
return 1;
}

cout << "Succeeded to call method(QueryChangesVirtualDisk)." << endl;

if (vhdHandle != NULL)
{
CloseHandle(vhdHandle);
}


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?










share|improve this question

























  • reference:docs.microsoft.com/en-us/windows/desktop/api/virtdisk/…

    – Chaplin Hwang
    Nov 21 '18 at 9:29














0












0








0


1






// QueryChangesVirtualDisk
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, // A handle to the open VHD
changeTrackingId, // A pointer to a string that specifies the change tracking identifier
byteOffset, // Specifies the distance from the start of the VHD to the beginning of the area of the VHD
byteLength, // Specifies the length of the area of the VHD that you want to check for changes
QUERY_CHANGES_VIRTUAL_DISK_FLAG_NONE, // Reserved
pQueryChangeRange, // Indicates the areas of the virtual disk that have changed
&rangeCount, // The number of QUERY_CHANGES_VIRTUAL_DISK_RANGE structures that the array that the Ranges parameter points to can hold
&processedLength // Indicates the total number of bytes that the method processed
);

if (openStatus != ERROR_SUCCESS)
{
wprintf(L"Failed to call method(QueryChangesVirtualDisk), Erorr code: %ldn", openStatus);
wprintf(L"Virtual disk path: %sn", virtualDiskPath);
wprintf(L"%sn", changeTrackingId);
wprintf(L"Start offset: %llun", byteOffset);
wprintf(L"End offset: %lun", virtualDiskInfoSize);
getchar();
return 1;
}

cout << "Succeeded to call method(QueryChangesVirtualDisk)." << endl;

if (vhdHandle != NULL)
{
CloseHandle(vhdHandle);
}


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?










share|improve this question
















// QueryChangesVirtualDisk
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, // A handle to the open VHD
changeTrackingId, // A pointer to a string that specifies the change tracking identifier
byteOffset, // Specifies the distance from the start of the VHD to the beginning of the area of the VHD
byteLength, // Specifies the length of the area of the VHD that you want to check for changes
QUERY_CHANGES_VIRTUAL_DISK_FLAG_NONE, // Reserved
pQueryChangeRange, // Indicates the areas of the virtual disk that have changed
&rangeCount, // The number of QUERY_CHANGES_VIRTUAL_DISK_RANGE structures that the array that the Ranges parameter points to can hold
&processedLength // Indicates the total number of bytes that the method processed
);

if (openStatus != ERROR_SUCCESS)
{
wprintf(L"Failed to call method(QueryChangesVirtualDisk), Erorr code: %ldn", openStatus);
wprintf(L"Virtual disk path: %sn", virtualDiskPath);
wprintf(L"%sn", changeTrackingId);
wprintf(L"Start offset: %llun", byteOffset);
wprintf(L"End offset: %lun", virtualDiskInfoSize);
getchar();
return 1;
}

cout << "Succeeded to call method(QueryChangesVirtualDisk)." << endl;

if (vhdHandle != NULL)
{
CloseHandle(vhdHandle);
}


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?







c++ virtual-machine backup wmi access-denied






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 9:31







Chaplin Hwang

















asked Nov 21 '18 at 5:56









Chaplin HwangChaplin Hwang

167




167













  • reference:docs.microsoft.com/en-us/windows/desktop/api/virtdisk/…

    – Chaplin Hwang
    Nov 21 '18 at 9:29



















  • reference:docs.microsoft.com/en-us/windows/desktop/api/virtdisk/…

    – Chaplin Hwang
    Nov 21 '18 at 9:29

















reference:docs.microsoft.com/en-us/windows/desktop/api/virtdisk/…

– Chaplin Hwang
Nov 21 '18 at 9:29





reference:docs.microsoft.com/en-us/windows/desktop/api/virtdisk/…

– Chaplin Hwang
Nov 21 '18 at 9:29












1 Answer
1






active

oldest

votes


















0














    openStatus = OpenVirtualDisk(
&storageType,
virtualDiskPath,
//VIRTUAL_DISK_ACCESS_GET_INFO,
VIRTUAL_DISK_ACCESS_ALL,
OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS,
openParameters,
&vhdHandle
);


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).

WTF?! I feel very tired, very.






share|improve this answer


























  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Dec 3 '18 at 1:07











  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Feb 26 at 5:40











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406033%2fquerychangesvirtualdisk-is-returning-access-denied-5%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














    openStatus = OpenVirtualDisk(
&storageType,
virtualDiskPath,
//VIRTUAL_DISK_ACCESS_GET_INFO,
VIRTUAL_DISK_ACCESS_ALL,
OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS,
openParameters,
&vhdHandle
);


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).

WTF?! I feel very tired, very.






share|improve this answer


























  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Dec 3 '18 at 1:07











  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Feb 26 at 5:40
















0














    openStatus = OpenVirtualDisk(
&storageType,
virtualDiskPath,
//VIRTUAL_DISK_ACCESS_GET_INFO,
VIRTUAL_DISK_ACCESS_ALL,
OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS,
openParameters,
&vhdHandle
);


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).

WTF?! I feel very tired, very.






share|improve this answer


























  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Dec 3 '18 at 1:07











  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Feb 26 at 5:40














0












0








0







    openStatus = OpenVirtualDisk(
&storageType,
virtualDiskPath,
//VIRTUAL_DISK_ACCESS_GET_INFO,
VIRTUAL_DISK_ACCESS_ALL,
OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS,
openParameters,
&vhdHandle
);


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).

WTF?! I feel very tired, very.






share|improve this answer















    openStatus = OpenVirtualDisk(
&storageType,
virtualDiskPath,
//VIRTUAL_DISK_ACCESS_GET_INFO,
VIRTUAL_DISK_ACCESS_ALL,
OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS,
openParameters,
&vhdHandle
);


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).

WTF?! I feel very tired, very.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 23 '18 at 2:32

























answered Nov 23 '18 at 1:14









Chaplin HwangChaplin Hwang

167




167













  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Dec 3 '18 at 1:07











  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Feb 26 at 5:40



















  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Dec 3 '18 at 1:07











  • Does anyone pay attention to this issue?

    – Chaplin Hwang
    Feb 26 at 5:40

















Does anyone pay attention to this issue?

– Chaplin Hwang
Dec 3 '18 at 1:07





Does anyone pay attention to this issue?

– Chaplin Hwang
Dec 3 '18 at 1:07













Does anyone pay attention to this issue?

– Chaplin Hwang
Feb 26 at 5:40





Does anyone pay attention to this issue?

– Chaplin Hwang
Feb 26 at 5:40




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406033%2fquerychangesvirtualdisk-is-returning-access-denied-5%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents