Y
Yaniv M
Hi,
My goal is to verify that a process is alive, therefore I use the
GetPriorityClass function, if this API function succeed it means that the
searched process is alife, otherwise it died.
The problem is that in Windows 2003 this function returns success even if
the process is dead.
Why it happens in Win2003? What is the way to solve this problem? Is there
any other way to check if the process alive?
Thanks,
Yaniv M
DWORD GetPriorityClass(
HANDLE hProcess // handle to process
);
code example:
HANDLE hProc;
//this line was add to support work with windows 2000.
hProc = OpenProcess(PROCESS_QUERY_INFORMATION , FALSE ,
process_info.dwProcessId);
// we can check if(hProc != NULL)
if((GetPriorityClass(hProc) == 0 ) && (app_type != WOW_16_BIT_APP ))
{
sprintf(logstr,"Process %s %s died",exefile, name==NULL?"":name);
}
else
{
// the process is alive.
}
My goal is to verify that a process is alive, therefore I use the
GetPriorityClass function, if this API function succeed it means that the
searched process is alife, otherwise it died.
The problem is that in Windows 2003 this function returns success even if
the process is dead.
Why it happens in Win2003? What is the way to solve this problem? Is there
any other way to check if the process alive?
Thanks,
Yaniv M
DWORD GetPriorityClass(
HANDLE hProcess // handle to process
);
code example:
HANDLE hProc;
//this line was add to support work with windows 2000.
hProc = OpenProcess(PROCESS_QUERY_INFORMATION , FALSE ,
process_info.dwProcessId);
// we can check if(hProc != NULL)
if((GetPriorityClass(hProc) == 0 ) && (app_type != WOW_16_BIT_APP ))
{
sprintf(logstr,"Process %s %s died",exefile, name==NULL?"":name);
}
else
{
// the process is alive.
}