[NTOS:CM/IO/KE] Implement minimal support for CrashControl:AutoReboot

The REG_DWORD value `AutoReboot` stored in the registry key
`HKLM\SYSTEM\CurrentControlSet\Control\CrashControl`
(used as a boolean value), controls whether to automatically reboot
the operating system at the end of the crash dump, after a bugcheck.

ReactOS doesn't currently implement crash dumps, so only the auto-reboot
is done. (The reason of the apparent redundant `Reboot` variable in
KeBugCheckWithTf() is because that variable would be updated on return
by the not-yet-existing crash-dump helper routines called from there.)
This commit is contained in:
Hermès Bélusca-Maïto 2024-08-09 17:39:00 +02:00
parent 44564cb682
commit a43bfe2916
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
4 changed files with 11 additions and 2 deletions

View file

@ -624,8 +624,6 @@ DATA_SEG("INITDATA") CM_SYSTEM_CONTROL_VECTOR CmControlVector[] =
NULL,
NULL
},
{
L"ProductOptions",
L"ProductSuite",
@ -926,6 +924,13 @@ DATA_SEG("INITDATA") CM_SYSTEM_CONTROL_VECTOR CmControlVector[] =
NULL,
NULL
},
{
L"CrashControl",
L"AutoReboot",
&IopAutoReboot,
NULL,
NULL
},
{
NULL,
NULL,

View file

@ -1453,6 +1453,7 @@ extern GENERIC_MAPPING IopFileMapping;
extern POBJECT_TYPE _IoFileObjectType;
extern HAL_DISPATCH _HalDispatchTable;
extern LIST_ENTRY IopErrorLogListHead;
extern ULONG IopAutoReboot;
extern ULONG IopNumTriageDumpDataBlocks;
extern PVOID IopTriageDumpDataBlocks[64];
extern PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList;

View file

@ -43,6 +43,7 @@ LARGE_INTEGER IoWriteTransferCount = {{0, 0}};
ULONG IoOtherOperationCount = 0;
LARGE_INTEGER IoOtherTransferCount = {{0, 0}};
KSPIN_LOCK IoStatisticsLock = 0;
ULONG IopAutoReboot;
ULONG IopNumTriageDumpDataBlocks;
PVOID IopTriageDumpDataBlocks[64];

View file

@ -1134,6 +1134,8 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
/* FIXME: Support Triage Dump */
/* FIXME: Write the crash dump */
// TODO: The crash-dump helper must set the Reboot variable.
Reboot = !!IopAutoReboot;
}
else
{