1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 //
5 // Implements System.Type
6 //
7 // ======================================================================================
8 
9 using System;
10 using Internal.Runtime.Augments;
11 
12 namespace System
13 {
14     internal static class Helpers
15     {
TryGetEEType(this Type type, out EETypePtr eeType)16         public static bool TryGetEEType(this Type type, out EETypePtr eeType)
17         {
18             RuntimeTypeHandle typeHandle = RuntimeAugments.Callbacks.GetTypeHandleIfAvailable(type);
19             if (typeHandle.IsNull)
20             {
21                 eeType = default(EETypePtr);
22                 return false;
23             }
24             eeType = typeHandle.ToEETypePtr();
25             return true;
26         }
27     }
28 }
29