How to compare WIN32 HANDLEs ? RRS feed

  • Question

  • Is there a WIN32 API for comparing handles ? I need to figure out if 2 handles represent the same kernel object.
    Monday, February 1, 2010 1:11 PM

All replies

  • Under most circumstances, the value of the handles will be the same so you can just compare them.  If for some reason you have circumstances where they could be different and if the object is a named object, you can use the semi-documented NtQueryObject using the undocumented ObjectNameInformation parameter to get the name of the object.  It comes with the standard disclaimer for undocumented functions that it may not always work in future versions.
    Monday, February 1, 2010 7:43 PM