mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00: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
|
add_library(wuauserv MODULE
|
||||||
wuauserv.c
|
wuauserv.c
|
||||||
wuauserv.rc)
|
wuauserv.rc
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/wuauserv.def)
|
||||||
|
|
||||||
set_module_type(wuauserv win32dll UNICODE)
|
set_module_type(wuauserv win32dll UNICODE)
|
||||||
add_importlibs(wuauserv advapi32 msvcrt kernel32 ntdll)
|
add_importlibs(wuauserv advapi32 msvcrt kernel32 ntdll)
|
||||||
|
|
|
@ -37,6 +37,9 @@ UpdateServiceStatus(DWORD dwState)
|
||||||
else
|
else
|
||||||
ServiceStatus.dwWaitHint = 0;
|
ServiceStatus.dwWaitHint = 0;
|
||||||
|
|
||||||
|
if (dwState == SERVICE_RUNNING)
|
||||||
|
ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
|
||||||
|
|
||||||
SetServiceStatus(ServiceStatusHandle,
|
SetServiceStatus(ServiceStatusHandle,
|
||||||
&ServiceStatus);
|
&ServiceStatus);
|
||||||
DPRINT1("WU UpdateServiceStatus() called\n");
|
DPRINT1("WU UpdateServiceStatus() called\n");
|
||||||
|
@ -52,8 +55,8 @@ ServiceControlHandler(DWORD dwControl,
|
||||||
{
|
{
|
||||||
case SERVICE_CONTROL_STOP:
|
case SERVICE_CONTROL_STOP:
|
||||||
DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_STOP received\n");
|
DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_STOP received\n");
|
||||||
UpdateServiceStatus(SERVICE_STOPPED);
|
|
||||||
SetEvent(exitEvent);
|
SetEvent(exitEvent);
|
||||||
|
UpdateServiceStatus(SERVICE_STOP_PENDING);
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
case SERVICE_CONTROL_PAUSE:
|
case SERVICE_CONTROL_PAUSE:
|
||||||
|
@ -74,7 +77,8 @@ ServiceControlHandler(DWORD dwControl,
|
||||||
|
|
||||||
case SERVICE_CONTROL_SHUTDOWN:
|
case SERVICE_CONTROL_SHUTDOWN:
|
||||||
DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_SHUTDOWN received\n");
|
DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_SHUTDOWN received\n");
|
||||||
UpdateServiceStatus(SERVICE_STOPPED);
|
SetEvent(exitEvent);
|
||||||
|
UpdateServiceStatus(SERVICE_STOP_PENDING);
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
default :
|
default :
|
||||||
|
@ -100,9 +104,10 @@ ServiceMain(DWORD argc, LPTSTR *argv)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exitEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
|
||||||
|
|
||||||
UpdateServiceStatus(SERVICE_RUNNING);
|
UpdateServiceStatus(SERVICE_RUNNING);
|
||||||
|
|
||||||
exitEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
|
||||||
WaitForSingleObject(exitEvent, INFINITE);
|
WaitForSingleObject(exitEvent, INFINITE);
|
||||||
CloseHandle(exitEvent);
|
CloseHandle(exitEvent);
|
||||||
|
|
||||||
|
|
|
@ -1781,7 +1781,7 @@ HKLM,"SOFTWARE\Microsoft\Ole","EnableRemoteConnect",0x00000000,"N"
|
||||||
; SvcHost services
|
; SvcHost services
|
||||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
|
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","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
|
; Win32 config
|
||||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows",,0x00000012
|
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows",,0x00000012
|
||||||
|
|
Loading…
Reference in a new issue