Thank you for a nice contribution with CoGetServerPid.
While investigating the code, I found that if the process ID is greater than what can be represented by an USHORT, an invalid process ID is returned (max USHORT).
If you happen to know about a solution to this problem, it would be highly appreciated.
Best regards,
Jøger