#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 210 of file int10.c.
215{
217#ifdef _M_IX86
222
223 TRACE_(VIDEOPRT,
"IntInt10AllocateBuffer\n");
224
226
228 MemoryAddress = (
PVOID)0x20000;
229
231 &MemoryAddress,
232 0,
237 {
238 WARN_(VIDEOPRT,
"- ZwAllocateVirtualMemory failed\n");
241 }
242
243 if (MemoryAddress > (
PVOID)(0x100000 -
Size))
244 {
246 &MemoryAddress,
249 WARN_(VIDEOPRT,
"- Unacceptable memory allocated\n");
252 }
253
257
258 INFO_(VIDEOPRT,
"- Segment: %x\n", (
ULONG_PTR)MemoryAddress >> 4);
259 INFO_(VIDEOPRT,
"- Offset: %x\n", (
ULONG_PTR)MemoryAddress & 0xF);
261
263
265#else
268#endif
269}
#define ERROR_NOT_ENOUGH_MEMORY
#define NT_SUCCESS(StatCode)
#define NtCurrentProcess()
#define PAGE_EXECUTE_READWRITE
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Out_ PKAPC_STATE ApcState
VOID FASTCALL IntDetachFromCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState)
VOID FASTCALL IntAttachToCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
struct _KPROCESS * PKPROCESS
NTSTATUS NTAPI x86BiosAllocateBuffer(_In_ ULONG *Size, _In_ USHORT *Segment, _In_ USHORT *Offset)
#define PsGetCurrentProcess
Referenced by VideoPortQueryServices().
◆ IntInt10CallBios()
Definition at line 380 of file int10.c.
383{
384#ifdef _M_AMD64
386#else
388#endif
392
393
395
396
398
399
409
410
416
417
419#ifdef _M_AMD64
421#else
423#endif
425
427
428
438
439
441
443 {
445 }
446
448}
#define ERROR_INVALID_PARAMETER
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 273 of file int10.c.
277{
279#ifdef _M_IX86
284
285 TRACE_(VIDEOPRT,
"IntInt10FreeBuffer\n");
286 INFO_(VIDEOPRT,
"- Segment: %x\n", Seg);
287 INFO_(VIDEOPRT,
"- Offset: %x\n", Off);
288
291 &MemoryAddress,
294
296
298#else
301#endif
302}
NTSTATUS NTAPI x86BiosFreeBuffer(_In_ USHORT Segment, _In_ USHORT Offset)
Referenced by VideoPortQueryServices().
◆ IntInt10ReadMemory()
Definition at line 306 of file int10.c.
312{
313#ifdef _M_IX86
316
317 TRACE_(VIDEOPRT,
"IntInt10ReadMemory\n");
318 INFO_(VIDEOPRT,
"- Segment: %x\n", Seg);
319 INFO_(VIDEOPRT,
"- Offset: %x\n", Off);
322
324
330
332
334#else
336
339#endif
340}
#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 344 of file int10.c.
350{
351#ifdef _M_IX86
354
355 TRACE_(VIDEOPRT,
"IntInt10WriteMemory\n");
356 INFO_(VIDEOPRT,
"- Segment: %x\n", Seg);
357 INFO_(VIDEOPRT,
"- Offset: %x\n", Off);
360
368
370#else
372
375#endif
376}
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
Referenced by IntInt10CallBios(), IntInt10ReadMemory(), and IntInt10WriteMemory().
◆ UnprotectLowV86Mem()
◆ VideoPortInt10()
Definition at line 457 of file int10.c.
460{
463
465 {
467 }
468
469
470 RtlCopyMemory(&Int10BiosArguments, BiosArguments,
sizeof(*BiosArguments));
471 Int10BiosArguments.
SegDs = 0;
472 Int10BiosArguments.
SegEs = 0;
473
474
476
477
478 RtlCopyMemory(BiosArguments, &Int10BiosArguments,
sizeof(*BiosArguments));
479
481}
VP_STATUS NTAPI IntInt10CallBios(IN PVOID Context, IN OUT PINT10_BIOS_ARGUMENTS BiosArguments)
Referenced by VbeSetMode().