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
bdc11ee0
Commit
bdc11ee0
authored
Mar 28, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a helper function to return the alternate 32/64 loader.
parent
61219f1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
16 deletions
+27
-16
loader.c
dlls/ntdll/unix/loader.c
+27
-16
No files found.
dlls/ntdll/unix/loader.c
View file @
bdc11ee0
...
...
@@ -653,6 +653,32 @@ static void init_paths( char *argv[] )
}
/***********************************************************************
* get_alternate_wineloader
*/
static
char
*
get_alternate_wineloader
(
WORD
machine
)
{
char
*
ret
=
NULL
;
if
(
machine
==
current_machine
)
return
NULL
;
if
(
machine
==
IMAGE_FILE_MACHINE_AMD64
)
/* try the 64-bit loader */
{
size_t
len
=
strlen
(
wineloader
);
if
(
len
<=
2
||
strcmp
(
wineloader
+
len
-
2
,
"64"
))
{
ret
=
malloc
(
len
+
3
);
strcpy
(
ret
,
wineloader
);
strcat
(
ret
,
"64"
);
}
return
ret
;
}
return
remove_tail
(
wineloader
,
"64"
);
}
static
void
preloader_exec
(
char
**
argv
)
{
if
(
use_preloader
)
...
...
@@ -686,22 +712,7 @@ static void preloader_exec( char **argv )
/* exec the appropriate wine loader for the specified machine */
static
NTSTATUS
loader_exec
(
char
**
argv
,
WORD
machine
)
{
if
(
machine
!=
current_machine
)
{
if
(
machine
==
IMAGE_FILE_MACHINE_AMD64
)
/* try the 64-bit loader */
{
size_t
len
=
strlen
(
wineloader
);
if
(
len
<=
2
||
strcmp
(
wineloader
+
len
-
2
,
"64"
))
{
argv
[
1
]
=
malloc
(
len
+
3
);
strcpy
(
argv
[
1
],
wineloader
);
strcat
(
argv
[
1
],
"64"
);
preloader_exec
(
argv
);
}
}
else
if
((
argv
[
1
]
=
remove_tail
(
wineloader
,
"64"
)))
preloader_exec
(
argv
);
}
if
(((
argv
[
1
]
=
get_alternate_wineloader
(
machine
))))
preloader_exec
(
argv
);
argv
[
1
]
=
strdup
(
wineloader
);
preloader_exec
(
argv
);
...
...
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