Windows内核线程休眠KeSleep函数
2022-08-10
179
0
//传入的数据若为1000,则 睡眠的时间为: 1000 * 100 ns * 10 *1000 =1s
VOID KeSleep(LONG msec)
{
#define DELAY_ONE_MICROSECOND (-10)
#define DELAY_ONE_MILLISECOND (DELAY_ONE_MICROSECOND * 1000)
LARGE_INTEGER interval;//单位为100ns
interval.QuadPart = DELAY_ONE_MILLISECOND;
interval.QuadPart *= msec; //
KeDelayExecutionThread(KernelMode, FALSE, &interval);
}