diff options
Diffstat (limited to 'src/native/windows/WindowsDynamicLinkerImpl_JNI.c')
-rw-r--r-- | src/native/windows/WindowsDynamicLinkerImpl_JNI.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/native/windows/WindowsDynamicLinkerImpl_JNI.c b/src/native/windows/WindowsDynamicLinkerImpl_JNI.c index ef94bb0..1874b30 100644 --- a/src/native/windows/WindowsDynamicLinkerImpl_JNI.c +++ b/src/native/windows/WindowsDynamicLinkerImpl_JNI.c @@ -94,4 +94,20 @@ Java_jogamp_common_os_WindowsDynamicLinkerImpl_LoadLibraryW(JNIEnv *env, jclass return (jlong) (intptr_t) _res; } +/* + * Class: jogamp_common_os_WindowsDynamicLinkerImpl + * Method: GetModuleFileNameA + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_jogamp_common_os_WindowsDynamicLinkerImpl_GetModuleFileNameA(JNIEnv *env, jclass _unused, jlong hModule) { + TCHAR tpath[PATH_MAX+1]; + memset(tpath, 0, PATH_MAX+1); + DWORD size = GetModuleFileNameA((HANDLE) (intptr_t) hModule, (LPTSTR)&tpath, PATH_MAX); + if( 0 == size ) { + return NULL; + } + return (*env)->NewStringUTF(env, tpath); +} + |