How to specify the type of (delegate) pointers without modified the .h file #2198
Unanswered
where where (wherewhere)
asked this question in
Q&A
Replies: 1 comment
|
Find it. Use But the anonymous function pointers need to define one by one... #include "jni.h"
// JNIInvokeInterface
typedef jint(JNICALL* InputJavaVM)(JavaVM* vm);
typedef jint(JNICALL* InputJavaVMWithArgs)(JavaVM* vm, JNIEnv* penv, JavaVMAttachArgs* args);
typedef jint(JNICALL* InputJavaVMWithVersion)(JavaVM* vm, JNIEnv* penv, jint version); |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In
jni.h, it has some structs with function pointer members:When use
WinmdGeneratorto generate it, it become:And then when it becomes to
winmd, theNativeTypeNameis missing:Which generated by
C#/Win32is:The type is only has
nint.I see the emums has
enums.jsonto specify numbers to the enums, such as:{ "$schema": "https://github.com/microsoft/win32metadata/raw/main/generation/WinSDK/enums.schema.json", "items": [ { "namespace": "Java.Runtime.Native", "name": "JNI_ERROR", "autoPopulate": { "filter": "JNI_OK|JNI_E", "header": "jni.h" }, "uses": [ { "method": "JNI_GetDefaultJavaVMInitArgs", "parameter": "return" }, { "method": "JNI_CreateJavaVM", "parameter": "return" }, { "method": "JNI_GetCreatedJavaVMs", "parameter": "return" } ] } ] }Is that other types have these settings?
By the way, it will be better if the
void*can be specified types like enums. Such aswhich
void**should beJNIEnv**.All reactions