windows driver 获取文件属性
2024-10-08 16:28:49
OBJECT_ATTRIBUTES oa;
FILE_NETWORK_OPEN_INFORMATION fnoi;
UNICODE_STRING strPath = RTL_CONSTANT_STRING(L"\\??\\E:\\安装软件\\win7旗舰版.iso");
LARGE_INTEGER li_temp; char strTime[ArrayLength] = {0};
ANSI_STRING as;
TIME_FIELDS tf;
InitializeObjectAttributes(&oa, &strPath, OBJ_KERNEL_HANDLE, NULL, NULL);
ZwQueryFullAttributesFile(&oa, &fnoi); ExSystemTimeToLocalTime(&fnoi.CreationTime, &li_temp);
RtlTimeToTimeFields(&li_temp, &tf);
RtlInitEmptyAnsiString(&as, strTime, ArrayLength);
RtlStringCbPrintfA(as.Buffer, ArrayLength, "%d-%d-%d %d:%d:%d\n", tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second);
KdPrint(("创建时间:%s\n", as.Buffer)); ExSystemTimeToLocalTime(&fnoi.LastWriteTime, &li_temp);
RtlTimeToTimeFields(&li_temp, &tf);
RtlInitEmptyAnsiString(&as, strTime, ArrayLength);
RtlStringCbPrintfA(as.Buffer, ArrayLength, "%d-%d-%d %d:%d:%d\n", tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second);
KdPrint(("修改时间:%s\n", as.Buffer)); ExSystemTimeToLocalTime(&fnoi.LastAccessTime, &li_temp);
RtlTimeToTimeFields(&li_temp, &tf);
RtlInitEmptyAnsiString(&as, strTime, ArrayLength);
RtlStringCbPrintfA(as.Buffer, ArrayLength, "%d-%d-%d %d:%d:%d\n", tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second);
KdPrint(("访问时间:%s\n", as.Buffer)); KdPrint (("文件大小:%I64d", fnoi.AllocationSize.QuadPart));
版权声明:本文为博主原创文章,未经博主允许不得转载。
最新文章
- Linux 查找文件并删除文件内容
- img和css背景的选择
- XML 解析器
- 如何为libs目录下的jar包关联源代码
- LeetCode10 Regular Expression Matching
- Android系统SVC命令教程
- jquery中json数据转换为字典
- My.Ioc 代码示例——实现自动注册/解析
- collections——高性能容器数据类型
- Spinner样式大全
- java自学者的福音
- 分布式配置管理--百度disconf搭建过程和详细使用
- [技术]浅谈c++ this指针
- tr 命令详解
- HDU ACM 2066 一个人的旅行
- 转载 .Net多线程编程—任务Task https://www.cnblogs.com/hdwgxz/p/6258014.html
- magrittr管道操作符使用解释(一)
- java 软件开发面试宝典
- LCD显示——点阵字体
- 敏捷项目管理架构(APMF)