#include"ntddk.h"
#include"Ntstrsafe.h"
VOID xiezai1(PDRIVER_OBJECT qudongduixiang)
{
KdPrint(("已经执行到了 驱动卸载历程\n"));
}
PWCHAR huoqudangqianshijian()//获取当前时间
{
LARGE_INTEGER shijian1_biaozhuen, shijian2_dangdi;
static WCHAR zifuchuan1[32] = { 0 };
TIME_FIELDS shijian_zhenggui;
KeQuerySystemTime(&shijian1_biaozhuen);//查询系统时间 标准时间
ExSystemTimeToLocalTime(&shijian1_biaozhuen, &shijian2_dangdi);//转换成当地时间
RtlTimeToTimeFields(&shijian2_dangdi, &shijian_zhenggui);
KdPrint(("%d年%d月%d日%d时%d分%d秒", shijian_zhenggui.Year, shijian_zhenggui.Month, shijian_zhenggui.Day, shijian_zhenggui.Hour, shijian_zhenggui.Minute, shijian_zhenggui.Second));
//RtlStringCchPrintfW(zifuchuan1, 32,L"%d年", shijian_zhenggui.Year);
return zifuchuan1;
}
NTSTATUS DriverEntry(PDRIVER_OBJECT qudongduixiang, PUNICODE_STRING zhucebiao1)
{
huoqudangqianshijian();
qudongduixiang->DriverUnload = xiezai1;
return STATUS_SUCCESS;
}