Question

The code below is working superbly, but now I want to generalize it, as GetNamedPipeClientProcessID is only compatible with Windows Vista and above. What alternative options do I have that support windows XP?

bRet = GetNamedPipeClientProcessId(hIn, &ClientID);
if (FALSE == bRet)
{
        printf("\nGetNamedPipeClientProcessId FAILED\n");
    CloseHandle(Overlapped.hEvent);
    CloseHandle(hIn);
    return 1;
}
Was it helpful?

Solution

If you handle the protocol, when the connection is established send a packet with the process id and read it in the other endpoint.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top