-
-
[求助]想通过dlsym(),调用libdvm.so中的dvmDecodeIndirectRef()函数,不知该如何声明函数形变量?
-
发表于:
2014-9-28 11:49
15845
-
[求助]想通过dlsym(),调用libdvm.so中的dvmDecodeIndirectRef()函数,不知该如何声明函数形变量?
想通过dlopen()及dlsym(),动态加载libdvm.so库,并调用其中的dvmDecodeIndirectRef()函数。
在android源代码中找到 dvmDecodeIndirectRef函数定义如下:
Object* dvmDecodeIndirectRef(Thread* self, jobject jobj);
在自己的.CPP程序中定义函数形变量:
typedef Object* PObject;
typedef PObject (*PMETH_dvmDecodeIndirectRef)(Thread* self, jobject jobj);
PMETH_dvmDecodeIndirectRef meth_dvmDecodeIndirectRef;
代码执行时情况如下:
void *ldvm = (void*)dlopen("libdvm.so", RTLD_LAZY); <<<<<<<ldvm 值能正常得到
meth_dvmDecodeIndirectRef = (PMETH_dvmDecodeIndirectRef)dlsym(ldvm, "dvmDecodeIndirectRef"); <<<<<meth_dvmDecodeIndirectRef值为0
并未取得该函数指针,不明白是哪里的问题?是定义部分错了吗?
谢谢!
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课