Hello,
Once again, I have problem.
I created an DLL that sets few hooks into target application. But I have problem with one function. Let's call it ParseData.
I hooked this function and any data coming through are displayed in ListCtrl.
I have 3 classes that actually calls this function.
The first master class passes address of the ParseData to 2 remaining classes.
Like:
...
*(DWORD*)&ParseData = m_pParseDataAddress;
m_SomeDlg->SetParseDataFunction(m_pParseDataAddress);
m_Para.SetParseDataFunction(m_pParseDataAddress);
...
When m_SomeDlg calls ParseData, it goes though hook and data are displayed in ListCtrl.
m_Para however creates new thread at some point via command:
...
if( strcmp(chCommand, "Load") == 0)
{
Init();
m_bActivated = true;
_beginthread((void (__cdecl *)(void *))&ProcThreadAddr, 0, (void*)this);
}
...
void __cdecl CPara::ProcThreadAddr(CPara * ParaPtr)
{
ParaPtr->MainThread();
_endthread();
}
In MainThread there is a while loop which checks if m_bActivated = true.
However any calls to ParseData from this thread aren't displayed in hook (Data is parsed however)
When I call ParseData from any place, data is displayed in hook, but when I call it from MainThread it doesn't display anything.
That's actually pretty strange for me.
Thank you for your help.