#include "videoprt.h"
#include <ndk/kefuncs.h>
#include <ndk/halfuncs.h>
#include <ndk/mmfuncs.h>
#include <debug.h>
Go to the source code of this file.
|
| static VOID | ProtectLowV86Mem (VOID) |
| |
| static VOID | UnprotectLowV86Mem (VOID) |
| |
| NTSTATUS NTAPI | IntInitializeVideoAddressSpace (VOID) |
| |
| VP_STATUS NTAPI | IntInt10AllocateBuffer (IN PVOID Context, OUT PUSHORT Seg, OUT PUSHORT Off, IN OUT PULONG Length) |
| |
| VP_STATUS NTAPI | IntInt10FreeBuffer (IN PVOID Context, IN USHORT Seg, IN USHORT Off) |
| |
| VP_STATUS NTAPI | IntInt10ReadMemory (IN PVOID Context, IN USHORT Seg, IN USHORT Off, OUT PVOID Buffer, IN ULONG Length) |
| |
| VP_STATUS NTAPI | IntInt10WriteMemory (IN PVOID Context, IN USHORT Seg, IN USHORT Off, IN PVOID Buffer, IN ULONG Length) |
| |
| VP_STATUS NTAPI | IntInt10CallBios (IN PVOID Context, IN OUT PINT10_BIOS_ARGUMENTS BiosArguments) |
| |
| VP_STATUS NTAPI | VideoPortInt10 (IN PVOID HwDeviceExtension, IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments) |
| |
◆ IsLowV86Mem
| #define IsLowV86Mem |
( |
|
_Seg, |
|
|
|
_Off |
|
) |
| ((((_Seg) << 4) + (_Off)) < (0xa0000)) |
◆ NDEBUG
◆ IntInitializeVideoAddressSpace()
◆ IntInt10AllocateBuffer()
Definition at line 213 of file int10.c.
218{
220#ifdef _M_IX86
225
226 TRACE_(VIDEOPRT,
"IntInt10AllocateBuffer\n");
227
228
231
233 MemoryAddress = (
PVOID)0x20000;
234
236 &MemoryAddress,
237 0,
242 {
243 WARN_(VIDEOPRT,
"- ZwAllocateVirtualMemory failed\n");
246 }
247
248 if (MemoryAddress > (
PVOID)(0x100000 -
Size))
249 {
251 &MemoryAddress,
254 WARN_(VIDEOPRT,
"- Unacceptable memory allocated\n");
257 }
258
260
264
265 INFO_(VIDEOPRT,
"- Segment: %x\n", *Seg);
266 INFO_(VIDEOPRT,
"- Offset: %x\n", *Off);
268
270#else
273#endif
274}
#define ERROR_NOT_ENOUGH_MEMORY
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define NtCurrentProcess()
#define PAGE_EXECUTE_READWRITE
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Out_ PKAPC_STATE ApcState
VOID FASTCALL IntDetachFromCSRSS(_In_ PKPROCESS CallingProcess, _In_ PKAPC_STATE ApcState)
Detach the current thread from the CSRSS process. This routine is to be invoked after a previous succ...
BOOLEAN FASTCALL IntAttachToCSRSS(_Outptr_ PKPROCESS *CallingProcess, _Out_ PKAPC_STATE ApcState)
Attach the current thread to the CSRSS process. The caller must detach from the process by invoking I...
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
NTSTATUS NTAPI x86BiosAllocateBuffer(_Inout_ ULONG *Size, _Out_ USHORT *Segment, _Out_ USHORT *Offset)
Referenced by VideoPortQueryServices().
◆ IntInt10CallBios()
Definition at line 394 of file int10.c.
397{
398#ifdef _M_AMD64
400#else
402#endif
406
407
418
419
422
423
429
430
432#ifdef _M_AMD64
434#else
436#endif
438
440
442
443
453
455}
static VOID UnprotectLowV86Mem(VOID)
static VOID ProtectLowV86Mem(VOID)
LONG NTAPI KeReleaseMutex(IN PKMUTEX Mutex, IN BOOLEAN Wait)
#define RtlZeroMemory(Destination, Length)
#define STATUS_UNSUCCESSFUL
NTSTATUS NTAPI Ke386CallBios(IN ULONG Int, OUT PCONTEXT Context)
KMUTEX VideoPortInt10Mutex
BOOLEAN NTAPI x86BiosCall(_In_ ULONG InterruptNumber, _Inout_ PX86_BIOS_REGISTERS Registers)
#define KeWaitForMutexObject
Referenced by VideoPortInt10(), and VideoPortQueryServices().
◆ IntInt10FreeBuffer()
Definition at line 278 of file int10.c.
282{
284#ifdef _M_IX86
289
290 TRACE_(VIDEOPRT,
"IntInt10FreeBuffer\n");
291 INFO_(VIDEOPRT,
"- Segment: %x\n", Seg);
292 INFO_(VIDEOPRT,
"- Offset: %x\n", Off);
293
294
297
299 &MemoryAddress,
302
304
306#else
309#endif
310}
NTSTATUS NTAPI x86BiosFreeBuffer(_In_ USHORT Segment, _In_ USHORT Offset)
Referenced by VideoPortQueryServices().
◆ IntInt10ReadMemory()
Definition at line 314 of file int10.c.
320{
321#ifdef _M_IX86
324
325 TRACE_(VIDEOPRT,
"IntInt10ReadMemory\n");
326 INFO_(VIDEOPRT,
"- Segment: %x\n", Seg);
327 INFO_(VIDEOPRT,
"- Offset: %x\n", Off);
330
331
334
340
342
344#else
346
349#endif
350}
#define IsLowV86Mem(_Seg, _Off)
#define RtlCopyMemory(Destination, Source, Length)
NTSTATUS NTAPI x86BiosReadMemory(_In_ USHORT Segment, _In_ USHORT Offset, _Out_writes_bytes_(Size) PVOID Buffer, _In_ ULONG Size)
Referenced by VideoPortQueryServices().
◆ IntInt10WriteMemory()
Definition at line 354 of file int10.c.
360{
361#ifdef _M_IX86
364
365 TRACE_(VIDEOPRT,
"IntInt10WriteMemory\n");
366 INFO_(VIDEOPRT,
"- Segment: %x\n", Seg);
367 INFO_(VIDEOPRT,
"- Offset: %x\n", Off);
370
371
374
380
382
384#else
386
389#endif
390}
NTSTATUS NTAPI x86BiosWriteMemory(_In_ USHORT Segment, _In_ USHORT Offset, _In_reads_bytes_(Size) PVOID Buffer, _In_ ULONG Size)
Referenced by VideoPortQueryServices().
◆ ProtectLowV86Mem()
Definition at line 39 of file int10.c.
40{
41
42
46
47
49
50
53 0,
58}
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
#define PsGetCurrentProcess
Referenced by IntInt10CallBios(), IntInt10ReadMemory(), and IntInt10WriteMemory().
◆ UnprotectLowV86Mem()
◆ VideoPortInt10()
Definition at line 464 of file int10.c.
467{
470
472 {
474 }
475
476
477 RtlCopyMemory(&Int10BiosArguments, BiosArguments,
sizeof(*BiosArguments));
478 Int10BiosArguments.
SegDs = 0;
479 Int10BiosArguments.
SegEs = 0;
480
481
483
484
485 RtlCopyMemory(BiosArguments, &Int10BiosArguments,
sizeof(*BiosArguments));
486
488}
VP_STATUS NTAPI IntInt10CallBios(IN PVOID Context, IN OUT PINT10_BIOS_ARGUMENTS BiosArguments)
Referenced by VbeSetMode().