msvcrt: Implement _wspawnl{, e, p, pe}.

This commit is contained in:
Hans Leidekker 2008-01-07 14:23:32 +01:00 committed by Alexandre Julliard
parent 3fd647c243
commit 054132f931
2 changed files with 109 additions and 4 deletions

View File

@ -556,10 +556,10 @@
@ cdecl _wsearchenv(wstr wstr ptr) @ cdecl _wsearchenv(wstr wstr ptr)
@ cdecl _wsetlocale(long wstr) MSVCRT__wsetlocale @ cdecl _wsetlocale(long wstr) MSVCRT__wsetlocale
@ varargs _wsopen (wstr long long) MSVCRT__wsopen @ varargs _wsopen (wstr long long) MSVCRT__wsopen
@ stub _wspawnl #(long wstr wstr) varargs @ varargs _wspawnl(long wstr wstr)
@ stub _wspawnle #(long wstr wstr) varargs @ varargs _wspawnle(long wstr wstr)
@ stub _wspawnlp #(long wstr wstr) varargs @ varargs _wspawnlp(long wstr wstr)
@ stub _wspawnlpe #(long wstr wstr) varargs @ varargs _wspawnlpe(long wstr wstr)
@ cdecl _wspawnv(long wstr ptr) @ cdecl _wspawnv(long wstr ptr)
@ cdecl _wspawnve(long wstr ptr ptr) @ cdecl _wspawnve(long wstr ptr ptr)
@ cdecl _wspawnvp(long wstr ptr) @ cdecl _wspawnvp(long wstr ptr)

View File

@ -589,6 +589,27 @@ MSVCRT_intptr_t CDECL _execvp(const char* name, char* const* argv)
return _execvpe(name, argv, NULL); return _execvpe(name, argv, NULL);
} }
/*********************************************************************
* _wspawnl (MSVCRT.@)
*
* Unicode version of _spawnl
*/
MSVCRT_intptr_t CDECL _wspawnl(int flags, const MSVCRT_wchar_t* name, const MSVCRT_wchar_t* arg0, ...)
{
va_list ap;
MSVCRT_wchar_t *args;
MSVCRT_intptr_t ret;
va_start(ap, arg0);
args = msvcrt_valisttos(arg0, ap, ' ');
va_end(ap);
ret = msvcrt_spawn(flags, name, args, NULL);
MSVCRT_free(args);
return ret;
}
/********************************************************************* /*********************************************************************
* _spawnl (MSVCRT.@) * _spawnl (MSVCRT.@)
* *
@ -614,6 +635,35 @@ MSVCRT_intptr_t CDECL _spawnl(int flags, const char* name, const char* arg0, ...
return ret; return ret;
} }
/*********************************************************************
* _wspawnle (MSVCRT.@)
*
* Unicode version of _spawnle
*/
MSVCRT_intptr_t CDECL _wspawnle(int flags, const MSVCRT_wchar_t* name, const MSVCRT_wchar_t* arg0, ...)
{
va_list ap;
MSVCRT_wchar_t *args, *envs = NULL;
const MSVCRT_wchar_t * const *envp;
MSVCRT_intptr_t ret;
va_start(ap, arg0);
args = msvcrt_valisttos(arg0, ap, ' ');
va_end(ap);
va_start(ap, arg0);
while (va_arg( ap, MSVCRT_wchar_t * ) != NULL) /*nothing*/;
envp = va_arg( ap, const MSVCRT_wchar_t * const * );
if (envp) envs = msvcrt_argvtos(envp, 0);
va_end(ap);
ret = msvcrt_spawn(flags, name, args, envs);
MSVCRT_free(args);
MSVCRT_free(envs);
return ret;
}
/********************************************************************* /*********************************************************************
* _spawnle (MSVCRT.@) * _spawnle (MSVCRT.@)
*/ */
@ -644,6 +694,29 @@ MSVCRT_intptr_t CDECL _spawnle(int flags, const char* name, const char* arg0, ..
return ret; return ret;
} }
/*********************************************************************
* _wspawnlp (MSVCRT.@)
*
* Unicode version of _spawnlp
*/
MSVCRT_intptr_t CDECL _wspawnlp(int flags, const MSVCRT_wchar_t* name, const MSVCRT_wchar_t* arg0, ...)
{
static const MSVCRT_wchar_t path[] = {'P','A','T','H',0};
va_list ap;
MSVCRT_wchar_t *args, fullname[MAX_PATH];
MSVCRT_intptr_t ret;
_wsearchenv(name, path, fullname);
va_start(ap, arg0);
args = msvcrt_valisttos(arg0, ap, ' ');
va_end(ap);
ret = msvcrt_spawn(flags, fullname[0] ? fullname : name, args, NULL);
MSVCRT_free(args);
return ret;
}
/********************************************************************* /*********************************************************************
* _spawnlp (MSVCRT.@) * _spawnlp (MSVCRT.@)
@ -672,6 +745,38 @@ MSVCRT_intptr_t CDECL _spawnlp(int flags, const char* name, const char* arg0, ..
return ret; return ret;
} }
/*********************************************************************
* _wspawnlpe (MSVCRT.@)
*
* Unicode version of _spawnlpe
*/
MSVCRT_intptr_t CDECL _wspawnlpe(int flags, const MSVCRT_wchar_t* name, const MSVCRT_wchar_t* arg0, ...)
{
static const MSVCRT_wchar_t path[] = {'P','A','T','H',0};
va_list ap;
MSVCRT_wchar_t *args, *envs = NULL, fullname[MAX_PATH];
const MSVCRT_wchar_t * const *envp;
MSVCRT_intptr_t ret;
_wsearchenv(name, path, fullname);
va_start(ap, arg0);
args = msvcrt_valisttos(arg0, ap, ' ');
va_end(ap);
va_start(ap, arg0);
while (va_arg( ap, MSVCRT_wchar_t * ) != NULL) /*nothing*/;
envp = va_arg( ap, const MSVCRT_wchar_t * const * );
if (envp) envs = msvcrt_argvtos(envp, 0);
va_end(ap);
ret = msvcrt_spawn(flags, fullname[0] ? fullname : name, args, envs);
MSVCRT_free(args);
MSVCRT_free(envs);
return ret;
}
/********************************************************************* /*********************************************************************
* _spawnlpe (MSVCRT.@) * _spawnlpe (MSVCRT.@)
*/ */