[VIDEOPRT]

- Guard Ke386CallBios calls against concurrent execution.
CORE-13214

svn path=/trunk/; revision=74581
This commit is contained in:
Thomas Faber 2017-05-18 21:29:24 +00:00
parent 7fd7537957
commit 17c95d5279
3 changed files with 13 additions and 0 deletions

View file

@ -296,7 +296,9 @@ IntInt10CallBios(
BiosContext.SegEs = BiosArguments->SegEs;
/* Do the ROM BIOS call */
(void)KeWaitForMutexObject(&VideoPortInt10Mutex, Executive, KernelMode, FALSE, NULL);
Status = Ke386CallBios(0x10, &BiosContext);
KeReleaseMutex(&VideoPortInt10Mutex, FALSE);
/* Return the arguments */
BiosArguments->Eax = BiosContext.Eax;
@ -354,7 +356,9 @@ VideoPortInt10(
BiosContext.Ebp = BiosArguments->Ebp;
/* Do the ROM BIOS call */
(void)KeWaitForMutexObject(&VideoPortInt10Mutex, Executive, KernelMode, FALSE, NULL);
Status = Ke386CallBios(0x10, &BiosContext);
KeReleaseMutex(&VideoPortInt10Mutex, FALSE);
/* Return the arguments */
BiosArguments->Eax = BiosContext.Eax;

View file

@ -33,6 +33,7 @@
ULONG CsrssInitialized = FALSE;
PKPROCESS Csrss = NULL;
ULONG VideoPortDeviceNumber = 0;
KMUTEX VideoPortInt10Mutex;
/* PRIVATE FUNCTIONS **********************************************************/
@ -464,9 +465,16 @@ VideoPortInitialize(
NTSTATUS Status;
PVIDEO_PORT_DRIVER_EXTENSION DriverExtension;
BOOLEAN PnpDriver = FALSE, LegacyDetection = FALSE;
static BOOLEAN Int10MutexInitialized;
TRACE_(VIDEOPRT, "VideoPortInitialize\n");
if (!Int10MutexInitialized)
{
KeInitializeMutex(&VideoPortInt10Mutex, 0);
Int10MutexInitialized = TRUE;
}
/* As a first thing do parameter checks. */
if (HwInitializationData->HwInitDataSize > sizeof(VIDEO_HW_INITIALIZATION_DATA))
{

View file

@ -247,6 +247,7 @@ IntVideoPortMapPhysicalMemory(
extern ULONG CsrssInitialized;
extern PKPROCESS Csrss;
extern ULONG VideoPortDeviceNumber;
extern KMUTEX VideoPortInt10Mutex;
VOID FASTCALL
IntAttachToCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState);