驱动中打印系统时间
2016-10-08 17:18
169 查看
在驱动中打印本地时间三个步骤:
1、在驱动中调用KeQuerySystemTime获取GMT系统时间
2、调用ExSystemTimeToLocalTime将GMT系统时间转换为本地系统时间
3、调用RtlTimeToTimeFields将本地时间转换为TIME_FIELDS结构体
TIME_FIELDS结构体定义如下:
typedef struct _TIME_FIELDS {
CSHORT Year; // range [1601...]
CSHORT Month; // range [1..12]
CSHORT Day; // range [1..31]
CSHORT Hour; // range [0..23]
CSHORT Minute; // range [0..59]
CSHORT Second; // range [0..59]
CSHORT Milliseconds;// range [0..999]
CSHORT Weekday; // range [0..6] == [Sunday..Saturday]
} TIME_FIELDS;
typedef TIME_FIELDS *PTIME_FIELDS;
实现如下:
CHAR szTime[128];
LARGE_INTEGER systemTime, localTime;
TIME_FIELDS timeField;
KeQuerySystemTime(&systemTime);
ExSystemTimeToLocalTime(&systemTime, &localTime);
RtlTimeToTimeFields(&localTime, &timeField);
sprintf("%d-%02d-%02d %02d:%02d:%02d:%03d",timeField.Year, timeField.Month, timeField.Day, timeField.Hour, timeField.Minute, timeField.Second, timeField.Milliseconds)
http://blog.csdn.net/eric_zl_zhang/article/details/6780786
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(294) | 评论(0) | 转发(0) |
0
上一篇:_beginthread, _beginthreadex (windows crt
下一篇:C2275 illegal use of this type as an expression
相关热门文章
Python 包管理工具解惑
Red Hat Linux 的主要系统目录...
APP开发报价单,如何计算APP报...
app开发需要多少钱
操作系统虚拟内存中的四种典型...
LNK1123: 转换到 COFF 期间失...
WIN7访问共享:0x80070035 找不...
Delphi 2010下载+完美破解...
vs2010调试C++程序时提示 无...
VISIO,不规则封闭图形填充方...
linux dhcp peizhi roc
关于Unix文件的软链接
求教这个命令什么意思,我是新...
sed -e "/grep/d" 是什么意思...
谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~
评论热议
1、在驱动中调用KeQuerySystemTime获取GMT系统时间
2、调用ExSystemTimeToLocalTime将GMT系统时间转换为本地系统时间
3、调用RtlTimeToTimeFields将本地时间转换为TIME_FIELDS结构体
TIME_FIELDS结构体定义如下:
typedef struct _TIME_FIELDS {
CSHORT Year; // range [1601...]
CSHORT Month; // range [1..12]
CSHORT Day; // range [1..31]
CSHORT Hour; // range [0..23]
CSHORT Minute; // range [0..59]
CSHORT Second; // range [0..59]
CSHORT Milliseconds;// range [0..999]
CSHORT Weekday; // range [0..6] == [Sunday..Saturday]
} TIME_FIELDS;
typedef TIME_FIELDS *PTIME_FIELDS;
实现如下:
CHAR szTime[128];
LARGE_INTEGER systemTime, localTime;
TIME_FIELDS timeField;
KeQuerySystemTime(&systemTime);
ExSystemTimeToLocalTime(&systemTime, &localTime);
RtlTimeToTimeFields(&localTime, &timeField);
sprintf("%d-%02d-%02d %02d:%02d:%02d:%03d",timeField.Year, timeField.Month, timeField.Day, timeField.Hour, timeField.Minute, timeField.Second, timeField.Milliseconds)
http://blog.csdn.net/eric_zl_zhang/article/details/6780786
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(294) | 评论(0) | 转发(0) |
0
上一篇:_beginthread, _beginthreadex (windows crt
下一篇:C2275 illegal use of this type as an expression
相关热门文章
Python 包管理工具解惑
Red Hat Linux 的主要系统目录...
APP开发报价单,如何计算APP报...
app开发需要多少钱
操作系统虚拟内存中的四种典型...
LNK1123: 转换到 COFF 期间失...
WIN7访问共享:0x80070035 找不...
Delphi 2010下载+完美破解...
vs2010调试C++程序时提示 无...
VISIO,不规则封闭图形填充方...
linux dhcp peizhi roc
关于Unix文件的软链接
求教这个命令什么意思,我是新...
sed -e "/grep/d" 是什么意思...
谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~
评论热议
相关文章推荐
- 驱动中打印系统时间
- printk打印加入系统流逝时间
- linux shell脚本实现:每10秒打印一次系统时间,连续打印10次
- 生成随机数 打印系统时间 方法
- 获取系统时间(精确到微秒),驱动中KeQueryPerformanceCounter,Win32程序QueryPerformanceCounter
- DTrace tricks and tips (1) - 打印当前系统时间
- Windows 驱动:获取系统当前时间,生成格式字符串
- windows控制台程序下打印彩色字和获取系统时间的函数
- linux驱动层获取当前的系统时间
- Windows 驱动:获取系统当前时间,生成格式字符串
- iOS中打印日志显示系统详细时间,类名,行号,函数名,线程,及打印值
- 获取系统时间(精确到微秒),驱动中KeQueryPerformanceCounter,Win32程序QueryPerformanceCounter
- shell打印系统时间
- java打印出的时间与系统时间相差八小时
- shell 脚本每隔一段时间打印当前系统时间
- 七、 在驱动中获取系统时间
- date,打印或设置系统的日期与时间
- WDM驱动中如何获得当前系统时间
- 【转载】获取系统时间(精确到微秒),驱动中KeQueryPerformanceCounter,Win32程序QueryPerformanceCounter
- 读取系统时间作为seed 随机打印数字