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
cc7aef32
Commit
cc7aef32
authored
Dec 03, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display an error message if loading a Winelib app failed (suggested by
Francois Gouget).
parent
99acd7df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
process.c
scheduler/process.c
+20
-7
No files found.
scheduler/process.c
View file @
cc7aef32
...
...
@@ -361,7 +361,7 @@ static void start_process(void)
*
* Try to open the Winelib app .so file based on argv[0] or WINEPRELOAD.
*/
void
*
open_winelib_app
(
c
onst
char
*
argv0
)
void
*
open_winelib_app
(
c
har
*
argv
[]
)
{
void
*
ret
=
NULL
;
char
*
tmp
;
...
...
@@ -369,22 +369,34 @@ void *open_winelib_app( const char *argv0 )
if
((
name
=
getenv
(
"WINEPRELOAD"
)))
{
ret
=
wine_dll_load_main_exe
(
name
,
0
);
if
(
!
(
ret
=
wine_dll_load_main_exe
(
name
,
0
)))
{
MESSAGE
(
"%s: could not load '%s' as specified in the WINEPRELOAD environment variable
\n
"
,
argv
[
0
],
name
);
ExitProcess
(
1
);
}
}
else
{
/* if argv[0] is "wine", don't try to load anything */
if
(
!
(
name
=
strrchr
(
argv
0
,
'/'
)))
name
=
argv0
;
if
(
!
(
name
=
strrchr
(
argv
[
0
],
'/'
)))
name
=
argv
[
0
]
;
else
name
++
;
if
(
!
strcmp
(
name
,
"wine"
))
return
NULL
;
/* now try argv[0] with ".so" appended */
if
((
tmp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
argv
0
)
+
4
)))
if
((
tmp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
argv
[
0
]
)
+
4
)))
{
strcpy
(
tmp
,
argv
0
);
strcpy
(
tmp
,
argv
[
0
]
);
strcat
(
tmp
,
".so"
);
/* search in PATH only if there was no '/' in argv[0] */
ret
=
wine_dll_load_main_exe
(
tmp
,
(
name
==
argv0
)
);
ret
=
wine_dll_load_main_exe
(
tmp
,
(
name
==
argv
[
0
])
);
if
(
!
ret
&&
!
argv
[
1
])
{
/* if no argv[1], this will be better than displaying usage */
MESSAGE
(
"%s: could not load library '%s' as Winelib application
\n
"
,
argv
[
0
],
tmp
);
ExitProcess
(
1
);
}
HeapFree
(
GetProcessHeap
(),
0
,
tmp
);
}
}
...
...
@@ -403,7 +415,7 @@ void PROCESS_InitWine( int argc, char *argv[] )
/* Initialize everything */
if
(
!
process_init
(
argv
))
exit
(
1
);
if
(
open_winelib_app
(
argv
[
0
]
))
goto
found
;
/* try to open argv[0] as a winelib app */
if
(
open_winelib_app
(
argv
))
goto
found
;
/* try to open argv[0] as a winelib app */
main_exe_argv
=
++
argv
;
/* remove argv[0] (wine itself) */
...
...
@@ -565,6 +577,7 @@ static char **build_envp( const char *env, const char *extra_env )
{
if
(
memcmp
(
p
,
"PATH="
,
5
)
&&
memcmp
(
p
,
"HOME="
,
5
)
&&
memcmp
(
p
,
"WINEPRELOAD="
,
12
)
&&
memcmp
(
p
,
"WINEPREFIX="
,
11
))
*
envptr
++
=
(
char
*
)
p
;
}
*
envptr
=
0
;
...
...
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