LibreOffice Module comphelper (master) 1
|
#include <windows.h>
#include <cstring>
#include <wchar.h>
#include <comphelper/windowsStart.hxx>
#include <userenv.h>
Go to the source code of this file.
Macros | |
#define | WIN32_LEAN_AND_MEAN |
Functions | |
static int | ArgStrLen (const wchar_t *s) |
Get the length that the string will take and takes into account the additional length if the string needs to be quoted and if characters need to be escaped. More... | |
static wchar_t * | ArgToString (wchar_t *d, const wchar_t *s) |
Copy string "s" to string "d", quoting the argument as appropriate and escaping doublequotes along with any backslashes that immediately precede doublequotes. More... | |
wchar_t * | MakeCommandLine (int argc, wchar_t **argv) |
Creates a command line from a list of arguments. More... | |
BOOL | WinLaunchChild (const wchar_t *exePath, int argc, wchar_t **argv, HANDLE userToken, HANDLE *hProcess) |
Launch a child process with the specified arguments. More... | |
#define WIN32_LEAN_AND_MEAN |
Definition at line 5 of file windows_process.cxx.
|
static |
Get the length that the string will take and takes into account the additional length if the string needs to be quoted and if characters need to be escaped.
Definition at line 22 of file windows_process.cxx.
References i.
Referenced by MakeCommandLine().
|
static |
Copy string "s" to string "d", quoting the argument as appropriate and escaping doublequotes along with any backslashes that immediately precede doublequotes.
The CRT parses this to retrieve the original argc/argv that we meant, see STDARGV.C in the MSVC CRT sources.
Definition at line 70 of file windows_process.cxx.
Referenced by MakeCommandLine().
wchar_t * MakeCommandLine | ( | int | argc, |
wchar_t ** | argv | ||
) |
Creates a command line from a list of arguments.
The returned string is allocated with "malloc" and should be "free"d.
argv is UTF8
Definition at line 133 of file windows_process.cxx.
References ArgStrLen(), ArgToString(), and i.
Referenced by WinLaunchChild().
BOOL WinLaunchChild | ( | const wchar_t * | exePath, |
int | argc, | ||
wchar_t ** | argv, | ||
HANDLE | userToken = nullptr , |
||
HANDLE * | hProcess = nullptr |
||
) |
Launch a child process with the specified arguments.
Definition at line 167 of file windows_process.cxx.
References FALSE, MakeCommandLine(), and TRUE.