3.4.5.2.41.3 IVdsOpenVDisk::DetachAndDelete (Opnum 5)

The DetachAndDelete method removes the operating system disk device that represents a virtual disk and deletes any backing store file.

 HRESULT DetachAndDelete(
   [in] DETACH_VIRTUAL_DISK_FLAG Flags,
   [in] ULONG ProviderSpecificFlags
 );

Flags: A DETACH_VIRTUAL_DISK_FLAG (section 2.2.2.20.1.2) enumeration value that specifies how the virtual disk is to be detached.

ProviderSpecificFlags: Flags specific to the type of virtual disk being detached.<144>

Return Values: The method MUST return zero to indicate success, or return an implementation-specific nonzero error code to indicate failure.

When the server receives this message, it MUST validate the following parameters:

  • Verify that Flags contains a bitwise OR of values from the DETACH_VIRTUAL_DISK_FLAG enumeration.

The server MUST then perform the following in sequence:

  • Pass the input parameters to the operating system to detach the disk.

  • Delete the file associated with the virtual disk.

  • Return any success or a failure if either the detach or the delete failed.