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
8f6e1db3
Commit
8f6e1db3
authored
Dec 20, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineboot: Add support for starting NT-style services.
parent
06e888f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
2 deletions
+51
-2
wineboot.c
programs/wineboot/wineboot.c
+51
-2
No files found.
programs/wineboot/wineboot.c
View file @
8f6e1db3
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
* - PendingRenameOperations (rename operations left in the registry - Win NT+ only)
* - PendingRenameOperations (rename operations left in the registry - Win NT+ only)
*
*
* Startup (before the user logs in)
* Startup (before the user logs in)
* - Services (NT
, ?semi-synchronous?, not implemented yet
)
* - Services (NT)
* - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce (9x, asynch)
* - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce (9x, asynch)
* - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices (9x, asynch)
* - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices (9x, asynch)
*
*
...
@@ -622,6 +622,51 @@ static int ProcessWindowsFileProtection(void)
...
@@ -622,6 +622,51 @@ static int ProcessWindowsFileProtection(void)
return
1
;
return
1
;
}
}
/* start services */
static
void
start_services
(
void
)
{
static
const
WCHAR
servicesW
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
's'
,
0
};
static
const
WCHAR
startW
[]
=
{
'S'
,
't'
,
'a'
,
'r'
,
't'
,
0
};
HKEY
hkey
,
skey
;
DWORD
type
,
size
,
start
,
index
=
0
;
WCHAR
name
[
MAX_PATH
];
SC_HANDLE
manager
;
if
(
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
servicesW
,
&
hkey
))
return
;
if
(
!
(
manager
=
OpenSCManagerW
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
)))
{
RegCloseKey
(
hkey
);
return
;
}
while
(
!
RegEnumKeyW
(
hkey
,
index
++
,
name
,
sizeof
(
name
)
))
{
if
(
RegOpenKeyW
(
hkey
,
name
,
&
skey
))
continue
;
size
=
sizeof
(
start
);
if
(
!
RegQueryValueExW
(
skey
,
startW
,
NULL
,
&
type
,
(
LPBYTE
)
&
start
,
&
size
)
&&
type
==
REG_DWORD
)
{
if
(
start
==
SERVICE_BOOT_START
||
start
==
SERVICE_SYSTEM_START
||
start
==
SERVICE_AUTO_START
)
{
SC_HANDLE
handle
=
OpenServiceW
(
manager
,
name
,
SERVICE_ALL_ACCESS
);
if
(
handle
)
{
WINE_TRACE
(
"starting service %s start %u
\n
"
,
wine_dbgstr_w
(
name
),
start
);
StartServiceW
(
handle
,
0
,
NULL
);
CloseServiceHandle
(
handle
);
}
}
}
RegCloseKey
(
skey
);
}
CloseServiceHandle
(
manager
);
RegCloseKey
(
hkey
);
}
/* Process items in the StartUp group of the user's Programs under the Start Menu. Some installers put
/* Process items in the StartUp group of the user's Programs under the Start Menu. Some installers put
* shell links here to restart themselves after boot. */
* shell links here to restart themselves after boot. */
static
BOOL
ProcessStartupItems
(
void
)
static
BOOL
ProcessStartupItems
(
void
)
...
@@ -790,7 +835,11 @@ int main( int argc, char *argv[] )
...
@@ -790,7 +835,11 @@ int main( int argc, char *argv[] )
ProcessWindowsFileProtection
();
ProcessWindowsFileProtection
();
ProcessRunKeys
(
HKEY_LOCAL_MACHINE
,
runkeys_names
[
RUNKEY_RUNSERVICESONCE
],
TRUE
,
FALSE
);
ProcessRunKeys
(
HKEY_LOCAL_MACHINE
,
runkeys_names
[
RUNKEY_RUNSERVICESONCE
],
TRUE
,
FALSE
);
if
(
!
restart
)
ProcessRunKeys
(
HKEY_LOCAL_MACHINE
,
runkeys_names
[
RUNKEY_RUNSERVICES
],
FALSE
,
FALSE
);
if
(
!
restart
)
{
ProcessRunKeys
(
HKEY_LOCAL_MACHINE
,
runkeys_names
[
RUNKEY_RUNSERVICES
],
FALSE
,
FALSE
);
start_services
();
}
ProcessRunKeys
(
HKEY_LOCAL_MACHINE
,
runkeys_names
[
RUNKEY_RUNONCE
],
TRUE
,
TRUE
);
ProcessRunKeys
(
HKEY_LOCAL_MACHINE
,
runkeys_names
[
RUNKEY_RUNONCE
],
TRUE
,
TRUE
);
if
(
!
restart
)
if
(
!
restart
)
{
{
...
...
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