ReactOS  0.4.15-dev-2947-g59e1b78
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)
 

Function Documentation

◆ DriverEntry()

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

Definition at line 30 of file vgamp.c.

32 {
34 
35  VideoPortZeroMemory(&InitData, sizeof InitData);
36 
37  InitData.HwInitDataSize = sizeof(InitData);
38  /* FIXME: Fill in InitData members */
39  InitData.StartingDeviceNumber = 0;
40 
41  /* Export driver entry points... */
42  InitData.HwFindAdapter = VGAFindAdapter;
43  InitData.HwInitialize = VGAInitialize;
44  InitData.HwStartIO = VGAStartIO;
45  /* InitData.HwInterrupt = VGAInterrupt; */
46  InitData.HwResetHw = VGAResetHw;
47  /* InitData.HwTimer = VGATimer; */
48 
49  return VideoPortInitialize(Context1, Context2, &InitData, NULL);
50 }
VPAPI ULONG NTAPI VideoPortInitialize(IN PVOID Argument1, IN PVOID Argument2, IN PVIDEO_HW_INITIALIZATION_DATA HwInitializationData, IN PVOID HwContext)
Definition: videoprt.c:645
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:170
BOOLEAN NTAPI VGAResetHw(PVOID DeviceExtension, ULONG Columns, ULONG Rows)
Definition: vgamp.c:377
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:79
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
BOOLEAN NTAPI VGAInitialize(PVOID DeviceExtension)
Definition: vgamp.c:113

◆ VGAFindAdapter()

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

Definition at line 79 of file vgamp.c.

84 {
85  /* FIXME: Determine if the adapter is present */
86  *Again = FALSE;
87 
88  ConfigInfo->VdmPhysicalVideoMemoryAddress.QuadPart = 0xa000;
89  ConfigInfo->VdmPhysicalVideoMemoryLength = 0x2000;
90  return NO_ERROR;
91 
92  /* FIXME: Claim any necessary memory/IO resources for the adapter */
93  /* FIXME: Map resources into system memory for the adapter */
94  /* FIXME: Fill in relevant information in the VIDEO_PORT_CONFIG_INFO buffer */
95  /* FIXME: Update registry settings for adapter specifics. */
96 // return NO_ERROR;
97 }
#define NO_ERROR
Definition: dderror.h:5
#define FALSE
Definition: types.h:117
PHYSICAL_ADDRESS VdmPhysicalVideoMemoryAddress
Definition: video.h:176
ULONG VdmPhysicalVideoMemoryLength
Definition: video.h:177
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by DriverEntry().

◆ VGAInitialize()

BOOLEAN NTAPI VGAInitialize ( PVOID  DeviceExtension)

Definition at line 113 of file vgamp.c.

114 {
115  return TRUE;
116 }
#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 406 of file vgamp.c.

410 {
412  PVOID ReturnedAddress;
413  ULONG IoSpace;
414  PHYSICAL_ADDRESS FrameBufferBase;
415  ReturnedAddress = RequestedAddress->RequestedVirtualAddress;
416  ReturnedLength = 256 * 1024;
417  FrameBufferBase.QuadPart = 0xA0000;
418  IoSpace = VIDEO_MEMORY_SPACE_MEMORY;
419  StatusBlock->Status = VideoPortMapMemory(DeviceExtension,
420  FrameBufferBase,
422  &IoSpace,
423  &ReturnedAddress);
424  if (StatusBlock->Status != 0)
425  {
426  StatusBlock->Information = 0;
427  return TRUE;
428  }
429  MapInformation->VideoRamBase = MapInformation->FrameBufferBase =
430  ReturnedAddress;
431  MapInformation->VideoRamLength = MapInformation->FrameBufferLength =
433  StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION);
434  return TRUE;
435 }
#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 437 of file vgamp.c.

439 {
440  /* Only one mode exists in VGA (640x480), so use VGAQueryCurrentMode */
441  return VGAQueryCurrentMode(ReturnedModes, StatusBlock);
442 }
BOOLEAN VGAQueryCurrentMode(OUT PVIDEO_MODE_INFORMATION CurrentMode, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:444

Referenced by VGAStartIO().

◆ VGAQueryCurrentMode()

BOOLEAN VGAQueryCurrentMode ( OUT PVIDEO_MODE_INFORMATION  CurrentMode,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 444 of file vgamp.c.

446 {
447  CurrentMode->Length = sizeof(VIDEO_MODE_INFORMATION);
448  CurrentMode->ModeIndex = 2;
449  CurrentMode->VisScreenWidth = 640;
450  CurrentMode->VisScreenHeight = 480;
451  CurrentMode->ScreenStride = 80;
452  CurrentMode->NumberOfPlanes = 4;
453  CurrentMode->BitsPerPlane = 1;
454  CurrentMode->Frequency = 60;
455  CurrentMode->XMillimeter = 320;
456  CurrentMode->YMillimeter = 240;
457  CurrentMode->NumberRedBits =
458  CurrentMode->NumberGreenBits =
459  CurrentMode->NumberBlueBits = 6;
460  CurrentMode->RedMask =
461  CurrentMode->GreenMask =
462  CurrentMode->BlueMask = 0;
463  CurrentMode->VideoMemoryBitmapWidth = 640;
464  CurrentMode->VideoMemoryBitmapHeight = 480;
465  CurrentMode->AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR |
467  CurrentMode->DriverSpecificAttributeFlags = 0;
468 
469  StatusBlock->Information = sizeof(VIDEO_MODE_INFORMATION);
470  return TRUE;
471 }
#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 473 of file vgamp.c.

475 {
476  NumberOfModes->NumModes = 1;
477  NumberOfModes->ModeInformationLength = sizeof(VIDEO_MODE_INFORMATION);
478  StatusBlock->Information = sizeof(VIDEO_NUM_MODES);
479  return TRUE;
480 }
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 377 of file vgamp.c.

380 {
381  /* We don't anything to the vga that int10 can't cope with. */
382  return(FALSE);
383 }
#define FALSE
Definition: types.h:117

Referenced by DriverEntry().

◆ VGASetColorRegisters()

BOOLEAN VGASetColorRegisters ( IN PVIDEO_CLUT  ColorLookUpTable,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 511 of file vgamp.c.

513 {
514  int i;
515 
516  for (i=ColorLookUpTable->FirstEntry; i<ColorLookUpTable->NumEntries; i++)
517  {
518  VideoPortWritePortUchar((PUCHAR)0x03c8, i);
519  VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Red);
520  VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Green);
521  VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Blue);
522  }
523 
524  return TRUE;
525 }
#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 527 of file vgamp.c.

529 {
530  if(RequestedMode->RequestedMode == 12)
531  {
532  InitVGAMode();
533  return TRUE;
534  } else {
535  VideoPortDebugPrint(Warn, "Unrecognised mode for VGASetCurrentMode\n");
536  return FALSE;
537  }
538 }
#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 482 of file vgamp.c.

484 {
485  ;
486 
487 /*
488  We don't need the following code because the palette registers are set correctly on VGA initialization.
489  Still, we may include\test this is in the future.
490 
491  int i, j = 2;
492  char tmp, v;
493 
494  tmp = VideoPortReadPortUchar(0x03da);
495  v = VideoPortReadPortUchar(0x03c0);
496 
497  // Set the first 16 palette registers to map to the first 16 palette colors
498  for (i=PaletteRegisters[1]; i<PaletteRegisters[0]; i++)
499  {
500  tmp = VideoPortReadPortUchar(0x03da);
501  VideoPortWritePortUchar(0x03c0, i);
502  VideoPortWritePortUchar(0x03c0, PaletteRegisters[j++]);
503  }
504 
505  tmp = VideoPortReadPortUchar(0x03da);
506  VideoPortWritePortUchar(0x03d0, v | 0x20);
507 */
508  return TRUE;
509 }
#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 540 of file vgamp.c.

543 {
545 
546  StatusBlock->Status = ERROR_INVALID_FUNCTION;
547  return FALSE;
548 }
#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 170 of file vgamp.c.

172 {
173  BOOLEAN Result;
174 
175  RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
176 
177  switch (RequestPacket->IoControlCode)
178  {
180  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
181  RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
182  {
183  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
184  return TRUE;
185  }
186  Result = VGAMapVideoMemory(DeviceExtension,
187  (PVIDEO_MEMORY) RequestPacket->InputBuffer,
189  RequestPacket->OutputBuffer,
190  RequestPacket->StatusBlock);
191  break;
192 
194  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
195  {
196  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
197  return TRUE;
198  }
200  RequestPacket->StatusBlock);
201  break;
202 
204  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
205  {
206  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
207  return TRUE;
208  }
210  RequestPacket->StatusBlock);
211  break;
212 
214  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_NUM_MODES))
215  {
216  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
217  return TRUE;
218  }
220  RequestPacket->StatusBlock);
221  break;
222 
224  VGAResetDevice(RequestPacket->StatusBlock);
225  Result = TRUE;
226  break;
227 
229  if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT) ||
230  RequestPacket->InputBufferLength <
231  (((PVIDEO_CLUT)RequestPacket->InputBuffer)->NumEntries * sizeof(ULONG)) +
232  FIELD_OFFSET(VIDEO_CLUT, LookupTable))
233  {
234  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
235  return TRUE;
236  }
238  RequestPacket->StatusBlock);
239  break;
240 
242  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MODE))
243  {
244  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
245  return TRUE;
246  }
247  Result = VGASetCurrentMode((PVIDEO_MODE) RequestPacket->InputBuffer,
248  RequestPacket->StatusBlock);
249  break;
250 
252  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
253  RequestPacket->InputBufferLength < sizeof(VIDEO_SHARE_MEMORY))
254  {
255  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
256  return TRUE;
257  }
259  (PVIDEO_MEMORY_INFORMATION) RequestPacket->OutputBuffer,
260  RequestPacket->StatusBlock);
261  break;
262 
264  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
265  {
266  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
267  return TRUE;
268  }
269  Result = VGAUnmapVideoMemory(DeviceExtension,
270  (PVIDEO_MEMORY) RequestPacket->InputBuffer,
271  RequestPacket->StatusBlock);
272  break;
273 
275  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
276  {
277  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
278  return TRUE;
279  }
281  RequestPacket->StatusBlock);
282  break;
285  RequestPacket->StatusBlock);
286  break;
287 
288 #if 0
293 
295  VGAFreePublicAccessRanges((PVIDEO_PUBLIC_ACCESS_RANGES)
296  RequestPacket->InputBuffer,
297  RequestPacket->StatusBlock);
298  break;
299 
309 
311  VGAQueryPublicAccessRanges((PVIDEO_PUBLIC_ACCESS_RANGES)
312  RequestPacket->OutputBuffer,
313  RequestPacket->StatusBlock);
314  break;
315 
323 
324 #endif
325 
326  default:
327  RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
328  return FALSE;
329  }
330 
331  if (Result)
332  RequestPacket->StatusBlock->Status = NO_ERROR;
333 
334  return TRUE;
335 }
#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:482
#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:473
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:527
#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:562
#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:550
#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:437
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:540
#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:406
#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:444
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:511
#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 550 of file vgamp.c.

553 {
554  if (VideoPortUnmapMemory(DeviceExtension,
555  MemoryToUnmap->RequestedVirtualAddress,
556  0) == NO_ERROR)
557  return TRUE;
558  else
559  return FALSE;
560 }
#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 562 of file vgamp.c.

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

Referenced by VGAStartIO().