How to check if process is still running on Windows server 2008? RRS feed

  • Question

  • We have two services: one service is 32-bit (process1) and the other is 64-bit (process2). We have code that process1 is using to check if process2 is running:

        HANDLE hProcess;

        hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, ProcessId);
        if (hProcess == NULL) {
            return FALSE;
        return TRUE;

    This code works fine in Windows server 2003 but doesn't work in Windows server 2008. Any ideas?

    I read about Session0 for services that was introduced in win2008 but in our case both are services, so there shouldn't be any access problems.

    I found this thread: which states that 32-bit process cannot access 64-bit process anymore. What can be done here?

    Monday, January 4, 2010 9:49 AM

All replies

  • Hi there,

    You cannot open a 64 bit process from a 32 bit process . Make sure your applicaiton is 64bit .

    can you compile your applicaiton as 64 bit and test ?

    Friday, January 8, 2010 4:48 AM