IVdsServiceUninstallDisk::UninstallDisks method (vds.h)
[Beginning with Windows 8 and Windows Server 2012, the Virtual Disk Service COM interface is superseded by the Windows Storage Management API.]
Uninstalls a set of disks.
Syntax
HRESULT UninstallDisks(
[in] VDS_OBJECT_ID *pDiskIdArray,
[in] ULONG ulCount,
[in] BOOLEAN bForce,
[out] BOOLEAN *pbReboot,
[out] HRESULT *pResults
);
Parameters
[in] pDiskIdArray
Address of a buffer containing an array of VDS object IDs, one for each disk to be uninstalled. Each ID in the array must be unique.
[in] ulCount
Number of VDS object IDs in the buffer that the pDiskIdArray parameter points to.
[in] bForce
If TRUE, VDS uninstalls the disks even if the volumes cannot be locked or dismounted.
[out] pbReboot
Address of a BOOLEAN variable that receives TRUE if the user must restart the computer to complete the uninstall process.
[out] pResults
The address of a caller-allocated array of HRESULT values. The number of elements in the array is pointed to by the pDiskIdArray parameter. The first element of this array corresponds to the first element in the pDiskIdArray, and so on. If any of the disks fails to initialize properly, the specific error code for the failure is returned in the corresponding element of this array.
Return value
This method can return standard HRESULT values, such as E_INVALIDARG or E_OUTOFMEMORY, and VDS-specific return values. It can also return converted system error codes using the HRESULT_FROM_WIN32 macro. Errors can originate from VDS itself or from the underlying VDS provider that is being used. Possible return values include the following.
Return code/value | Description |
---|---|
|
The disks were successfully uninstalled. |
|
This method returned a warning or error code for one or more disks. |
|
The disks were successfully uninstalled, but the GUID partition table (GPT) attributes could not be retrieved for one or more disks. |
|
VDS encountered an internal error. Check the event log for more information. |
|
One or more disks were missing. |
|
The path could not be retrieved for one or more disks. |
|
The path could not be retrieved for one or more volumes. |
|
One or more of the specified VDS object IDs correspond to disks that are no longer present. |
|
One or more of the specified VDS object IDs correspond to disks that do not exist. |
|
The provider's cache is not in sync with the driver cache. |
Remarks
VDS implements this method.
This method, which is synchronous, first uninstalls the volumes on the specified disks, and then uninstalls the disks. After the disks are uninstalled, the corresponding LUNs can be masked (hidden) or deleted.
This method cleans up the drive letters that were assigned to the volumes on the disks. In addition, it sets the volumes offline to prevent a volume from being remounted after the dismount handle has been closed but before the disk is actually removed.
When removing a dynamic volume that spans more than one disk, you must call this method instead of using device manager functions.
For instructions on how to uninstall a disk on Windows Server 2003 releases where the UninstallDisks method is not supported, see the Remarks section of the IVdsLun::SetMask method.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 R2 [desktop apps only] |
Target Platform | Windows |
Header | vds.h |
Library | Uuid.lib |