mirror of
https://github.com/ipxe/sanbootconf.git
synced 2025-05-09 01:21:13 +08:00
[driver] Allow boot text to be disabled via "BootText" registry parameter
Suggested-by: Tal Aloni <tal.aloni.il@gmail.com> Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
This commit is contained in:
parent
8b48fa5f8e
commit
3285a5aa91
@ -25,6 +25,7 @@
|
|||||||
#include "ibft.h"
|
#include "ibft.h"
|
||||||
#include "sbft.h"
|
#include "sbft.h"
|
||||||
#include "abft.h"
|
#include "abft.h"
|
||||||
|
#include "registry.h"
|
||||||
#include "boottext.h"
|
#include "boottext.h"
|
||||||
|
|
||||||
/** Maximum time to wait for system disk, in seconds */
|
/** Maximum time to wait for system disk, in seconds */
|
||||||
@ -68,6 +69,41 @@ static const PWCHAR sanbootconf_device_symlink[] = {
|
|||||||
L"\\DosDevices\\iSCSIBoot",
|
L"\\DosDevices\\iSCSIBoot",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load driver parameters
|
||||||
|
*
|
||||||
|
* @v key_name Driver key name
|
||||||
|
* @ret ntstatus NT status
|
||||||
|
*/
|
||||||
|
static NTSTATUS load_parameters ( LPCWSTR key_name ) {
|
||||||
|
HANDLE reg_key;
|
||||||
|
ULONG boottext;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* Open Parameters key */
|
||||||
|
status = reg_open ( ®_key, key_name, L"Parameters", NULL );
|
||||||
|
if ( ! NT_SUCCESS ( status ) ) {
|
||||||
|
DbgPrint ( "Could not open Parameters key: %x\n", status );
|
||||||
|
goto err_reg_open;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Retrieve BootText parameter */
|
||||||
|
status = reg_fetch_dword ( reg_key, L"BootText", &boottext );
|
||||||
|
if ( NT_SUCCESS ( status ) ) {
|
||||||
|
boottext_enabled = ( ( boottext != 0 ) ? TRUE : FALSE );
|
||||||
|
DbgPrint ( "Boot screen text is %s\n",
|
||||||
|
( boottext_enabled ? "enabled" : "disabled" ) );
|
||||||
|
} else {
|
||||||
|
DbgPrint ( "Could not read BootText parameter: %x\n", status );
|
||||||
|
/* Treat as non-fatal error */
|
||||||
|
status = STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
reg_close ( reg_key );
|
||||||
|
err_reg_open:
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dummy IRP handler
|
* Dummy IRP handler
|
||||||
*
|
*
|
||||||
@ -493,6 +529,14 @@ NTSTATUS DriverEntry ( IN PDRIVER_OBJECT DriverObject,
|
|||||||
|
|
||||||
DbgPrint ( "SAN Boot Configuration Driver initialising\n" );
|
DbgPrint ( "SAN Boot Configuration Driver initialising\n" );
|
||||||
|
|
||||||
|
/* Load driver parameters */
|
||||||
|
status = load_parameters ( RegistryPath->Buffer );
|
||||||
|
if ( ! NT_SUCCESS ( status ) ) {
|
||||||
|
/* Treat as non-fatal error */
|
||||||
|
DbgPrint ( "Could not load parameters: %x\n", status );
|
||||||
|
status = STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/* Hook in driver methods */
|
/* Hook in driver methods */
|
||||||
DriverObject->MajorFunction[IRP_MJ_CREATE] = sanbootconf_dummy_irp;
|
DriverObject->MajorFunction[IRP_MJ_CREATE] = sanbootconf_dummy_irp;
|
||||||
DriverObject->MajorFunction[IRP_MJ_CLOSE] = sanbootconf_dummy_irp;
|
DriverObject->MajorFunction[IRP_MJ_CLOSE] = sanbootconf_dummy_irp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user