![](/img/trans.png)
[英]What would be the equivalent to the Windows API CreateEvent function in C#
[英]Is there a Windows driver function that does the equivalent of the Windows file api SeFileAttributes
My question is if there's a Windows Driver function that does the equivalent of the function SetFileAttributesA in the Windows file api. 如果有,我想知道它在 Microsoft 文档中的位置。
如果通过“Windows 驱动程序”function 您的意思是 function 您可以从/在 Kernel 模式代码中调用,那么是的,有一个。
function 是ZwSetInformationFile()
- 在wdm.h
中定义如下:
NTSYSAPI NTSTATUS NTAPI ZwSetInformationFile(__in HANDLE FileHandle, __out PIO_STATUS_BLOCK IoStatusBlock,
__in_bcount(Length) PVOID FileInformation, __in ULONG Length, __in FILE_INFORMATION_CLASS FileInformationClass);
您需要将FileInformationClass
参数设置为FileAttributeTagInformation
,其中FileInformation
参数指向FILE_ATTRIBUTE_TAG_INFORMATION
结构。
更多信息/文档可以在这里ZwSetInformationFile和FILE_ATTRIBUTE_TAG_INFORMATION 找到。
希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.