mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 12:40:33 +00:00
[VIDEOPRT] [FORMATTING] No code change
This commit is contained in:
parent
9ab3246d43
commit
e7b3c66a42
1 changed files with 126 additions and 95 deletions
|
@ -151,7 +151,8 @@ IntInitializeVideoAddressSpace(VOID)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_M_IX86)
|
#if defined(_M_IX86)
|
||||||
VP_STATUS NTAPI
|
VP_STATUS
|
||||||
|
NTAPI
|
||||||
IntInt10AllocateBuffer(
|
IntInt10AllocateBuffer(
|
||||||
IN PVOID Context,
|
IN PVOID Context,
|
||||||
OUT PUSHORT Seg,
|
OUT PUSHORT Seg,
|
||||||
|
@ -168,9 +169,12 @@ IntInt10AllocateBuffer(
|
||||||
IntAttachToCSRSS(&CallingProcess, &ApcState);
|
IntAttachToCSRSS(&CallingProcess, &ApcState);
|
||||||
|
|
||||||
MemoryAddress = (PVOID)0x20000;
|
MemoryAddress = (PVOID)0x20000;
|
||||||
Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &MemoryAddress, 0,
|
Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
|
||||||
Length, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
&MemoryAddress,
|
||||||
|
0,
|
||||||
|
Length,
|
||||||
|
MEM_COMMIT,
|
||||||
|
PAGE_EXECUTE_READWRITE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
WARN_(VIDEOPRT, "- ZwAllocateVirtualMemory failed\n");
|
WARN_(VIDEOPRT, "- ZwAllocateVirtualMemory failed\n");
|
||||||
|
@ -199,7 +203,8 @@ IntInt10AllocateBuffer(
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
VP_STATUS NTAPI
|
VP_STATUS
|
||||||
|
NTAPI
|
||||||
IntInt10FreeBuffer(
|
IntInt10FreeBuffer(
|
||||||
IN PVOID Context,
|
IN PVOID Context,
|
||||||
IN USHORT Seg,
|
IN USHORT Seg,
|
||||||
|
@ -216,14 +221,18 @@ IntInt10FreeBuffer(
|
||||||
INFO_(VIDEOPRT, "- Offset: %x\n", Off);
|
INFO_(VIDEOPRT, "- Offset: %x\n", Off);
|
||||||
|
|
||||||
IntAttachToCSRSS(&CallingProcess, &ApcState);
|
IntAttachToCSRSS(&CallingProcess, &ApcState);
|
||||||
Status = ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, &Size,
|
Status = ZwFreeVirtualMemory(NtCurrentProcess(),
|
||||||
|
&MemoryAddress,
|
||||||
|
&Size,
|
||||||
MEM_RELEASE);
|
MEM_RELEASE);
|
||||||
|
|
||||||
IntDetachFromCSRSS(&CallingProcess, &ApcState);
|
IntDetachFromCSRSS(&CallingProcess, &ApcState);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
VP_STATUS NTAPI
|
VP_STATUS
|
||||||
|
NTAPI
|
||||||
IntInt10ReadMemory(
|
IntInt10ReadMemory(
|
||||||
IN PVOID Context,
|
IN PVOID Context,
|
||||||
IN USHORT Seg,
|
IN USHORT Seg,
|
||||||
|
@ -247,7 +256,8 @@ IntInt10ReadMemory(
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
VP_STATUS NTAPI
|
VP_STATUS
|
||||||
|
NTAPI
|
||||||
IntInt10WriteMemory(
|
IntInt10WriteMemory(
|
||||||
IN PVOID Context,
|
IN PVOID Context,
|
||||||
IN USHORT Seg,
|
IN USHORT Seg,
|
||||||
|
@ -286,7 +296,7 @@ IntInt10CallBios(
|
||||||
IntAttachToCSRSS(&CallingProcess, &ApcState);
|
IntAttachToCSRSS(&CallingProcess, &ApcState);
|
||||||
|
|
||||||
/* Clear the context */
|
/* Clear the context */
|
||||||
RtlZeroMemory(&BiosContext, sizeof(CONTEXT));
|
RtlZeroMemory(&BiosContext, sizeof(BiosContext));
|
||||||
|
|
||||||
/* Fill out the bios arguments */
|
/* Fill out the bios arguments */
|
||||||
BiosContext.Eax = BiosArguments->Eax;
|
BiosContext.Eax = BiosArguments->Eax;
|
||||||
|
@ -300,8 +310,14 @@ IntInt10CallBios(
|
||||||
BiosContext.SegEs = BiosArguments->SegEs;
|
BiosContext.SegEs = BiosArguments->SegEs;
|
||||||
|
|
||||||
/* Do the ROM BIOS call */
|
/* Do the ROM BIOS call */
|
||||||
(void)KeWaitForMutexObject(&VideoPortInt10Mutex, Executive, KernelMode, FALSE, NULL);
|
(void)KeWaitForMutexObject(&VideoPortInt10Mutex,
|
||||||
|
Executive,
|
||||||
|
KernelMode,
|
||||||
|
FALSE,
|
||||||
|
NULL);
|
||||||
|
|
||||||
Status = Ke386CallBios(0x10, &BiosContext);
|
Status = Ke386CallBios(0x10, &BiosContext);
|
||||||
|
|
||||||
KeReleaseMutex(&VideoPortInt10Mutex, FALSE);
|
KeReleaseMutex(&VideoPortInt10Mutex, FALSE);
|
||||||
|
|
||||||
/* Return the arguments */
|
/* Return the arguments */
|
||||||
|
@ -317,7 +333,12 @@ IntInt10CallBios(
|
||||||
|
|
||||||
/* Detach and return status */
|
/* Detach and return status */
|
||||||
IntDetachFromCSRSS(&CallingProcess, &ApcState);
|
IntDetachFromCSRSS(&CallingProcess, &ApcState);
|
||||||
if (NT_SUCCESS(Status)) return NO_ERROR;
|
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
return NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -328,7 +349,8 @@ IntInt10CallBios(
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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)
|
||||||
|
@ -360,7 +382,11 @@ VideoPortInt10(
|
||||||
BiosContext.Ebp = BiosArguments->Ebp;
|
BiosContext.Ebp = BiosArguments->Ebp;
|
||||||
|
|
||||||
/* Do the ROM BIOS call */
|
/* Do the ROM BIOS call */
|
||||||
(void)KeWaitForMutexObject(&VideoPortInt10Mutex, Executive, KernelMode, FALSE, NULL);
|
(void)KeWaitForMutexObject(&VideoPortInt10Mutex,
|
||||||
|
Executive,
|
||||||
|
KernelMode,
|
||||||
|
FALSE,
|
||||||
|
NULL);
|
||||||
Status = Ke386CallBios(0x10, &BiosContext);
|
Status = Ke386CallBios(0x10, &BiosContext);
|
||||||
KeReleaseMutex(&VideoPortInt10Mutex, FALSE);
|
KeReleaseMutex(&VideoPortInt10Mutex, FALSE);
|
||||||
|
|
||||||
|
@ -375,7 +401,12 @@ VideoPortInt10(
|
||||||
|
|
||||||
/* Detach from CSRSS */
|
/* Detach from CSRSS */
|
||||||
IntDetachFromCSRSS(&CallingProcess, &ApcState);
|
IntDetachFromCSRSS(&CallingProcess, &ApcState);
|
||||||
if (NT_SUCCESS(Status)) return NO_ERROR;
|
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
return NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
#else
|
#else
|
||||||
/* Not implemented for anything else than X86*/
|
/* Not implemented for anything else than X86*/
|
||||||
|
|
Loading…
Reference in a new issue