This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch crypto-174
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/crypto-174 by this push:
     new a9ad4bb0 Convert char * for Windows LoadlLibrary [skip ci]
a9ad4bb0 is described below

commit a9ad4bb0a24f8a972424364318cd6891d353019f
Author: Sebb <[email protected]>
AuthorDate: Mon Nov 6 22:05:12 2023 +0000

    Convert char * for Windows LoadlLibrary [skip ci]
---
 src/main/native/org/apache/commons/crypto/DynamicLoader.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/native/org/apache/commons/crypto/DynamicLoader.c 
b/src/main/native/org/apache/commons/crypto/DynamicLoader.c
index 4b3eccdc..186c1002 100644
--- a/src/main/native/org/apache/commons/crypto/DynamicLoader.c
+++ b/src/main/native/org/apache/commons/crypto/DynamicLoader.c
@@ -44,7 +44,10 @@ HMODULE open_library(JNIEnv *env)
 #endif
 
 #ifdef WINDOWS
-    openssl = LoadLibrary(TEXT("libcrypto-1_1-x64.dll")); // TEMP HACK
+    size_t liblen = strlen(libraryPath) + 1;
+    wchar_t* lib = (wchar_t *)malloc(liblen);
+    mbstowcs(lib, libraryPath, liblen); // convert for Windows call
+    openssl = LoadLibrary(lib);
 #endif
 
   }

Reply via email to