windows driver 获取文件属性
2014-11-13 20:21
141 查看
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));
相关文章推荐
- windows driver 获取文件属性
- Windows批处理中获取文件属性的一些方法
- 背水一战 Windows 10 (86) - 文件系统: 获取文件夹的属性, 获取文件夹的缩略图
- 【万里征程——Windows App开发】文件&数据——获取文件属性
- 2.通过原始的Driver接口通过读取Properties属性文件获取JDBC数据库连接Connection
- 如何在windows下和linux下获取文件(如exe文件)的详细信息和属性
- 2.通过原始的Driver接口通过读取Properties属性文件获取JDBC数据库连接Connection
- 【万里征程——Windows App开发】文件&数据——获取文件属性
- Windows平台C语言获取文件的一些属性
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)
- FileInfo 0.0.0005--masm32写的获取文件属性、版本、时间、MD5、SHA1 等信息的小程序
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(二)
- Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(一)
- [Python]获取文件属性
- poi读取文件,并获取相应属性 (java操作Excel文件)
- 在VC++下对文件属性的获取与更改
- [导入]Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)(二)
- 调用windows文件属性对话框
- 如何获取现有文件的ContentType属性
- FileInfo 0.0.0003--masm32写的获取文件属性、版本、时间、MD5值等信息的小程序