메모장 입니다2

Windows] KeDelayExecutionThread 본문

Study/Programming

Windows] KeDelayExecutionThread

Wooum@n 2017. 9. 5. 18:32

1.정의


 -유저모드의 Sleep()과 동일한 기능 제공.




2.정의


 NTSTATUS KeDelayExecutionThread(

  _In_ KPROCESSOR_MODE WaitMode,
  _In_ BOOLEAN         Alertable,
  _In_ PLARGE_INTEGER  Interval
);

WaitMode: KernelMode

BOOLEAN: FALSE

Interval:  LARGE_INTEGER.QuadPart = x * -10000000(초)




//DriverEntry

#define TIME_SECOND(x) x*10000000*-1



int i = 0;

LARGE_INTEGER timeout;


while (i<20)

{

KeDelayExecutionThread(KernelMode, FALSE, &timeout);

DbgPrintEx(DPFLTR_ACPI_ID, 0, "test...\n");

i++;

}