diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-09-14 21:12:36 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-09-15 06:20:02 +0200 |
commit | 8d24a4e1feaf88ee3f01393cc84a0747441911c3 (patch) | |
tree | 633f2d8ec7f3674c8d4aab4d2ed875056cfa09f4 | |
parent | loader: don't use 8-bit string functions (diff) | |
download | core-8d24a4e1feaf88ee3f01393cc84a0747441911c3.tar.gz core-8d24a4e1feaf88ee3f01393cc84a0747441911c3.zip |
windows_process: don't use 8-bit string functions
Change-Id: Ie309f907220ffb69585442a1ae456623debf6654
Reviewed-on: https://gerrit.libreoffice.org/42303
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | comphelper/source/windows/windows_process.cxx | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/comphelper/source/windows/windows_process.cxx b/comphelper/source/windows/windows_process.cxx index 16ba61399b87..e8fd4a01c8b8 100644 --- a/comphelper/source/windows/windows_process.cxx +++ b/comphelper/source/windows/windows_process.cxx @@ -2,14 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#define WIN32_LEAN_AND_MEAN #include <windows.h> -#include <shellapi.h> -#include <cstddef> #include <cstring> -#include <cwchar> - -#include <comphelper/windowsStart.hxx> +#include <wchar.h> // Needed for CreateEnvironmentBlock #include <userenv.h> @@ -244,15 +241,15 @@ WinLaunchChild(const wchar_t *exePath, else { LPVOID lpMsgBuf = nullptr; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - nullptr, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - reinterpret_cast<LPTSTR>(&lpMsgBuf), - 0, - nullptr); + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + nullptr, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + reinterpret_cast<LPWSTR>(&lpMsgBuf), + 0, + nullptr); wprintf(L"Error restarting: %s\n", lpMsgBuf ? lpMsgBuf : L"(null)"); if (lpMsgBuf) LocalFree(lpMsgBuf); |