mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 03:33:02 +00:00
- Fix VideoPortInt10 implementation. The previous implementation was passing a significantly smaller KV86M_REGISTERS struct vice CONTEXT struct to Ke386CallBios, resulting in memory corruption.
- Part 2 of ? fixes for bug 2286. svn path=/trunk/; revision=38365
This commit is contained in:
parent
a7e5b19f4c
commit
51dc30a02c
1 changed files with 37 additions and 37 deletions
|
@ -199,48 +199,48 @@ IntInt10CallBios(
|
||||||
|
|
||||||
VP_STATUS NTAPI
|
VP_STATUS NTAPI
|
||||||
VideoPortInt10(
|
VideoPortInt10(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments)
|
IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments)
|
||||||
{
|
{
|
||||||
KV86M_REGISTERS Regs;
|
CONTEXT BiosContext;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
|
PKPROCESS CallingProcess = (PKPROCESS)PsGetCurrentProcess();
|
||||||
KAPC_STATE ApcState;
|
KAPC_STATE ApcState;
|
||||||
|
|
||||||
TRACE_(VIDEOPRT, "VideoPortInt10\n");
|
if (!CsrssInitialized)
|
||||||
|
{
|
||||||
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
if (!CsrssInitialized)
|
/* Attach to CSRSS */
|
||||||
{
|
IntAttachToCSRSS(&CallingProcess, &ApcState);
|
||||||
return ERROR_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
|
|
||||||
IntAttachToCSRSS(&CallingProcess, &ApcState);
|
/* Clear the context */
|
||||||
|
RtlZeroMemory(&BiosContext, sizeof(CONTEXT));
|
||||||
|
|
||||||
memset(&Regs, 0, sizeof(Regs));
|
/* Fill out the bios arguments */
|
||||||
INFO_(VIDEOPRT, "- Input register Eax: %x\n", BiosArguments->Eax);
|
BiosContext.Eax = BiosArguments->Eax;
|
||||||
Regs.Eax = BiosArguments->Eax;
|
BiosContext.Ebx = BiosArguments->Ebx;
|
||||||
INFO_(VIDEOPRT, "- Input register Ebx: %x\n", BiosArguments->Ebx);
|
BiosContext.Ecx = BiosArguments->Ecx;
|
||||||
Regs.Ebx = BiosArguments->Ebx;
|
BiosContext.Edx = BiosArguments->Edx;
|
||||||
INFO_(VIDEOPRT, "- Input register Ecx: %x\n", BiosArguments->Ecx);
|
BiosContext.Esi = BiosArguments->Esi;
|
||||||
Regs.Ecx = BiosArguments->Ecx;
|
BiosContext.Edi = BiosArguments->Edi;
|
||||||
INFO_(VIDEOPRT, "- Input register Edx: %x\n", BiosArguments->Edx);
|
BiosContext.Ebp = BiosArguments->Ebp;
|
||||||
Regs.Edx = BiosArguments->Edx;
|
|
||||||
INFO_(VIDEOPRT, "- Input register Esi: %x\n", BiosArguments->Esi);
|
|
||||||
Regs.Esi = BiosArguments->Esi;
|
|
||||||
INFO_(VIDEOPRT, "- Input register Edi: %x\n", BiosArguments->Edi);
|
|
||||||
Regs.Edi = BiosArguments->Edi;
|
|
||||||
INFO_(VIDEOPRT, "- Input register Ebp: %x\n", BiosArguments->Ebp);
|
|
||||||
Regs.Ebp = BiosArguments->Ebp;
|
|
||||||
Status = Ke386CallBios(0x10, (PCONTEXT)&Regs);
|
|
||||||
BiosArguments->Eax = Regs.Eax;
|
|
||||||
BiosArguments->Ebx = Regs.Ebx;
|
|
||||||
BiosArguments->Ecx = Regs.Ecx;
|
|
||||||
BiosArguments->Edx = Regs.Edx;
|
|
||||||
BiosArguments->Esi = Regs.Esi;
|
|
||||||
BiosArguments->Edi = Regs.Edi;
|
|
||||||
BiosArguments->Ebp = Regs.Ebp;
|
|
||||||
|
|
||||||
IntDetachFromCSRSS(&CallingProcess, &ApcState);
|
/* Do the ROM BIOS call */
|
||||||
|
Status = Ke386CallBios(0x10, &BiosContext);
|
||||||
|
|
||||||
return Status;
|
/* Return the arguments */
|
||||||
|
BiosArguments->Eax = BiosContext.Eax;
|
||||||
|
BiosArguments->Ebx = BiosContext.Ebx;
|
||||||
|
BiosArguments->Ecx = BiosContext.Ecx;
|
||||||
|
BiosArguments->Edx = BiosContext.Edx;
|
||||||
|
BiosArguments->Esi = BiosContext.Esi;
|
||||||
|
BiosArguments->Edi = BiosContext.Edi;
|
||||||
|
BiosArguments->Ebp = BiosContext.Ebp;
|
||||||
|
|
||||||
|
/* Detach from CSRSS */
|
||||||
|
IntDetachFromCSRSS(&CallingProcess, &ApcState);
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue