一个进程以独占方式打开CreateFile某个文件或设备后,是不是其他进程就没办法再访问该设备或文件了?除非等该进程退出?
解决方案 »
- 模拟键盘按下回车小程序
- 百思不得其解:子对话框中声明的连接、记录指针无效???!!!(在线等待)
- (全分送出!) dll访问数据库时网络断开应该捕捉什么类型的错误?
- 微软的Detours可以hook Com接口中的函数么?
- 请问哈有没有谁有与图像处理相关的外文翻译啊,做毕业设计!(英文版即可)
- Button求助!加分!!!!
- 请问如何在对话框中重绘主窗口?
- 菜鸟问题!
- 我做的对话框程序,在开始的时候没有加入winsock支持,现在要网络编程,该怎么办?
- 请问各位一个关于 EditBox 的小问题
- 命名空间(namespace)和对象目录(DirectoryObject)具体的区别是什么呢?
- 关于_endthread()后函数栈的析构
CreateFile等函数是否是要经过文件系统和磁盘设备驱动?
我能否绕过这些驱动,直接读写设备?
但是,如果你想禁止不正常情况,你可能需要在设备驱动里面过滤这些请求,具体的我也不知道
帮你顶顶吧
The requested sharing mode of the file or device, which can be read, write, both, delete, all of these, or none (refer to the following table). Access requests to attributes or extended attributes are not affected by this flag.If this parameter is zero and CreateFile succeeds, the file or device cannot be shared and cannot be opened again until the handle to the file or device is closed. For more information, see the Res section.You cannot request a sharing mode that conflicts with the access mode that is specified in an existing request that has an open handle. CreateFile would fail and the GetLastError function would return ERROR_SHARING_VIOLATION.To enable a process to share a file or device while another process has the file or device open, use a compatible combination of one or more of the following values. For more information about valid combinations of this parameter with the dwDesiredAccess parameter, see Creating and Opening Files.Note The sharing options for each open handle remain in effect until that handle is closed, regardless of process context.Value Meaning
0
0x00000000 Prevents other processes from opening a file or device if they request delete, read, or write access.