IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
NativeLibraryHandle.cs
Go to the documentation of this file.
1using System;
2using System.Runtime.InteropServices;
3
4namespace IKVM.Runtime
5{
6
7#if FIRST_PASS == false && IMPORTER == FALSE && EXPORTER == false
8
12 internal class NativeLibraryHandle : SafeHandle
13 {
14
19 internal NativeLibraryHandle(IntPtr handle) :
20 base(IntPtr.Zero, true)
21 {
22 SetHandle(handle);
23 }
24
26 public override bool IsInvalid => handle == IntPtr.Zero;
27
29 protected override bool ReleaseHandle()
30 {
31 NativeLibrary.Free(handle);
32 return true;
33 }
34
41 public NativeLibraryExport GetExport(string name, int argl = -1) => NativeLibrary.GetExport(handle, name, argl) is nint h and not 0 ? new NativeLibraryExport(this, h) : null;
42
43 }
44
45#endif
46
47}