I have a minifilter and a simple C++ client that connects to this minifilter over a port. The client receives and sends message to minifilter using FilterGetMessage
and FilterSendMessage
. The client receives a message from the minifilter, performs tasks foo
, updates the minifilter about the status by calling FilterSendMessage
and waits for another message. Things were working fine.
Recently, I moved the function (foo
) that calls FilterSendMessage
to a detached thread e.g. std::thread(foo, ...).detach()
. Now when foo
is called by the client, FilterSendMessage
blocks indefinitely. I also don’t see the log message from MessageNotifyCallback. I am assuming that calling foo
from a detached thread has caused this but I can’t be sure.
foo
communicates over the network and can have quite large latency. I don’t want to wait for it to finish before calling the FilterGetMessage again. Hence, it was called from a detached thread.
So the question is, is it possible to call FilterSendMessage
from a detached thread? If not, I’d like to know the details. Docs don’t mention much. If yes, then I need to debug more.
PS: I am very new to the Win32 platform. Mostly a Linux developer.