Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cdddf02d
Commit
cdddf02d
authored
Oct 26, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Implement CreateProcessInternalA/W.
Based on a patch by Michael Müller. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
72662305
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
19 deletions
+41
-19
kernel32.spec
dlls/kernel32/kernel32.spec
+2
-2
process.c
dlls/kernel32/process.c
+34
-15
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+2
-2
winbase.h
include/winbase.h
+3
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
cdddf02d
...
...
@@ -314,8 +314,8 @@
# @ stub CreatePrivateNamespaceW
@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr)
# @ stub CreateProcessAsUserW
# @ stub CreateProcessInternalA
# @ stub CreateProcessInternalW
@ 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
@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr)
@ stdcall CreateRemoteThread(long ptr long ptr long long ptr)
...
...
dlls/kernel32/process.c
View file @
cdddf02d
...
...
@@ -2660,12 +2660,14 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
return
ret
;
}
/* Steam hotpatches CreateProcessA and W, so to prevent it from crashing use an internal function */
static
BOOL
create_process_impl
(
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
)
/**********************************************************************
* CreateProcessInternalW (KERNEL32.@)
*/
BOOL
WINAPI
CreateProcessInternalW
(
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
,
HANDLE
*
new_token
)
{
BOOL
retv
=
FALSE
;
HANDLE
hFile
=
0
;
...
...
@@ -2681,6 +2683,9 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
TRACE
(
"app %s cmdline %s
\n
"
,
debugstr_w
(
app_name
),
debugstr_w
(
cmd_line
)
);
if
(
token
)
FIXME
(
"Creating a process with a token is not yet implemented
\n
"
);
if
(
new_token
)
FIXME
(
"No support for returning created process token
\n
"
);
if
(
!
(
tidy_cmdline
=
get_file_name
(
app_name
,
cmd_line
,
name
,
ARRAY_SIZE
(
name
),
&
hFile
,
&
is_64bit
)))
return
FALSE
;
if
(
hFile
==
INVALID_HANDLE_VALUE
)
goto
done
;
...
...
@@ -2798,12 +2803,13 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
/**********************************************************************
* CreateProcessA (KERNEL32.@)
* CreateProcess
Internal
A (KERNEL32.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
CreateProcessA
(
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
)
BOOL
WINAPI
CreateProcessInternalA
(
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
,
HANDLE
*
new_token
)
{
BOOL
ret
=
FALSE
;
WCHAR
*
app_nameW
=
NULL
,
*
cmd_lineW
=
NULL
,
*
cur_dirW
=
NULL
;
...
...
@@ -2827,8 +2833,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA( LPCSTR app_name, LPSTR cmd_line, L
FIXME
(
"StartupInfo.lpReserved is used, please report (%s)
\n
"
,
debugstr_a
(
startup_info
->
lpReserved
));
ret
=
create_process_impl
(
app_nameW
,
cmd_lineW
,
process_attr
,
thread_attr
,
inherit
,
flags
,
env
,
cur_dirW
,
&
infoW
,
info
);
ret
=
CreateProcessInternalW
(
token
,
app_nameW
,
cmd_lineW
,
process_attr
,
thread_attr
,
inherit
,
flags
,
env
,
cur_dirW
,
&
infoW
,
info
,
new_token
);
done:
HeapFree
(
GetProcessHeap
(),
0
,
app_nameW
);
HeapFree
(
GetProcessHeap
(),
0
,
cmd_lineW
);
...
...
@@ -2840,6 +2846,19 @@ done:
/**********************************************************************
* CreateProcessA (KERNEL32.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
CreateProcessA
(
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
(
NULL
,
app_name
,
cmd_line
,
process_attr
,
thread_attr
,
inherit
,
flags
,
env
,
cur_dir
,
startup_info
,
info
,
NULL
);
}
/**********************************************************************
* CreateProcessW (KERNEL32.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
CreateProcessW
(
LPCWSTR
app_name
,
LPWSTR
cmd_line
,
LPSECURITY_ATTRIBUTES
process_attr
,
...
...
@@ -2847,8 +2866,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW( LPCWSTR app_name, LPWSTR cmd_line,
LPVOID
env
,
LPCWSTR
cur_dir
,
LPSTARTUPINFOW
startup_info
,
LPPROCESS_INFORMATION
info
)
{
return
create_process_impl
(
app_name
,
cmd_line
,
process_attr
,
thread_attr
,
inherit
,
flags
,
env
,
cur_dir
,
startup_info
,
info
);
return
CreateProcessInternalW
(
NULL
,
app_name
,
cmd_line
,
process_attr
,
thread_attr
,
inherit
,
flags
,
env
,
cur_dir
,
startup_info
,
info
,
NULL
);
}
...
...
dlls/kernelbase/kernelbase.spec
View file @
cdddf02d
...
...
@@ -208,8 +208,8 @@
@ 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
# @ stub
CreateProcessInternalA
# @ stub
CreateProcessInternalW
@ 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
@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread
@ stdcall CreateRemoteThreadEx(long ptr long ptr ptr long ptr ptr) kernel32.CreateRemoteThreadEx
...
...
include/winbase.h
View file @
cdddf02d
...
...
@@ -1865,6 +1865,9 @@ WINBASEAPI BOOL WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTE
WINADVAPI
BOOL
WINAPI
CreateProcessAsUserA
(
HANDLE
,
LPCSTR
,
LPSTR
,
LPSECURITY_ATTRIBUTES
,
LPSECURITY_ATTRIBUTES
,
BOOL
,
DWORD
,
LPVOID
,
LPCSTR
,
LPSTARTUPINFOA
,
LPPROCESS_INFORMATION
);
WINADVAPI
BOOL
WINAPI
CreateProcessAsUserW
(
HANDLE
,
LPCWSTR
,
LPWSTR
,
LPSECURITY_ATTRIBUTES
,
LPSECURITY_ATTRIBUTES
,
BOOL
,
DWORD
,
LPVOID
,
LPCWSTR
,
LPSTARTUPINFOW
,
LPPROCESS_INFORMATION
);
#define CreateProcessAsUser WINELIB_NAME_AW(CreateProcessAsUser)
WINBASEAPI
BOOL
WINAPI
CreateProcessInternalA
(
HANDLE
,
LPCSTR
,
LPSTR
,
LPSECURITY_ATTRIBUTES
,
LPSECURITY_ATTRIBUTES
,
BOOL
,
DWORD
,
LPVOID
,
LPCSTR
,
LPSTARTUPINFOA
,
LPPROCESS_INFORMATION
,
HANDLE
*
);
WINBASEAPI
BOOL
WINAPI
CreateProcessInternalW
(
HANDLE
,
LPCWSTR
,
LPWSTR
,
LPSECURITY_ATTRIBUTES
,
LPSECURITY_ATTRIBUTES
,
BOOL
,
DWORD
,
LPVOID
,
LPCWSTR
,
LPSTARTUPINFOW
,
LPPROCESS_INFORMATION
,
HANDLE
*
);
#define CreateProcessInternal WINELIB_NAME_AW(CreateProcessInternal)
WINADVAPI
BOOL
WINAPI
CreateProcessWithLogonW
(
LPCWSTR
,
LPCWSTR
,
LPCWSTR
,
DWORD
,
LPCWSTR
,
LPWSTR
,
DWORD
,
LPVOID
,
LPCWSTR
,
LPSTARTUPINFOW
,
LPPROCESS_INFORMATION
);
WINBASEAPI
HANDLE
WINAPI
CreateRemoteThread
(
HANDLE
,
LPSECURITY_ATTRIBUTES
,
SIZE_T
,
LPTHREAD_START_ROUTINE
,
LPVOID
,
DWORD
,
LPDWORD
);
WINBASEAPI
HANDLE
WINAPI
CreateRemoteThreadEx
(
HANDLE
,
LPSECURITY_ATTRIBUTES
,
SIZE_T
,
LPTHREAD_START_ROUTINE
,
LPVOID
,
DWORD
,
LPPROC_THREAD_ATTRIBUTE_LIST
,
LPDWORD
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment