3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/inbv/inbv.c
6 * PURPOSE: Boot video support
7 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
9 * 12-07-2003 CSH Created
12 /* INCLUDES ******************************************************************/
15 #include <ntos/bootvid.h>
16 #include <ddk/ntbootvid.h>
19 #include <internal/debug.h>
22 /* GLOBALS *******************************************************************/
24 /* DATA **********************************************************************/
26 static HANDLE BootVidDevice = NULL;
27 static BOOL BootVidDriverInstalled = FALSE;
28 static NTBOOTVID_FUNCTION_TABLE BootVidFunctionTable;
30 /* FUNCTIONS *****************************************************************/
34 InbvCheckBootVid(VOID)
38 if (BootVidDevice == NULL)
41 OBJECT_ATTRIBUTES ObjectAttributes;
42 UNICODE_STRING BootVidName;
44 RtlInitUnicodeStringFromLiteral(&BootVidName, L"\\Device\\BootVid");
45 InitializeObjectAttributes(&ObjectAttributes,
50 Status = ZwOpenFile(&BootVidDevice,
56 if (!NT_SUCCESS(Status))
61 return(STATUS_SUCCESS);
66 InbvAcquireDisplayOwnership(VOID)
73 InbvCheckDisplayOwnership(VOID)
81 InbvDisplayString(IN PCHAR String)
88 InbvResetDisplayParameters(ULONG SizeX, ULONG SizeY)
90 return(InbvResetDisplay());
95 InbvEnableBootDriver(IN BOOLEAN Enable)
100 Status = InbvCheckBootVid();
101 if (!NT_SUCCESS(Status))
108 Status = NtDeviceIoControlFile(BootVidDevice,
113 IOCTL_BOOTVID_INITIALIZE,
116 &BootVidFunctionTable,
117 sizeof(BootVidFunctionTable));
118 if (!NT_SUCCESS(Status))
122 BootVidDriverInstalled = TRUE;
123 /* Notify the hal we have acquired the display. */
125 HalAcquireDisplayOwnership(InbvResetDisplayParameters);
129 Status = NtDeviceIoControlFile(BootVidDevice,
134 IOCTL_BOOTVID_CLEANUP,
139 if (!NT_SUCCESS(Status))
143 BootVidDriverInstalled = FALSE;
144 /* Notify the hal we have released the display. */
145 HalReleaseDisplayOwnership();
147 NtClose(BootVidDevice);
148 BootVidDevice = NULL;
154 InbvEnableDisplayString(IN BOOLEAN Enable)
162 InbvInstallDisplayStringFilter(IN PVOID Unknown)
169 InbvIsBootDriverInstalled(VOID)
171 return(BootVidDriverInstalled);
177 InbvNotifyDisplayOwnershipLost(IN PVOID Callback)
184 InbvResetDisplay(VOID)
186 if (!BootVidDriverInstalled)
190 return(BootVidFunctionTable.ResetDisplay());
196 InbvSetScrollRegion(IN ULONG Left,
206 InbvSetTextColor(IN ULONG Color)
213 InbvSolidColorFill(IN ULONG Left,