如何在驱动器/分区Win-Api 32上获得独占锁定? [英] How Can I Get Exclusive Lock On Drive / Partition Win-Api 32 ?

查看:75
本文介绍了如何在驱动器/分区Win-Api 32上获得独占锁定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何锁定特定驱动器上的锁定,直到我执行驱动器的某些操作。
当我在驱动器上捕获锁定时
..没有其他进程应该能够在该驱动器上写入,直到我释放锁定开车..





i找到了一个api ..即。 DeviceIoControl()..

但是..我只想在驱动器上访问我的进程..但是API'MAY'阻止访问所有进程!!



i我不太确定lockfile()和lockfileex()是如何工作的。!!

plz建议我用/ API / LOgic来做这个!!

谢谢!! :)

how to lock lock on specific drive till i perform some operation of drive.
when i have captured lock on drive .. no other process should able to write on that drive till i release lock on that drive..
.
.
i have found one api.. ie. DeviceIoControl()..
but.. i want access on drive my process only.. but above API 'MAY' block access of all the process!!
.
i am not quite sure how lockfile() and lockfileex() works..!!
plz suggest me some way / API/ LOgic to do this!!
thank you !! :)

推荐答案

你可以尝试 FSCTL_LOCK_VOLUME [ ^ ]。


这篇关于如何在驱动器/分区Win-Api 32上获得独占锁定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆