From 58e99bd087a837288e96f6f5d797cc0852669690 Mon Sep 17 00:00:00 2001 From: Alain Frisch Date: Tue, 18 Jun 2013 10:25:01 +0000 Subject: #4719: use GetModuleFileName to get an absolute path to the current executable under Windows. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13799 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- byterun/win32.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'byterun/win32.c') diff --git a/byterun/win32.c b/byterun/win32.c index d807f69003..5bb4fc1532 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; +} -- cgit v1.2.1