https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1a31d8222de42482bba11…
commit 1a31d8222de42482bba117bb21dddaada1cf6821
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Sat Aug 31 18:34:20 2019 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Aug 31 18:48:12 2019 +0200
[FIND] Return from the utility the success value from the FindString() function in all cases.
CORE-16356
Therefore the ERRORLEVEL value will be correctly set in accordance on
return from the utility in cmd.exe, and conditional tests based on this
returned value will succeed as they should.
---
base/applications/cmdutils/find/find.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/base/applications/cmdutils/find/find.c b/base/applications/cmdutils/find/find.c
index 9dd003fc07f..53d01932c16 100644
--- a/base/applications/cmdutils/find/find.c
+++ b/base/applications/cmdutils/find/find.c
@@ -337,7 +337,7 @@ int wmain(int argc, WCHAR* argv[])
}
else
{
- FindString(stdin, NULL, argv[iSearchedStringIndex]);
+ iReturnValue = FindString(stdin, NULL, argv[iSearchedStringIndex]);
}
return iReturnValue;
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fa0eef085c9fe5b9b1de5…
commit fa0eef085c9fe5b9b1de5a9dac39946f27999540
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sat Aug 31 18:17:14 2019 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sat Aug 31 18:17:14 2019 +0200
[BOOTDATA][LSASRV] Add the security service(s)
- Add the service routines for the SamSs service.
- Start the SamSs service.
---
boot/bootdata/hivesys.inf | 23 ++++++++
dll/win32/lsasrv/service.c | 133 ++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 153 insertions(+), 3 deletions(-)
diff --git a/boot/bootdata/hivesys.inf b/boot/bootdata/hivesys.inf
index dde3a8e9fd8..667104ed7b4 100644
--- a/boot/bootdata/hivesys.inf
+++ b/boot/bootdata/hivesys.inf
@@ -1964,6 +1964,17 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","ObjectName",0x00000000,"LocalSys
HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","Start",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","Type",0x00010001,0x00000010
+; SamSs service
+HKLM,"SYSTEM\CurrentControlSet\Services\SamSs","DependOnService",0x00010000,"RPCSS"
+HKLM,"SYSTEM\CurrentControlSet\Services\SamSs","Description",0x00000000,%SAMSS_SERVICE_DESCRIPTION%
+HKLM,"SYSTEM\CurrentControlSet\Services\SamSs","DisplayName",0x00000000,%SAMSS_SERVICE%
+HKLM,"SYSTEM\CurrentControlSet\Services\SamSs","ErrorControl",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\SamSs","Group",0x00000000,"LocalValidation"
+HKLM,"SYSTEM\CurrentControlSet\Services\SamSs","ImagePath",0x00020000,"%SystemRoot%\system32\lsass.exe"
+HKLM,"SYSTEM\CurrentControlSet\Services\SamSs","ObjectName",0x00000000,"LocalSystem"
+HKLM,"SYSTEM\CurrentControlSet\Services\SamSs","Start",0x00010001,0x00000002
+HKLM,"SYSTEM\CurrentControlSet\Services\SamSs","Type",0x00010001,0x00000020
+
; Scheduler service
HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","DependOnService",0x00010000,"RPCSS"
HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","Description",0x00000000,%SCHEDULE_SERVICE_DESCRIPTION%
@@ -2231,6 +2242,9 @@ PLUGPLAY_SERVICE_DESCRIPTION="Detects hardware changes and installs needed softw
RPCSS_SERVICE="Remote Procedure Call"
RPCSS_SERVICE_DESCRIPTION="RPC subsystem which is responsible for Remote Procedure Calls on the local machine."
+SAMSS_SERVICE="Security Accounts Manager"
+SAMSS_SERVICE_DESCRIPTION="The startup of this service signals other services that the Security Accounts Manager (SAM) is ready to accept requests. Disabling this service will prevent other services in the system from being notified when the SAM is ready, which may in turn cause those services to fail to start correctly. This service should not be disabled."
+
SCHEDULE_SERVICE="Scheduler service"
SCHEDULE_SERVICE_DESCRIPTION="Allows starting of programs at specific times."
@@ -2379,6 +2393,9 @@ PLUGPLAY_SERVICE_DESCRIPTION="Wykrywa zmiany w sprzęcie i instaluje potrzebne o
RPCSS_SERVICE="Zdalne wykonywanie procedur"
RPCSS_SERVICE_DESCRIPTION="Podsystem RPC, który jest odpowiedzialny za zdalne wykonywanie procedur na tym komputerze."
+SAMSS_SERVICE="Security Accounts Manager"
+SAMSS_SERVICE_DESCRIPTION="The startup of this service signals other services that the Security Accounts Manager (SAM) is ready to accept requests. Disabling this service will prevent other services in the system from being notified when the SAM is ready, which may in turn cause those services to fail to start correctly. This service should not be disabled."
+
SCHEDULE_SERVICE="Usługa Harmonogram"
SCHEDULE_SERVICE_DESCRIPTION="Umożliwia uruchamianie programów w określonym czasie."
@@ -2521,6 +2538,9 @@ PLUGPLAY_SERVICE_DESCRIPTION="Detectează schimbările în configurația fizică
RPCSS_SERVICE="Apel procedural la distanță"
RPCSS_SERVICE_DESCRIPTION="Subsistemul responsabil pentru apel procedural la distanță în calculatorul local."
+SAMSS_SERVICE="Security Accounts Manager"
+SAMSS_SERVICE_DESCRIPTION="The startup of this service signals other services that the Security Accounts Manager (SAM) is ready to accept requests. Disabling this service will prevent other services in the system from being notified when the SAM is ready, which may in turn cause those services to fail to start correctly. This service should not be disabled."
+
SCHEDULE_SERVICE="Serviciu de planificare"
SCHEDULE_SERVICE_DESCRIPTION="Permite pornirea de programe la o anumită oră."
@@ -2663,6 +2683,9 @@ PLUGPLAY_SERVICE_DESCRIPTION="Обнаруживает изменения обо
RPCSS_SERVICE="Удаленный вызов процедур (RPC)"
RPCSS_SERVICE_DESCRIPTION="Подсистема для вызова удаленных процедур на локальной машине."
+SAMSS_SERVICE="Security Accounts Manager"
+SAMSS_SERVICE_DESCRIPTION="The startup of this service signals other services that the Security Accounts Manager (SAM) is ready to accept requests. Disabling this service will prevent other services in the system from being notified when the SAM is ready, which may in turn cause those services to fail to start correctly. This service should not be disabled."
+
SCHEDULE_SERVICE="Планировщик заданий"
SCHEDULE_SERVICE_DESCRIPTION="Позволяет запускать программы в определенное время."
diff --git a/dll/win32/lsasrv/service.c b/dll/win32/lsasrv/service.c
index ed4b97c01b8..9c207811135 100644
--- a/dll/win32/lsasrv/service.c
+++ b/dll/win32/lsasrv/service.c
@@ -2,22 +2,149 @@
* PROJECT: Local Security Authority Server DLL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/lsasrv/service.c
- * PURPOSE: Main file
- * COPYRIGHT: Copyright 2016 Eric Kohl
+ * PURPOSE: Security service
+ * COPYRIGHT: Copyright 2016, 2019 Eric Kohl <eric.kohl(a)reactos.org>
*/
/* INCLUDES ****************************************************************/
#include "lsasrv.h"
+#include <winsvc.h>
+
+VOID WINAPI I_ScIsSecurityProcess(VOID);
+
+static VOID WINAPI SamSsServiceMain(DWORD dwArgc, PWSTR *pszArgv);
+
+SERVICE_TABLE_ENTRYW ServiceTable[] =
+{
+ {L"SAMSS", SamSsServiceMain},
+ {NULL, NULL}
+};
+
/* FUNCTIONS ***************************************************************/
+static
+VOID
+WINAPI
+SamSsControlHandler(
+ _In_ DWORD fdwControl)
+{
+ TRACE("SamSsControlHandler(%lu)\n", fdwControl);
+}
+
+
+static
+VOID
+WINAPI
+SamSsServiceMain(
+ _In_ DWORD dwArgc,
+ _In_ PWSTR *pszArgv)
+{
+ SERVICE_STATUS_HANDLE hStatus;
+ SERVICE_STATUS ServiceStatus;
+
+ TRACE("SamSsServiceMain(%lu %p)\n", dwArgc, pszArgv);
+
+ hStatus = RegisterServiceCtrlHandlerW(L"SAMSS",
+ SamSsControlHandler);
+ if (hStatus == NULL)
+ return;
+
+ ServiceStatus.dwServiceType = SERVICE_WIN32_SHARE_PROCESS;
+ ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
+ ServiceStatus.dwControlsAccepted = 0;
+ ServiceStatus.dwWin32ExitCode = ERROR_SUCCESS;
+ ServiceStatus.dwServiceSpecificExitCode = ERROR_SUCCESS;
+ ServiceStatus.dwCheckPoint = 1;
+ ServiceStatus.dwWaitHint = 0x7530;
+
+ SetServiceStatus(hStatus, &ServiceStatus);
+
+ ServiceStatus.dwCurrentState = SERVICE_RUNNING;
+ ServiceStatus.dwCheckPoint = 0;
+ ServiceStatus.dwWaitHint = 0;
+
+ SetServiceStatus(hStatus, &ServiceStatus);
+}
+
+
+static
+DWORD
+WINAPI
+DispatcherThread(
+ _In_ PVOID pParameter)
+{
+ HANDLE hEvent;
+ DWORD dwError;
+
+ TRACE("DispatcherThread(%p)\n", pParameter);
+
+ /* Create or open the SECURITY_SERVICES_STARTED event */
+ hEvent = CreateEventW(NULL,
+ TRUE,
+ FALSE,
+ L"SECURITY_SERVICES_STARTED");
+ if (hEvent == NULL)
+ {
+ dwError = GetLastError();
+ if (dwError != ERROR_ALREADY_EXISTS)
+ return dwError;
+
+ hEvent = OpenEventW(SYNCHRONIZE,
+ FALSE,
+ L"SECURITY_SERVICES_STARTED");
+ if (hEvent == NULL)
+ return GetLastError();
+ }
+
+ /* Wait for the SECURITY_SERVICES_STARTED event to be signaled */
+ TRACE("Waiting for the SECURITY_SERVICES_STARTED event!\n");
+ dwError = WaitForSingleObject(hEvent, INFINITE);
+ TRACE("WaitForSingleObject returned %lu\n", dwError);
+
+ /* Close the event handle */
+ CloseHandle(hEvent);
+
+ /* Fail, if the event was not signaled */
+ if (dwError != WAIT_OBJECT_0)
+ {
+ ERR("Wait failed!\n");
+ return dwError;
+ }
+
+ /* This is the security process */
+ I_ScIsSecurityProcess();
+
+ /* Start the services */
+ TRACE("Start the security services!\n");
+ if (!StartServiceCtrlDispatcherW(ServiceTable))
+ return GetLastError();
+
+ TRACE("Done!\n");
+
+ return ERROR_SUCCESS;
+}
+
NTSTATUS
WINAPI
ServiceInit(VOID)
{
- TRACE("ServiceInit() called\n");
+ HANDLE hThread;
+ DWORD dwThreadId;
+
+ TRACE("ServiceInit()\n");
+
+ hThread = CreateThread(NULL,
+ 0,
+ DispatcherThread,
+ NULL,
+ 0,
+ &dwThreadId);
+ if (hThread == NULL)
+ return (NTSTATUS)GetLastError();
+
return STATUS_SUCCESS;
}
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=98a44b4f9b613f621d498…
commit 98a44b4f9b613f621d498343c18f6762830f030c
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sat Aug 31 00:27:24 2019 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Aug 31 01:42:23 2019 +0200
[FREELDR] Update the FREELDR.INI documentation / template.
---
boot/freeldr/FREELDR.INI | 171 +++++++++++++++++++++++++++++++----------------
1 file changed, 114 insertions(+), 57 deletions(-)
diff --git a/boot/freeldr/FREELDR.INI b/boot/freeldr/FREELDR.INI
index 7177121b824..ac63ff653bd 100644
--- a/boot/freeldr/FREELDR.INI
+++ b/boot/freeldr/FREELDR.INI
@@ -1,72 +1,137 @@
; FreeLoader by Brian Palmer
-; FREELDR.INI - FreeLoader Initialization file
+; FREELDR.INI - FreeLoader Initialization File
;
; Each line must be less than 1024 characters long
; and must be either a section heading (i.e. [section_name])
; or a setting (i.e. name=value) or a blank line.
; Comments start with a ';' character.
-; Background colors can be any one of the following:
-; Black
-; Blue
-; Green
-; Cyan
-; Red
-; Magenta
-; Brown
-; Gray
-
-; Text colors can be any one of the background
-; colors and any of the following:
-; DarkGray
-; LightBlue
-; LightGreen
-; LightCyan
-; LightRed
-; LightMagenta
-; Yellow
-; White
; [FREELOADER] Section Commands:
;
-; Debug - FreeLoader debugging port parameters, e.g. /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200
-; MessageBox - displays the specified text in a message box upon bootup
-; MessageLine - adds a new line of text to a message box (must come before MessageBox command)
-; TitleText - text that is displayed in the title box
-; StatusBarColor - color of status bar's background
-; StatusBarTextColor - color of status bar's text
-; BackdropTextColor - color of the backdrop's fill
-; BackdropColor - color of the backdrop's background
-; BackdropFillStyle - backdrop fill style - can be Light, Medium, or Dark
-; TitleBoxTextColor - title box text color
-; TitleBoxColor - title box background color
-; MessageBoxTextColor - message box text color
-; MessageBoxColor - message box background color
-; MenuTextColor - menu text color
-; MenuColor - menu color
-; TextColor - normal text color
-; SelectedTextColor - selected text color
-; SelectedColor - selected text background color
-; TimeOut - sets the timeout (in seconds) before the first OS listed gets booted automagically
+; Debug - FreeLoader debugging port parameters, e.g.
+; /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200
+; MessageBox - displays the specified text in a message box upon bootup.
+; DefaultOS - specifies which OS listed is the default choice.
+; TimeOut - sets the timeout (in seconds) before the first OS listed
+; gets booted automatically.
+
+; [Display] Section Commands:
+;
+; DisplayMode - sets the video mode to be used by FreeLoader.
+; The following values are supported:
+; NORMAL_VGA for 80x25
+; EXTENDED_VGA for 80x50 on VGA 80x43 on EGA
+; 0x501C for 80x28
+; 0x501E for 80x30
+; 0x5022 for 80x34
+; 0x502B for 80x43
+; 0x503C for 80x60
+;
+; TitleText - text that is displayed in the title box.
+; StatusBarColor - color of status bar's background.
+; StatusBarTextColor - color of status bar's text.
+; BackdropTextColor - color of the backdrop's fill.
+; BackdropColor - color of the backdrop's background.
+; BackdropFillStyle - backdrop fill style - can be: Light, Medium, Dark.
+; TitleBoxTextColor - title box text color.
+; TitleBoxColor - title box background color.
+; MessageBoxTextColor - message box text color.
+; MessageBoxColor - message box background color.
+; MenuTextColor - menu text color.
+; MenuColor - menu color.
+; TextColor - normal text color.
+; SelectedTextColor - selected text color.
+; SelectedColor - selected text background color.
+; SpecialEffects - turns on ("Yes") or off ("No") video special effects.
+;
+; Background colors can be any one of the following:
+; Black, Blue, Green, Cyan, Red, Magenta, Brown, Gray.
+;
+; Text colors can be any one of the background colors and any of the following:
+; DarkGray, LightBlue, LightGreen, LightCyan, LightRed, LightMagenta,
+; Yellow, White.
; [OS-General] Section Commands:
;
-; BootType - sets the boot type: Windows, WindowsNT40, Windows2003, Linux, BootSector, Partition, Drive, ReactOSSetup
+; BootType - specifies the boot type: Windows, WindowsNT40, Windows2003,
+; ReactOSSetup, Linux, BootSector, Partition, Drive
; BootPath - ARC path, e.g. multi(0)disk(0)rdisk(x)partition(y)
-; DriveMap - maps a BIOS drive number to another (i.e. DriveMap=hd1,hd0 maps harddisk1 to harddisk0 or DriveMap=fd1,fd0)
+; DriveMap - maps a BIOS drive number to another (i.e. DriveMap=hd1,hd0
+; maps harddisk1 to harddisk0 or DriveMap=fd1,fd0).
+
+; ["Drive" OSType] Section Commands:
+;
+; BootDrive - specifies the BIOS drive number to be used.
+;
+; REMARK: If a "BootPath" ARC path is specified, its value takes precedence
+; over the "BootDrive" value.
+
+; ["Partition" OSType] Section Commands:
+;
+; BootDrive - specifies the BIOS drive number to be used.
+; BootPartition - specifies the partition number to be used (default: 0).
+;
+; REMARK: If a "BootPath" ARC path is specified, its value takes precedence
+; over both the "BootDrive" and "BootPartition" values.
-; [BootSector OSType] Section Commands:
+; ["BootSector" OSType] Section Commands:
+;
+; BootDrive - specifies the BIOS drive number to be used.
+; BootPartition - specifies the partition number to be used (cannot be 0).
+;
+; REMARK: If a "BootPath" ARC path is specified, its value takes precedence
+; over both the "BootDrive" and "BootPartition" values.
;
-; BootSector - sets the filename of the bootsector to be loaded
+; REMARK 2: The "BootDrive", "BootPartition" and "BootPath" values are optional.
+; If none of them are given and a relative file path is specified by the
+; "BootSectorFile" value, the default boot partition will be used instead.
+;
+; BootSectorFile - specifies the file name of the bootsector to be loaded.
+; It can be either relative to "BootDrive" and "BootPartition"
+; (or to "BootPath"), or be an absolute ARC path, in which case
+; the "BootDrive" and "BootPartition" (or "BootPath") values
+; will only be used to set the boot partition.
-; [Windows(NT40|2003) OSType] Section Commands:
+; ["Linux" OSType] Section Commands:
+;
+; BootDrive - specifies the BIOS drive number to be used.
+; BootPartition - specifies the partition number to be used (cannot be 0).
+;
+; REMARK: If a "BootPath" ARC path is specified, its value takes precedence
+; over both the "BootDrive" and "BootPartition" values.
;
-; SystemPath - sets the system root path (must be a valid ARC - Path):
+; REMARK 2: The "BootDrive", "BootPartition" and "BootPath" values are optional.
+; If none of them are given and a relative file path is specified by the
+; "Kernel" or "Initrd" values, the default boot partition will be used instead.
+;
+; Kernel - specifies the kernel file name to be used.
+; It can be either relative to "BootDrive" and "BootPartition"
+; (or to "BootPath"), or be an absolute ARC path, in which case
+; the "BootDrive" and "BootPartition" (or "BootPath") values
+; will only be used to set the boot partition.
+; Initrd - specifies the optional init ramdisk file name to be used.
+; The same remarks about the path as for "Kernel" remain valid.
+; CommandLine - specifies the command line options for the kernel.
+
+; ["Windows(NT40|2003)" OSType] Section Commands:
+;
+; SystemPath - specifies the system root path (must be a valid ARC path):
; multi(0)disk(0)rdisk(0)partition(1)\reactos
; multi(0)disk(0)fdisk(0)
-; Options - sets the command line options for the kernel being booted
-; Kernel - sets the kernel filename (default: ntoskrnl.exe)
-; Hal - sets the HAL filename (default: hal.dll)
+; Options - specifies the command line options for the kernel being booted.
+; Kernel - specifies the kernel file name (default: ntoskrnl.exe)
+; Hal - specifies the HAL file name (default: hal.dll)
+;
+; REMARK: The "Kernel" and "Hal" values can be either relative to "SystemPath",
+; or be an absolute ARC path. Also they can alternatively be specified using the
+; NT-compatible "/HAL=filename" and "/KERNEL=filename" option switches to the
+; "Options" value, in which case the latter ones take precedence.
+
+; ["ReactOSSetup" OSType] Section Commands:
+;
+; No options defined for the moment. This OS type is used to tell FreeLdr
+; to start the SETUP portion of NT / ReactOS.
[FREELOADER]
@@ -74,14 +139,6 @@ MessageBox=Welcome to FreeLoader!\nCopyright (c) 2003 by Brian Palmer <brianp@sg
DefaultOS=ReactOSHD
TimeOut=10
-; DisplayMode can be:
-; NORMAL_VGA for 80x25
-; EXTENDED_VGA for 80x50 on VGA 80x43 on EGA
-; 0x501C for 80x28
-; 0x501E for 80x30
-; 0x5022 for 80x34
-; 0x502B for 80x43
-; 0x503C for 80x60
[Display]
DisplayMode=NORMAL_VGA
TitleText=Brian�s Custom FreeLoader Boot Disk