[Libreoffice-commits] core.git: comphelper/source

Mike Kaganski mike.kaganski at collabora.com
Fri Sep 15 04:20:30 UTC 2017


 comphelper/source/windows/windows_process.cxx |   25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

New commits:
commit 8d24a4e1feaf88ee3f01393cc84a0747441911c3
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Thu Sep 14 21:12:36 2017 +0300

    windows_process: don't use 8-bit string functions
    
    Change-Id: Ie309f907220ffb69585442a1ae456623debf6654
    Reviewed-on: https://gerrit.libreoffice.org/42303
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

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);


More information about the Libreoffice-commits mailing list