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 cd786edc67f..00000000000 Binary files a/base/applications/wusa/res/setup.ico and /dev/null differ diff --git a/base/applications/wusa/resource.h b/base/applications/wusa/resource.h deleted file mode 100644 index 0901b426ea4..00000000000 --- a/base/applications/wusa/resource.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#define IDI_WUSA 101 diff --git a/base/applications/wusa/resource.rc b/base/applications/wusa/resource.rc deleted file mode 100644 index d4141fce21f..00000000000 --- a/base/applications/wusa/resource.rc +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#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"