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
fe7652d0
Commit
fe7652d0
authored
Dec 13, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Don't run a nonexistent builtin from CreateProcess when filename is not specified.
parent
f9c8afd3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
23 deletions
+4
-23
process.c
dlls/kernel32/process.c
+4
-23
No files found.
dlls/kernel32/process.c
View file @
fe7652d0
...
@@ -242,24 +242,15 @@ static HANDLE open_exe_file( const WCHAR *name, struct binary_info *binary_info
...
@@ -242,24 +242,15 @@ static HANDLE open_exe_file( const WCHAR *name, struct binary_info *binary_info
*
*
* Open an exe file, and return the full name and file handle.
* Open an exe file, and return the full name and file handle.
* Returns FALSE if file could not be found.
* Returns FALSE if file could not be found.
* If file exists but cannot be opened, returns TRUE and set handle to INVALID_HANDLE_VALUE.
* If file is a builtin exe, returns TRUE and sets handle to 0.
*/
*/
static
BOOL
find_exe_file
(
const
WCHAR
*
name
,
WCHAR
*
buffer
,
int
buflen
,
static
BOOL
find_exe_file
(
const
WCHAR
*
name
,
WCHAR
*
buffer
,
int
buflen
,
HANDLE
*
handle
,
struct
binary_info
*
binary_info
)
HANDLE
*
handle
,
struct
binary_info
*
binary_info
)
{
{
TRACE
(
"looking for %s
\n
"
,
debugstr_w
(
name
)
);
TRACE
(
"looking for %s
\n
"
,
debugstr_w
(
name
)
);
if
(
!
SearchPathW
(
NULL
,
name
,
exeW
,
buflen
,
buffer
,
NULL
))
if
(
!
SearchPathW
(
NULL
,
name
,
exeW
,
buflen
,
buffer
,
NULL
)
&&
{
if
(
contains_path
(
name
)
&&
get_builtin_path
(
name
,
exeW
,
buffer
,
buflen
,
binary_info
))
{
*
handle
=
0
;
return
TRUE
;
}
/* no builtin found, try native without extension in case it is a Unix app */
/* no builtin found, try native without extension in case it is a Unix app */
if
(
!
SearchPathW
(
NULL
,
name
,
NULL
,
buflen
,
buffer
,
NULL
))
return
FALSE
;
!
SearchPathW
(
NULL
,
name
,
NULL
,
buflen
,
buffer
,
NULL
))
return
FALSE
;
}
TRACE
(
"Trying native exe %s
\n
"
,
debugstr_w
(
buffer
)
);
TRACE
(
"Trying native exe %s
\n
"
,
debugstr_w
(
buffer
)
);
if
((
*
handle
=
CreateFileW
(
buffer
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_DELETE
,
if
((
*
handle
=
CreateFileW
(
buffer
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_DELETE
,
...
@@ -2173,11 +2164,7 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
...
@@ -2173,11 +2164,7 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
memcpy
(
name
,
cmdline
+
1
,
len
*
sizeof
(
WCHAR
)
);
memcpy
(
name
,
cmdline
+
1
,
len
*
sizeof
(
WCHAR
)
);
name
[
len
]
=
0
;
name
[
len
]
=
0
;
if
(
!
find_exe_file
(
name
,
buffer
,
buflen
,
handle
,
binary_info
))
if
(
!
find_exe_file
(
name
,
buffer
,
buflen
,
handle
,
binary_info
))
goto
done
;
{
if
(
!
get_builtin_path
(
name
,
exeW
,
buffer
,
buflen
,
binary_info
))
goto
done
;
*
handle
=
0
;
}
ret
=
cmdline
;
/* no change necessary */
ret
=
cmdline
;
/* no change necessary */
goto
done
;
goto
done
;
}
}
...
@@ -2205,13 +2192,7 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
...
@@ -2205,13 +2192,7 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
if
(
!
ret
)
if
(
!
ret
)
{
{
if
(
first_space
)
*
first_space
=
0
;
/* try only the first word as a builtin */
SetLastError
(
ERROR_FILE_NOT_FOUND
);
if
(
get_builtin_path
(
name
,
exeW
,
buffer
,
buflen
,
binary_info
))
{
*
handle
=
0
;
ret
=
cmdline
;
}
else
SetLastError
(
ERROR_FILE_NOT_FOUND
);
}
}
else
if
(
first_space
)
/* build a new command-line with quotes */
else
if
(
first_space
)
/* build a new command-line with quotes */
{
{
...
...
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