what is the best way to communicate with events using a while loop.

  • Thread starter Thread starter Frankooo
  • Start date Start date
F

Frankooo

Guest
VOID DriverLoop() {

while (TRUE)
{
DbgPrintEx(0, 0, "running waiting for a command to execute.. \n");





LARGE_INTEGER Timeout;
Timeout.QuadPart = RELATIVE(SECONDS(1));
KeDelayExecutionThread(KernelMode, FALSE, &Timeout);
}
}

this is what i have for now, i used to send string commands but it was slow and not reliable enough because sometimes it reads something like "Reade" and my string is actually "Read" and sometimes it doesn't read anything. and am sure am sending and comparing without the "\0" terminator so idk what is the issue with that. but now as i can send events how could i check if an event is signaled or not like i was thinking of creating something like this ...


VOID DriverLoop() {

while (TRUE)
{
DbgPrintEx(0, 0, "running waiting for a command to execute.. \n");


// check if a certain event was triggered
// and if yes then do whatever here.
// and repeat that check for multiple events.


LARGE_INTEGER Timeout;
Timeout.QuadPart = RELATIVE(SECONDS(1));
KeDelayExecutionThread(KernelMode, FALSE, &Timeout);
}
}

Continue reading...
 
Back
Top