I have the following scenario where the dwThreadId of
PROCESS_INFORMATION does not match the corresponding dwProcessId.
This is what I do.
Code:
--------------------
LPSECURITY_ATTRIBUTES psa = 0;
PROCESS_INFORMATION pi = {0};
STARTUPINFO* ps = 0;
STARTUPINFO si = {0};
si.cb = sizeof (STARTUPINFO);
si.dwFlags = 1;
si.wShowWindow = wShow;
ps = &si;
if (::CreateProcess (TEXT ("\\windows\\wceload.exe") ,TEXT ("/silent \"my.cab\""), psa, 0, FALSE, 0, 0, 0, ps, &pi))
{
LOG (TEXT ("Process Id for wceload=[%x]"), pi.dwProcessId);
LOG (TEXT ("Thread Id for wceload=[%x]"), pi.dwThreadId);
// Rest of the logic goes here.
}
--------------------
Now in my log file, I get