Windows API 第21篇 DeleteVolumeMountPoint 删除挂载点

本文详细解析了Windows API函数DeleteVolumeMountPoint的使用方法,包括其参数、返回值及注意事项,通过示例代码展示了如何删除指定的卷挂载点。

函数原型:
BOOL DeleteVolumeMountPoint(
                                                      LPCTSTR lpszVolumeMountPoint  // volume mount point path
                                                   );

参数:
lpszVolumeMountPoint  :挂载点路径,必须以反斜杠'\'结尾。

[in] Pointer to a string that indicates the volume mount point to be unmounted. This may be a root directory (X:\, in which case the DOS drive letter assignment is removed) or a directory on a volume (X:\mnt\). A trailing backslash is required.
Remarks

It is not an error to attempt to unmount a volume from a volume mount point when there is no volume actually mounted at that volume mount point.

举例说明:

//删除上一节子为F盘设置的挂载点C:\\share\\

CHAR szVolumeMountPoint[] = "C:\\share\\";

BOOL bRet = DeleteVolumeMountPoint(szVolumeMountPoint);

if (bRet)

{

        printf("success");

       //............

}

 

转载于:https://www.cnblogs.com/priarieNew/p/9755496.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值