kernel32: Add CreateProcessAsUserA/W.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-10-26 13:31:08 +02:00
parent cdddf02d0c
commit 2769bb1e9b
8 changed files with 39 additions and 99 deletions

View File

@ -137,9 +137,9 @@
@ stdcall CreatePrivateObjectSecurity(ptr ptr ptr long long ptr)
@ stdcall CreatePrivateObjectSecurityEx(ptr ptr ptr ptr long long long ptr)
@ stdcall CreatePrivateObjectSecurityWithMultipleInheritance(ptr ptr ptr ptr long long long long ptr)
@ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr)
@ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) kernel32.CreateProcessAsUserA
# @ stub CreateProcessAsUserSecure
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr)
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessAsUserW
@ stdcall CreateProcessWithLogonW(wstr wstr wstr long wstr wstr long ptr wstr ptr ptr)
@ stdcall CreateProcessWithTokenW(long long wstr wstr long ptr wstr ptr ptr)
@ stdcall CreateRestrictedToken(long long long ptr long ptr long ptr ptr)

View File

@ -5562,97 +5562,6 @@ BOOL WINAPI DestroyPrivateObjectSecurity( PSECURITY_DESCRIPTOR* ObjectDescriptor
return TRUE;
}
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserA(
HANDLE hToken,
LPCSTR lpApplicationName,
LPSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCSTR lpCurrentDirectory,
LPSTARTUPINFOA lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation )
{
BOOL ret;
WCHAR *appW, *cmdlnW, *cwdW;
STARTUPINFOW sinfo;
TRACE("%p %s %s %p %p %d 0x%08x %p %s %p %p\n", hToken, debugstr_a(lpApplicationName),
debugstr_a(lpCommandLine), lpProcessAttributes, lpThreadAttributes, bInheritHandles,
dwCreationFlags, lpEnvironment, debugstr_a(lpCurrentDirectory), lpStartupInfo, lpProcessInformation);
appW = SERV_dup(lpApplicationName);
cmdlnW = SERV_dup(lpCommandLine);
cwdW = SERV_dup(lpCurrentDirectory);
sinfo.cb = sizeof(sinfo);
sinfo.lpReserved = SERV_dup(lpStartupInfo->lpReserved);
sinfo.lpDesktop = SERV_dup(lpStartupInfo->lpDesktop);
sinfo.lpTitle = SERV_dup(lpStartupInfo->lpTitle);
sinfo.dwX = lpStartupInfo->dwX;
sinfo.dwY = lpStartupInfo->dwY;
sinfo.dwXSize = lpStartupInfo->dwXSize;
sinfo.dwYSize = lpStartupInfo->dwYSize;
sinfo.dwXCountChars = lpStartupInfo->dwXCountChars;
sinfo.dwYCountChars = lpStartupInfo->dwYCountChars;
sinfo.dwFillAttribute = lpStartupInfo->dwFillAttribute;
sinfo.dwFlags = lpStartupInfo->dwFlags;
sinfo.wShowWindow = lpStartupInfo->wShowWindow;
sinfo.cbReserved2 = lpStartupInfo->cbReserved2;
sinfo.lpReserved2 = lpStartupInfo->lpReserved2;
sinfo.hStdInput = lpStartupInfo->hStdInput;
sinfo.hStdOutput = lpStartupInfo->hStdOutput;
sinfo.hStdError = lpStartupInfo->hStdError;
ret = CreateProcessAsUserW(hToken, appW, cmdlnW, lpProcessAttributes,
lpThreadAttributes, bInheritHandles, dwCreationFlags,
lpEnvironment, cwdW, &sinfo, lpProcessInformation);
heap_free(appW);
heap_free(cmdlnW);
heap_free(cwdW);
heap_free(sinfo.lpReserved);
heap_free(sinfo.lpDesktop);
heap_free(sinfo.lpTitle);
return ret;
}
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW(
HANDLE hToken,
LPCWSTR lpApplicationName,
LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCWSTR lpCurrentDirectory,
LPSTARTUPINFOW lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation )
{
FIXME("%p %s %s %p %p %d 0x%08x %p %s %p %p - semi-stub\n", hToken,
debugstr_w(lpApplicationName), debugstr_w(lpCommandLine), lpProcessAttributes,
lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment,
debugstr_w(lpCurrentDirectory), lpStartupInfo, lpProcessInformation);
/* We should create the process with a suspended main thread */
if (!CreateProcessW (lpApplicationName,
lpCommandLine,
lpProcessAttributes,
lpThreadAttributes,
bInheritHandles,
dwCreationFlags, /* CREATE_SUSPENDED */
lpEnvironment,
lpCurrentDirectory,
lpStartupInfo,
lpProcessInformation))
{
return FALSE;
}
return TRUE;
}
/******************************************************************************
* CreateProcessWithLogonW
*/

View File

@ -1,5 +1,5 @@
@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) kernel32.CreateProcessA
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) advapi32.CreateProcessAsUserW
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessAsUserW
@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessW
@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread
@ stdcall CreateRemoteThreadEx(long ptr long ptr ptr long ptr ptr) kernel32.CreateRemoteThreadEx

View File

@ -1,5 +1,5 @@
@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) kernel32.CreateProcessA
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) advapi32.CreateProcessAsUserW
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessAsUserW
@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessW
@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread
@ stdcall CreateRemoteThreadEx(long ptr long ptr ptr long ptr ptr) kernel32.CreateRemoteThreadEx

View File

@ -1,5 +1,5 @@
@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) kernel32.CreateProcessA
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) advapi32.CreateProcessAsUserW
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessAsUserW
@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessW
@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread
@ stdcall CreateRemoteThreadEx(long ptr long ptr ptr long ptr ptr) kernel32.CreateRemoteThreadEx

View File

@ -313,7 +313,8 @@
# @ stub CreatePrivateNamespaceA
# @ stub CreatePrivateNamespaceW
@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr)
# @ stub CreateProcessAsUserW
@ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr)
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr)
@ stdcall CreateProcessInternalA(long str str ptr ptr long long ptr str ptr ptr ptr)
@ stdcall CreateProcessInternalW(long wstr wstr ptr ptr long long ptr wstr ptr ptr ptr)
# @ stub CreateProcessInternalWSecure

View File

@ -2871,6 +2871,36 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW( LPCWSTR app_name, LPWSTR cmd_line,
}
/**********************************************************************
* CreateProcessAsUserA (KERNEL32.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserA( HANDLE token, LPCSTR app_name, LPSTR cmd_line,
LPSECURITY_ATTRIBUTES process_attr,
LPSECURITY_ATTRIBUTES thread_attr,
BOOL inherit, DWORD flags, LPVOID env, LPCSTR cur_dir,
LPSTARTUPINFOA startup_info,
LPPROCESS_INFORMATION info )
{
return CreateProcessInternalA( token, app_name, cmd_line, process_attr, thread_attr,
inherit, flags, env, cur_dir, startup_info, info, NULL );
}
/**********************************************************************
* CreateProcessAsUserW (KERNEL32.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_line,
LPSECURITY_ATTRIBUTES process_attr,
LPSECURITY_ATTRIBUTES thread_attr,
BOOL inherit, DWORD flags, LPVOID env, LPCWSTR cur_dir,
LPSTARTUPINFOW startup_info,
LPPROCESS_INFORMATION info )
{
return CreateProcessInternalW( token, app_name, cmd_line, process_attr, thread_attr,
inherit, flags, env, cur_dir, startup_info, info, NULL );
}
/**********************************************************************
* exec_process
*/

View File

@ -206,8 +206,8 @@
@ stdcall CreatePrivateObjectSecurityEx(ptr ptr ptr ptr long long long ptr) advapi32.CreatePrivateObjectSecurityEx
@ stdcall CreatePrivateObjectSecurityWithMultipleInheritance(ptr ptr ptr ptr long long long long ptr) advapi32.CreatePrivateObjectSecurityWithMultipleInheritance
@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) kernel32.CreateProcessA
@ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) advapi32.CreateProcessAsUserA
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) advapi32.CreateProcessAsUserW
@ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) kernel32.CreateProcessAsUserA
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessAsUserW
@ stdcall CreateProcessInternalA(long str str ptr ptr long long ptr str ptr ptr ptr) kernel32.CreateProcessInternalA
@ stdcall CreateProcessInternalW(long wstr wstr ptr ptr long long ptr wstr ptr ptr ptr) kernel32.CreateProcessInternalW
@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessW