summaryrefslogtreecommitdiff
path: root/platform/uwp
diff options
context:
space:
mode:
authorEmmanuel Leblond <emmanuel.leblond@gmail.com>2022-04-29 00:51:04 +0200
committerEmmanuel Leblond <emmanuel.leblond@gmail.com>2022-04-29 00:51:04 +0200
commit80f61352fb1b0bed251c06eb0a21a09374de77b3 (patch)
tree37e9cfe46ecd8757d3b21af2daea679194acccbf /platform/uwp
parent574bf0b91b848e6369d0a07a611d4decf88e668b (diff)
Add GDNativeInterface::get_library_path to GDExtension
Diffstat (limited to 'platform/uwp')
-rw-r--r--platform/uwp/os_uwp.cpp7
-rw-r--r--platform/uwp/os_uwp.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index 22a54911f9..5ce045eb20 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -733,10 +733,15 @@ static String format_error_message(DWORD id) {
return msg;
}
-Error OS_UWP::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {
+Error OS_UWP::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path, String *r_resolved_path) {
String full_path = "game/" + p_path;
p_library_handle = (void *)LoadPackagedLibrary((LPCWSTR)(full_path.utf16().get_data()), 0);
ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + full_path + ", error: " + format_error_message(GetLastError()) + ".");
+
+ if (r_resolved_path != nullptr) {
+ *r_resolved_path = full_path;
+ }
+
return OK;
}
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index f955be1da9..709bf16bec 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -233,7 +233,7 @@ public:
virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), bool p_multiline = false, int p_max_input_length = -1, int p_cursor_start = -1, int p_cursor_end = -1);
virtual void hide_virtual_keyboard();
- virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false);
+ virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false, String *r_resolved_path = nullptr);
virtual Error close_dynamic_library(void *p_library_handle);
virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false);