本文介绍了如何删除从内核模式的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个微过滤器(内核模式)。我想删除特定路径的文件(\\设备\\ HarddiskVolume1 \\ file.txt的或C:\\ file.txt的)从内核模式
I have a minifilter (kernel-mode). I want to delete a file with specific path (\Device\HarddiskVolume1\file.txt or C:\file.txt) from kernel-mode
有没有办法做到这一点?
Is there any way to do that?
更新:20150130
我尝试使用为Harry约翰斯顿说。这是我的codeS:
I try to use ZwDeleteFile routine as Harry Johnston said. These are my codes:
RtlInitUnicodeString(&gRedirectFullFilePath, "\\Device\\HarddiskVolume1\\test.txt"); // This file existed
InitializeObjectAttributes(&ObjectAttribute, &gRedirectFullFilePath, OBJ_CASE_INSENSITIVE, NULL, NULL);
status = ZwDeleteFile(&ObjectAttribute);
但它崩溃我的系统。有什么毛病我codeS? =>固定的(这是答案)
But it crash my system. Is there anything wrong with my codes? => fixed (This is answer)
谢谢!
推荐答案
的:
该ZwDeleteFile程序删除该文件。
这篇关于如何删除从内核模式的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!