Exemplo n.º 1
0
 private static IntPtr GetFunctionPointer(IntPtr nativeLibraryHandle, string functionName)
 {
     return(MacNativeMethods.dlsym(nativeLibraryHandle, functionName));
 }
Exemplo n.º 2
0
 /// <summary>
 ///     Attempts to load a native library.
 /// </summary>
 /// <param name="path">Path of the library.</param>
 /// <param name="libraryName">Name of the library.</param>
 /// <param name="version">Version of the library.</param>
 /// <returns>
 ///     A handle to the library when found; otherwise, <see cref="IntPtr.Zero" />.
 /// </returns>
 /// <remarks>
 ///     This function may return a null handle. If it does, individual functions loaded from it will throw a
 ///     DllNotFoundException,
 ///     but not until an attempt is made to actually use the function (rather than load it). This matches how PInvokes
 ///     behave.
 /// </remarks>
 public static IntPtr LoadNativeLibrary(string libraryName)
 {
     return(MacNativeMethods.dlopen(libraryName, MacNativeMethods.RTLD_NOW));
 }