From 14e4939dc4bdf689122d328a8ee5d85dd9de0d23 Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Mon, 6 Mar 2023 11:44:56 +0100 Subject: [PATCH] [0.4.11][WMISVC][SRVSVC][WKSSVC][DHCPSVC][WUAUSERV] Start/Stop behavior by partially porting back: 0.4.15-dev-xxx [WMISVC][WUAUSERV] Fix 2 DPRINTs that lack arguments 0.4.13-dev-684-g eab73ad1a4613c79af7f8eed45d3b4497ec08dfe [SRVSVC] Make the server service stoppable 0.4.13-dev-683-g 4073a8c58db8441489f142b65f088dfd28c9c2f7 [WKSSVC] Make the workstation service stoppable 0.4.13-dev-680-g eb532bc64159f62ca766efa1bb8a2d199dcf95e9 [WMISVC] Accept stop and shutdown commands when the service is running 0.4.12-dev-1063-g 15a828c86d1d68a9dabaaa77bb6bb9d5e7104f42 [DHCPCSVC] Eliminate unused code and associated parameters and revert 0.4.10-dev-558-g 55368bacc8cba3f9b729d1e06e0184f11907e294 (#355) [WUAUSERV][WUSA] on this branch as that Service stub does not even start in releases/0.4.10-0.4.12. And it doesn't allow any application to run that wouldn't have run before. Even with those changes the .NET4.5 and Python 3.5 mentioned in that PR don't work yet. We postpone introduction of WUAUSERV to releases/0.4.13 therefore. --- base/applications/CMakeLists.txt | 1 - base/applications/wusa/CMakeLists.txt | 6 -- base/applications/wusa/res/setup.ico | Bin 22486 -> 0 bytes base/applications/wusa/resource.h | 3 - base/applications/wusa/resource.rc | 14 --- base/applications/wusa/wusa.c | 19 ---- base/applications/wusa/wusa.h | 4 - base/services/CMakeLists.txt | 1 - base/services/dhcpcsvc/dhcp/dhclient.c | 6 +- base/services/dhcpcsvc/dhcp/options.c | 70 ++------------ base/services/dhcpcsvc/include/dhcpd.h | 2 +- base/services/srvsvc/srvsvc.c | 3 + base/services/wkssvc/wkssvc.c | 3 + base/services/wmisvc/wmisvc.c | 4 +- base/services/wuauserv/CMakeLists.txt | 7 -- base/services/wuauserv/wuauserv.c | 128 ------------------------- base/services/wuauserv/wuauserv.h | 11 --- base/services/wuauserv/wuauserv.rc | 5 - base/services/wuauserv/wuauserv.spec | 1 - boot/bootdata/hivesys.inf | 13 --- 20 files changed, 22 insertions(+), 279 deletions(-) delete mode 100644 base/applications/wusa/CMakeLists.txt delete mode 100644 base/applications/wusa/res/setup.ico delete mode 100644 base/applications/wusa/resource.h delete mode 100644 base/applications/wusa/resource.rc delete mode 100644 base/applications/wusa/wusa.c delete mode 100644 base/applications/wusa/wusa.h delete mode 100644 base/services/wuauserv/CMakeLists.txt delete mode 100644 base/services/wuauserv/wuauserv.c delete mode 100644 base/services/wuauserv/wuauserv.h delete mode 100644 base/services/wuauserv/wuauserv.rc delete mode 100644 base/services/wuauserv/wuauserv.spec diff --git a/base/applications/CMakeLists.txt b/base/applications/CMakeLists.txt index 7ece4b66eb8..0fba2f09166 100644 --- a/base/applications/CMakeLists.txt +++ b/base/applications/CMakeLists.txt @@ -43,4 +43,3 @@ add_subdirectory(winhlp32) add_subdirectory(winver) add_subdirectory(wordpad) add_subdirectory(write) -add_subdirectory(wusa) diff --git a/base/applications/wusa/CMakeLists.txt b/base/applications/wusa/CMakeLists.txt deleted file mode 100644 index ab27e96541b..00000000000 --- a/base/applications/wusa/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ - -add_rc_deps(resource.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/setup.ico) -add_executable(wusa wusa.c resource.rc) -set_module_type(wusa win32gui UNICODE) -add_importlibs(wusa shell32 msvcrt kernel32) -add_cd_file(TARGET wusa DESTINATION reactos/system32 FOR all) diff --git a/base/applications/wusa/res/setup.ico b/base/applications/wusa/res/setup.ico deleted file mode 100644 index cd786edc67f58fd5877078c47857362e27845771..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22486 zcmeHP34D~*wLc>WA%J8h3xOmg$Re%?s9;b)D~nJUs!%OxM4<=@)F+ZB1PBy0TE$cp z11(CdP{W?E4kQFZ2oUz51i~f+6b#CfXaUdr|L@Ek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X`lR6VDtN^TPOtH`_#Sw@3SO@n8?Wg<&|kOkyZdzPAG~1&FImAqHvS6u z!wUYef=s@{KruR(zGr{FnaJjK>k5_QHjnKxd`qp{OGnwP_tnYaZ&bX<|`m|B&JY`;9|5erJSZIe7 zwgG;6r9zu$-w?BYaQzeb?iay#uTsE=H+8WzLm*HaObruVZT;g)@QQX;JvB@ S#ZAAa;wAoz$EQl - -#include "resource.h" - -/* Common resources */ - -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL - -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS WUSA stub" -#define REACTOS_STR_INTERNAL_NAME "wusa" -#define REACTOS_STR_ORIGINAL_FILENAME "wusa.exe" -#include - -IDI_WUSA ICON "res/setup.ico" diff --git a/base/applications/wusa/wusa.c b/base/applications/wusa/wusa.c deleted file mode 100644 index c6a7245f952..00000000000 --- a/base/applications/wusa/wusa.c +++ /dev/null @@ -1,19 +0,0 @@ -/* -* PROJECT: ReactOS Update Service -* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) -* PURPOSE: Windows Update Stand-Alone installer. -* Stub is required for some application at the installation phase. -* COPYRIGHT: Copyright 2018 Denis Malikov (filedem@gmail.com) -*/ - -#include "wusa.h" - -int -WINAPI -wWinMain(HINSTANCE hCurInst, - HINSTANCE hPrevInst, - LPWSTR lpsCmdLine, - int nCmdShow) -{ - return 0; -} diff --git a/base/applications/wusa/wusa.h b/base/applications/wusa/wusa.h deleted file mode 100644 index 4b4669d5750..00000000000 --- a/base/applications/wusa/wusa.h +++ /dev/null @@ -1,4 +0,0 @@ -#define WIN32_NO_STATUS -#define WIN32_LEAN_AND_MEAN -#include -#include diff --git a/base/services/CMakeLists.txt b/base/services/CMakeLists.txt index 977b5edf681..75b547844ca 100644 --- a/base/services/CMakeLists.txt +++ b/base/services/CMakeLists.txt @@ -15,4 +15,3 @@ add_subdirectory(umpnpmgr) add_subdirectory(wkssvc) add_subdirectory(wlansvc) add_subdirectory(wmisvc) -add_subdirectory(wuauserv) diff --git a/base/services/dhcpcsvc/dhcp/dhclient.c b/base/services/dhcpcsvc/dhcp/dhclient.c index ab28782bf86..f840f5b876c 100644 --- a/base/services/dhcpcsvc/dhcp/dhclient.c +++ b/base/services/dhcpcsvc/dhcp/dhclient.c @@ -1288,7 +1288,7 @@ make_discover(struct interface_info *ip, struct client_lease *lease) /* Set up the option buffer... */ ip->client->packet_length = cons_options(NULL, &ip->client->packet, 0, - options, 0, 0, 0, NULL, 0); + options); if (ip->client->packet_length < BOOTP_MIN_LEN) ip->client->packet_length = BOOTP_MIN_LEN; @@ -1380,7 +1380,7 @@ make_request(struct interface_info *ip, struct client_lease * lease) /* Set up the option buffer... */ ip->client->packet_length = cons_options(NULL, &ip->client->packet, 0, - options, 0, 0, 0, NULL, 0); + options); if (ip->client->packet_length < BOOTP_MIN_LEN) ip->client->packet_length = BOOTP_MIN_LEN; @@ -1464,7 +1464,7 @@ make_decline(struct interface_info *ip, struct client_lease *lease) /* Set up the option buffer... */ ip->client->packet_length = cons_options(NULL, &ip->client->packet, 0, - options, 0, 0, 0, NULL, 0); + options); if (ip->client->packet_length < BOOTP_MIN_LEN) ip->client->packet_length = BOOTP_MIN_LEN; diff --git a/base/services/dhcpcsvc/dhcp/options.c b/base/services/dhcpcsvc/dhcp/options.c index d7572fbee7a..9763bb29c3e 100644 --- a/base/services/dhcpcsvc/dhcp/options.c +++ b/base/services/dhcpcsvc/dhcp/options.c @@ -49,7 +49,7 @@ int bad_options_max = 5; void parse_options(struct packet *); void parse_option_buffer(struct packet *, unsigned char *, int); int store_options(unsigned char *, int, struct tree_cache **, - unsigned char *, int, int, int, int); + unsigned char *, int, int, int); /* @@ -197,12 +197,10 @@ parse_option_buffer(struct packet *packet, */ int cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, - int mms, struct tree_cache **options, - int overload, /* Overload flags that may be set. */ - int terminate, int bootpp, u_int8_t *prl, int prl_len) + int mms, struct tree_cache **options) { unsigned char priority_list[300], buffer[4096]; - int priority_len, main_buffer_size, mainbufix, bufix; + int priority_len, main_buffer_size, mainbufix; int option_size, length; /* @@ -223,8 +221,6 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, if (mms) main_buffer_size = mms - DHCP_FIXED_LEN; - else if (bootpp) - main_buffer_size = 64; else main_buffer_size = 576 - DHCP_FIXED_LEN; @@ -254,14 +250,6 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, inpacket->options[DHO_DHCP_PARAMETER_REQUEST_LIST].data, prlen); priority_len += prlen; - prl = priority_list; - } else if (prl) { - if (prl_len + priority_len > sizeof(priority_list)) - prl_len = sizeof(priority_list) - priority_len; - - memcpy(&priority_list[priority_len], prl, prl_len); - priority_len += prl_len; - prl = priority_list; } else { memcpy(&priority_list[priority_len], dhcp_option_default_priority_list, @@ -272,11 +260,9 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, /* Copy the options into the big buffer... */ option_size = store_options( buffer, - (main_buffer_size - 7 + ((overload & 1) ? DHCP_FILE_LEN : 0) + - ((overload & 2) ? DHCP_SNAME_LEN : 0)), + main_buffer_size - 7, options, priority_list, priority_len, main_buffer_size, - (main_buffer_size + ((overload & 1) ? DHCP_FILE_LEN : 0)), - terminate); + main_buffer_size); /* Put the cookie up front... */ memcpy(outpacket->options, DHCP_OPTIONS_COOKIE, 4); @@ -305,33 +291,7 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, memcpy(&outpacket->options[mainbufix], buffer, main_buffer_size - mainbufix); - bufix = main_buffer_size - mainbufix; length = DHCP_FIXED_NON_UDP + mainbufix; - if (overload & 1) { - if (option_size - bufix <= DHCP_FILE_LEN) { - memcpy(outpacket->file, - &buffer[bufix], option_size - bufix); - mainbufix = option_size - bufix; - if (mainbufix < DHCP_FILE_LEN) - outpacket->file[mainbufix++] = (char)DHO_END; - while (mainbufix < DHCP_FILE_LEN) - outpacket->file[mainbufix++] = (char)DHO_PAD; - } else { - memcpy(outpacket->file, - &buffer[bufix], DHCP_FILE_LEN); - bufix += DHCP_FILE_LEN; - } - } - if ((overload & 2) && option_size < bufix) { - memcpy(outpacket->sname, - &buffer[bufix], option_size - bufix); - - mainbufix = option_size - bufix; - if (mainbufix < DHCP_SNAME_LEN) - outpacket->file[mainbufix++] = (char)DHO_END; - while (mainbufix < DHCP_SNAME_LEN) - outpacket->file[mainbufix++] = (char)DHO_PAD; - } } return (length); } @@ -342,9 +302,9 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, int store_options(unsigned char *buffer, int buflen, struct tree_cache **options, unsigned char *priority_list, int priority_len, int first_cutoff, - int second_cutoff, int terminate) + int second_cutoff) { - int bufix = 0, option_stored[256], i, ix, tto; + int bufix = 0, option_stored[256], i, ix; /* Zero out the stored-lengths array. */ memset(option_stored, 0, sizeof(option_stored)); @@ -380,13 +340,6 @@ store_options(unsigned char *buffer, int buflen, struct tree_cache **options, /* We should now have a constant length for the option. */ length = options[code]->len; - /* Do we add a NUL? */ - if (terminate && dhcp_options[code].format[0] == 't') { - length++; - tto = 1; - } else - tto = 0; - /* Try to store the option. */ /* @@ -426,13 +379,8 @@ store_options(unsigned char *buffer, int buflen, struct tree_cache **options, /* Everything looks good - copy it in! */ buffer[bufix] = code; buffer[bufix + 1] = incr; - if (tto && incr == length) { - memcpy(buffer + bufix + 2, - options[code]->value + ix, incr - 1); - buffer[bufix + 2 + incr - 1] = 0; - } else - memcpy(buffer + bufix + 2, - options[code]->value + ix, incr); + memcpy(buffer + bufix + 2, + options[code]->value + ix, incr); length -= incr; ix += incr; bufix += 2 + incr; diff --git a/base/services/dhcpcsvc/include/dhcpd.h b/base/services/dhcpcsvc/include/dhcpd.h index b7b01b4e005..4cf5b6e1607 100644 --- a/base/services/dhcpcsvc/include/dhcpd.h +++ b/base/services/dhcpcsvc/include/dhcpd.h @@ -282,7 +282,7 @@ struct hash_table { /* options.c */ int cons_options(struct packet *, struct dhcp_packet *, int, - struct tree_cache **, int, int, int, u_int8_t *, int); + struct tree_cache **); char *pretty_print_option(unsigned int, unsigned char *, int, int, int); void do_packet(struct interface_info *, struct dhcp_packet *, diff --git a/base/services/srvsvc/srvsvc.c b/base/services/srvsvc/srvsvc.c index 1c3710547b1..a4e77f2c8f8 100644 --- a/base/services/srvsvc/srvsvc.c +++ b/base/services/srvsvc/srvsvc.c @@ -60,6 +60,9 @@ UpdateServiceStatus(DWORD dwState) else ServiceStatus.dwWaitHint = 0; + if (dwState == SERVICE_RUNNING) + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + SetServiceStatus(ServiceStatusHandle, &ServiceStatus); } diff --git a/base/services/wkssvc/wkssvc.c b/base/services/wkssvc/wkssvc.c index 5200570256b..eba9053e5e0 100644 --- a/base/services/wkssvc/wkssvc.c +++ b/base/services/wkssvc/wkssvc.c @@ -57,6 +57,9 @@ UpdateServiceStatus(DWORD dwState) else ServiceStatus.dwWaitHint = 0; + if (dwState == SERVICE_RUNNING) + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + SetServiceStatus(ServiceStatusHandle, &ServiceStatus); } diff --git a/base/services/wmisvc/wmisvc.c b/base/services/wmisvc/wmisvc.c index 8ac9d9b7339..ed16730795b 100644 --- a/base/services/wmisvc/wmisvc.c +++ b/base/services/wmisvc/wmisvc.c @@ -65,6 +65,9 @@ UpdateServiceStatus(DWORD dwState) else ServiceStatus.dwWaitHint = 0; + if (dwState == SERVICE_RUNNING) + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + SetServiceStatus(ServiceStatusHandle, &ServiceStatus); } @@ -106,7 +109,6 @@ ServiceControlHandler(DWORD dwControl, return ERROR_SUCCESS; default : - DPRINT1(" Control %lu received\n"); return ERROR_CALL_NOT_IMPLEMENTED; } } diff --git a/base/services/wuauserv/CMakeLists.txt b/base/services/wuauserv/CMakeLists.txt deleted file mode 100644 index 841d836fa6f..00000000000 --- a/base/services/wuauserv/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_library(wuauserv SHARED - wuauserv.c - wuauserv.rc) - -set_module_type(wuauserv win32dll UNICODE) -add_importlibs(wuauserv advapi32 msvcrt kernel32 ntdll) -add_cd_file(TARGET wuauserv DESTINATION reactos/system32 FOR all) diff --git a/base/services/wuauserv/wuauserv.c b/base/services/wuauserv/wuauserv.c deleted file mode 100644 index d302169826d..00000000000 --- a/base/services/wuauserv/wuauserv.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -* PROJECT: ReactOS Update Service -* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) -* PURPOSE: Automatic Updates service stub. -* Stub is required for some application at the installation phase. -* COPYRIGHT: Copyright 2018 Denis Malikov (filedem@gmail.com) -*/ - -#include "wuauserv.h" - -/* GLOBALS ******************************************************************/ - -static WCHAR ServiceName[] = L"wuauserv"; - -static SERVICE_STATUS_HANDLE ServiceStatusHandle; -static SERVICE_STATUS ServiceStatus; - -static HANDLE exitEvent = NULL; - -/* FUNCTIONS *****************************************************************/ - -static VOID -UpdateServiceStatus(DWORD dwState) -{ - ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - ServiceStatus.dwCurrentState = dwState; - ServiceStatus.dwControlsAccepted = 0; - ServiceStatus.dwWin32ExitCode = 0; - ServiceStatus.dwServiceSpecificExitCode = 0; - ServiceStatus.dwCheckPoint = 0; - - if (dwState == SERVICE_START_PENDING || - dwState == SERVICE_STOP_PENDING || - dwState == SERVICE_PAUSE_PENDING || - dwState == SERVICE_CONTINUE_PENDING) - ServiceStatus.dwWaitHint = 1000; - else - ServiceStatus.dwWaitHint = 0; - - SetServiceStatus(ServiceStatusHandle, - &ServiceStatus); - DPRINT1("WU UpdateServiceStatus() called\n"); -} - -static DWORD WINAPI -ServiceControlHandler(DWORD dwControl, - DWORD dwEventType, - LPVOID lpEventData, - LPVOID lpContext) -{ - switch (dwControl) - { - case SERVICE_CONTROL_STOP: - DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_STOP received\n"); - UpdateServiceStatus(SERVICE_STOPPED); - SetEvent(exitEvent); - return ERROR_SUCCESS; - - case SERVICE_CONTROL_PAUSE: - DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_PAUSE received\n"); - UpdateServiceStatus(SERVICE_PAUSED); - return ERROR_SUCCESS; - - case SERVICE_CONTROL_CONTINUE: - DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_CONTINUE received\n"); - UpdateServiceStatus(SERVICE_RUNNING); - return ERROR_SUCCESS; - - case SERVICE_CONTROL_INTERROGATE: - DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_INTERROGATE received\n"); - SetServiceStatus(ServiceStatusHandle, - &ServiceStatus); - return ERROR_SUCCESS; - - case SERVICE_CONTROL_SHUTDOWN: - DPRINT1("WU ServiceControlHandler() SERVICE_CONTROL_SHUTDOWN received\n"); - UpdateServiceStatus(SERVICE_STOPPED); - return ERROR_SUCCESS; - - default : - DPRINT1("WU ServiceControlHandler() Control %lu received\n"); - return ERROR_CALL_NOT_IMPLEMENTED; - } -} - -VOID WINAPI -ServiceMain(DWORD argc, LPTSTR *argv) -{ - UNREFERENCED_PARAMETER(argc); - UNREFERENCED_PARAMETER(argv); - - DPRINT("WU ServiceMain() called\n"); - - ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName, - ServiceControlHandler, - NULL); - if (!ServiceStatusHandle) - { - DPRINT1("RegisterServiceCtrlHandlerExW() failed! (Error %lu)\n", GetLastError()); - return; - } - - UpdateServiceStatus(SERVICE_RUNNING); - - exitEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - WaitForSingleObject(exitEvent, INFINITE); - CloseHandle(exitEvent); - - UpdateServiceStatus(SERVICE_STOPPED); -} - -BOOL WINAPI -DllMain(HINSTANCE hinstDLL, - DWORD fdwReason, - LPVOID lpvReserved) -{ - switch (fdwReason) - { - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinstDLL); - break; - - case DLL_PROCESS_DETACH: - break; - } - - return TRUE; -} diff --git a/base/services/wuauserv/wuauserv.h b/base/services/wuauserv/wuauserv.h deleted file mode 100644 index 7134c2642b1..00000000000 --- a/base/services/wuauserv/wuauserv.h +++ /dev/null @@ -1,11 +0,0 @@ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H -#include -#include -#include -#include -#include - -#define NDEBUG -#include diff --git a/base/services/wuauserv/wuauserv.rc b/base/services/wuauserv/wuauserv.rc deleted file mode 100644 index 83feb925b10..00000000000 --- a/base/services/wuauserv/wuauserv.rc +++ /dev/null @@ -1,5 +0,0 @@ -#define REACTOS_VERSION_DLL -#define REACTOS_STR_FILE_DESCRIPTION "AutoUpdate Service Stub" -#define REACTOS_STR_INTERNAL_NAME "wuauserv" -#define REACTOS_STR_ORIGINAL_FILENAME "wuauserv.dll" -#include diff --git a/base/services/wuauserv/wuauserv.spec b/base/services/wuauserv/wuauserv.spec deleted file mode 100644 index 1b27fe53864..00000000000 --- a/base/services/wuauserv/wuauserv.spec +++ /dev/null @@ -1 +0,0 @@ -@ stdcall ServiceMain(long ptr) diff --git a/boot/bootdata/hivesys.inf b/boot/bootdata/hivesys.inf index d7415e10d97..5b2af33c6b9 100644 --- a/boot/bootdata/hivesys.inf +++ b/boot/bootdata/hivesys.inf @@ -2047,16 +2047,6 @@ HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","Start",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","Type",0x00010001,0x00000020 HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\wbem\wmisvc.dll" -; AutoUpdate Service -HKLM,"SYSTEM\CurrentControlSet\Services\wuauserv","DisplayName",0x00000000,%WUAUSERV_SERVICE% -HKLM,"SYSTEM\CurrentControlSet\Services\wuauserv","Description",0x00000000,%WUAUSERV_SERVICE_DESCRIPTION% -HKLM,"SYSTEM\CurrentControlSet\Services\wuauserv","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\wuauserv","ImagePath",0x00020000,"%SystemRoot%\system32\svchost.exe -k netsvcs" -HKLM,"SYSTEM\CurrentControlSet\Services\wuauserv","ObjectName",0x00000000,"LocalSystem" -HKLM,"SYSTEM\CurrentControlSet\Services\wuauserv","Start",0x00010001,0x00000002 -HKLM,"SYSTEM\CurrentControlSet\Services\wuauserv","Type",0x00010001,0x00000020 -HKLM,"SYSTEM\CurrentControlSet\Services\wuauserv\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\wuauserv.dll" - ; Sound Blaster (NT4) ;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","Description",0x00000000,"Sound Blaster (NT4)" ;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","ErrorControl",0x00010001,0x00000001 @@ -2213,9 +2203,6 @@ THEMES_SERVICE_DESCRIPTION="Themes support" WINMGMT_SERVICE="ReactOS Management Infrastructure" WINMGMT_SERVICE_DESCRIPTION="Provides interface to system management information." -WUAUSERV_SERVICE="Automatic Updates" -WUAUSERV_SERVICE_DESCRIPTION="AutoUpdate Service stub." - WLANSVC_SERVICE="WLAN Service" WLANSVC_SERVICE_DESCRIPTION="WLAN Service"