ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

vgamp.c
Go to the documentation of this file.
00001 /*
00002  * VGA.C - a generic VGA miniport driver
00003  *
00004  */
00005 
00006 //  -------------------------------------------------------  Includes
00007 
00008 #include "vgamp.h"
00009 
00010 //  -------------------------------------------------------  Public Interface
00011 
00012 //    DriverEntry
00013 //
00014 //  DESCRIPTION:
00015 //    This function initializes the driver.
00016 //
00017 //  RUN LEVEL:
00018 //    PASSIVE_LEVEL
00019 //
00020 //  ARGUMENTS:
00021 //    IN  PVOID  Context1  Context parameter to pass to VidPortInitialize
00022 //    IN  PVOID  Context2  Context parameter to pass to VidPortInitialize
00023 //  RETURNS:
00024 //    ULONG
00025 
00026 ULONG NTAPI
00027 DriverEntry(IN PVOID Context1,
00028             IN PVOID Context2)
00029 {
00030   VIDEO_HW_INITIALIZATION_DATA  InitData;
00031 
00032   VideoPortZeroMemory(&InitData, sizeof InitData);
00033 
00034   InitData.HwInitDataSize = sizeof(InitData);
00035   /* FIXME: Fill in InitData members  */
00036   InitData.StartingDeviceNumber = 0;
00037 
00038   /*  Export driver entry points...  */
00039   InitData.HwFindAdapter = VGAFindAdapter;
00040   InitData.HwInitialize = VGAInitialize;
00041   InitData.HwStartIO = VGAStartIO;
00042   /* InitData.HwInterrupt = VGAInterrupt;  */
00043   InitData.HwResetHw = VGAResetHw;
00044   /* InitData.HwTimer = VGATimer;  */
00045 
00046   return  VideoPortInitialize(Context1, Context2, &InitData, NULL);
00047 }
00048 
00049 //    VGAFindAdapter
00050 //
00051 //  DESCRIPTION:
00052 //    This routine is called by the videoport driver to find and allocate
00053 //    the adapter for a given bus.  The miniport driver needs to do the
00054 //    following in this routine:
00055 //      - Determine if the adapter is present
00056 //      - Claim any necessary memory/IO resources for the adapter
00057 //      - Map resources into system memory for the adapter
00058 //      - fill in relevant information in the VIDEO_PORT_CONFIG_INFO buffer
00059 //      - update registry settings for adapter specifics.
00060 //      - Set 'Again' based on whether the function should be called again
00061 //        another adapter on the same bus.
00062 //
00063 //  RUN LEVEL:
00064 //    PASSIVE_LEVEL
00065 //
00066 //  ARGUMENTS:
00067 //    PVOID                    DeviceExtension
00068 //    PVOID                    Context
00069 //    PWSTR                    ArgumentString
00070 //    PVIDEO_PORT_CONFIG_INFO  ConfigInfo
00071 //    PUCHAR                   Again
00072 //  RETURNS:
00073 //    VP_STATUS
00074 
00075 VP_STATUS NTAPI
00076 VGAFindAdapter(PVOID DeviceExtension,
00077                PVOID Context,
00078                PWSTR ArgumentString,
00079                PVIDEO_PORT_CONFIG_INFO ConfigInfo,
00080                PUCHAR Again)
00081 {
00082   /* FIXME: Determine if the adapter is present  */
00083   *Again = FALSE;
00084 
00085   return  NO_ERROR;
00086 
00087   /* FIXME: Claim any necessary memory/IO resources for the adapter  */
00088   /* FIXME: Map resources into system memory for the adapter  */
00089   /* FIXME: Fill in relevant information in the VIDEO_PORT_CONFIG_INFO buffer  */
00090   /* FIXME: Update registry settings for adapter specifics.  */
00091 //  return  NO_ERROR;
00092 }
00093 
00094 //    VGAInitialize
00095 //
00096 //  DESCRIPTION:
00097 //    Perform initialization tasks, but leave the adapter in the same
00098 //    user visible state
00099 //
00100 //  RUN LEVEL:
00101 //    PASSIVE_LEVEL
00102 //
00103 //  ARGUMENTS:
00104 //    PVOID  DeviceExtension
00105 //  RETURNS:
00106 //    BOOLEAN  Success or failure
00107 BOOLEAN NTAPI
00108 VGAInitialize(PVOID DeviceExtension)
00109 {
00110   return  TRUE;
00111 }
00112 
00113 //    VGAStartIO
00114 //
00115 //  DESCRIPTION:
00116 //    This function gets called in responce to GDI EngDeviceIoControl
00117 //    calls.  Device requests are passed in VRPs.
00118 //      Required VRPs:
00119 //        IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES
00120 //        IOCTL_VIDEO_QUERY_AVAIL_MODES
00121 //        IOCTL_VIDEO_QUERY_CURRENT_MODE
00122 //        IOCTL_VIDEO_SET_CURRENT_MODE
00123 //        IOCTL_VIDEO_RESET_DEVICE
00124 //        IOCTL_VIDEO_MAP_VIDEO_MEMORY
00125 //        IOCTL_VIDEO_UNMAP_VIDEO_MEMORY
00126 //        IOCTL_VIDEO_SHARE_VIDEO_MEMORY
00127 //        IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY
00128 //      Optional VRPs:
00129 //        IOCTL_VIDEO_GET_PUBLIC_ACCESS_RANGES
00130 //        IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES
00131 //        IOCTL_VIDEO_GET_POWER_MANAGEMENT
00132 //        IOCTL_VIDEO_SET_POWER_MANAGEMENT
00133 //        IOCTL_QUERY_COLOR_CAPABILITIES
00134 //        IOCTL_VIDEO_SET_COLOR_REGISTERS (required if the device has a palette)
00135 //        IOCTL_VIDEO_DISABLE_POINTER
00136 //        IOCTL_VIDEO_ENABLE_POINTER
00137 //        IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES
00138 //        IOCTL_VIDEO_QUERY_POINTER_ATTR
00139 //        IOCTL_VIDEO_SET_POINTER_ATTR
00140 //        IOCTL_VIDEO_QUERY_POINTER_POSITION
00141 //        IOCTL_VIDEO_SET_POINTER_POSITION
00142 //        IOCTL_VIDEO_SAVE_HARDWARE_STATE
00143 //        IOCTL_VIDEO_RESTORE_HARDWARE_STATE
00144 //        IOCTL_VIDEO_DISABLE_CURSOR
00145 //        IOCTL_VIDEO_ENABLE_CURSOR
00146 //        IOCTL_VIDEO_QUERY_CURSOR_ATTR
00147 //        IOCTL_VIDEO_SET_CURSOR_ATTR
00148 //        IOCTL_VIDEO_QUERY_CURSOR_POSITION
00149 //        IOCTL_VIDEO_SET_CURSOR_POSITION
00150 //        IOCTL_VIDEO_GET_BANK_SELECT_CODE
00151 //        IOCTL_VIDEO_SET_PALETTE_REGISTERS
00152 //        IOCTL_VIDEO_LOAD_AND_SET_FONT
00153 //
00154 //  RUN LEVEL:
00155 //    PASSIVE_LEVEL
00156 //
00157 //  ARGUMENTS:
00158 //    PVOID                  DeviceExtension
00159 //    PVIDEO_REQUEST_PACKET  RequestPacket
00160 //  RETURNS:
00161 //    BOOLEAN  This function must return TRUE, and complete the work or
00162 //             set an error status in the VRP.
00163 
00164 BOOLEAN NTAPI
00165 VGAStartIO(PVOID DeviceExtension,
00166            PVIDEO_REQUEST_PACKET RequestPacket)
00167 {
00168   BOOLEAN Result;
00169 
00170   RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
00171 
00172   switch (RequestPacket->IoControlCode)
00173     {
00174     case  IOCTL_VIDEO_MAP_VIDEO_MEMORY:
00175       if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
00176           RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
00177       {
00178         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00179         return TRUE;
00180       }
00181       Result = VGAMapVideoMemory(DeviceExtension,
00182             (PVIDEO_MEMORY) RequestPacket->InputBuffer,
00183                          (PVIDEO_MEMORY_INFORMATION)
00184                          RequestPacket->OutputBuffer,
00185                          RequestPacket->StatusBlock);
00186       break;
00187 
00188     case  IOCTL_VIDEO_QUERY_AVAIL_MODES:
00189       if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
00190       {
00191         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00192         return TRUE;
00193       }
00194       Result = VGAQueryAvailModes((PVIDEO_MODE_INFORMATION) RequestPacket->OutputBuffer,
00195                          RequestPacket->StatusBlock);
00196       break;
00197 
00198     case  IOCTL_VIDEO_QUERY_CURRENT_MODE:
00199       if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
00200       {
00201         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00202         return TRUE;
00203       }
00204       Result = VGAQueryCurrentMode((PVIDEO_MODE_INFORMATION) RequestPacket->OutputBuffer,
00205                           RequestPacket->StatusBlock);
00206       break;
00207 
00208     case  IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES:
00209       if (RequestPacket->OutputBufferLength < sizeof(VIDEO_NUM_MODES))
00210       {
00211         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00212         return TRUE;
00213       }
00214       Result = VGAQueryNumAvailModes((PVIDEO_NUM_MODES) RequestPacket->OutputBuffer,
00215                             RequestPacket->StatusBlock);
00216       break;
00217 
00218     case  IOCTL_VIDEO_RESET_DEVICE:
00219       VGAResetDevice(RequestPacket->StatusBlock);
00220       Result = TRUE;
00221       break;
00222 
00223     case  IOCTL_VIDEO_SET_COLOR_REGISTERS:
00224       if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT) ||
00225           RequestPacket->InputBufferLength <
00226           (((PVIDEO_CLUT)RequestPacket->InputBuffer)->NumEntries * sizeof(ULONG)) +
00227           FIELD_OFFSET(VIDEO_CLUT, LookupTable))
00228       {
00229         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00230         return TRUE;
00231       }
00232       Result = VGASetColorRegisters((PVIDEO_CLUT) RequestPacket->InputBuffer,
00233                            RequestPacket->StatusBlock);
00234       break;
00235 
00236     case  IOCTL_VIDEO_SET_CURRENT_MODE:
00237       if (RequestPacket->InputBufferLength < sizeof(VIDEO_MODE))
00238       {
00239         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00240         return TRUE;
00241       }
00242       Result = VGASetCurrentMode((PVIDEO_MODE) RequestPacket->InputBuffer,
00243                         RequestPacket->StatusBlock);
00244       break;
00245 
00246     case  IOCTL_VIDEO_SHARE_VIDEO_MEMORY:
00247       if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
00248           RequestPacket->InputBufferLength < sizeof(VIDEO_SHARE_MEMORY))
00249       {
00250         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00251         return TRUE;
00252       }
00253       Result = VGAShareVideoMemory((PVIDEO_SHARE_MEMORY) RequestPacket->InputBuffer,
00254                           (PVIDEO_MEMORY_INFORMATION) RequestPacket->OutputBuffer,
00255                           RequestPacket->StatusBlock);
00256       break;
00257 
00258     case  IOCTL_VIDEO_UNMAP_VIDEO_MEMORY:
00259       if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
00260       {
00261         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00262         return TRUE;
00263       }
00264       Result = VGAUnmapVideoMemory(DeviceExtension,
00265               (PVIDEO_MEMORY) RequestPacket->InputBuffer,
00266                           RequestPacket->StatusBlock);
00267       break;
00268 
00269     case  IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY:
00270       if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
00271       {
00272         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00273         return TRUE;
00274       }
00275       Result = VGAUnshareVideoMemory((PVIDEO_MEMORY) RequestPacket->InputBuffer,
00276                             RequestPacket->StatusBlock);
00277       break;
00278     case  IOCTL_VIDEO_SET_PALETTE_REGISTERS:
00279       Result = VGASetPaletteRegisters((PUSHORT) RequestPacket->InputBuffer,
00280                              RequestPacket->StatusBlock);
00281       break;
00282 
00283 #if 0
00284     case  IOCTL_VIDEO_DISABLE_CURSOR:
00285     case  IOCTL_VIDEO_DISABLE_POINTER:
00286     case  IOCTL_VIDEO_ENABLE_CURSOR:
00287     case  IOCTL_VIDEO_ENABLE_POINTER:
00288 
00289     case  IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES:
00290       VGAFreePublicAccessRanges((PVIDEO_PUBLIC_ACCESS_RANGES)
00291                                   RequestPacket->InputBuffer,
00292                                 RequestPacket->StatusBlock);
00293       break;
00294 
00295     case  IOCTL_VIDEO_GET_BANK_SELECT_CODE:
00296     case  IOCTL_VIDEO_GET_POWER_MANAGEMENT:
00297     case  IOCTL_VIDEO_LOAD_AND_SET_FONT:
00298     case  IOCTL_VIDEO_QUERY_CURSOR_POSITION:
00299     case  IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES:
00300     case  IOCTL_VIDEO_QUERY_CURSOR_ATTR:
00301     case  IOCTL_VIDEO_QUERY_POINTER_ATTR:
00302     case  IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES:
00303     case  IOCTL_VIDEO_QUERY_POINTER_POSITION:
00304 
00305     case  IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES:
00306       VGAQueryPublicAccessRanges((PVIDEO_PUBLIC_ACCESS_RANGES)
00307                                    RequestPacket->OutputBuffer,
00308                                  RequestPacket->StatusBlock);
00309       break;
00310 
00311     case  IOCTL_VIDEO_RESTORE_HARDWARE_STATE:
00312     case  IOCTL_VIDEO_SAVE_HARDWARE_STATE:
00313     case  IOCTL_VIDEO_SET_CURSOR_ATTR:
00314     case  IOCTL_VIDEO_SET_CURSOR_POSITION:
00315     case  IOCTL_VIDEO_SET_POINTER_ATTR:
00316     case  IOCTL_VIDEO_SET_POINTER_POSITION:
00317     case  IOCTL_VIDEO_SET_POWER_MANAGEMENT:
00318 
00319 #endif
00320 
00321     default:
00322       RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
00323       return FALSE;
00324     }
00325 
00326   if (Result)
00327     RequestPacket->StatusBlock->Status = NO_ERROR;
00328 
00329   return TRUE;
00330 }
00331 
00332 #if 0
00333 //    VGAInterrupt
00334 //
00335 //  DESCRIPTION:
00336 //    This function will be called upon receipt of a adapter generated
00337 //    interrupt when enabled.
00338 //
00339 //  RUN LEVEL:
00340 //    IRQL
00341 //
00342 //  ARGUMENTS:
00343 //    PVOID                  DeviceExtension
00344 //  RETURNS:
00345 //    BOOLEAN  TRUE if the interrupt was handled by the routine
00346 
00347 static BOOLEAN NTAPI
00348 VGAInterrupt(PVOID DeviceExtension)
00349 {
00350   return(TRUE);
00351 }
00352 #endif
00353 
00354 //    VGAResetHw
00355 //
00356 //  DESCRIPTION:
00357 //    This function is called to reset the hardware to a known state
00358 //    if calling a BIOS int 10 reset will not achieve this result.
00359 //
00360 //  RUN LEVEL:
00361 //    PASSIVE_LEVEL
00362 //
00363 //  ARGUMENTS:
00364 //    PVOID  DeviceExtension
00365 //    ULONG  Columns          Columns and Rows specify the mode parameters
00366 //    ULONG  Rows               to reset to.
00367 //  RETURNS:
00368 //    BOOLEAN  TRUE if no further action is necessary, FALSE if the system
00369 //             needs to still do a BIOS int 10 reset.
00370 
00371 BOOLEAN NTAPI
00372 VGAResetHw(PVOID DeviceExtension,
00373        ULONG Columns,
00374        ULONG Rows)
00375 {
00376   /* We don't anything to the vga that int10 can't cope with. */
00377   return(FALSE);
00378 }
00379 
00380 #if 0
00381 //    VGATimer
00382 //
00383 //  DESCRIPTION:
00384 //    This function will be called once a second when enabled
00385 //
00386 //  RUN LEVEL:
00387 //    PASSIVE_LEVEL
00388 //
00389 //  ARGUMENTS:
00390 //    PVOID  DeviceExtension
00391 //  RETURNS:
00392 //    VOID
00393 
00394 static VOID NTAPI
00395 VGATimer(PVOID DeviceExtension)
00396 {
00397 }
00398 
00399 #endif
00400 
00401 BOOLEAN  VGAMapVideoMemory(IN PVOID DeviceExtension,
00402             IN PVIDEO_MEMORY  RequestedAddress,
00403                         OUT PVIDEO_MEMORY_INFORMATION  MapInformation,
00404                         OUT PSTATUS_BLOCK  StatusBlock)
00405 {
00406   ULONG ReturnedLength;
00407   PVOID ReturnedAddress;
00408   ULONG IoSpace;
00409   PHYSICAL_ADDRESS FrameBufferBase;
00410   ReturnedAddress = RequestedAddress->RequestedVirtualAddress;
00411   ReturnedLength = 256 * 1024;
00412   FrameBufferBase.QuadPart = 0xA0000;
00413   IoSpace = VIDEO_MEMORY_SPACE_MEMORY;
00414   StatusBlock->Status = VideoPortMapMemory(DeviceExtension,
00415                        FrameBufferBase,
00416                        &ReturnedLength,
00417                        &IoSpace,
00418                        &ReturnedAddress);
00419   if (StatusBlock->Status != 0)
00420     {
00421       StatusBlock->Information = 0;
00422       return TRUE;
00423     }
00424   MapInformation->VideoRamBase = MapInformation->FrameBufferBase =
00425     ReturnedAddress;
00426   MapInformation->VideoRamLength = MapInformation->FrameBufferLength =
00427     ReturnedLength;
00428   StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION);
00429   return TRUE;
00430 }
00431 
00432 BOOLEAN  VGAQueryAvailModes(OUT PVIDEO_MODE_INFORMATION  ReturnedModes,
00433                          OUT PSTATUS_BLOCK  StatusBlock)
00434 {
00435   /* Only one mode exists in VGA (640x480), so use VGAQueryCurrentMode */
00436   return VGAQueryCurrentMode(ReturnedModes, StatusBlock);
00437 }
00438 
00439 BOOLEAN  VGAQueryCurrentMode(OUT PVIDEO_MODE_INFORMATION  CurrentMode,
00440                           OUT PSTATUS_BLOCK  StatusBlock)
00441 {
00442   CurrentMode->Length = sizeof(VIDEO_MODE_INFORMATION);
00443   CurrentMode->ModeIndex = 2;
00444   CurrentMode->VisScreenWidth = 640;
00445   CurrentMode->VisScreenHeight = 480;
00446   CurrentMode->ScreenStride = 80;
00447   CurrentMode->NumberOfPlanes = 4;
00448   CurrentMode->BitsPerPlane = 1;
00449   CurrentMode->Frequency = 60;
00450   CurrentMode->XMillimeter = 320;
00451   CurrentMode->YMillimeter = 240;
00452   CurrentMode->NumberRedBits =
00453   CurrentMode->NumberGreenBits =
00454   CurrentMode->NumberBlueBits = 6;
00455   CurrentMode->RedMask =
00456   CurrentMode->GreenMask =
00457   CurrentMode->BlueMask = 0;
00458   CurrentMode->VideoMemoryBitmapWidth = 640;
00459   CurrentMode->VideoMemoryBitmapHeight = 480;
00460   CurrentMode->AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR |
00461       VIDEO_MODE_NO_OFF_SCREEN;
00462   CurrentMode->DriverSpecificAttributeFlags = 0;
00463 
00464   StatusBlock->Information = sizeof(VIDEO_MODE_INFORMATION);
00465   return TRUE;
00466 }
00467 
00468 BOOLEAN  VGAQueryNumAvailModes(OUT PVIDEO_NUM_MODES  NumberOfModes,
00469                             OUT PSTATUS_BLOCK  StatusBlock)
00470 {
00471   NumberOfModes->NumModes = 1;
00472   NumberOfModes->ModeInformationLength = sizeof(VIDEO_MODE_INFORMATION);
00473   StatusBlock->Information = sizeof(VIDEO_NUM_MODES);
00474   return TRUE;
00475 }
00476 
00477 BOOLEAN  VGASetPaletteRegisters(IN PUSHORT  PaletteRegisters,
00478                              OUT PSTATUS_BLOCK  StatusBlock)
00479 {
00480   ;
00481 
00482 /*
00483   We don't need the following code because the palette registers are set correctly on VGA initialization.
00484   Still, we may include\test this is in the future.
00485 
00486   int i, j = 2;
00487   char tmp, v;
00488 
00489   tmp = VideoPortReadPortUchar(0x03da);
00490   v = VideoPortReadPortUchar(0x03c0);
00491 
00492   // Set the first 16 palette registers to map to the first 16 palette colors
00493   for (i=PaletteRegisters[1]; i<PaletteRegisters[0]; i++)
00494   {
00495     tmp = VideoPortReadPortUchar(0x03da);
00496     VideoPortWritePortUchar(0x03c0, i);
00497     VideoPortWritePortUchar(0x03c0, PaletteRegisters[j++]);
00498   }
00499 
00500   tmp = VideoPortReadPortUchar(0x03da);
00501   VideoPortWritePortUchar(0x03d0, v | 0x20);
00502 */
00503   return TRUE;
00504 }
00505 
00506 BOOLEAN  VGASetColorRegisters(IN PVIDEO_CLUT  ColorLookUpTable,
00507                            OUT PSTATUS_BLOCK  StatusBlock)
00508 {
00509   int i;
00510 
00511   for (i=ColorLookUpTable->FirstEntry; i<ColorLookUpTable->NumEntries; i++)
00512   {
00513     VideoPortWritePortUchar((PUCHAR)0x03c8, i);
00514     VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Red);
00515     VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Green);
00516     VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[i].RgbArray.Blue);
00517   }
00518 
00519   return TRUE;
00520 }
00521 
00522 BOOLEAN  VGASetCurrentMode(IN PVIDEO_MODE  RequestedMode,
00523                         OUT PSTATUS_BLOCK  StatusBlock)
00524 {
00525   if(RequestedMode->RequestedMode == 12)
00526   {
00527     InitVGAMode();
00528     return TRUE;
00529   } else {
00530     VideoPortDebugPrint(Warn, "Unrecognised mode for VGASetCurrentMode\n");
00531     return FALSE;
00532   }
00533 }
00534 
00535 BOOLEAN  VGAShareVideoMemory(IN PVIDEO_SHARE_MEMORY  RequestedMemory,
00536                           OUT PVIDEO_MEMORY_INFORMATION  ReturnedMemory,
00537                           OUT PSTATUS_BLOCK  StatusBlock)
00538 {
00539   UNIMPLEMENTED;
00540 
00541   StatusBlock->Status = ERROR_INVALID_FUNCTION;
00542   return FALSE;
00543 }
00544 
00545 BOOLEAN  VGAUnmapVideoMemory(IN PVOID DeviceExtension,
00546               IN PVIDEO_MEMORY  MemoryToUnmap,
00547                           OUT PSTATUS_BLOCK  StatusBlock)
00548 {
00549   if (VideoPortUnmapMemory(DeviceExtension,
00550                MemoryToUnmap->RequestedVirtualAddress,
00551                0) == NO_ERROR)
00552     return TRUE;
00553   else
00554     return FALSE;
00555 }
00556 
00557 BOOLEAN  VGAUnshareVideoMemory(IN PVIDEO_MEMORY  MemoryToUnshare,
00558                             OUT PSTATUS_BLOCK  StatusBlock)
00559 {
00560   UNIMPLEMENTED;
00561 
00562   StatusBlock->Status = ERROR_INVALID_FUNCTION;
00563   return FALSE;
00564 }

Generated on Sun May 27 2012 04:38:12 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.