diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/process.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index f1e223bd34cd..cc5c1568f2f4 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -335,10 +335,8 @@ static rtl_uString ** osl_createCommandArgs_Impl (int argc, char **) { /* Ensure absolute path */ ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH ); - DWORD dwResult = 0; - - dwResult = SearchPathW ( - nullptr, o3tl::toW(ppArgs[0]->buffer), L".exe", aBuffer.getBufSizeInSymbols(), o3tl::toW(aBuffer), nullptr); + DWORD dwResult + = GetModuleFileNameW(nullptr, o3tl::toW(aBuffer), aBuffer.getBufSizeInSymbols()); if ((0 < dwResult) && (dwResult < aBuffer.getBufSizeInSymbols())) { /* Replace argv[0] with its absolute path */ |