svn path=/trunk/; revision=20015
* Set to Write Mode 2 and Read Mode 0.
*/
* Set to Write Mode 2 and Read Mode 0.
*/
-static VGA_REGISTERS Mode12Regs =
+static const VGA_REGISTERS Mode12Regs =
{
/* CRT Controller Registers */
{0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00,
{
/* CRT Controller Registers */
{0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00,
static CLIENT_ID BitmapThreadId;
static PUCHAR BootimageBitmap;
static CLIENT_ID BitmapThreadId;
static PUCHAR BootimageBitmap;
+static ULONG ShutdownNotify;
+static KEVENT ShutdownCompleteEvent;
+
/* DATA **********************************************************************/
static PDRIVER_OBJECT BootVidDriverObject = NULL;
/* DATA **********************************************************************/
static PDRIVER_OBJECT BootVidDriverObject = NULL;
-vgaSetRegisters(PVGA_REGISTERS Registers)
+vgaSetRegisters(const VGA_REGISTERS *Registers)
VidCleanUp(VOID)
{
InbvUnmapVideoMemory();
VidCleanUp(VOID)
{
InbvUnmapVideoMemory();
+ InterlockedIncrement(&ShutdownNotify);
+ KeWaitForSingleObject(&ShutdownCompleteEvent, Executive, KernelMode,
+ FALSE, NULL);
FaderPaletteDelta[i].b = ((Palette[i].rgbBlue << 8) / PALETTE_FADE_STEPS);
}
FaderPaletteDelta[i].b = ((Palette[i].rgbBlue << 8) / PALETTE_FADE_STEPS);
}
- for (i = 0; i < PALETTE_FADE_STEPS; i++)
+ for (i = 0; i < PALETTE_FADE_STEPS && !ShutdownNotify; i++)
{
/* Disable screen and enable palette access. */
READ_PORT_UCHAR(STATUS);
{
/* Disable screen and enable palette access. */
READ_PORT_UCHAR(STATUS);
{
DbgPrint("Warning: Cannot find boot image\n");
}
{
DbgPrint("Warning: Cannot find boot image\n");
}
+ KeSetEvent(&ShutdownCompleteEvent, 0, FALSE);
BootVidDriverObject = DriverObject;
BootVidDriverObject = DriverObject;
+ ShutdownNotify = 0;
+ KeInitializeEvent(&ShutdownCompleteEvent, NotificationEvent, FALSE);
+
/* Register driver routines */
DriverObject->MajorFunction[IRP_MJ_CLOSE] = VidDispatch;
DriverObject->MajorFunction[IRP_MJ_CREATE] = VidDispatch;
/* Register driver routines */
DriverObject->MajorFunction[IRP_MJ_CLOSE] = VidDispatch;
DriverObject->MajorFunction[IRP_MJ_CREATE] = VidDispatch;