diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index cff8ecda24..c4113aa42e 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -556,10 +556,10 @@ @ cdecl _wsearchenv(wstr wstr ptr) @ cdecl _wsetlocale(long wstr) MSVCRT__wsetlocale @ varargs _wsopen (wstr long long) MSVCRT__wsopen -@ stub _wspawnl #(long wstr wstr) varargs -@ stub _wspawnle #(long wstr wstr) varargs -@ stub _wspawnlp #(long wstr wstr) varargs -@ stub _wspawnlpe #(long wstr wstr) varargs +@ varargs _wspawnl(long wstr wstr) +@ varargs _wspawnle(long wstr wstr) +@ varargs _wspawnlp(long wstr wstr) +@ varargs _wspawnlpe(long wstr wstr) @ cdecl _wspawnv(long wstr ptr) @ cdecl _wspawnve(long wstr ptr ptr) @ cdecl _wspawnvp(long wstr ptr) diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c index fa8f52a080..d764eaff74 100644 --- a/dlls/msvcrt/process.c +++ b/dlls/msvcrt/process.c @@ -589,6 +589,27 @@ MSVCRT_intptr_t CDECL _execvp(const char* name, char* const* argv) 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.@) * @@ -614,6 +635,35 @@ MSVCRT_intptr_t CDECL _spawnl(int flags, const char* name, const char* arg0, ... 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.@) */ @@ -644,6 +694,29 @@ MSVCRT_intptr_t CDECL _spawnle(int flags, const char* name, const char* arg0, .. 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.@) @@ -672,6 +745,38 @@ MSVCRT_intptr_t CDECL _spawnlp(int flags, const char* name, const char* arg0, .. 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.@) */