Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
aef821cc
Commit
aef821cc
authored
Mar 25, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a helper to launch start.exe always as builtin.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
96710025
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
9 deletions
+30
-9
env.c
dlls/ntdll/unix/env.c
+3
-9
loader.c
dlls/ntdll/unix/loader.c
+26
-0
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-0
No files found.
dlls/ntdll/unix/env.c
View file @
aef821cc
...
...
@@ -1880,23 +1880,17 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params(void)
if
(
status
)
/* try launching it through start.exe */
{
static
const
WCHAR
startW
[]
=
{
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
,
's'
,
't'
,
'a'
,
'r'
,
't'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
static
const
WCHAR
slashwW
[]
=
{
'/'
,
'w'
,
0
};
static
const
WCHAR
slashbW
[]
=
{
'/'
,
'b'
,
0
};
const
WCHAR
*
args
[]
=
{
startW
,
slashwW
,
slashbW
};
const
WCHAR
*
args
[]
=
{
NULL
,
slashwW
,
slashbW
};
free
(
image
);
prepend_main_wargv
(
args
,
3
);
if
((
status
=
load_main_exe
(
startW
,
NULL
,
curdir
,
&
image
,
&
module
,
&
image_info
)))
{
MESSAGE
(
"wine: failed to start %s
\n
"
,
debugstr_w
(
main_wargv
[
2
])
);
NtTerminateProcess
(
GetCurrentProcess
(),
status
);
}
load_start_exe
(
&
image
,
&
module
,
&
image_info
);
}
else
main_wargv
[
0
]
=
get_dos_path
(
image
);
NtCurrentTeb
()
->
Peb
->
ImageBaseAddress
=
module
;
main_wargv
[
0
]
=
get_dos_path
(
image
);
cmdline
=
build_command_line
(
main_wargv
);
TRACE
(
"image %s cmdline %s dir %s
\n
"
,
...
...
dlls/ntdll/unix/loader.c
View file @
aef821cc
...
...
@@ -1544,6 +1544,32 @@ failed:
}
/***********************************************************************
* load_start_exe
*
* Load start.exe as main image.
*/
NTSTATUS
load_start_exe
(
WCHAR
**
image
,
void
**
module
,
SECTION_IMAGE_INFORMATION
*
image_info
)
{
static
const
WCHAR
startW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
,
's'
,
't'
,
'a'
,
'r'
,
't'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
UNICODE_STRING
nt_name
;
NTSTATUS
status
;
SIZE_T
size
;
init_unicode_string
(
&
nt_name
,
startW
);
status
=
find_builtin_dll
(
&
nt_name
,
module
,
&
size
,
image_info
,
current_machine
,
FALSE
);
if
(
status
)
{
MESSAGE
(
"wine: failed to load start.exe: %x
\n
"
,
status
);
NtTerminateProcess
(
GetCurrentProcess
(),
status
);
}
*
image
=
malloc
(
sizeof
(
startW
)
);
memcpy
(
*
image
,
startW
,
sizeof
(
startW
)
);
return
status
;
}
#ifdef __FreeBSD__
/* The PT_LOAD segments are sorted in increasing order, and the first
* starts at the beginning of the ELF file. By parsing the file, we can
...
...
dlls/ntdll/unix/unix_private.h
View file @
aef821cc
...
...
@@ -145,6 +145,7 @@ extern NTSTATUS load_builtin( const pe_image_info_t *image_info, const WCHAR *fi
void
**
addr_ptr
,
SIZE_T
*
size_ptr
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
load_main_exe
(
const
WCHAR
*
name
,
const
char
*
unix_name
,
const
WCHAR
*
curdir
,
WCHAR
**
image
,
void
**
module
,
SECTION_IMAGE_INFORMATION
*
image_info
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
load_start_exe
(
WCHAR
**
image
,
void
**
module
,
SECTION_IMAGE_INFORMATION
*
image_info
)
DECLSPEC_HIDDEN
;
extern
void
start_server
(
BOOL
debug
)
DECLSPEC_HIDDEN
;
extern
ULONG_PTR
get_image_address
(
void
)
DECLSPEC_HIDDEN
;
...
...
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