1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| VOID KThreadB(PVOID context) { LARGE_INTEGER sleeptime = { 0 }; PKEVENT pevent = (PKEVENT)context; sleeptime.QuadPart = -100 * 10 * 1000 * 3; while (1) { KeDelayExecutionThread(KernelMode, FALSE, &sleeptime); DbgPrint("Traggering envet\n"); KeSetEvent(pevent, IO_NO_INCREMENT, FALSE); } PsTerminateSystemThread(0); }
VOID KThreadA(PVOID context) { UNREFERENCED_PARAMETER(context); KeInitializeEvent(&kEvent, NotificationEvent, FALSE); HANDLE hThread = NULL; NTSTATUS status = PsCreateSystemThread(&hThread, 0, NULL, NULL, NULL, KThreadB, (PVOID)&kEvent); if (!NT_SUCCESS(status)) { DbgPrint("Create System Thread Failed\n"); } ZwClose(hThread); while (1) { KeWaitForSingleObject(&kEvent, Executive, KernelMode, FALSE, NULL); DbgPrint("Event Just Triggered\n"); KeResetEvent(&kEvent); } PsTerminateSystemThread(0); }
|