mirror of
https://github.com/reactos/reactos.git
synced 2024-11-27 05:23:33 +08:00
[WUAUSERV] Make the wuauserv service startable and stoppable.
This commit is contained in:
parent
ae99df1675
commit
8a631c8455
@ -1,6 +1,9 @@
|
||||
spec2def(wuauserv.dll wuauserv.spec ADD_IMPORTLIB)
|
||||
|
||||
add_library(wuauserv MODULE
|
||||
wuauserv.c
|
||||
wuauserv.rc)
|
||||
wuauserv.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wuauserv.def)
|
||||
|
||||
set_module_type(wuauserv win32dll UNICODE)
|
||||
add_importlibs(wuauserv advapi32 msvcrt kernel32 ntdll)
|
||||
|
@ -37,6 +37,9 @@ UpdateServiceStatus(DWORD dwState)
|
||||
else
|
||||
ServiceStatus.dwWaitHint = 0;
|
||||
|
||||
if (dwState == SERVICE_RUNNING)
|
||||
ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
|
||||
|
||||
SetServiceStatus(ServiceStatusHandle,
|
||||
&ServiceStatus);
|
||||
DPRINT1("WU UpdateServiceStatus() called\n");
|
||||
@ -52,8 +55,8 @@ ServiceControlHandler(DWORD dwControl,
|
||||
{
|
||||
case SERVICE_CONTROL_STOP:
|
||||
DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_STOP received\n");
|
||||
UpdateServiceStatus(SERVICE_STOPPED);
|
||||
SetEvent(exitEvent);
|
||||
UpdateServiceStatus(SERVICE_STOP_PENDING);
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
case SERVICE_CONTROL_PAUSE:
|
||||
@ -74,7 +77,8 @@ ServiceControlHandler(DWORD dwControl,
|
||||
|
||||
case SERVICE_CONTROL_SHUTDOWN:
|
||||
DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_SHUTDOWN received\n");
|
||||
UpdateServiceStatus(SERVICE_STOPPED);
|
||||
SetEvent(exitEvent);
|
||||
UpdateServiceStatus(SERVICE_STOP_PENDING);
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
default :
|
||||
@ -100,9 +104,10 @@ ServiceMain(DWORD argc, LPTSTR *argv)
|
||||
return;
|
||||
}
|
||||
|
||||
exitEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
|
||||
|
||||
UpdateServiceStatus(SERVICE_RUNNING);
|
||||
|
||||
exitEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
WaitForSingleObject(exitEvent, INFINITE);
|
||||
CloseHandle(exitEvent);
|
||||
|
||||
|
@ -1781,7 +1781,7 @@ HKLM,"SOFTWARE\Microsoft\Ole","EnableRemoteConnect",0x00000000,"N"
|
||||
; SvcHost services
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost","DcomLaunch",0x00010000,"DcomLaunch","PlugPlay"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"DHCP","BITS","lanmanserver","lanmanworkstation","Schedule","Themes","winmgmt","W32Time"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"DHCP","BITS","lanmanserver","lanmanworkstation","Schedule","Themes","W32Time","winmgmt","wuauserv"
|
||||
|
||||
; Win32 config
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows",,0x00000012
|
||||
|
Loading…
Reference in New Issue
Block a user