ReactOS  0.4.15-dev-4927-gfe8f806
vgamp.c File Reference
#include "vgamp.h"
#include <dderror.h>
#include <devioctl.h>
Include dependency graph for vgamp.c:

Go to the source code of this file.

Functions

ULONG NTAPI DriverEntry (IN PVOID Context1, IN PVOID Context2)
 
VP_STATUS NTAPI VGAFindAdapter (PVOID DeviceExtension, PVOID Context, PWSTR ArgumentString, PVIDEO_PORT_CONFIG_INFO ConfigInfo, PUCHAR Again)
 
BOOLEAN NTAPI VGAInitialize (PVOID DeviceExtension)
 
BOOLEAN NTAPI VGAStartIO (PVOID DeviceExtension, PVIDEO_REQUEST_PACKET RequestPacket)
 
BOOLEAN NTAPI VGAResetHw (PVOID DeviceExtension, ULONG Columns, ULONG Rows)
 
BOOLEAN VGAMapVideoMemory (IN PVOID DeviceExtension, IN PVIDEO_MEMORY RequestedAddress, OUT PVIDEO_MEMORY_INFORMATION MapInformation, OUT PSTATUS_BLOCK StatusBlock)
 
BOOLEAN VGAQueryAvailModes (OUT PVIDEO_MODE_INFORMATION ReturnedModes, OUT PSTATUS_BLOCK StatusBlock)
 
BOOLEAN VGAQueryCurrentMode (OUT PVIDEO_MODE_INFORMATION CurrentMode, OUT PSTATUS_BLOCK StatusBlock)
 
BOOLEAN VGAQueryNumAvailModes (OUT PVIDEO_NUM_MODES NumberOfModes, OUT PSTATUS_BLOCK StatusBlock)
 
BOOLEAN VGASetPaletteRegisters (IN PUSHORT PaletteRegisters, OUT PSTATUS_BLOCK StatusBlock)
 
BOOLEAN VGASetColorRegisters (IN PVIDEO_CLUT ColorLookUpTable, OUT PSTATUS_BLOCK StatusBlock)
 
BOOLEAN VGASetCurrentMode (IN PVIDEO_MODE RequestedMode, OUT PSTATUS_BLOCK StatusBlock)
 
BOOLEAN VGAShareVideoMemory (IN PVIDEO_SHARE_MEMORY RequestedMemory, OUT PVIDEO_MEMORY_INFORMATION ReturnedMemory, OUT PSTATUS_BLOCK StatusBlock)
 
BOOLEAN VGAUnmapVideoMemory (IN PVOID DeviceExtension, IN PVIDEO_MEMORY MemoryToUnmap, OUT PSTATUS_BLOCK StatusBlock)
 
BOOLEAN VGAUnshareVideoMemory (IN PVIDEO_MEMORY MemoryToUnshare, OUT PSTATUS_BLOCK StatusBlock)
 

Variables

VIDEO_ACCESS_RANGE VGAAccessRange []
 

Function Documentation

◆ DriverEntry()

ULONG NTAPI DriverEntry ( IN PVOID  Context1,
IN PVOID  Context2 
)

Definition at line 37 of file vgamp.c.

39 {
41 
42  VideoPortZeroMemory(&InitData, sizeof InitData);
43 
44  InitData.HwInitDataSize = sizeof(InitData);
45  /* FIXME: Fill in InitData members */
46  InitData.StartingDeviceNumber = 0;
47 
48  /* Export driver entry points... */
49  InitData.HwFindAdapter = VGAFindAdapter;
50  InitData.HwInitialize = VGAInitialize;
51  InitData.HwStartIO = VGAStartIO;
52  /* InitData.HwInterrupt = VGAInterrupt; */
53  InitData.HwResetHw = VGAResetHw;
54  /* InitData.HwTimer = VGATimer; */
57 
58  return VideoPortInitialize(Context1, Context2, &InitData, NULL);
59 }
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
VPAPI ULONG NTAPI VideoPortInitialize(IN PVOID Argument1, IN PVOID Argument2, IN PVIDEO_HW_INITIALIZATION_DATA HwInitializationData, IN PVOID HwContext)
Definition: videoprt.c:662
VPAPI VOID NTAPI VideoPortZeroMemory(IN PVOID Destination, IN ULONG Length)
PVIDEO_HW_START_IO HwStartIO
Definition: video.h:669
BOOLEAN NTAPI VGAStartIO(PVOID DeviceExtension, PVIDEO_REQUEST_PACKET RequestPacket)
Definition: vgamp.c:188
BOOLEAN NTAPI VGAResetHw(PVOID DeviceExtension, ULONG Columns, ULONG Rows)
Definition: vgamp.c:395
PVIDEO_HW_INITIALIZE HwInitialize
Definition: video.h:667
PVIDEO_HW_FIND_ADAPTER HwFindAdapter
Definition: video.h:666
VP_STATUS NTAPI VGAFindAdapter(PVOID DeviceExtension, PVOID Context, PWSTR ArgumentString, PVIDEO_PORT_CONFIG_INFO ConfigInfo, PUCHAR Again)
Definition: vgamp.c:88
PVIDEO_HW_RESET_HW HwResetHw
Definition: video.h:672
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1094
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1094
#define NULL
Definition: types.h:112
PVIDEO_ACCESS_RANGE HwLegacyResourceList
Definition: video.h:680
BOOLEAN NTAPI VGAInitialize(PVOID DeviceExtension)
Definition: vgamp.c:131
VIDEO_ACCESS_RANGE VGAAccessRange[]
Definition: vgamp.c:13

◆ VGAFindAdapter()

VP_STATUS NTAPI VGAFindAdapter ( PVOID  DeviceExtension,
PVOID  Context,
PWSTR  ArgumentString,
PVIDEO_PORT_CONFIG_INFO  ConfigInfo,
PUCHAR  Again 
)

Definition at line 88 of file vgamp.c.

93 {
95 
96  /* FIXME: Determine if the adapter is present */
97  *Again = FALSE;
98 
99  if (ConfigInfo->Length < sizeof(VIDEO_PORT_CONFIG_INFO))
101 
103  if (Status != NO_ERROR)
104  return Status;
105 
108  return NO_ERROR;
109 
110  /* FIXME: Claim any necessary memory/IO resources for the adapter */
111  /* FIXME: Map resources into system memory for the adapter */
112  /* FIXME: Fill in relevant information in the VIDEO_PORT_CONFIG_INFO buffer */
113  /* FIXME: Update registry settings for adapter specifics. */
114 // return NO_ERROR;
115 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define NO_ERROR
Definition: dderror.h:5
#define FALSE
Definition: types.h:117
PHYSICAL_ADDRESS VdmPhysicalVideoMemoryAddress
Definition: video.h:176
Status
Definition: gdiplustypes.h:24
VPAPI VP_STATUS NTAPI VideoPortVerifyAccessRanges(IN PVOID HwDeviceExtension, IN ULONG NumAccessRanges, IN PVIDEO_ACCESS_RANGE AccessRanges)
Definition: resource.c:824
LONG VP_STATUS
Definition: video.h:153
ULONG RangeLength
Definition: video.h:216
ULONG VdmPhysicalVideoMemoryLength
Definition: video.h:177
VIDEO_ACCESS_RANGE VGAAccessRange[]
Definition: vgamp.c:13
PHYSICAL_ADDRESS RangeStart
Definition: video.h:215

Referenced by DriverEntry().

◆ VGAInitialize()

BOOLEAN NTAPI VGAInitialize ( PVOID  DeviceExtension)

Definition at line 131 of file vgamp.c.

132 {
133  return TRUE;
134 }
#define TRUE
Definition: types.h:120

Referenced by DriverEntry().

◆ VGAMapVideoMemory()

BOOLEAN VGAMapVideoMemory ( IN PVOID  DeviceExtension,
IN PVIDEO_MEMORY  RequestedAddress,
OUT PVIDEO_MEMORY_INFORMATION  MapInformation,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 424 of file vgamp.c.

428 {
430  PVOID ReturnedAddress;
431  ULONG IoSpace;
432  PHYSICAL_ADDRESS FrameBufferBase;
433  ReturnedAddress = RequestedAddress->RequestedVirtualAddress;
434  ReturnedLength = 256 * 1024;
435  FrameBufferBase.QuadPart = 0xA0000;
436  IoSpace = VIDEO_MEMORY_SPACE_MEMORY;
437  StatusBlock->Status = VideoPortMapMemory(DeviceExtension,
438  FrameBufferBase,
440  &IoSpace,
441  &ReturnedAddress);
442  if (StatusBlock->Status != 0)
443  {
444  StatusBlock->Information = 0;
445  return TRUE;
446  }
447  MapInformation->VideoRamBase = MapInformation->FrameBufferBase =
448  ReturnedAddress;
449  MapInformation->VideoRamLength = MapInformation->FrameBufferLength =
451  StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION);
452  return TRUE;
453 }
#define TRUE
Definition: types.h:120
VPAPI VP_STATUS NTAPI VideoPortMapMemory(IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS PhysicalAddress, IN OUT PULONG Length, IN PULONG InIoSpace, IN OUT PVOID *VirtualAddress)
struct _VIDEO_MEMORY_INFORMATION VIDEO_MEMORY_INFORMATION
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG _In_ ULONG _Out_ PULONG ReturnedLength
Definition: batclass.h:187
unsigned int ULONG
Definition: retypes.h:1
#define VIDEO_MEMORY_SPACE_MEMORY
Definition: video.h:132
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by VGAStartIO().

◆ VGAQueryAvailModes()

BOOLEAN VGAQueryAvailModes ( OUT PVIDEO_MODE_INFORMATION  ReturnedModes,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 455 of file vgamp.c.

457 {
458  /* Only one mode exists in VGA (640x480), so use VGAQueryCurrentMode */
459  return VGAQueryCurrentMode(ReturnedModes, StatusBlock);
460 }
BOOLEAN VGAQueryCurrentMode(OUT PVIDEO_MODE_INFORMATION CurrentMode, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:462

Referenced by VGAStartIO().

◆ VGAQueryCurrentMode()

BOOLEAN VGAQueryCurrentMode ( OUT PVIDEO_MODE_INFORMATION  CurrentMode,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 462 of file vgamp.c.

464 {
465  CurrentMode->Length = sizeof(VIDEO_MODE_INFORMATION);
466  CurrentMode->ModeIndex = 2;
467  CurrentMode->VisScreenWidth = 640;
468  CurrentMode->VisScreenHeight = 480;
469  CurrentMode->ScreenStride = 80;
470  CurrentMode->NumberOfPlanes = 4;
471  CurrentMode->BitsPerPlane = 1;
472  CurrentMode->Frequency = 60;
473  CurrentMode->XMillimeter = 320;
474  CurrentMode->YMillimeter = 240;
475  CurrentMode->NumberRedBits =
476  CurrentMode->NumberGreenBits =
477  CurrentMode->NumberBlueBits = 6;
478  CurrentMode->RedMask =
479  CurrentMode->GreenMask =
480  CurrentMode->BlueMask = 0;
481  CurrentMode->VideoMemoryBitmapWidth = 640;
482  CurrentMode->VideoMemoryBitmapHeight = 480;
483  CurrentMode->AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR |
485  CurrentMode->DriverSpecificAttributeFlags = 0;
486 
487  StatusBlock->Information = sizeof(VIDEO_MODE_INFORMATION);
488  return TRUE;
489 }
#define TRUE
Definition: types.h:120
#define VIDEO_MODE_NO_OFF_SCREEN
Definition: ntddvdeo.h:299
#define VIDEO_MODE_COLOR
Definition: ntddvdeo.h:294
struct _VIDEO_MODE_INFORMATION VIDEO_MODE_INFORMATION
#define VIDEO_MODE_GRAPHICS
Definition: ntddvdeo.h:295

Referenced by VGAQueryAvailModes(), and VGAStartIO().

◆ VGAQueryNumAvailModes()

BOOLEAN VGAQueryNumAvailModes ( OUT PVIDEO_NUM_MODES  NumberOfModes,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 491 of file vgamp.c.

493 {
494  NumberOfModes->NumModes = 1;
495  NumberOfModes->ModeInformationLength = sizeof(VIDEO_MODE_INFORMATION);
496  StatusBlock->Information = sizeof(VIDEO_NUM_MODES);
497  return TRUE;
498 }
struct _VIDEO_NUM_MODES VIDEO_NUM_MODES
#define TRUE
Definition: types.h:120
struct _VIDEO_MODE_INFORMATION VIDEO_MODE_INFORMATION

Referenced by VGAStartIO().

◆ VGAResetHw()

BOOLEAN NTAPI VGAResetHw ( PVOID  DeviceExtension,
ULONG  Columns,
ULONG  Rows 
)

Definition at line 395 of file vgamp.c.

398 {
399  /* We don't anything to the vga that int10 can't cope with. */
400  return(FALSE);
401 }
#define FALSE
Definition: types.h:117

Referenced by DriverEntry().

◆ VGASetColorRegisters()

BOOLEAN VGASetColorRegisters ( IN PVIDEO_CLUT  ColorLookUpTable,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 529 of file vgamp.c.

531 {
532  int i;
533 
534  for (i=ColorLookUpTable->FirstEntry; i<ColorLookUpTable->NumEntries; i++)
535  {
536  VideoPortWritePortUchar((PUCHAR)0x03c8, i);
537  VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Red);
538  VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Green);
539  VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Blue);
540  }
541 
542  return TRUE;
543 }
#define TRUE
Definition: types.h:120
unsigned char * PUCHAR
Definition: retypes.h:3
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VPAPI VOID NTAPI VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)

Referenced by VGAStartIO().

◆ VGASetCurrentMode()

BOOLEAN VGASetCurrentMode ( IN PVIDEO_MODE  RequestedMode,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 545 of file vgamp.c.

547 {
548  if(RequestedMode->RequestedMode == 12)
549  {
550  InitVGAMode();
551  return TRUE;
552  } else {
553  VideoPortDebugPrint(Warn, "Unrecognised mode for VGASetCurrentMode\n");
554  return FALSE;
555  }
556 }
#define TRUE
Definition: types.h:120
VOID InitVGAMode(VOID)
Definition: initvga.c:110
#define FALSE
Definition: types.h:117
Definition: video.h:581
VPAPI VOID __cdecl VideoPortDebugPrint(IN VIDEO_DEBUG_LEVEL DebugPrintLevel, IN PSTR DebugMessage, IN ...)

Referenced by VGAStartIO().

◆ VGASetPaletteRegisters()

BOOLEAN VGASetPaletteRegisters ( IN PUSHORT  PaletteRegisters,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 500 of file vgamp.c.

502 {
503  ;
504 
505 /*
506  We don't need the following code because the palette registers are set correctly on VGA initialization.
507  Still, we may include\test this is in the future.
508 
509  int i, j = 2;
510  char tmp, v;
511 
512  tmp = VideoPortReadPortUchar(0x03da);
513  v = VideoPortReadPortUchar(0x03c0);
514 
515  // Set the first 16 palette registers to map to the first 16 palette colors
516  for (i=PaletteRegisters[1]; i<PaletteRegisters[0]; i++)
517  {
518  tmp = VideoPortReadPortUchar(0x03da);
519  VideoPortWritePortUchar(0x03c0, i);
520  VideoPortWritePortUchar(0x03c0, PaletteRegisters[j++]);
521  }
522 
523  tmp = VideoPortReadPortUchar(0x03da);
524  VideoPortWritePortUchar(0x03d0, v | 0x20);
525 */
526  return TRUE;
527 }
#define TRUE
Definition: types.h:120

Referenced by VGAStartIO().

◆ VGAShareVideoMemory()

BOOLEAN VGAShareVideoMemory ( IN PVIDEO_SHARE_MEMORY  RequestedMemory,
OUT PVIDEO_MEMORY_INFORMATION  ReturnedMemory,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 558 of file vgamp.c.

561 {
563 
564  StatusBlock->Status = ERROR_INVALID_FUNCTION;
565  return FALSE;
566 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by VGAStartIO().

◆ VGAStartIO()

BOOLEAN NTAPI VGAStartIO ( PVOID  DeviceExtension,
PVIDEO_REQUEST_PACKET  RequestPacket 
)

Definition at line 188 of file vgamp.c.

190 {
191  BOOLEAN Result;
192 
193  RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
194 
195  switch (RequestPacket->IoControlCode)
196  {
198  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
199  RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
200  {
201  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
202  return TRUE;
203  }
204  Result = VGAMapVideoMemory(DeviceExtension,
205  (PVIDEO_MEMORY) RequestPacket->InputBuffer,
207  RequestPacket->OutputBuffer,
208  RequestPacket->StatusBlock);
209  break;
210 
212  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
213  {
214  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
215  return TRUE;
216  }
218  RequestPacket->StatusBlock);
219  break;
220 
222  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
223  {
224  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
225  return TRUE;
226  }
228  RequestPacket->StatusBlock);
229  break;
230 
232  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_NUM_MODES))
233  {
234  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
235  return TRUE;
236  }
238  RequestPacket->StatusBlock);
239  break;
240 
242  VGAResetDevice(RequestPacket->StatusBlock);
243  Result = TRUE;
244  break;
245 
247  if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT) ||
248  RequestPacket->InputBufferLength <
249  (((PVIDEO_CLUT)RequestPacket->InputBuffer)->NumEntries * sizeof(ULONG)) +
250  FIELD_OFFSET(VIDEO_CLUT, LookupTable))
251  {
252  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
253  return TRUE;
254  }
256  RequestPacket->StatusBlock);
257  break;
258 
260  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MODE))
261  {
262  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
263  return TRUE;
264  }
265  Result = VGASetCurrentMode((PVIDEO_MODE) RequestPacket->InputBuffer,
266  RequestPacket->StatusBlock);
267  break;
268 
270  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
271  RequestPacket->InputBufferLength < sizeof(VIDEO_SHARE_MEMORY))
272  {
273  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
274  return TRUE;
275  }
277  (PVIDEO_MEMORY_INFORMATION) RequestPacket->OutputBuffer,
278  RequestPacket->StatusBlock);
279  break;
280 
282  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
283  {
284  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
285  return TRUE;
286  }
287  Result = VGAUnmapVideoMemory(DeviceExtension,
288  (PVIDEO_MEMORY) RequestPacket->InputBuffer,
289  RequestPacket->StatusBlock);
290  break;
291 
293  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
294  {
295  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
296  return TRUE;
297  }
299  RequestPacket->StatusBlock);
300  break;
303  RequestPacket->StatusBlock);
304  break;
305 
306 #if 0
311 
313  VGAFreePublicAccessRanges((PVIDEO_PUBLIC_ACCESS_RANGES)
314  RequestPacket->InputBuffer,
315  RequestPacket->StatusBlock);
316  break;
317 
327 
329  VGAQueryPublicAccessRanges((PVIDEO_PUBLIC_ACCESS_RANGES)
330  RequestPacket->OutputBuffer,
331  RequestPacket->StatusBlock);
332  break;
333 
341 
342 #endif
343 
344  default:
345  RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
346  return FALSE;
347  }
348 
349  if (Result)
350  RequestPacket->StatusBlock->Status = NO_ERROR;
351 
352  return TRUE;
353 }
#define IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES
Definition: ntddvdeo.h:110
#define IOCTL_VIDEO_QUERY_POINTER_POSITION
Definition: ntddvdeo.h:131
#define IOCTL_VIDEO_QUERY_POINTER_ATTR
Definition: ntddvdeo.h:125
#define IOCTL_VIDEO_SET_POINTER_ATTR
Definition: ntddvdeo.h:164
#define IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY
Definition: ntddvdeo.h:182
BOOLEAN VGASetPaletteRegisters(IN PUSHORT PaletteRegisters, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:500
#define IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES
Definition: ntddvdeo.h:128
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define TRUE
Definition: types.h:120
#define IOCTL_VIDEO_DISABLE_CURSOR
Definition: ntddvdeo.h:77
#define IOCTL_VIDEO_GET_POWER_MANAGEMENT
Definition: ntddvdeo.h:98
#define IOCTL_VIDEO_RESET_DEVICE
Definition: ntddvdeo.h:137
#define IOCTL_VIDEO_MAP_VIDEO_MEMORY
Definition: ntddvdeo.h:104
BOOLEAN VGAQueryNumAvailModes(OUT PVIDEO_NUM_MODES NumberOfModes, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:491
ULONG InputBufferLength
Definition: video.h:333
#define NO_ERROR
Definition: dderror.h:5
#define IOCTL_VIDEO_GET_BANK_SELECT_CODE
Definition: ntddvdeo.h:92
#define IOCTL_VIDEO_DISABLE_POINTER
Definition: ntddvdeo.h:80
#define IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES
Definition: ntddvdeo.h:89
BOOLEAN VGASetCurrentMode(IN PVIDEO_MODE RequestedMode, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:545
#define IOCTL_VIDEO_QUERY_CURRENT_MODE
Definition: ntddvdeo.h:113
#define IOCTL_VIDEO_SET_CURRENT_MODE
Definition: ntddvdeo.h:152
BOOLEAN VGAUnshareVideoMemory(IN PVIDEO_MEMORY MemoryToUnshare, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:580
#define FALSE
Definition: types.h:117
#define IOCTL_VIDEO_SET_PALETTE_REGISTERS
Definition: ntddvdeo.h:161
#define IOCTL_VIDEO_SET_CURSOR_POSITION
Definition: ntddvdeo.h:158
unsigned char BOOLEAN
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
BOOLEAN VGAUnmapVideoMemory(IN PVOID DeviceExtension, IN PVIDEO_MEMORY MemoryToUnmap, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:568
#define IOCTL_VIDEO_QUERY_CURSOR_ATTR
Definition: ntddvdeo.h:116
ULONG OutputBufferLength
Definition: video.h:335
#define IOCTL_VIDEO_SET_POWER_MANAGEMENT
Definition: ntddvdeo.h:170
#define IOCTL_VIDEO_SET_CURSOR_ATTR
Definition: ntddvdeo.h:155
#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY
Definition: ntddvdeo.h:179
#define IOCTL_VIDEO_ENABLE_CURSOR
Definition: ntddvdeo.h:83
#define IOCTL_VIDEO_QUERY_CURSOR_POSITION
Definition: ntddvdeo.h:119
BOOLEAN VGAQueryAvailModes(OUT PVIDEO_MODE_INFORMATION ReturnedModes, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:455
VOID VGAResetDevice(OUT PSTATUS_BLOCK StatusBlock)
Definition: initvga.c:117
VP_STATUS Status
Definition: video.h:323
BOOLEAN VGAShareVideoMemory(IN PVIDEO_SHARE_MEMORY RequestedMemory, OUT PVIDEO_MEMORY_INFORMATION ReturnedMemory, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:558
#define IOCTL_VIDEO_LOAD_AND_SET_FONT
Definition: ntddvdeo.h:101
#define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES
Definition: ntddvdeo.h:122
#define IOCTL_VIDEO_QUERY_AVAIL_MODES
Definition: ntddvdeo.h:107
BOOLEAN VGAMapVideoMemory(IN PVOID DeviceExtension, IN PVIDEO_MEMORY RequestedAddress, OUT PVIDEO_MEMORY_INFORMATION MapInformation, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:424
#define IOCTL_VIDEO_SHARE_VIDEO_MEMORY
Definition: ntddvdeo.h:173
PSTATUS_BLOCK StatusBlock
Definition: video.h:331
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define IOCTL_VIDEO_ENABLE_POINTER
Definition: ntddvdeo.h:86
#define IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES
Definition: ntddvdeo.h:134
BOOLEAN VGAQueryCurrentMode(OUT PVIDEO_MODE_INFORMATION CurrentMode, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:462
unsigned int ULONG
Definition: retypes.h:1
#define IOCTL_VIDEO_RESTORE_HARDWARE_STATE
Definition: ntddvdeo.h:140
unsigned short * PUSHORT
Definition: retypes.h:2
#define IOCTL_VIDEO_SAVE_HARDWARE_STATE
Definition: ntddvdeo.h:143
BOOLEAN VGASetColorRegisters(IN PVIDEO_CLUT ColorLookUpTable, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:529
#define IOCTL_VIDEO_SET_POINTER_POSITION
Definition: ntddvdeo.h:167
#define IOCTL_VIDEO_SET_COLOR_REGISTERS
Definition: ntddvdeo.h:149
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by DriverEntry().

◆ VGAUnmapVideoMemory()

BOOLEAN VGAUnmapVideoMemory ( IN PVOID  DeviceExtension,
IN PVIDEO_MEMORY  MemoryToUnmap,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 568 of file vgamp.c.

571 {
572  if (VideoPortUnmapMemory(DeviceExtension,
573  MemoryToUnmap->RequestedVirtualAddress,
574  0) == NO_ERROR)
575  return TRUE;
576  else
577  return FALSE;
578 }
#define TRUE
Definition: types.h:120
#define NO_ERROR
Definition: dderror.h:5
#define FALSE
Definition: types.h:117
VPAPI VP_STATUS NTAPI VideoPortUnmapMemory(IN PVOID HwDeviceExtension, IN OUT PVOID VirtualAddress, IN HANDLE ProcessHandle)

Referenced by VGAStartIO().

◆ VGAUnshareVideoMemory()

BOOLEAN VGAUnshareVideoMemory ( IN PVIDEO_MEMORY  MemoryToUnshare,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 580 of file vgamp.c.

582 {
584 
585  StatusBlock->Status = ERROR_INVALID_FUNCTION;
586  return FALSE;
587 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by VGAStartIO().

Variable Documentation

◆ VGAAccessRange

VIDEO_ACCESS_RANGE VGAAccessRange[]
Initial value:
=
{
{ {{0x3b0}}, 0x3bb - 0x3b0 + 1, 1, 0, 0 },
{ {{0x3c0}}, 0x3df - 0x3c0 + 1, 1, 0, 0 },
{ {{0xa0000}}, 0x20000, 0, 0, 0 },
}

Definition at line 13 of file vgamp.c.

Referenced by DriverEntry(), and VGAFindAdapter().