diff --git a/CHANGES.md b/CHANGES.md index 0ba882e459..0088b30426 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Features * [#1471](https://github.com/java-native-access/jna/pull/1471): Add `c.s.j.p.win32.Advapi32Util#isCurrentProcessElevated` and associated Types - [@dbwiddis](https://github.com/dbwiddis). * [#1474](https://github.com/java-native-access/jna/pull/1474): Add `c.s.j.p.win32.WbemCli#IWbemClassObject.IWbemQualifierSet`, `IWbemServices.GetObject`, `IWbemContext.SetValue` and associated methods - [@rchateauneu](https://github.com/rchateauneu). * [#1482](https://github.com/java-native-access/jna/pull/1482): Add multilingual support of `Kernel32Util.formatMessage` - [@overpathz](https://github.com/overpathz). +* [#1490](https://github.com/java-native-access/jna/pull/1490): Adds support for a custom `SymbolProvider` in `NativeLibrary` - [@soywiz](https://github.com/soywiz). Bug Fixes --------- diff --git a/src/com/sun/jna/Library.java b/src/com/sun/jna/Library.java index ce7dcbc8d3..3b79fabde0 100644 --- a/src/com/sun/jna/Library.java +++ b/src/com/sun/jna/Library.java @@ -114,6 +114,11 @@ public interface Library { */ String OPTION_CLASSLOADER = "classloader"; + /** + * Supports a custom symbol provider for the NativeLibrary (see {@link SymbolProvider}) + */ + String OPTION_SYMBOL_PROVIDER = "symbol-provider"; + static class Handler implements InvocationHandler { static final Method OBJECT_TOSTRING; diff --git a/src/com/sun/jna/NativeLibrary.java b/src/com/sun/jna/NativeLibrary.java index d7bd902110..9edcf6b8cb 100644 --- a/src/com/sun/jna/NativeLibrary.java +++ b/src/com/sun/jna/NativeLibrary.java @@ -96,6 +96,8 @@ public class NativeLibrary implements Closeable { private final Map functions = new HashMap(); final int callFlags; private String encoding; + private SymbolProvider symbolProvider; + private SymbolProvider defaultSymbolProvider; final Map options; private static final Map> libraries = new HashMap>(); @@ -123,6 +125,17 @@ private NativeLibrary(String libraryName, String libraryPath, long handle, Map