ReactOS 0.4.17-dev-1190-g4c812f4
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_ PVOID DeviceExtension, _In_ PVIDEO_SHARE_MEMORY RequestedMemory, _Out_ PVIDEO_MEMORY_INFORMATION ReturnedMemory, _Out_ PSTATUS_BLOCK StatusBlock)
 Shares a portion of VGA video memory with a VDM.
 
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... */
50 InitData.HwInitialize = VGAInitialize;
51 InitData.HwStartIO = VGAStartIO;
52 /* InitData.HwInterrupt = VGAInterrupt; */
53 InitData.HwResetHw = VGAResetHw;
54 /* InitData.HwTimer = VGATimer; */
57
58 InitData.AdapterInterfaceType = Isa;
59 return VideoPortInitialize(Context1, Context2, &InitData, NULL);
60}
#define ARRAYSIZE(a)
Definition: cat.c:25
#define NULL
Definition: types.h:112
@ Isa
Definition: restypes.h:123
VPAPI VOID NTAPI VideoPortZeroMemory(IN PVOID Destination, IN ULONG Length)
VPAPI ULONG NTAPI VideoPortInitialize(IN PVOID Argument1, IN PVOID Argument2, IN PVIDEO_HW_INITIALIZATION_DATA HwInitializationData, IN PVOID HwContext)
Definition: videoprt.c:945
PVIDEO_HW_FIND_ADAPTER HwFindAdapter
Definition: video.h:674
PVIDEO_HW_START_IO HwStartIO
Definition: video.h:677
PVIDEO_HW_RESET_HW HwResetHw
Definition: video.h:680
INTERFACE_TYPE AdapterInterfaceType
Definition: video.h:673
PVIDEO_ACCESS_RANGE HwLegacyResourceList
Definition: video.h:688
PVIDEO_HW_INITIALIZE HwInitialize
Definition: video.h:675
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1095
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1096
VIDEO_ACCESS_RANGE VGAAccessRange[]
Definition: vgamp.c:13
VP_STATUS NTAPI VGAFindAdapter(PVOID DeviceExtension, PVOID Context, PWSTR ArgumentString, PVIDEO_PORT_CONFIG_INFO ConfigInfo, PUCHAR Again)
Definition: vgamp.c:89
BOOLEAN NTAPI VGAInitialize(PVOID DeviceExtension)
Definition: vgamp.c:132
BOOLEAN NTAPI VGAStartIO(PVOID DeviceExtension, PVIDEO_REQUEST_PACKET RequestPacket)
Definition: vgamp.c:189
BOOLEAN NTAPI VGAResetHw(PVOID DeviceExtension, ULONG Columns, ULONG Rows)
Definition: vgamp.c:397

◆ VGAFindAdapter()

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

Definition at line 89 of file vgamp.c.

94{
96
97 /* FIXME: Determine if the adapter is present */
98 *Again = FALSE;
99
100 if (ConfigInfo->Length < sizeof(VIDEO_PORT_CONFIG_INFO))
102
104 if (Status != NO_ERROR)
105 return Status;
106
109 return NO_ERROR;
110
111 /* FIXME: Claim any necessary memory/IO resources for the adapter */
112 /* FIXME: Map resources into system memory for the adapter */
113 /* FIXME: Fill in relevant information in the VIDEO_PORT_CONFIG_INFO buffer */
114 /* FIXME: Update registry settings for adapter specifics. */
115// return NO_ERROR;
116}
#define NO_ERROR
Definition: dderror.h:5
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
Status
Definition: gdiplustypes.h:24
VPAPI VP_STATUS NTAPI VideoPortVerifyAccessRanges(_In_ PVOID HwDeviceExtension, _In_opt_ ULONG NumAccessRanges, _In_reads_opt_(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges)
Claims or releases a range of hardware resources and checks for conflicts.
Definition: resource.c:982
LONG VP_STATUS
Definition: video.h:153
ULONG RangeLength
Definition: video.h:216
PHYSICAL_ADDRESS RangeStart
Definition: video.h:215
PHYSICAL_ADDRESS VdmPhysicalVideoMemoryAddress
Definition: video.h:176
ULONG VdmPhysicalVideoMemoryLength
Definition: video.h:177

Referenced by DriverEntry().

◆ VGAInitialize()

BOOLEAN NTAPI VGAInitialize ( PVOID  DeviceExtension)

Definition at line 132 of file vgamp.c.

133{
134 return TRUE;
135}
#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 426 of file vgamp.c.

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

Referenced by VGAStartIO().

◆ VGAQueryAvailModes()

BOOLEAN VGAQueryAvailModes ( OUT PVIDEO_MODE_INFORMATION  ReturnedModes,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 457 of file vgamp.c.

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

Referenced by VGAStartIO().

◆ VGAQueryCurrentMode()

BOOLEAN VGAQueryCurrentMode ( OUT PVIDEO_MODE_INFORMATION  CurrentMode,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 464 of file vgamp.c.

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

Referenced by VGAQueryAvailModes(), and VGAStartIO().

◆ VGAQueryNumAvailModes()

BOOLEAN VGAQueryNumAvailModes ( OUT PVIDEO_NUM_MODES  NumberOfModes,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 493 of file vgamp.c.

495{
496 NumberOfModes->NumModes = 1;
497 NumberOfModes->ModeInformationLength = sizeof(VIDEO_MODE_INFORMATION);
498 StatusBlock->Information = sizeof(VIDEO_NUM_MODES);
499 return TRUE;
500}
struct _VIDEO_NUM_MODES VIDEO_NUM_MODES

Referenced by VGAStartIO().

◆ VGAResetHw()

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

Definition at line 397 of file vgamp.c.

400{
401 /* We don't anything to the vga that int10 can't cope with. */
402 return(FALSE);
403}

Referenced by DriverEntry().

◆ VGASetColorRegisters()

BOOLEAN VGASetColorRegisters ( IN PVIDEO_CLUT  ColorLookUpTable,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 531 of file vgamp.c.

533{
534 int i;
535
536 for (i=ColorLookUpTable->FirstEntry; i<ColorLookUpTable->NumEntries; i++)
537 {
539 VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Red);
540 VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Green);
541 VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Blue);
542 }
543
544 return TRUE;
545}
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)
unsigned char * PUCHAR
Definition: typedefs.h:53

Referenced by VGAStartIO().

◆ VGASetCurrentMode()

BOOLEAN VGASetCurrentMode ( IN PVIDEO_MODE  RequestedMode,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 547 of file vgamp.c.

549{
550 if(RequestedMode->RequestedMode == 2)
551 {
552 InitVGAMode();
553 return TRUE;
554 } else {
555 VideoPortDebugPrint(Warn, "Unrecognised mode for VGASetCurrentMode\n");
556 return FALSE;
557 }
558}
VOID InitVGAMode(VOID)
Definition: initvga.c:110
@ Warn
Definition: video.h:589
VPAPI VOID __cdecl VideoPortDebugPrint(_In_ VIDEO_DEBUG_LEVEL DebugPrintLevel, _In_ PSTR DebugMessage, _In_ ...)
Definition: videoprt.c:1145

Referenced by VGAStartIO().

◆ VGASetPaletteRegisters()

BOOLEAN VGASetPaletteRegisters ( IN PUSHORT  PaletteRegisters,
OUT PSTATUS_BLOCK  StatusBlock 
)

Definition at line 502 of file vgamp.c.

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

Referenced by VGAStartIO().

◆ VGAShareVideoMemory()

BOOLEAN VGAShareVideoMemory ( _In_ PVOID  DeviceExtension,
_In_ PVIDEO_SHARE_MEMORY  RequestedMemory,
_Out_ PVIDEO_MEMORY_INFORMATION  ReturnedMemory,
_Out_ PSTATUS_BLOCK  StatusBlock 
)

Shares a portion of VGA video memory with a VDM.

Parameters
[in]DeviceExtensionMiniport device extension.
[in]RequestedMemorySpecifies the process, offset, size, and requested virtual address of the shared view.
[out]ReturnedMemoryReceives the base and length of the mapped shared view.
[out]StatusBlockReceives the operation status.
Returns
TRUE always. Failure is returned through StatusBlock->Status.

Definition at line 581 of file vgamp.c.

586{
588 PVOID ReturnedAddress;
589 ULONG IoSpace;
590 PHYSICAL_ADDRESS FrameBufferBase;
591
592 /* Requested view must fall in the 64K VGA gap at 0xA0000 */
593 if (RequestedMemory->ViewOffset + RequestedMemory->ViewSize > 0x10000)
594 {
595 StatusBlock->Status = ERROR_INVALID_PARAMETER;
596 StatusBlock->Information = 0;
597 return TRUE;
598 }
599
600 ReturnedAddress = RequestedMemory->RequestedVirtualAddress;
601 ReturnedLength = RequestedMemory->ViewSize;
602 FrameBufferBase.QuadPart = 0xA0000 + RequestedMemory->ViewOffset;
604
605 StatusBlock->Status = VideoPortMapMemory(DeviceExtension,
606 FrameBufferBase,
608 &IoSpace,
609 &ReturnedAddress);
610 if (StatusBlock->Status != NO_ERROR)
611 {
612 StatusBlock->Information = 0;
613 return TRUE;
614 }
615
616 ReturnedMemory->VideoRamBase = ReturnedMemory->FrameBufferBase = ReturnedAddress;
617 ReturnedMemory->VideoRamLength = ReturnedMemory->FrameBufferLength = ReturnedLength;
618 StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION);
619
620 return TRUE;
621}

Referenced by VGAStartIO().

◆ VGAStartIO()

BOOLEAN NTAPI VGAStartIO ( PVOID  DeviceExtension,
PVIDEO_REQUEST_PACKET  RequestPacket 
)

Definition at line 189 of file vgamp.c.

191{
193
194 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
195
196 switch (RequestPacket->IoControlCode)
197 {
199 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
200 RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
201 {
203 return TRUE;
204 }
205 Result = VGAMapVideoMemory(DeviceExtension,
206 (PVIDEO_MEMORY) RequestPacket->InputBuffer,
208 RequestPacket->OutputBuffer,
209 RequestPacket->StatusBlock);
210 break;
211
213 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
214 {
216 return TRUE;
217 }
219 RequestPacket->StatusBlock);
220 break;
221
223 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
224 {
226 return TRUE;
227 }
229 RequestPacket->StatusBlock);
230 break;
231
233 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_NUM_MODES))
234 {
236 return TRUE;
237 }
239 RequestPacket->StatusBlock);
240 break;
241
243 VGAResetDevice(RequestPacket->StatusBlock);
244 Result = TRUE;
245 break;
246
248 if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT) ||
249 RequestPacket->InputBufferLength <
250 (((PVIDEO_CLUT)RequestPacket->InputBuffer)->NumEntries * sizeof(ULONG)) +
251 FIELD_OFFSET(VIDEO_CLUT, LookupTable))
252 {
254 return TRUE;
255 }
257 RequestPacket->StatusBlock);
258 break;
259
261 if (RequestPacket->InputBufferLength < sizeof(VIDEO_MODE))
262 {
264 return TRUE;
265 }
267 RequestPacket->StatusBlock);
268 break;
269
271 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
272 RequestPacket->InputBufferLength < sizeof(VIDEO_SHARE_MEMORY))
273 {
275 return TRUE;
276 }
277 Result = VGAShareVideoMemory(DeviceExtension,
278 (PVIDEO_SHARE_MEMORY) RequestPacket->InputBuffer,
280 RequestPacket->StatusBlock);
281 break;
282
284 if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
285 {
287 return TRUE;
288 }
289 Result = VGAUnmapVideoMemory(DeviceExtension,
290 (PVIDEO_MEMORY) RequestPacket->InputBuffer,
291 RequestPacket->StatusBlock);
292 break;
293
295 if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
296 {
298 return TRUE;
299 }
301 RequestPacket->StatusBlock);
302 break;
305 RequestPacket->StatusBlock);
306 break;
307
308#if 0
313
315 VGAFreePublicAccessRanges((PVIDEO_PUBLIC_ACCESS_RANGES)
316 RequestPacket->InputBuffer,
317 RequestPacket->StatusBlock);
318 break;
319
329
331 VGAQueryPublicAccessRanges((PVIDEO_PUBLIC_ACCESS_RANGES)
332 RequestPacket->OutputBuffer,
333 RequestPacket->StatusBlock);
334 break;
335
343
344#endif
345
346 default:
347 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
348 return FALSE;
349 }
350
351 if (Result)
352 RequestPacket->StatusBlock->Status = NO_ERROR;
353
354 return TRUE;
355}
unsigned char BOOLEAN
Definition: actypes.h:127
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
VOID VGAResetDevice(OUT PSTATUS_BLOCK StatusBlock)
Definition: initvga.c:117
#define IOCTL_VIDEO_SET_POWER_MANAGEMENT
Definition: ntddvdeo.h:239
#define IOCTL_VIDEO_SHARE_VIDEO_MEMORY
Definition: ntddvdeo.h:242
#define IOCTL_VIDEO_MAP_VIDEO_MEMORY
Definition: ntddvdeo.h:173
#define IOCTL_VIDEO_ENABLE_POINTER
Definition: ntddvdeo.h:155
#define IOCTL_VIDEO_SET_PALETTE_REGISTERS
Definition: ntddvdeo.h:230
#define IOCTL_VIDEO_SET_POINTER_ATTR
Definition: ntddvdeo.h:233
#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY
Definition: ntddvdeo.h:248
#define IOCTL_VIDEO_QUERY_CURSOR_ATTR
Definition: ntddvdeo.h:185
#define IOCTL_VIDEO_QUERY_CURSOR_POSITION
Definition: ntddvdeo.h:188
#define IOCTL_VIDEO_SET_CURSOR_POSITION
Definition: ntddvdeo.h:227
#define IOCTL_VIDEO_QUERY_CURRENT_MODE
Definition: ntddvdeo.h:182
#define IOCTL_VIDEO_ENABLE_CURSOR
Definition: ntddvdeo.h:152
#define IOCTL_VIDEO_DISABLE_CURSOR
Definition: ntddvdeo.h:146
#define IOCTL_VIDEO_GET_POWER_MANAGEMENT
Definition: ntddvdeo.h:167
#define IOCTL_VIDEO_SET_POINTER_POSITION
Definition: ntddvdeo.h:236
#define IOCTL_VIDEO_SET_CURRENT_MODE
Definition: ntddvdeo.h:221
#define IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES
Definition: ntddvdeo.h:158
#define IOCTL_VIDEO_GET_BANK_SELECT_CODE
Definition: ntddvdeo.h:161
#define IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES
Definition: ntddvdeo.h:197
#define IOCTL_VIDEO_SET_COLOR_REGISTERS
Definition: ntddvdeo.h:218
#define IOCTL_VIDEO_LOAD_AND_SET_FONT
Definition: ntddvdeo.h:170
#define IOCTL_VIDEO_RESET_DEVICE
Definition: ntddvdeo.h:206
#define IOCTL_VIDEO_QUERY_POINTER_POSITION
Definition: ntddvdeo.h:200
#define IOCTL_VIDEO_SET_CURSOR_ATTR
Definition: ntddvdeo.h:224
#define IOCTL_VIDEO_DISABLE_POINTER
Definition: ntddvdeo.h:149
#define IOCTL_VIDEO_QUERY_POINTER_ATTR
Definition: ntddvdeo.h:194
#define IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY
Definition: ntddvdeo.h:251
#define IOCTL_VIDEO_QUERY_AVAIL_MODES
Definition: ntddvdeo.h:176
#define IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES
Definition: ntddvdeo.h:179
#define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES
Definition: ntddvdeo.h:191
#define IOCTL_VIDEO_SAVE_HARDWARE_STATE
Definition: ntddvdeo.h:212
#define IOCTL_VIDEO_RESTORE_HARDWARE_STATE
Definition: ntddvdeo.h:209
#define IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES
Definition: ntddvdeo.h:203
VP_STATUS Status
Definition: video.h:323
ULONG InputBufferLength
Definition: video.h:333
PSTATUS_BLOCK StatusBlock
Definition: video.h:331
ULONG OutputBufferLength
Definition: video.h:335
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
uint16_t * PUSHORT
Definition: typedefs.h:56
BOOLEAN VGAUnmapVideoMemory(IN PVOID DeviceExtension, IN PVIDEO_MEMORY MemoryToUnmap, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:623
BOOLEAN VGASetColorRegisters(IN PVIDEO_CLUT ColorLookUpTable, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:531
BOOLEAN VGASetCurrentMode(IN PVIDEO_MODE RequestedMode, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:547
BOOLEAN VGAMapVideoMemory(IN PVOID DeviceExtension, IN PVIDEO_MEMORY RequestedAddress, OUT PVIDEO_MEMORY_INFORMATION MapInformation, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:426
BOOLEAN VGAShareVideoMemory(_In_ PVOID DeviceExtension, _In_ PVIDEO_SHARE_MEMORY RequestedMemory, _Out_ PVIDEO_MEMORY_INFORMATION ReturnedMemory, _Out_ PSTATUS_BLOCK StatusBlock)
Shares a portion of VGA video memory with a VDM.
Definition: vgamp.c:581
BOOLEAN VGAQueryAvailModes(OUT PVIDEO_MODE_INFORMATION ReturnedModes, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:457
BOOLEAN VGAUnshareVideoMemory(IN PVIDEO_MEMORY MemoryToUnshare, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:635
BOOLEAN VGASetPaletteRegisters(IN PUSHORT PaletteRegisters, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:502
BOOLEAN VGAQueryNumAvailModes(OUT PVIDEO_NUM_MODES NumberOfModes, OUT PSTATUS_BLOCK StatusBlock)
Definition: vgamp.c:493
_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:409

Referenced by DriverEntry().

◆ VGAUnmapVideoMemory()

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

Definition at line 623 of file vgamp.c.

626{
627 if (VideoPortUnmapMemory(DeviceExtension,
628 MemoryToUnmap->RequestedVirtualAddress,
629 0) == NO_ERROR)
630 return TRUE;
631 else
632 return FALSE;
633}
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 635 of file vgamp.c.

637{
639
640 StatusBlock->Status = ERROR_INVALID_FUNCTION;
641 return FALSE;
642}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

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().