diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2004-12-23 10:35:24 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2004-12-23 10:35:24 +0000 |
commit | 198219ecff9c9b0f3e514b2e85d04768045350a6 (patch) | |
tree | 3f4639a210465f2e8ec1447be9765ffef058d5fa /sal | |
parent | 40183900c0b4c2d1dcc391bc5dcc6112f73fa52a (diff) |
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.
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/process.c | 41 |
1 files changed, 39 insertions, 2 deletions
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 @@ -236,6 +236,43 @@ oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const Ti } /*************************************************************************** + * 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. ***************************************************************************/ |