mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 08:00:24 +00:00
[UPDATES] New stubs for Automatic Updates service and WUSA.exe. Presence of this modules required for installation by some NT6+ applications.
This commit is contained in:
parent
8569c905ca
commit
55368bacc8
14 changed files with 213 additions and 0 deletions
|
@ -43,3 +43,4 @@ add_subdirectory(winhlp32)
|
|||
add_subdirectory(winver)
|
||||
add_subdirectory(wordpad)
|
||||
add_subdirectory(write)
|
||||
add_subdirectory(wusa)
|
||||
|
|
6
base/applications/wusa/CMakeLists.txt
Normal file
6
base/applications/wusa/CMakeLists.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
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)
|
BIN
base/applications/wusa/res/setup.ico
Normal file
BIN
base/applications/wusa/res/setup.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
3
base/applications/wusa/resource.h
Normal file
3
base/applications/wusa/resource.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#define IDI_WUSA 101
|
14
base/applications/wusa/resource.rc
Normal file
14
base/applications/wusa/resource.rc
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include <windef.h>
|
||||
|
||||
#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 <reactos/version.rc>
|
||||
|
||||
IDI_WUSA ICON "res/setup.ico"
|
19
base/applications/wusa/wusa.c
Normal file
19
base/applications/wusa/wusa.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* 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;
|
||||
}
|
4
base/applications/wusa/wusa.h
Normal file
4
base/applications/wusa/wusa.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
#define WIN32_NO_STATUS
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <wchar.h>
|
|
@ -15,3 +15,4 @@ add_subdirectory(umpnpmgr)
|
|||
add_subdirectory(wkssvc)
|
||||
add_subdirectory(wlansvc)
|
||||
add_subdirectory(wmisvc)
|
||||
add_subdirectory(wuauserv)
|
||||
|
|
7
base/services/wuauserv/CMakeLists.txt
Normal file
7
base/services/wuauserv/CMakeLists.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
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)
|
128
base/services/wuauserv/wuauserv.c
Normal file
128
base/services/wuauserv/wuauserv.c
Normal file
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* 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;
|
||||
}
|
11
base/services/wuauserv/wuauserv.h
Normal file
11
base/services/wuauserv/wuauserv.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <stdarg.h>
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winreg.h>
|
||||
#include <winsvc.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
5
base/services/wuauserv/wuauserv.rc
Normal file
5
base/services/wuauserv/wuauserv.rc
Normal file
|
@ -0,0 +1,5 @@
|
|||
#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 <reactos/version.rc>
|
1
base/services/wuauserv/wuauserv.spec
Normal file
1
base/services/wuauserv/wuauserv.spec
Normal file
|
@ -0,0 +1 @@
|
|||
@ stdcall ServiceMain(long ptr)
|
|
@ -2035,6 +2035,16 @@ 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
|
||||
|
@ -2191,6 +2201,9 @@ 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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue