summaryrefslogtreecommitdiffstats
path: root/byterun/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/win32.c')
-rw-r--r--byterun/win32.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/byterun/win32.c b/byterun/win32.c
index d807f6900..5bb4fc153 100644
--- a/byterun/win32.c
+++ b/byterun/win32.c
@@ -502,3 +502,16 @@ void caml_install_invalid_parameter_handler()
}
#endif
+
+
+/* Recover executable name */
+
+int caml_executable_name(char * name, int name_len)
+{
+ int retcode;
+
+ int ret = GetModuleFileName(NULL, name, name_len);
+ printf("ret = %d, name = %s\n", ret, name); fflush(stdout);
+ if (0 == ret || ret >= name_len) return -1;
+ return 0;
+}