There is no explicit way to check if two descriptors belong to the same process. The only way is to request process information and check this, for example. using GetProcessIdon each descriptor to check process identifiers.
If you do not have the necessary rights to call the required request functions, you can try calling DuplicateHandleto get a new descriptor with a large number of access rights. However, if this fails, you cannot tell if the descriptors of the same process are being processed.
source
share