ReactOS 0.4.16-dev-2104-gb84fa49
corecrt_wprocess.h File Reference
#include <corecrt.h>
Include dependency graph for corecrt_wprocess.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

_ACRTIMP intptr_t __cdecl _wexecl (const wchar_t *, const wchar_t *,...)
 
_ACRTIMP intptr_t __cdecl _wexecle (const wchar_t *, const wchar_t *,...)
 
_ACRTIMP intptr_t __cdecl _wexeclp (const wchar_t *, const wchar_t *,...)
 
_ACRTIMP intptr_t __cdecl _wexeclpe (const wchar_t *, const wchar_t *,...)
 
_ACRTIMP intptr_t __cdecl _wexecv (const wchar_t *, const wchar_t *const *)
 
_ACRTIMP intptr_t __cdecl _wexecve (const wchar_t *, const wchar_t *const *, const wchar_t *const *)
 
_ACRTIMP intptr_t __cdecl _wexecvp (const wchar_t *, const wchar_t *const *)
 
_ACRTIMP intptr_t __cdecl _wexecvpe (const wchar_t *, const wchar_t *const *, const wchar_t *const *)
 
_ACRTIMP intptr_t __cdecl _wspawnl (int, const wchar_t *, const wchar_t *,...)
 
_ACRTIMP intptr_t __cdecl _wspawnle (int, const wchar_t *, const wchar_t *,...)
 
_ACRTIMP intptr_t __cdecl _wspawnlp (int, const wchar_t *, const wchar_t *,...)
 
_ACRTIMP intptr_t __cdecl _wspawnlpe (int, const wchar_t *, const wchar_t *,...)
 
_ACRTIMP intptr_t __cdecl _wspawnv (int, const wchar_t *, const wchar_t *const *)
 
_ACRTIMP intptr_t __cdecl _wspawnve (int, const wchar_t *, const wchar_t *const *, const wchar_t *const *)
 
_ACRTIMP intptr_t __cdecl _wspawnvp (int, const wchar_t *, const wchar_t *const *)
 
_ACRTIMP intptr_t __cdecl _wspawnvpe (int, const wchar_t *, const wchar_t *const *, const wchar_t *const *)
 
_ACRTIMP int __cdecl _wsystem (const wchar_t *)
 

Function Documentation

◆ _wexecl()

_ACRTIMP intptr_t __cdecl _wexecl ( const wchar_t name,
const wchar_t arg0,
  ... 
)

This file has no copyright assigned and is placed in the Public Domain. This file is part of the Wine project.

Definition at line 395 of file process.c.

396{
397 va_list ap;
398 wchar_t *args;
400
401 va_start(ap, arg0);
402 args = msvcrt_valisttos(arg0, ap, ' ');
403 va_end(ap);
404
406
407 free(args);
408 return ret;
409}
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
int intptr_t
Definition: corecrt.h:176
#define _P_OVERLAY
Definition: process.h:17
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
static intptr_t msvcrt_spawn(int flags, const wchar_t *exe, wchar_t *cmdline, wchar_t *env, int use_path)
Definition: process.c:135
static wchar_t * msvcrt_valisttos(const wchar_t *arg0, va_list alist, wchar_t delim)
Definition: process.c:279
return ret
Definition: mutex.c:146
#define args
Definition: format.c:66
Definition: match.c:390
Definition: name.c:39
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

◆ _wexecle()

_ACRTIMP intptr_t __cdecl _wexecle ( const wchar_t name,
const wchar_t arg0,
  ... 
)

Definition at line 441 of file process.c.

442{
443 va_list ap;
444 wchar_t *args, *envs = NULL;
445 const wchar_t * const *envp;
447
448 va_start(ap, arg0);
449 args = msvcrt_valisttos(arg0, ap, ' ');
450 va_end(ap);
451
452 va_start(ap, arg0);
453 while (va_arg( ap, wchar_t * ) != NULL) /*nothing*/;
454 envp = va_arg( ap, const wchar_t * const * );
455 if (envp) envs = msvcrt_argvtos(envp, 0);
456 va_end(ap);
457
458 ret = msvcrt_spawn(_P_OVERLAY, name, args, envs, 0);
459
460 free(args);
461 free(envs);
462 return ret;
463}
#define va_arg(v, l)
Definition: stdarg.h:27
static wchar_t * msvcrt_argvtos(const wchar_t *const *arg, wchar_t delim)
Definition: process.c:191

◆ _wexeclp()

_ACRTIMP intptr_t __cdecl _wexeclp ( const wchar_t name,
const wchar_t arg0,
  ... 
)

Definition at line 500 of file process.c.

501{
502 va_list ap;
503 wchar_t *args;
505
506 va_start(ap, arg0);
507 args = msvcrt_valisttos(arg0, ap, ' ');
508 va_end(ap);
509
511
512 free(args);
513 return ret;
514}

◆ _wexeclpe()

_ACRTIMP intptr_t __cdecl _wexeclpe ( const wchar_t name,
const wchar_t arg0,
  ... 
)

Definition at line 546 of file process.c.

547{
548 va_list ap;
549 wchar_t *args, *envs = NULL;
550 const wchar_t * const *envp;
552
553 va_start(ap, arg0);
554 args = msvcrt_valisttos(arg0, ap, ' ');
555 va_end(ap);
556
557 va_start(ap, arg0);
558 while (va_arg( ap, wchar_t * ) != NULL) /*nothing*/;
559 envp = va_arg( ap, const wchar_t * const * );
560 if (envp) envs = msvcrt_argvtos(envp, 0);
561 va_end(ap);
562
563 ret = msvcrt_spawn(_P_OVERLAY, name, args, envs, 1);
564
565 free(args);
566 free(envs);
567 return ret;
568}

◆ _wexecv()

_ACRTIMP intptr_t __cdecl _wexecv ( const wchar_t name,
const wchar_t *const argv 
)

Definition at line 605 of file process.c.

606{
607 return _wspawnve(_P_OVERLAY, name, argv, NULL);
608}
intptr_t CDECL _wspawnve(int flags, const wchar_t *name, const wchar_t *const *argv, const wchar_t *const *envv)
Definition: process.c:924
#define argv
Definition: mplay32.c:18

◆ _wexecve()

_ACRTIMP intptr_t __cdecl _wexecve ( const wchar_t name,
const wchar_t *const argv,
const wchar_t *const envv 
)

Definition at line 626 of file process.c.

627{
628 return _wspawnve(_P_OVERLAY, name, argv, envv);
629}

◆ _wexecvp()

_ACRTIMP intptr_t __cdecl _wexecvp ( const wchar_t name,
const wchar_t *const argv 
)

Definition at line 668 of file process.c.

669{
670 return _wexecvpe(name, argv, NULL);
671}
intptr_t CDECL _wexecvpe(const wchar_t *name, const wchar_t *const *argv, const wchar_t *const *envv)
Definition: process.c:647

◆ _wexecvpe()

_ACRTIMP intptr_t __cdecl _wexecvpe ( const wchar_t name,
const wchar_t *const argv,
const wchar_t *const envv 
)

Definition at line 647 of file process.c.

648{
649 return _wspawnvpe(_P_OVERLAY, name, argv, envv);
650}
intptr_t CDECL _wspawnvpe(int flags, const wchar_t *name, const wchar_t *const *argv, const wchar_t *const *envv)
Definition: process.c:991

Referenced by _wexecvp().

◆ _wspawnl()

_ACRTIMP intptr_t __cdecl _wspawnl ( int  flags,
const wchar_t name,
const wchar_t arg0,
  ... 
)

Definition at line 689 of file process.c.

690{
691 va_list ap;
692 wchar_t *args;
694
695 va_start(ap, arg0);
696 args = msvcrt_valisttos(arg0, ap, ' ');
697 va_end(ap);
698
700
701 free(args);
702 return ret;
703}
GLbitfield flags
Definition: glext.h:7161

◆ _wspawnle()

_ACRTIMP intptr_t __cdecl _wspawnle ( int  flags,
const wchar_t name,
const wchar_t arg0,
  ... 
)

Definition at line 735 of file process.c.

736{
737 va_list ap;
738 wchar_t *args, *envs = NULL;
739 const wchar_t * const *envp;
741
742 va_start(ap, arg0);
743 args = msvcrt_valisttos(arg0, ap, ' ');
744 va_end(ap);
745
746 va_start(ap, arg0);
747 while (va_arg( ap, wchar_t * ) != NULL) /*nothing*/;
748 envp = va_arg( ap, const wchar_t * const * );
749 if (envp) envs = msvcrt_argvtos(envp, 0);
750 va_end(ap);
751
752 ret = msvcrt_spawn(flags, name, args, envs, 0);
753
754 free(args);
755 free(envs);
756 return ret;
757}

◆ _wspawnlp()

_ACRTIMP intptr_t __cdecl _wspawnlp ( int  flags,
const wchar_t name,
const wchar_t arg0,
  ... 
)

Definition at line 794 of file process.c.

795{
796 va_list ap;
797 wchar_t *args;
799
800 va_start(ap, arg0);
801 args = msvcrt_valisttos(arg0, ap, ' ');
802 va_end(ap);
803
805
806 free(args);
807 return ret;
808}

◆ _wspawnlpe()

_ACRTIMP intptr_t __cdecl _wspawnlpe ( int  flags,
const wchar_t name,
const wchar_t arg0,
  ... 
)

Definition at line 840 of file process.c.

841{
842 va_list ap;
843 wchar_t *args, *envs = NULL;
844 const wchar_t * const *envp;
846
847 va_start(ap, arg0);
848 args = msvcrt_valisttos(arg0, ap, ' ');
849 va_end(ap);
850
851 va_start(ap, arg0);
852 while (va_arg( ap, wchar_t * ) != NULL) /*nothing*/;
853 envp = va_arg( ap, const wchar_t * const * );
854 if (envp) envs = msvcrt_argvtos(envp, 0);
855 va_end(ap);
856
857 ret = msvcrt_spawn(flags, name, args, envs, 1);
858
859 free(args);
860 free(envs);
861 return ret;
862}

◆ _wspawnv()

_ACRTIMP intptr_t __cdecl _wspawnv ( int  flags,
const wchar_t name,
const wchar_t *const argv 
)

Definition at line 956 of file process.c.

957{
958 return _wspawnve(flags, name, argv, NULL);
959}

◆ _wspawnve()

_ACRTIMP intptr_t __cdecl _wspawnve ( int  flags,
const wchar_t name,
const wchar_t *const argv,
const wchar_t *const envv 
)

Definition at line 924 of file process.c.

926{
927 wchar_t *args, *envs;
929
930 args = msvcrt_argvtos(argv, ' ');
931 envs = msvcrt_argvtos(envv, 0);
932
933 ret = msvcrt_spawn(flags, name, args, envs, 0);
934
935 free(args);
936 free(envs);
937 return ret;
938}

Referenced by _tspawnve(), _wexecv(), _wexecve(), and _wspawnv().

◆ _wspawnvp()

_ACRTIMP intptr_t __cdecl _wspawnvp ( int  flags,
const wchar_t name,
const wchar_t *const argv 
)

Definition at line 1023 of file process.c.

1024{
1025 return _wspawnvpe(flags, name, argv, NULL);
1026}

◆ _wspawnvpe()

_ACRTIMP intptr_t __cdecl _wspawnvpe ( int  flags,
const wchar_t name,
const wchar_t *const argv,
const wchar_t *const envv 
)

Definition at line 991 of file process.c.

993{
994 wchar_t *args, *envs;
996
997 args = msvcrt_argvtos(argv, ' ');
998 envs = msvcrt_argvtos(envv, 0);
999
1000 ret = msvcrt_spawn(flags, name, args, envs, 1);
1001
1002 free(args);
1003 free(envs);
1004 return ret;
1005}

Referenced by _tspawnvpe(), _wexecvpe(), and _wspawnvp().

◆ _wsystem()

_ACRTIMP int __cdecl _wsystem ( const wchar_t cmd)

Definition at line 1254 of file process.c.

1255{
1256 int res;
1257 wchar_t *comspec, *fullcmd;
1258 unsigned int len;
1259
1260 comspec = msvcrt_get_comspec();
1261
1262 if (cmd == NULL)
1263 {
1264 if (comspec == NULL)
1265 {
1266 *_errno() = ENOENT;
1267 return 0;
1268 }
1269 HeapFree(GetProcessHeap(), 0, comspec);
1270 return 1;
1271 }
1272
1273 if (comspec == NULL)
1274 return -1;
1275
1276 len = wcslen(comspec) + wcslen(cmd) + 5;
1277
1278 if (!(fullcmd = HeapAlloc(GetProcessHeap(), 0, len * sizeof(wchar_t))))
1279 {
1280 HeapFree(GetProcessHeap(), 0, comspec);
1281 return -1;
1282 }
1283 wcscpy(fullcmd, comspec);
1284 wcscat(fullcmd, L" /c ");
1285 wcscat(fullcmd, cmd);
1286
1287 res = msvcrt_spawn(_P_WAIT, comspec, fullcmd, NULL, 1);
1288
1289 HeapFree(GetProcessHeap(), 0, comspec);
1290 HeapFree(GetProcessHeap(), 0, fullcmd);
1291 return res;
1292}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
int *CDECL _errno(void)
Definition: errno.c:215
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
#define ENOENT
Definition: errno.h:25
#define _P_WAIT
Definition: process.h:15
static wchar_t * msvcrt_get_comspec(void)
Definition: process.c:346
#define L(x)
Definition: resources.c:13
GLuint res
Definition: glext.h:9613
GLenum GLsizei len
Definition: glext.h:6722
wcscat
wcscpy
Definition: ftp_var.h:139

Referenced by DisplayOutput(), START_TEST(), and wmain().