From 198219ecff9c9b0f3e514b2e85d04768045350a6 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Thu, 23 Dec 2004 10:35:24 +0000 Subject: INTEGRATION: CWS mhu05 (1.29.12); FILE MERGED 2004/11/27 14:58:12 mhu 1.29.12.2: #i37371# Added documentation reference to issue. 2004/11/25 18:28:53 mhu 1.29.12.1: #i37371# Added function 'osl_bootstrap_getExecutableFile_Impl()' for internal use by rtl_bootstrap functions. --- sal/osl/w32/process.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'sal') diff --git a/sal/osl/w32/process.c b/sal/osl/w32/process.c index b10ac416c..1974e5d68 100644 --- a/sal/osl/w32/process.c +++ b/sal/osl/w32/process.c @@ -2,9 +2,9 @@ * * $RCSfile: process.c,v $ * - * $Revision: 1.29 $ + * $Revision: 1.30 $ * - * last change: $Author: mhu $ $Date: 2004-11-03 14:37:35 $ + * last change: $Author: vg $ $Date: 2004-12-23 11:35:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -235,6 +235,43 @@ oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const Ti return osl_error; } +/*************************************************************************** + * osl_bootstrap_getExecutableFile_Impl(). + * + * @internal + * @see rtl_bootstrap + * @see #i37371# + * + ***************************************************************************/ + +oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl ( + rtl_uString ** ppFileURL +) SAL_THROW_EXTERN_C() +{ + oslProcessError result = osl_Process_E_NotFound; + + TCHAR buffer[MAX_PATH]; + DWORD buflen; + + if ((buflen = GetModuleFileNameW (0, buffer, MAX_PATH)) > 0) + { + rtl_uString * pAbsPath = 0; + rtl_uString_newFromStr_WithLength (&(pAbsPath), buffer, buflen); + if (pAbsPath) + { + /* Convert from path to url. */ + if (osl_getFileURLFromSystemPath (pAbsPath, ppFileURL) == osl_File_E_None) + { + /* Success. */ + result = osl_Process_E_None; + } + rtl_uString_release (pAbsPath); + } + } + + return (result); +} + /*************************************************************************** * Command Line Arguments. ***************************************************************************/ -- cgit v1.2.3