ReactOS 0.4.16-dev-2528-g7139e57
inbv.h File Reference
#include "bootvid/bootvid.h"
Include dependency graph for inbv.h:

Go to the source code of this file.

Functions

BOOLEAN NTAPI InbvDriverInitialize (_In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ ULONG Count)
 
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState (VOID)
 
VOID NTAPI InbvAcquireLock (VOID)
 
VOID NTAPI InbvReleaseLock (VOID)
 
PUCHAR NTAPI InbvGetResourceAddress (_In_ ULONG ResourceNumber)
 
VOID NTAPI InbvBitBlt (_In_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y)
 
VOID NTAPI InbvBufferToScreenBlt (_In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
 
VOID NTAPI InbvScreenToBufferBlt (_Out_writes_bytes_all_(Delta *Height) PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
 
VOID NTAPI InbvSetProgressBarCoordinates (_In_ ULONG Left, _In_ ULONG Top)
 Sets the screen coordinates of the loading progress bar and enable it.
 
VOID NTAPI InbvIndicateProgress (VOID)
 Gives some progress feedback, without specifying any explicit number of progress steps or percentage. The corresponding percentage is derived from the progress indicator's current count, capped to the number of expected calls to be made to this function (default: 25, see InbvProgressIndicator.Expected).
 
VOID NTAPI InbvSetProgressBarSubset (_In_ ULONG Floor, _In_ ULONG Ceiling)
 Specifies a progress percentage sub-range. Further calls to InbvIndicateProgress() or InbvUpdateProgressBar() will update the progress percentage relative to this sub-range. In particular, the percentage provided to InbvUpdateProgressBar() is relative to this sub-range.
 
VOID NTAPI InbvUpdateProgressBar (_In_ ULONG Percentage)
 Updates the progress bar percentage, relative to the current percentage sub-range previously set by InbvSetProgressBarSubset().
 
VOID NTAPI InbvPortEnableFifo (_In_ ULONG PortId, _In_ BOOLEAN Enable)
 
BOOLEAN NTAPI InbvPortPollOnly (_In_ ULONG PortId)
 
BOOLEAN NTAPI InbvPortGetByte (_In_ ULONG PortId, _Out_ PUCHAR Byte)
 
VOID NTAPI InbvPortPutByte (_In_ ULONG PortId, _In_ UCHAR Byte)
 
BOOLEAN NTAPI InbvPortInitialize (_In_ ULONG BaudRate, _In_ ULONG PortNumber, _In_ PUCHAR PortAddress, _Out_ PULONG PortId, _In_ BOOLEAN IsMMIODevice)
 
VOID NTAPI InbvPortTerminate (_In_ ULONG PortId)
 

Variables

BOOLEAN InbvBootDriverInstalled
 

Function Documentation

◆ InbvAcquireLock()

VOID NTAPI InbvAcquireLock ( VOID  )

Definition at line 223 of file inbv.c.

224{
226
227 /* Check if we're at dispatch level or lower */
229 if (OldIrql <= DISPATCH_LEVEL)
230 {
231 /* Loop until the lock is free */
233
234 /* Raise IRQL to dispatch level */
236 }
237
238 /* Acquire the lock */
241}
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
static KIRQL InbvOldIrql
Definition: inbv.c:37
static KSPIN_LOCK BootDriverLock
Definition: inbv.c:36
BOOLEAN FASTCALL KeTestSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:475
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:287
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778

Referenced by BootAnimTickProgressBar(), BootLogoFadeIn(), DisplayBootBitmap(), FinalizeBootLogo(), InbvBitBlt(), InbvDisplayString(), InbvEnableBootDriver(), InbvNotifyDisplayOwnershipLost(), InbvRotationThread(), and InbvSolidColorFill().

◆ InbvBitBlt()

VOID NTAPI InbvBitBlt ( _In_ PUCHAR  Buffer,
_In_ ULONG  X,
_In_ ULONG  Y 
)

Definition at line 537 of file inbv.c.

541{
542 /* Check if we're installed and we own it */
545 {
546 /* Acquire the lock */
548
549 /* Do the blit */
550 VidBitBlt(Buffer, X, Y);
551
552 /* Release the lock */
554 }
555}
Definition: bufpool.h:45
#define Y(I)
VOID NTAPI VidBitBlt(_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
Definition: common.c:318
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:39
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:223
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:38
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:245
@ INBV_DISPLAY_STATE_OWNED
Definition: inbvtypes.h:33

Referenced by BitBltPalette(), and DisplayShutdownBitmap().

◆ InbvBufferToScreenBlt()

VOID NTAPI InbvBufferToScreenBlt ( _In_reads_bytes_(Delta *Height) PUCHAR  Buffer,
_In_ ULONG  X,
_In_ ULONG  Y,
_In_ ULONG  Width,
_In_ ULONG  Height,
_In_ ULONG  Delta 
)

Definition at line 559 of file inbv.c.

566{
567 /* Check if we're installed and we own it */
570 {
571 /* Do the blit */
573 }
574}
VOID NTAPI VidBufferToScreenBlt(_In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: common.c:300
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

Referenced by DisplayBootBitmap().

◆ InbvDriverInitialize()

BOOLEAN NTAPI InbvDriverInitialize ( _In_ PLOADER_PARAMETER_BLOCK  LoaderBlock,
_In_ ULONG  Count 
)

Definition at line 179 of file inbv.c.

182{
183 PCHAR CommandLine;
184 BOOLEAN ResetMode = FALSE; // By default do not reset the video mode
185 ULONG i;
186
187 /* Quit if we're already installed */
188 if (InbvBootDriverInstalled) return TRUE;
189
190 /* Initialize the lock and check the current display state */
193 {
194 /* Reset the video mode in case we do not have a custom boot logo */
195 CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
196 ResetMode = (CommandLine == NULL) || (strstr(CommandLine, "BOOTLOGO") == NULL);
197 }
198
199 /* Initialize the video */
202 {
203 /* Find bitmap resources in the kernel */
205 for (i = 1; i <= ResourceCount; i++)
206 {
207 /* Do the lookup */
208 ResourceList[i] = FindBitmapResource(LoaderBlock, i);
209 }
210
211 /* Set the progress bar ranges */
213
214 // BootAnimInitialize(LoaderBlock, Count);
215 }
216
217 /* Return install state */
219}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
unsigned char BOOLEAN
Definition: actypes.h:127
BOOLEAN NTAPI VidInitialize(_In_ BOOLEAN SetMode)
Definition: bootvid.c:231
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_ACRTIMP char *__cdecl strstr(const char *, const char *)
Definition: string.c:3415
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID NTAPI InbvSetProgressBarSubset(_In_ ULONG Floor, _In_ ULONG Ceiling)
Specifies a progress percentage sub-range. Further calls to InbvIndicateProgress() or InbvUpdateProgr...
Definition: inbv.c:670
static ULONG ResourceCount
Definition: inbv.c:50
static PVOID FindBitmapResource(_In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ ULONG ResourceId)
Definition: inbv.c:99
#define min(a, b)
Definition: monoChain.cc:55
int Count
Definition: noreturn.cpp:7
_strupr
Definition: string.h:453
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309

Referenced by Phase1InitializationDiscard().

◆ InbvGetDisplayState()

INBV_DISPLAY_STATE NTAPI InbvGetDisplayState ( VOID  )

Definition at line 327 of file inbv.c.

328{
329 /* Return the actual state */
330 return InbvDisplayState;
331}

Referenced by BootAnimTickProgressBar(), BootLogoFadeIn(), FinalizeBootLogo(), and InbvRotationThread().

◆ InbvGetResourceAddress()

PUCHAR NTAPI InbvGetResourceAddress ( _In_ ULONG  ResourceNumber)

Definition at line 166 of file inbv.c.

168{
169 /* Validate the resource number */
170 if (ResourceNumber > ResourceCount) return NULL;
171
172 /* Return the address */
173 return ResourceList[ResourceNumber];
174}

Referenced by DisplayBootBitmap(), and DisplayShutdownBitmap().

◆ InbvIndicateProgress()

VOID NTAPI InbvIndicateProgress ( VOID  )

Gives some progress feedback, without specifying any explicit number of progress steps or percentage. The corresponding percentage is derived from the progress indicator's current count, capped to the number of expected calls to be made to this function (default: 25, see InbvProgressIndicator.Expected).

Returns
None.

Definition at line 632 of file inbv.c.

633{
634 ULONG Percentage;
635
636 /* Increase progress */
638
639 /* Compute the new percentage - Don't go over 100% */
640 Percentage = 100 * InbvProgressIndicator.Count /
642 Percentage = min(Percentage, 99);
643
644 if (Percentage != InbvProgressIndicator.Percentage)
645 {
646 /* Percentage has changed, update the progress bar */
648 InbvUpdateProgressBar(Percentage);
649 }
650}
static BT_PROGRESS_INDICATOR InbvProgressIndicator
Definition: inbv.c:48
VOID NTAPI InbvUpdateProgressBar(_In_ ULONG Percentage)
Updates the progress bar percentage, relative to the current percentage sub-range previously set by I...
Definition: inbv.c:696

Referenced by IopInitializeBuiltinDriver(), and IopInitializeSystemDrivers().

◆ InbvPortEnableFifo()

VOID NTAPI InbvPortEnableFifo ( _In_ ULONG  PortId,
_In_ BOOLEAN  Enable 
)

Definition at line 60 of file inbvport.c.

63{
64 /* Set FIFO as requested */
66}
VOID NTAPI CpEnableFifo(_In_ PUCHAR Address, _In_ BOOLEAN Enable)
Definition: cport.c:41
CPPORT Port[4]
Definition: inbvport.c:17
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
static WCHAR Address[46]
Definition: ping.c:68

Referenced by HdlspEnableTerminal().

◆ InbvPortGetByte()

BOOLEAN NTAPI InbvPortGetByte ( _In_ ULONG  PortId,
_Out_ PUCHAR  Byte 
)

Definition at line 40 of file inbvport.c.

43{
44 /* Read a byte from the port */
45 return CpGetByte(&Port[PortId], Byte, TRUE, FALSE) == CP_GET_SUCCESS;
46}
USHORT NTAPI CpGetByte(_Inout_ PCPPORT Port, _Out_ PUCHAR Byte, _In_ BOOLEAN Wait, _In_ BOOLEAN Poll)
Definition: cport.c:82
#define CP_GET_SUCCESS
Definition: cportlib.h:17
unsigned char Byte
Definition: zlib.h:37

Referenced by HdlspDispatch().

◆ InbvPortInitialize()

BOOLEAN NTAPI InbvPortInitialize ( _In_ ULONG  BaudRate,
_In_ ULONG  PortNumber,
_In_ PUCHAR  PortAddress,
_Out_ PULONG  PortId,
_In_ BOOLEAN  IsMMIODevice 
)

Definition at line 79 of file inbvport.c.

85{
86 /* Not yet supported */
87 ASSERT(IsMMIODevice == FALSE);
88
89 /* Set the default baud rate */
90 if (BaudRate == 0)
91 BaudRate = DEFAULT_BAUD_RATE;
92
93 /* Check if the port or address is given */
94 if (PortNumber)
95 {
96 /* Pick correct address for port */
97 if (!PortAddress)
98 {
99 if (PortNumber < 1 || PortNumber > MAX_COM_PORTS)
101 PortAddress = UlongToPtr(BaseArray[PortNumber]);
102 }
103 }
104 else
105 {
106 /* Pick correct port for address */
107#if defined(SARCH_PC98)
108 static const ULONG TestPorts[] = {1, 2};
109#else
110 static const ULONG TestPorts[] = {2, 1};
111#endif
112 PortAddress = UlongToPtr(BaseArray[TestPorts[0]]);
113 if (CpDoesPortExist(PortAddress))
114 {
115 PortNumber = TestPorts[0];
116 }
117 else
118 {
119 PortAddress = UlongToPtr(BaseArray[TestPorts[1]]);
120 if (!CpDoesPortExist(PortAddress))
121 return FALSE;
122 PortNumber = TestPorts[1];
123 }
124 }
125
126 /* Initialize the port unless it's already up and return it */
127 if (Port[PortNumber - 1].Address)
128 return FALSE;
129
130 CpInitialize(&Port[PortNumber - 1], PortAddress, BaudRate);
131 *PortId = PortNumber - 1;
132 return TRUE;
133}
NTSTATUS NTAPI CpInitialize(_Inout_ PCPPORT Port, _In_ PUCHAR Address, _In_ ULONG BaudRate)
Definition: cport.c:59
BOOLEAN NTAPI CpDoesPortExist(_In_ PUCHAR Address)
Definition: cport.c:33
#define UlongToPtr(u)
Definition: config.h:106
#define MAX_COM_PORTS
Definition: machpc.c:29
#define ASSERT(a)
Definition: mode.c:44
ULONG PortNumber
Definition: storport.c:18
#define DEFAULT_BAUD_RATE
Definition: uartinfo.h:24

Referenced by HdlspEnableTerminal().

◆ InbvPortPollOnly()

BOOLEAN NTAPI InbvPortPollOnly ( _In_ ULONG  PortId)

Definition at line 29 of file inbvport.c.

31{
32 UCHAR Dummy;
33
34 /* Poll a byte from the port */
35 return CpGetByte(&Port[PortId], &Dummy, FALSE, TRUE) == CP_GET_SUCCESS;
36}
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by HdlspDispatch().

◆ InbvPortPutByte()

VOID NTAPI InbvPortPutByte ( _In_ ULONG  PortId,
_In_ UCHAR  Byte 
)

Definition at line 50 of file inbvport.c.

53{
54 /* Send the byte */
55 CpPutByte(&Port[PortId], Byte);
56}
VOID NTAPI CpPutByte(_Inout_ PCPPORT Port, _In_ UCHAR Byte)
Definition: cport.c:93

Referenced by HdlspPutData(), and HdlspSendStringAtBaud().

◆ InbvPortTerminate()

VOID NTAPI InbvPortTerminate ( _In_ ULONG  PortId)

Definition at line 70 of file inbvport.c.

72{
73 /* The port is now available */
74 Port[PortId].Address = NULL;
75}
PUCHAR Address
Definition: cportlib.h:28

Referenced by HdlspEnableTerminal().

◆ InbvReleaseLock()

VOID NTAPI InbvReleaseLock ( VOID  )

Definition at line 245 of file inbv.c.

246{
248
249 /* Capture the old IRQL */
251
252 /* Release the driver lock */
254
255 /* If we were at dispatch level or lower, restore the old IRQL */
257}
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:298

Referenced by BootAnimTickProgressBar(), BootLogoFadeIn(), DisplayBootBitmap(), FinalizeBootLogo(), InbvBitBlt(), InbvDisplayString(), InbvEnableBootDriver(), InbvNotifyDisplayOwnershipLost(), InbvRotationThread(), and InbvSolidColorFill().

◆ InbvScreenToBufferBlt()

VOID NTAPI InbvScreenToBufferBlt ( _Out_writes_bytes_all_(Delta *Height) PUCHAR  Buffer,
_In_ ULONG  X,
_In_ ULONG  Y,
_In_ ULONG  Width,
_In_ ULONG  Height,
_In_ ULONG  Delta 
)

Definition at line 578 of file inbv.c.

585{
586 /* Check if we're installed and we own it */
589 {
590 /* Do the blit */
592 }
593}
VOID NTAPI VidScreenToBufferBlt(_Out_writes_bytes_all_(Delta *Height) PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: bootvid.c:284

Referenced by DisplayBootBitmap().

◆ InbvSetProgressBarCoordinates()

VOID NTAPI InbvSetProgressBarCoordinates ( _In_ ULONG  Left,
_In_ ULONG  Top 
)

Sets the screen coordinates of the loading progress bar and enable it.

Parameters
[in]Left
[in]TopThe left/top coordinates.
Returns
None.

Definition at line 607 of file inbv.c.

610{
611 /* Update the coordinates */
612 ProgressBarLeft = Left;
614
615 /* Enable the progress bar */
617}
static LPHIST_ENTRY Top
Definition: history.c:53
ULONG ProgressBarTop
Definition: inbv.c:45
ULONG ProgressBarLeft
Definition: inbv.c:45
BOOLEAN ShowProgressBar
Definition: inbv.c:46

Referenced by DisplayBootBitmap().

◆ InbvSetProgressBarSubset()

VOID NTAPI InbvSetProgressBarSubset ( _In_ ULONG  Floor,
_In_ ULONG  Ceiling 
)

Specifies a progress percentage sub-range. Further calls to InbvIndicateProgress() or InbvUpdateProgressBar() will update the progress percentage relative to this sub-range. In particular, the percentage provided to InbvUpdateProgressBar() is relative to this sub-range.

Parameters
[in]FloorThe lower bound percentage of the sub-range (default: 0).
[in]CeilingThe upper bound percentage of the sub-range (default: 100).
Returns
None.

Definition at line 670 of file inbv.c.

673{
674 /* Sanity checks */
675 ASSERT(Floor < Ceiling);
676 ASSERT(Ceiling <= 100);
677
678 /* Update the progress bar state */
679 InbvProgressState.Floor = Floor * 100;
680 InbvProgressState.Ceiling = Ceiling * 100;
681 InbvProgressState.Bias = Ceiling - Floor;
682}
static INBV_PROGRESS_STATE InbvProgressState
Definition: inbv.c:47

Referenced by BootAnimInitialize(), InbvDriverInitialize(), and Phase1InitializationDiscard().

◆ InbvUpdateProgressBar()

VOID NTAPI InbvUpdateProgressBar ( _In_ ULONG  Percentage)

Updates the progress bar percentage, relative to the current percentage sub-range previously set by InbvSetProgressBarSubset().

Parameters
[in]PercentageThe progress percentage, relative to the current sub-range.
Returns
None.

Definition at line 696 of file inbv.c.

698{
699 ULONG TotalProgress;
700
701 /* Make sure the progress bar is enabled, that we own and are installed */
702 if (ShowProgressBar &&
705 {
706 /* Compute the total progress and tick the progress bar */
707 TotalProgress = InbvProgressState.Floor + (Percentage * InbvProgressState.Bias);
708 // TotalProgress /= (100 * 100);
709
710 BootAnimTickProgressBar(TotalProgress);
711 }
712}
VOID NTAPI BootAnimTickProgressBar(_In_ ULONG SubPercentTimes100)
Ticks the progress bar. Used by InbvUpdateProgressBar() and related.
Definition: bootanim.c:318

Referenced by InbvIndicateProgress(), and Phase1InitializationDiscard().

Variable Documentation

◆ InbvBootDriverInstalled