detach vhd by disk number

Viewed 160

I want to replace my system call of Powershell's Dismount-VHD -DiskNumber, with proper WinAPI. Unfortunately, as far as I can tell, the only way WinAPI provides for detaching a VHD is DetachVirtualDisk, which requires a handle returned by OpenVirtualDisk, which requires a path string, which I cannot use for VHDs that exist on network paths, because my program is (necessarily) not running as a domain user.

0 Answers
Related