-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DLL ordinal value function #638
Comments
Why is a FunctionMapper not sufficient for this purpose?
|
Because FunctionMapper can only translate function name, But ordinal value is not a string type.
lpProcName [in]
|
You should be able to make this work by writing a mapping for GetProcAddress() which takes an int/long ordinal as the second parameter, and then use the returned Pointer as the basis to create a Function object. I don’t think there’d have to be any native code involved.
|
Ok I see, Thank you. |
I require the same feature. Edit: The proposal indeed works. private interface Kernel32 extends Library {
public Pointer GetProcAddress(HMODULE hModule, long lpProcName);
}
...
Native.loadLibrary("xinput1_3.dll", Library.class);
HMODULE hModule = com.sun.jna.platform.win32.Kernel32.INSTANCE.GetModuleHandle("xinput1_3.dll");
Kernel32 kernel32 = (Kernel32) Native.loadLibrary(Kernel32.class);
Function function = Function.getFunction(kernel32.GetProcAddress(hModule, 100));
function.invoke(new Object[] { controllerId, cs }); |
Needed basic functions were merged as #705, #689 (comment) describes a way and provides code how this basic work can be used to create interface based bindings to ordinal value functions. |
Motivation: A new netty release was done Modifications: Upgrade to netty 4.1.104.Final Result: Use latest netty version
As we know, VC can hide function name in dll by ordinal value. I have checked the source code.
So I request a feature about ordinal value function support. Thank you.
The text was updated successfully, but these errors were encountered: