Exemple #1
0
 private IntPtr LoadWithResolver(string name, PathResolver pathResolver)
 {
     if (Path.IsPathRooted(name))
     {
         return(CoreLoadNativeLibrary(name));
     }
     else
     {
         foreach (string loadTarget in pathResolver.EnumeratePossibleLibraryLoadTargets(name))
         {
             if (!Path.IsPathRooted(loadTarget) || File.Exists(loadTarget))
             {
                 IntPtr ret = CoreLoadNativeLibrary(loadTarget);
                 if (ret != IntPtr.Zero)
                 {
                     return(ret);
                 }
             }
         }
         return(IntPtr.Zero);
     }
 }
Exemple #2
0
 public NativeLibrary(LibraryLoader loader, PathResolver pathResolver, params string[] names)
 {
     _loader = loader;
     Handle  = _loader.LoadNativeLibrary(pathResolver, names);
 }