Coder Social home page Coder Social logo

windows-driver's Introduction

Windows-Driver

Windows驱动编程

.
|
|-- MT-Callback         // 回调函数
|
|-- MT-CheckTime        // 本地时间校验驱动
|
|-- MT-Communication	// 驱动层&应用层通信
|
|-- MT-KillProcess	// 杀死进程驱动
|
|-- MT-Test		// 演示驱动
|
|-- MT-FSDHook          // FSD钩子
|
|-- MT-InlineHook       // InlineHook钩子
|
|-- MT_Keyboard         // 键盘过滤驱动
|
|-- MT_Thread           // 内核线程驱动
|
.

windows-driver's People

Contributors

g4rb3n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

windows-driver's Issues

MTDriver_CheckTime得出来的时间戳不准确

在XP和win7下测试,得出来的时间戳都不准确,比正确时间戳晚了很多。以下为修正后代码:
`#include <ntddk.h>

const unsigned char g_day_per_mon[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

/*

  • 功能:
  • 判断是否是闰年
    
  • 参数:
  • year:需要判断的年份数
    
  • 返回值:
  • 闰年返回1,否则返回0
    

*/
unsigned char applib_dt_is_leap_year(unsigned short year)
{
if ((year % 400) == 0) {
return 1;
} else if ((year % 100) == 0) {
return 0;
} else if ((year % 4) == 0) {
return 1;
} else {
return 0;
}
}

/*

  • 功能:
  • 得到每个月有多少天
    
  • 参数:
  • month:需要得到天数的月份数
    
  • year:该月所对应的年份数
    
  • 返回值:
  • 该月有多少天
    

*/
unsigned char applib_dt_last_day_of_mon(unsigned char month, unsigned short year)
{
if ((month == 0) || (month > 12)) {
return g_day_per_mon[1] + applib_dt_is_leap_year(year);
}

if (month != 2) {
    return g_day_per_mon[month - 1];
} else {
    return g_day_per_mon[1] + applib_dt_is_leap_year(year);
}

}
// 日期转时间戳
int TimeStamp()
{
LARGE_INTEGER snow, now, tickcount;
TIME_FIELDS now_fields;
unsigned short i = 0;
unsigned int no_of_days = 0;
int utc_time = 0;
UINT16 iYear,iMonth,iDay,iHour,iMin,iSec;
// 获取标准时间
KeQuerySystemTime(&snow);

// 转换为当地时间
ExSystemTimeToLocalTime(&snow, &now);

// 整理出年、月、日、时、分、秒
RtlTimeToTimeFields(&now, &now_fields);

// 打印年月日
DbgPrint("NowTime : %4d-%2d-%2d %2d:%2d:%2d\n", 
	now_fields.Year, now_fields.Month, now_fields.Day, 
	now_fields.Hour, now_fields.Minute, now_fields.Second);


iYear=now_fields.Year;
iMonth=now_fields.Month;
iDay=now_fields.Day;
iHour=now_fields.Hour;
iMin=now_fields.Minute;
iSec=now_fields.Second;

/* year */
for (i = 1970; i < iYear; i++) {
    no_of_days += (365 + applib_dt_is_leap_year(i));
}

/* month */
for (i = 1; i < iMonth; i++) {
    no_of_days += applib_dt_last_day_of_mon((unsigned char) i, iYear);
}

/* day */
no_of_days += (iDay - 1);

/* sec */
utc_time = (unsigned int) no_of_days * 86400 + (unsigned int) (iHour * 3600 +iMin * 60 + iSec);

utc_time -= 3600*8;

return utc_time;

}`

Windows on ARM, Support?

Please let us know when can we have an ARM64 version for Windows on ARM OS. We can help you test We have Windows on Rasberry Pi setup. Please pursue it we at Windows on Rasberry Pi community will be glad to extend support in testing your drivers and tools for ARM64.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.