Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Mayr
wine
Commits
d55b2de5
Commit
d55b2de5
authored
17 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
kernel32: Launch wineboot on first startup of a wine process.
parent
3133280d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/kernel32/process.c
+47
-0
47 additions, 0 deletions
dlls/kernel32/process.c
programs/wineboot/Makefile.in
+1
-1
1 addition, 1 deletion
programs/wineboot/Makefile.in
programs/wineboot/wineboot.c
+13
-0
13 additions, 0 deletions
programs/wineboot/wineboot.c
with
61 additions
and
1 deletion
dlls/kernel32/process.c
+
47
−
0
View file @
d55b2de5
...
...
@@ -773,6 +773,45 @@ static BOOL process_init(void)
}
/***********************************************************************
* start_wineboot
*
* Start the wineboot process if necessary. Return the event to wait on.
*/
static
HANDLE
start_wineboot
(
void
)
{
static
const
WCHAR
wineboot_eventW
[]
=
{
'_'
,
'_'
,
'w'
,
'i'
,
'n'
,
'e'
,
'b'
,
'o'
,
'o'
,
't'
,
'_'
,
'e'
,
'v'
,
'e'
,
'n'
,
't'
,
0
};
HANDLE
event
;
if
(
!
(
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
wineboot_eventW
)))
{
ERR
(
"failed to create wineboot event, expect trouble
\n
"
);
return
0
;
}
if
(
GetLastError
()
!=
ERROR_ALREADY_EXISTS
)
/* we created it */
{
static
const
WCHAR
command_line
[]
=
{
'\\'
,
'w'
,
'i'
,
'n'
,
'e'
,
'b'
,
'o'
,
'o'
,
't'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
STARTUPINFOW
si
;
PROCESS_INFORMATION
pi
;
WCHAR
cmdline
[
MAX_PATH
+
sizeof
(
command_line
)
/
sizeof
(
WCHAR
)];
memset
(
&
si
,
0
,
sizeof
(
si
)
);
si
.
cb
=
sizeof
(
si
);
GetSystemDirectoryW
(
cmdline
,
MAX_PATH
);
lstrcatW
(
cmdline
,
command_line
);
if
(
CreateProcessW
(
NULL
,
cmdline
,
NULL
,
NULL
,
FALSE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
si
,
&
pi
))
{
TRACE
(
"started wineboot pid %04x tid %04x
\n
"
,
pi
.
dwProcessId
,
pi
.
dwThreadId
);
CloseHandle
(
pi
.
hThread
);
CloseHandle
(
pi
.
hProcess
);
}
else
ERR
(
"failed to start wineboot, err %u
\n
"
,
GetLastError
()
);
}
return
event
;
}
/***********************************************************************
* init_stack
*
...
...
@@ -894,6 +933,7 @@ void __wine_kernel_init(void)
WCHAR
*
p
,
main_exe_name
[
MAX_PATH
+
1
];
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
HANDLE
boot_event
=
0
;
/* Initialize everything */
if
(
!
process_init
())
exit
(
1
);
...
...
@@ -913,6 +953,7 @@ void __wine_kernel_init(void)
ExitProcess
(
GetLastError
()
);
}
if
(
!
build_command_line
(
__wine_main_wargv
))
goto
error
;
boot_event
=
start_wineboot
();
}
/* if there's no extension, append a dot to prevent LoadLibrary from appending .dll */
...
...
@@ -944,6 +985,12 @@ void __wine_kernel_init(void)
ExitProcess
(
error
);
}
if
(
boot_event
)
{
if
(
WaitForSingleObject
(
boot_event
,
30000
))
WARN
(
"boot event wait timed out
\n
"
);
CloseHandle
(
boot_event
);
}
/* switch to the new stack */
wine_switch_to_stack
(
start_process
,
NULL
,
init_stack
()
);
...
...
This diff is collapsed.
Click to expand it.
programs/wineboot/Makefile.in
+
1
−
1
View file @
d55b2de5
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
wineboot.exe
APPMODE
=
-mconsole
IMPORTS
=
shell32 shlwapi version user32 advapi32 kernel32
IMPORTS
=
shell32 shlwapi version user32 advapi32 kernel32
ntdll
EXTRALIBS
=
-luuid
C_SRCS
=
\
...
...
This diff is collapsed.
Click to expand it.
programs/wineboot/wineboot.c
+
13
−
0
View file @
d55b2de5
...
...
@@ -716,9 +716,13 @@ static const struct option long_options[] =
int
main
(
int
argc
,
char
*
argv
[]
)
{
extern
HANDLE
__wine_make_process_system
(
void
);
static
const
WCHAR
wineboot_eventW
[]
=
{
'_'
,
'_'
,
'w'
,
'i'
,
'n'
,
'e'
,
'b'
,
'o'
,
'o'
,
't'
,
'_'
,
'e'
,
'v'
,
'e'
,
'n'
,
't'
,
0
};
/* First, set the current directory to SystemRoot */
int
optc
;
int
end_session
=
0
,
force
=
0
,
kill
=
0
,
restart
=
0
,
shutdown
=
0
;
HANDLE
event
;
GetWindowsDirectoryW
(
windowsdir
,
MAX_PATH
);
if
(
!
SetCurrentDirectoryW
(
windowsdir
)
)
...
...
@@ -750,6 +754,9 @@ int main( int argc, char *argv[] )
if
(
shutdown
)
return
0
;
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
wineboot_eventW
);
ResetEvent
(
event
);
/* in case this is a restart */
wininit
();
pendingRename
();
...
...
@@ -769,5 +776,11 @@ int main( int argc, char *argv[] )
}
WINE_TRACE
(
"Operation done
\n
"
);
SetEvent
(
event
);
/* FIXME: the wait is needed to keep services running */
/* it should be removed once we have a proper services.exe */
WaitForSingleObject
(
__wine_make_process_system
(),
INFINITE
);
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment