gpt4 book ai didi

c++ - IVdsPack::创建卷

转载 作者:行者123 更新时间:2023-11-30 17:58:37 24 4
gpt4 key购买 nike

HRESULT CreatePartitionEx(ULONGLONG ullOffset, ULONGLONG ullSize, ULONG ulAlign,  [in]   CREATE_PARTITION_PARAMETERS *para, IVdsAsync **ppAsync
)

当我传递参数 ppAsync = NULL 时,特定调用失败并返回无效参数。

请帮我解决这个问题。

最佳答案

根据documentation ,关于最后一个参数 - ppAsync:

The address of an IVdsAsync interface pointer, which VDS initializes on return. Callers must release the interface. Use this pointer to cancel, wait for, or query the status of the operation.

这意味着在调用函数时您应该提供一个实际的指针作为最后一个参数。由于您提供了 NULL,因此可能会导致问题。

编辑:

像这样使用:

IVdsAsync *pAsync;    // Declare a pointer
// Then use it like this (take a look at the last parameter)
CreatePartitionEx(
ullOffset,
ullSize,
ulAlign,
para,
&pAsync); // You pass it with a leading &, which gives you the address of the pointer

这样就可以了。

请记住,如文档所述,您应该在完成后释放 pAsync

关于c++ - IVdsPack::创建卷,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12085288/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com