R
R
Recardo_Recoly2017-09-26 14:47:54
C++ / C#
Recardo_Recoly, 2017-09-26 14:47:54

How to call a method of one thread from another?

There is a 1st thread (ala DLL attack namely DllMain) and it creates another thread through _beginthread.
And the WndProc function is also hooked.
WndProc is called in the first thread (the same as DllMain) and here is the question.
How to call a function from WndProc so that it is executed by the thread that was created?
It's just that if it's direct, it will crash. I tried to make a BOOL variable and change it in 1 thread and check its value in the second one. It works somehow, but it's buggy and it seems like shit code.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex_ak1, 2017-09-26
@alex_ak1

What happens in the second chain? You cannot call it directly (after launch), you need to send a message to it in one way or another. Your boolean is what it is

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question