/// <summary>
        /// Loads method in the library
        /// </summary>
        /// <param name="symbolName">The methold of the library</param>
        /// <returns>method address</returns>
        private IntPtr LoadSymbol(string symbolName)
        {
            if (IsWindows)
            {
                return(WindowsLoader.GetProcAddress(Handle, symbolName));
            }

            throw new InvalidOperationException("Unsupported platform.");
        }
示例#2
0
 /// <summary>
 /// Loads method in the library
 /// </summary>
 /// <param name="symbolName">The methold of the library</param>
 /// <returns>method address</returns>
 private IntPtr LoadSymbol(string symbolName)
 {
     if (IsWindows)
     {
         return(WindowsLoader.GetProcAddress(Handle, symbolName));
     }
     if (IsLinux)
     {
         if (IsNetCore)
         {
             return(CoreCLRLoader.dlsym(Handle, symbolName));
         }
         return(LinuxLoader.dlsym(Handle, symbolName));
     }
     if (IsMacOSX)
     {
         return(MacOSXLoader.dlsym(Handle, symbolName));
     }
     throw new InvalidOperationException("Unsupported platform.");
 }