Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SetDllImportResolver()

static void System.Runtime.InteropServices.NativeLibrary.SetDllImportResolver ( Assembly assembly,
DllImportResolver resolver )
inlinestatic

Definition at line 118 of file NativeLibrary.cs.

119 {
120 if (assembly == null)
121 {
122 throw new ArgumentNullException("assembly");
123 }
124 if (resolver == null)
125 {
126 throw new ArgumentNullException("resolver");
127 }
128 if (!assembly.IsRuntimeImplemented())
129 {
130 throw new ArgumentException(SR.Argument_MustBeRuntimeAssembly);
131 }
132 if (s_nativeDllResolveMap == null)
133 {
135 }
136 try
137 {
138 s_nativeDllResolveMap.Add(assembly, resolver);
139 }
140 catch (ArgumentException)
141 {
142 throw new InvalidOperationException(SR.InvalidOperation_CannotRegisterSecondResolver);
143 }
144 }
static ConditionalWeakTable< Assembly, DllImportResolver > s_nativeDllResolveMap
static int CompareExchange(ref int location1, int value, int comparand)

References System.SR.Argument_MustBeRuntimeAssembly, System.Threading.Interlocked.CompareExchange(), System.SR.InvalidOperation_CannotRegisterSecondResolver, System.Reflection.Assembly.IsRuntimeImplemented(), and System.Runtime.InteropServices.NativeLibrary.s_nativeDllResolveMap.