public static bool GetHandleType(IntPtr handle, int processId, out SystemHandleType handleType)
        {
            string token = GetHandleTypeToken(handle, processId);

            if (handleTypeTokens.ContainsKey(token))
            {
                handleType = handleTypeTokens[token];
                return(true);
            }
            handleType = SystemHandleType.Unknown;
            return(false);
        }
Exemple #2
0
 private static bool GetHandleTypeFromToken(string token, out SystemHandleType handleType)
 {
     for (int i = 1; i < handleTypeTokenCount; i++)
     {
         if (handleTypeTokens[i] == token)
         {
             handleType = (SystemHandleType)i;
             return(true);
         }
     }
     handleType = SystemHandleType.OB_TYPE_UNKNOWN;
     return(false);
 }
Exemple #3
0
        private static bool GetHandleType(IntPtr handle, out SystemHandleType handleType)
        {
            string token = GetHandleTypeToken(handle);

            return(GetHandleTypeFromToken(token, out handleType));
        }