Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

fsvga.h File Reference

#include "ntddvdeo.h"
#include "fscrnctl.h"
#include "vga.h"

Go to the source code of this file.

Classes

struct  _FSVGA_CONFIGURATION_INFORMATION
struct  _EMULATE_BUFFER_INFORMATION
struct  _DEVICE_EXTENSION

Defines

#define ENABLE_WORD_WRITE_VRAM   0x01
#define NO_HARDWARE_CURSOR   0
#define HARDWARE_CURSOR   0x01
#define NO_HARDWARE_SCROLL   0
#define HARDWARE_SCROLL   0x01
#define USE_LINE_COMPARE   0x02
#define OFFSET_128_TO_NEXT_SLICE   0x04
#define LIMIT_64K   0x10000L
#define FSVGA_ERROR_VALUE_BASE   1000
#define FSVGA_HARDWARE_PRESENT   1
#define FsVgaPrint(x)

Typedefs

typedef enum _VGA_IO_PORT_TYPE VGA_IO_PORT_TYPE
typedef _FSVGA_CONFIGURATION_INFORMATION FSVGA_CONFIGURATION_INFORMATION
typedef _FSVGA_CONFIGURATION_INFORMATIONPFSVGA_CONFIGURATION_INFORMATION
typedef _EMULATE_BUFFER_INFORMATION EMULATE_BUFFER_INFORMATION
typedef _EMULATE_BUFFER_INFORMATIONPEMULATE_BUFFER_INFORMATION
typedef _DEVICE_EXTENSION DEVICE_EXTENSION
typedef _DEVICE_EXTENSIONPDEVICE_EXTENSION

Enumerations

enum  _VGA_IO_PORT_TYPE {
  CRTCAddressPortColor = 0, CRTCDataPortColor, GRAPHAddressPort, SEQUAddressPort,
  MaximumPortCount
}

Functions

NTSTATUS DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
VOID FsVgaConfiguration (IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING KeyboardDeviceName)
NTSTATUS FsVgaPeripheralCallout (IN PVOID Context, IN PUNICODE_STRING PathName, IN INTERFACE_TYPE BusType, IN ULONG BusNumber, IN PKEY_VALUE_FULL_INFORMATION *BusInformation, IN CONFIGURATION_TYPE ControllerType, IN ULONG ControllerNumber, IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation, IN CONFIGURATION_TYPE PeripheralType, IN ULONG PeripheralNumber, IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation)
VOID FsVgaServiceParameters (IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING FsVgaDeviceName)
VOID FsVgaBuildResourceList (IN PDEVICE_EXTENSION DeviceExtension, OUT PCM_RESOURCE_LIST *ResourceList, OUT PULONG ResourceListSize)
NTSTATUS FsVgaOpenCloseDispatch (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS FsVgaDeviceControl (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS FsVgaCopyFrameBuffer (PDEVICE_EXTENSION DeviceExtension, PFSVIDEO_COPY_FRAME_BUFFER CopyFrameBuffer, ULONG inputBufferLength)
NTSTATUS FsVgaWriteToFrameBuffer (PDEVICE_EXTENSION DeviceExtension, PFSVIDEO_WRITE_TO_FRAME_BUFFER WriteFrameBuffer, ULONG inputBufferLength)
NTSTATUS FsVgaReverseMousePointer (PDEVICE_EXTENSION DeviceExtension, PFSVIDEO_REVERSE_MOUSE_POINTER MouseBuffer, ULONG inputBufferLength)
NTSTATUS FsVgaSetMode (PDEVICE_EXTENSION DeviceExtension, PFSVIDEO_MODE_INFORMATION ModeInformation, ULONG inputBufferLength)
NTSTATUS FsVgaSetScreenInformation (PDEVICE_EXTENSION DeviceExtension, PFSVIDEO_SCREEN_INFORMATION ScreenInformation, ULONG inputBufferLength)
NTSTATUS FsVgaSetCursorPosition (PDEVICE_EXTENSION DeviceExtension, PFSVIDEO_CURSOR_POSITION CursorPosition, ULONG inputBufferLength)
NTSTATUS FsVgaSetCursorAttribute (PDEVICE_EXTENSION DeviceExtension, PVIDEO_CURSOR_ATTRIBUTES CursorAttributes, ULONG inputBufferLength)
VOID FsVgaLogError (IN PDEVICE_OBJECT DeviceObject, IN NTSTATUS ErrorCode, IN ULONG UniqueErrorValue, IN NTSTATUS FinalStatus, IN PULONG DumpData, IN ULONG DumpCount)
ULONG CalcGRAMSize (IN COORD WindowSize, IN PDEVICE_EXTENSION DeviceExtension)
PUCHAR CalcGRAMAddress (IN COORD WindowSize, IN PDEVICE_EXTENSION DeviceExtension)
BOOL IsGRAMRowOver (PUCHAR BufPtr, BOOL fDbcs, PDEVICE_EXTENSION DeviceExtension)
PUCHAR NextGRAMRow (PUCHAR BufPtr, PDEVICE_EXTENSION DeviceExtension)
VOID memcpyGRAM (IN PCHAR TargetPtr, IN PCHAR SourcePtr, IN ULONG Length)
VOID memcpyGRAMOver (IN PCHAR TargetPtr, IN PCHAR SourcePtr, IN ULONG Length, IN PUCHAR FrameBufPtr, IN PDEVICE_EXTENSION DeviceExtension)
VOID MoveGRAM (IN PCHAR TargetPtr, IN PCHAR SourcePtr, IN ULONG Length, IN PUCHAR FrameBufPtr, IN PDEVICE_EXTENSION DeviceExtension)
NTSTATUS FsgVgaInitializeHWFlags (PDEVICE_EXTENSION DeviceExtension)
NTSTATUS FsgCopyFrameBuffer (PDEVICE_EXTENSION DeviceExtension, PFSVIDEO_COPY_FRAME_BUFFER CopyFrameBuffer, ULONG inputBufferLength)
NTSTATUS FsgWriteToFrameBuffer (PDEVICE_EXTENSION DeviceExtension, PFSVIDEO_WRITE_TO_FRAME_BUFFER WriteFrameBuffer, ULONG inputBufferLength)
NTSTATUS FsgReverseMousePointer (PDEVICE_EXTENSION DeviceExtension, PFSVIDEO_REVERSE_MOUSE_POINTER MouseBuffer, ULONG inputBufferLength)
NTSTATUS FsgInvertCursor (PDEVICE_EXTENSION DeviceExtension, BOOL Invert)
NTSTATUS FsgWriteToScreen (PUCHAR FrameBuffer, PUCHAR BitmapBuffer, DWORD cjBytes, BOOL fDbcs, WORD Attributes1, WORD Attributes2, PDEVICE_EXTENSION DeviceExtension)
NTSTATUS FsgWriteToScreenCommonLVB (PUCHAR FrameBuffer, WORD Attributes, PDEVICE_EXTENSION DeviceExtension)
UCHAR AccessGRAM_WR (PUCHAR FrameBuffer, UCHAR write)
UCHAR AccessGRAM_RW (PUCHAR FrameBuffer, UCHAR write)
UCHAR AccessGRAM_AND (PUCHAR FrameBuffer, UCHAR write)
DWORD CalcBitmapBufferSize (IN COORD FontSize, IN DWORD dwAlign)
VOID AlignCopyMemory (OUT PBYTE pDestBits, IN DWORD dwDestAlign, IN PBYTE pSrcBits, IN DWORD dwSrcAlign, IN COORD FontSize)
int ConvertOutputToOem (IN LPWSTR Source, IN int SourceLength, OUT LPSTR Target, IN int TargetLength)
NTSTATUS TranslateOutputToOem (OUT PCHAR_IMAGE_INFO OutputBuffer, IN PCHAR_IMAGE_INFO InputBuffer, IN DWORD Length)
VOID GetHardwareScrollReg (PDEVICE_EXTENSION deviceExtension)
VOID SetGRAMWriteMode (PDEVICE_EXTENSION deviceExtension)
VOID SetGRAMCopyMode (PDEVICE_EXTENSION deviceExtension)
VOID SetGRAMInvertMode (PDEVICE_EXTENSION deviceExtension)
VOID set_opaque_bkgnd_proc (PDEVICE_EXTENSION deviceExtension, PUCHAR FrameBuffer, WORD Attributes)
VOID ColorSetGridMask (PDEVICE_EXTENSION deviceExtension, BYTE BitMask)
VOID ColorSetDirect (PDEVICE_EXTENSION deviceExtension, PUCHAR FrameBuffer, BYTE ColorFg, BYTE ColorBg)


Define Documentation

#define ENABLE_WORD_WRITE_VRAM   0x01
 

Definition at line 50 of file fsvga.h.

Referenced by FsgWriteToScreen().

#define FSVGA_ERROR_VALUE_BASE   1000
 

Definition at line 168 of file fsvga.h.

Referenced by DriverEntry(), FsVgaBuildResourceList(), and FsVgaWriteToFrameBuffer().

#define FSVGA_HARDWARE_PRESENT   1
 

Definition at line 174 of file fsvga.h.

Referenced by DriverEntry(), FsVgaConfiguration(), and FsVgaPeripheralCallout().

#define FsVgaPrint  ) 
 

Definition at line 310 of file fsvga.h.

Referenced by DriverEntry(), FsVgaBuildResourceList(), FsVgaConfiguration(), FsVgaDeviceControl(), FsVgaOpenCloseDispatch(), FsVgaPeripheralCallout(), FsVgaServiceParameters(), and FsVgaWriteToFrameBuffer().

#define HARDWARE_CURSOR   0x01
 

Definition at line 54 of file fsvga.h.

#define HARDWARE_SCROLL   0x01
 

Definition at line 58 of file fsvga.h.

#define LIMIT_64K   0x10000L
 

Definition at line 96 of file fsvga.h.

Referenced by FsgVgaInitializeHWFlags().

#define NO_HARDWARE_CURSOR   0
 

Definition at line 53 of file fsvga.h.

Referenced by FsVgaServiceParameters().

#define NO_HARDWARE_SCROLL   0
 

Definition at line 57 of file fsvga.h.

Referenced by FsVgaServiceParameters().

#define OFFSET_128_TO_NEXT_SLICE   0x04
 

Definition at line 60 of file fsvga.h.

#define USE_LINE_COMPARE   0x02
 

Definition at line 59 of file fsvga.h.

Referenced by FsgVgaInitializeHWFlags().


Typedef Documentation

typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION
 

typedef struct _EMULATE_BUFFER_INFORMATION EMULATE_BUFFER_INFORMATION
 

typedef struct _FSVGA_CONFIGURATION_INFORMATION FSVGA_CONFIGURATION_INFORMATION
 

typedef struct _DEVICE_EXTENSION * PDEVICE_EXTENSION
 

typedef struct _EMULATE_BUFFER_INFORMATION * PEMULATE_BUFFER_INFORMATION
 

typedef struct _FSVGA_CONFIGURATION_INFORMATION * PFSVGA_CONFIGURATION_INFORMATION
 

Referenced by FsVgaConfiguration().

typedef enum _VGA_IO_PORT_TYPE VGA_IO_PORT_TYPE
 


Enumeration Type Documentation

enum _VGA_IO_PORT_TYPE
 

Enumeration values:
CRTCAddressPortColor 
CRTCDataPortColor 
GRAPHAddressPort 
SEQUAddressPort 
MaximumPortCount 

Definition at line 35 of file fsvga.h.


Function Documentation

UCHAR AccessGRAM_AND PUCHAR  FrameBuffer,
UCHAR  write
 

Definition at line 998 of file drawscrn.c.

Referenced by FsgInvertCursor(), and FsgReverseMousePointer().

01002 { 01003 return *FrameBuffer &= write; 01004 }

UCHAR AccessGRAM_RW PUCHAR  FrameBuffer,
UCHAR  write
 

Definition at line 986 of file drawscrn.c.

Referenced by FsgWriteToScreenCommonLVB().

00990 { 00991 UCHAR tmp; 00992 tmp = *FrameBuffer; 00993 *FrameBuffer = write; 00994 return tmp; 00995 }

UCHAR AccessGRAM_WR PUCHAR  FrameBuffer,
UCHAR  write
 

Definition at line 976 of file drawscrn.c.

Referenced by ColorSetDirect().

00980 { 00981 *FrameBuffer = write; 00982 return *FrameBuffer; 00983 }

VOID AlignCopyMemory OUT PBYTE  pDestBits,
IN DWORD  dwDestAlign,
IN PBYTE  pSrcBits,
IN DWORD  dwSrcAlign,
IN COORD  FontSize
 

Definition at line 56 of file fullscr/vga/foncache.c.

References BITMAP_BITS_BYTE_ALIGN, BITMAP_BITS_WORD_ALIGN, BYTE_ALIGN, CALC_BITMAP_BITS_FOR_X, CalcBitmapBufferSize(), DWORD, EXCEPTION_EXECUTE_HANDLER, and WORD_ALIGN.

Referenced by FsgWriteToFrameBuffer().

00063 { 00064 DWORD dwDestBufferSize; 00065 COORD coord; 00066 00067 try 00068 { 00069 00070 if (dwDestAlign == dwSrcAlign) { 00071 dwDestBufferSize = CalcBitmapBufferSize(FontSize, dwDestAlign); 00072 RtlCopyMemory(pDestBits, pSrcBits, dwDestBufferSize); 00073 return; 00074 } 00075 00076 switch (dwDestAlign) { 00077 default: 00078 case WORD_ALIGN: 00079 switch (dwSrcAlign) { 00080 default: 00081 // 00082 // pDest = WORD, pSrc = WORD 00083 // 00084 case WORD_ALIGN: 00085 dwDestBufferSize = CalcBitmapBufferSize(FontSize, dwDestAlign); 00086 RtlCopyMemory(pDestBits, pSrcBits, dwDestBufferSize); 00087 break; 00088 // 00089 // pDest = WORD, pSrc = BYTE 00090 // 00091 case BYTE_ALIGN: 00092 dwDestBufferSize = CalcBitmapBufferSize(FontSize, dwDestAlign); 00093 if (((FontSize.X % BITMAP_BITS_BYTE_ALIGN) == 0) && 00094 ((FontSize.X % BITMAP_BITS_WORD_ALIGN) == 0) ) { 00095 RtlCopyMemory(pDestBits, pSrcBits, dwDestBufferSize); 00096 } 00097 else { 00098 RtlZeroMemory(pDestBits, dwDestBufferSize); 00099 for (coord.Y=0; coord.Y < FontSize.Y; coord.Y++) { 00100 for (coord.X=0; 00101 coord.X < CALC_BITMAP_BITS_FOR_X(FontSize.X, BITMAP_BITS_BYTE_ALIGN); 00102 coord.X++) { 00103 *pDestBits++ = *pSrcBits++; 00104 } 00105 if (CALC_BITMAP_BITS_FOR_X(FontSize.X, BITMAP_BITS_BYTE_ALIGN) & 1) 00106 pDestBits++; 00107 } 00108 } 00109 break; 00110 } 00111 break; 00112 case BYTE_ALIGN: 00113 switch (dwSrcAlign) { 00114 // 00115 // pDest = BYTE, pSrc = BYTE 00116 // 00117 case BYTE_ALIGN: 00118 dwDestBufferSize = CalcBitmapBufferSize(FontSize, dwDestAlign); 00119 RtlCopyMemory(pDestBits, pSrcBits, dwDestBufferSize); 00120 break; 00121 default: 00122 // 00123 // pDest = BYTE, pSrc = WORD 00124 // 00125 case WORD_ALIGN: 00126 dwDestBufferSize = CalcBitmapBufferSize(FontSize, dwDestAlign); 00127 if (((FontSize.X % BITMAP_BITS_BYTE_ALIGN) == 0) && 00128 ((FontSize.X % BITMAP_BITS_WORD_ALIGN) == 0) ) { 00129 RtlCopyMemory(pDestBits, pSrcBits, dwDestBufferSize); 00130 } 00131 else { 00132 RtlZeroMemory(pDestBits, dwDestBufferSize); 00133 for (coord.Y=0; coord.Y < FontSize.Y; coord.Y++) { 00134 for (coord.X=0; 00135 coord.X < CALC_BITMAP_BITS_FOR_X(FontSize.X, BITMAP_BITS_BYTE_ALIGN); 00136 coord.X++) { 00137 *pDestBits++ = *pSrcBits++; 00138 } 00139 if (CALC_BITMAP_BITS_FOR_X(FontSize.X, BITMAP_BITS_BYTE_ALIGN) & 1) 00140 pSrcBits++; 00141 } 00142 } 00143 break; 00144 } 00145 break; 00146 } 00147 00148 } 00149 except (EXCEPTION_EXECUTE_HANDLER) 00150 { 00151 } 00152 }

DWORD CalcBitmapBufferSize IN COORD  FontSize,
IN DWORD  dwAlign
 

Definition at line 41 of file fullscr/vga/foncache.c.

00045 { 00046 DWORD uiCount; 00047 00048 uiCount = CALC_BITMAP_BITS_FOR_X(FontSize.X, 00049 (dwAlign==BYTE_ALIGN ? BITMAP_BITS_BYTE_ALIGN : BITMAP_BITS_WORD_ALIGN)); 00050 uiCount = uiCount * BITMAP_PLANES * FontSize.Y; 00051 return uiCount; 00052 }

PUCHAR CalcGRAMAddress IN COORD  WindowSize,
IN PDEVICE_EXTENSION  DeviceExtension
 

Definition at line 116 of file drawscrn.c.

References CalcGRAMOffs, and DWORD.

Referenced by FsgCopyFrameBuffer(), FsgInvertCursor(), FsgReverseMousePointer(), and FsgWriteToFrameBuffer().

00123 : 00124 00125 This routine calcurate a graphics buffer address. 00126 00127 Arguments: 00128 00129 WindowSize - Coord of window size. 00130 00131 DeviceExtension - Pointer to the miniport driver's device extension. 00132 00133 Return Value: 00134 00135 Returen to graphics buffer address. 00136 00137 --*/ 00138 { 00139 PUCHAR BufPtr = (PUCHAR)DeviceExtension->CurrentMode.VideoMemory.FrameBufferBase; 00140 00141 BufPtr += CalcGRAMOffs(WindowSize, DeviceExtension); 00142 if ((DWORD)(BufPtr - 00143 (PUCHAR)DeviceExtension->CurrentMode.VideoMemory.FrameBufferBase) 00144 >= DeviceExtension->EmulateInfo.LimitGRAM) 00145 return (BufPtr - DeviceExtension->EmulateInfo.LimitGRAM); 00146 else 00147 return BufPtr; 00148 }

ULONG CalcGRAMSize IN COORD  WindowSize,
IN PDEVICE_EXTENSION  DeviceExtension
 

Definition at line 85 of file drawscrn.c.

References CalcGRAMScanLine.

00092 : 00093 00094 This Macro calcurate a graphics buffer size. 00095 00096 Arguments: 00097 00098 WindowSize - Coord of window size. 00099 00100 DeviceExtension - Pointer to the miniport driver's device extension. 00101 00102 Return Value: 00103 00104 Returen to graphics buffer offset. 00105 00106 --*/ 00107 00108 { 00109 return WindowSize.X + 00110 CalcGRAMScanLine(WindowSize.Y, DeviceExtension->ScreenAndFont.FontSize.Y) * 00111 DeviceExtension->EmulateInfo.BytePerLine; 00112 }

VOID ColorSetDirect PDEVICE_EXTENSION  deviceExtension,
PUCHAR  FrameBuffer,
BYTE  ColorFg,
BYTE  ColorBg
 

Definition at line 257 of file port.c.

References AccessGRAM_WR(), _DEVICE_EXTENSION::DeviceRegisters, DR_SET, DR_XOR, GRAPH_ADDR_MASK, GRAPHAddressPort, IND_DATA_ROTATE, IND_SET_RESET, and IND_SET_RESET_ENABLE.

Referenced by FsgWriteToScreenCommonLVB(), and set_opaque_bkgnd_proc().

00275 { 00276 // 00277 // Set up to write data without interacting with the latches. 00278 // 00279 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00280 MAKEWORD(IND_DATA_ROTATE, DR_SET)); 00281 00282 // 00283 // Put the background color in the Set/Reset register. 00284 // 00285 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00286 MAKEWORD(IND_SET_RESET, ColorBg)); 00287 00288 // 00289 // That color is used for all planes. 00290 // 00291 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00292 MAKEWORD(IND_SET_RESET_ENABLE, GRAPH_ADDR_MASK)); 00293 00294 // 00295 // This gets our background color into the latches. 00296 // 00297 AccessGRAM_WR(FrameBuffer, GRAPH_ADDR_MASK); 00298 00299 // 00300 // Change the Set/Reset register to be all zeroes. 00301 // 00302 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00303 MAKEWORD(IND_SET_RESET, 0)); 00304 00305 // 00306 // The Set/Reset enable register now flags where the foreground/background colors are the same. 00307 // 00308 ColorFg = ~(ColorFg ^ ColorBg); 00309 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00310 MAKEWORD(IND_SET_RESET_ENABLE, ColorFg)); 00311 00312 // 00313 // Color differences will be xor'd with the latches. 00314 // 00315 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00316 MAKEWORD(IND_DATA_ROTATE, DR_XOR)); 00317 00318 00319 }

VOID ColorSetGridMask PDEVICE_EXTENSION  deviceExtension,
BYTE  BitMask
 

Definition at line 225 of file port.c.

References _DEVICE_EXTENSION::DeviceRegisters, DR_SET, GRAPH_ADDR_MASK, GRAPHAddressPort, IND_BIT_MASK, IND_DATA_ROTATE, IND_SET_RESET, and IND_SET_RESET_ENABLE.

Referenced by FsgWriteToScreenCommonLVB().

00229 { 00230 00231 // 00232 // That color is used for all planes. 00233 // 00234 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00235 MAKEWORD(IND_SET_RESET_ENABLE, GRAPH_ADDR_MASK)); 00236 00237 // 00238 // Change the Set/Reset register to be all set. 00239 // 00240 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00241 MAKEWORD(IND_SET_RESET, 0x07)); 00242 00243 // 00244 // Use specified pixel positions. 00245 // 00246 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00247 MAKEWORD(IND_BIT_MASK, BitMask)); 00248 00249 // 00250 // Set up to write data without interacting with the latches. 00251 // 00252 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00253 MAKEWORD(IND_DATA_ROTATE, DR_SET)); 00254 }

int ConvertOutputToOem IN LPWSTR  Source,
IN int  SourceLength,
OUT LPSTR  Target,
IN int  TargetLength
 

Definition at line 31 of file w32/ntcon/fullscr/vga/misc.c.

00045 { 00046 NTSTATUS Status; 00047 int Length; 00048 UNICODE_STRING SourceUni; 00049 ANSI_STRING TargetAns; 00050 CHAR AnsBuf[256]; 00051 00052 SourceUni.MaximumLength = 00053 SourceUni.Length = SourceLength * sizeof(WCHAR); 00054 SourceUni.Buffer = Source; 00055 00056 TargetAns.Length = 0; 00057 TargetAns.MaximumLength = sizeof(AnsBuf); 00058 TargetAns.Buffer = AnsBuf; 00059 00060 // Can do this in place 00061 Status = RtlUnicodeStringToAnsiString(&TargetAns, 00062 &SourceUni, 00063 FALSE); 00064 if (NT_SUCCESS(Status)) { 00065 Length = strlen(AnsBuf); 00066 if (Length <= TargetLength) { 00067 RtlMoveMemory(Target, AnsBuf, Length); 00068 return Length; 00069 } 00070 else { 00071 return 0; 00072 } 00073 } else { 00074 return 0; 00075 } 00076 }

NTSTATUS DriverEntry IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath
 

Definition at line 67 of file fs_rec.c.

00074 : 00075 00076 This routine is invoked once when the driver is loaded to allow the driver 00077 to initialize itself. The initialization for the driver consists of simply 00078 creating a device object for each type of file system recognized by this 00079 driver, and then registering each as active file systems. 00080 00081 Arguments: 00082 00083 DriverObject - Pointer to the driver object for this driver. 00084 00085 RegistryPath - Pointer to the registry service node for this driver. 00086 00087 Return Value: 00088 00089 The function value is the final status of the initialization for the driver. 00090 00091 --*/ 00092 00093 { 00094 PDEVICE_OBJECT UdfsMainRecognizerDeviceObject; 00095 NTSTATUS status; 00096 ULONG count = 0; 00097 00098 PAGED_CODE(); 00099 00100 // 00101 // Mark the entire driver as pagable. 00102 // 00103 00104 MmPageEntireDriver ((PVOID)DriverEntry); 00105 00106 // 00107 // Begin by initializing the driver object so that it the driver is 00108 // prepared to provide services. 00109 // 00110 00111 DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = FsRecFsControl; 00112 DriverObject->MajorFunction[IRP_MJ_CREATE] = FsRecCreate; 00113 DriverObject->MajorFunction[IRP_MJ_CLEANUP] = FsRecCleanupClose; 00114 DriverObject->MajorFunction[IRP_MJ_CLOSE] = FsRecCleanupClose; 00115 DriverObject->DriverUnload = FsRecUnload; 00116 00117 FsRecLoadSync = ExAllocatePoolWithTag( NonPagedPool, sizeof(KEVENT), FSREC_POOL_TAG ); 00118 00119 if (FsRecLoadSync == NULL) { 00120 00121 return STATUS_INSUFFICIENT_RESOURCES; 00122 } 00123 00124 KeInitializeEvent( FsRecLoadSync, SynchronizationEvent, TRUE ); 00125 00126 // 00127 // Create and initialize each of the file system driver type device 00128 // objects. 00129 // 00130 00131 status = FsRecCreateAndRegisterDO( DriverObject, 00132 NULL, 00133 NULL, 00134 L"\\Cdfs", 00135 L"\\FileSystem\\CdfsRecognizer", 00136 CdfsFileSystem, 00137 FILE_DEVICE_CD_ROM_FILE_SYSTEM ); 00138 if (NT_SUCCESS( status )) { 00139 count++; 00140 } 00141 00142 status = FsRecCreateAndRegisterDO( DriverObject, 00143 NULL, 00144 &UdfsMainRecognizerDeviceObject, 00145 L"\\UdfsCdRom", 00146 L"\\FileSystem\\UdfsCdRomRecognizer", 00147 UdfsFileSystem, 00148 FILE_DEVICE_CD_ROM_FILE_SYSTEM ); 00149 if (NT_SUCCESS( status )) { 00150 count++; 00151 } 00152 00153 status = FsRecCreateAndRegisterDO( DriverObject, 00154 UdfsMainRecognizerDeviceObject, 00155 NULL, 00156 L"\\UdfsDisk", 00157 L"\\FileSystem\\UdfsDiskRecognizer", 00158 UdfsFileSystem, 00159 FILE_DEVICE_DISK_FILE_SYSTEM ); 00160 if (NT_SUCCESS( status )) { 00161 count++; 00162 } 00163 00164 status = FsRecCreateAndRegisterDO( DriverObject, 00165 NULL, 00166 NULL, 00167 L"\\Fat", 00168 L"\\FileSystem\\FatRecognizer", 00169 FatFileSystem, 00170 FILE_DEVICE_DISK_FILE_SYSTEM ); 00171 if (NT_SUCCESS( status )) { 00172 count++; 00173 } 00174 00175 status = FsRecCreateAndRegisterDO( DriverObject, 00176 NULL, 00177 NULL, 00178 L"\\Ntfs", 00179 L"\\FileSystem\\NtfsRecognizer", 00180 NtfsFileSystem, 00181 FILE_DEVICE_DISK_FILE_SYSTEM ); 00182 if (NT_SUCCESS( status )) { 00183 count++; 00184 } 00185 00186 if (count) { 00187 return STATUS_SUCCESS; 00188 } else { 00189 return STATUS_IMAGE_ALREADY_LOADED; 00190 } 00191 }

NTSTATUS FsgCopyFrameBuffer PDEVICE_EXTENSION  DeviceExtension,
PFSVIDEO_COPY_FRAME_BUFFER  CopyFrameBuffer,
ULONG  inputBufferLength
 

Definition at line 437 of file drawscrn.c.

References CalcGRAMAddress(), _DEVICE_EXTENSION::CurrentMode, FALSE, FsgInvertCursor(), MoveGRAM(), _DEVICE_EXTENSION::ScreenAndFont, and TRUE.

Referenced by FsVgaCopyFrameBuffer().

00445 : 00446 00447 This routine copy the frame buffer. 00448 00449 Arguments: 00450 00451 DeviceExtension - Pointer to the miniport driver's device extension. 00452 00453 CopyFrameBuffer - Pointer to the structure containing the information about the copy frame buffer. 00454 00455 inputBufferLength - Length of the input buffer supplied by the user. 00456 00457 Return Value: 00458 00459 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 00460 for the input data. 00461 00462 STATUS_SUCCESS if the operation completed successfully. 00463 00464 --*/ 00465 00466 { 00467 PUCHAR SourcePtr, TargetPtr; 00468 00469 FsgInvertCursor(DeviceExtension,FALSE); 00470 00471 SourcePtr = CalcGRAMAddress (CopyFrameBuffer->SrcScreen.Position, 00472 DeviceExtension); 00473 TargetPtr = CalcGRAMAddress (CopyFrameBuffer->DestScreen.Position, 00474 DeviceExtension); 00475 MoveGRAM (TargetPtr, 00476 SourcePtr, 00477 CopyFrameBuffer->SrcScreen.nNumberOfChars * 00478 DeviceExtension->ScreenAndFont.FontSize.Y, 00479 DeviceExtension->CurrentMode.VideoMemory.FrameBufferBase, 00480 DeviceExtension 00481 ); 00482 00483 FsgInvertCursor(DeviceExtension,TRUE); 00484 00485 return STATUS_SUCCESS; 00486 }

NTSTATUS FsgInvertCursor PDEVICE_EXTENSION  DeviceExtension,
BOOL  Invert
 

Definition at line 702 of file drawscrn.c.

References AccessGRAM_AND(), BOOL, BYTE, CalcGRAMAddress(), _EMULATE_BUFFER_INFORMATION::CursorAttributes, _EMULATE_BUFFER_INFORMATION::CursorPosition, _DEVICE_EXTENSION::EmulateInfo, FALSE, NextGRAMRow(), _DEVICE_EXTENSION::ScreenAndFont, SetGRAMInvertMode(), SetGRAMWriteMode(), SHORT, _EMULATE_BUFFER_INFORMATION::ShowCursor, and TRUE.

Referenced by FsgCopyFrameBuffer(), FsgReverseMousePointer(), FsgWriteToFrameBuffer(), FsVgaSetCursorAttribute(), and FsVgaSetCursorPosition().

00709 : 00710 00711 This routine inverts the cursor. 00712 00713 Arguments: 00714 00715 DeviceExtension - Pointer to the miniport driver's device extension. 00716 00717 Invert - 00718 00719 Return Value: 00720 00721 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 00722 for the input data. 00723 00724 STATUS_SUCCESS if the operation completed successfully. 00725 00726 --*/ 00727 00728 { 00729 PUCHAR CurFrameBufPtr; 00730 COORD CursorPosition; 00731 COORD FontSize; 00732 SHORT i; 00733 SHORT TopScanLine; 00734 BOOL fOneMore = FALSE; 00735 00736 if (DeviceExtension->EmulateInfo.ShowCursor == Invert) 00737 return STATUS_SUCCESS; 00738 00739 DeviceExtension->EmulateInfo.ShowCursor = Invert; 00740 00741 if (!(DeviceExtension->EmulateInfo.CursorAttributes.Enable)) 00742 return STATUS_SUCCESS; 00743 00744 FontSize = DeviceExtension->ScreenAndFont.FontSize; 00745 if (DeviceExtension->ScreenAndFont.ScreenSize.Y > 25) 00746 { 00747 TopScanLine = ((DeviceExtension->EmulateInfo.CursorAttributes.Height + 8) * 100 / 8) - 100; 00748 } 00749 else 00750 { 00751 TopScanLine = ((DeviceExtension->EmulateInfo.CursorAttributes.Height + 16) * 100 / 16) - 100; 00752 } 00753 TopScanLine = (FontSize.Y * TopScanLine) / 100; 00754 00755 CursorPosition.X = DeviceExtension->EmulateInfo.CursorPosition.Coord.Column; 00756 CursorPosition.Y = DeviceExtension->EmulateInfo.CursorPosition.Coord.Row; 00757 if ( (0 <= CursorPosition.X && 00758 CursorPosition.X < DeviceExtension->ScreenAndFont.ScreenSize.X) && 00759 (0 <= CursorPosition.Y && 00760 CursorPosition.Y < DeviceExtension->ScreenAndFont.ScreenSize.Y) ) 00761 { 00762 switch (DeviceExtension->EmulateInfo.CursorPosition.dwType) 00763 { 00764 case CHAR_TYPE_LEADING: 00765 if (CursorPosition.X != DeviceExtension->ScreenAndFont.ScreenSize.X-1) 00766 { 00767 fOneMore = TRUE; 00768 } 00769 break; 00770 case CHAR_TYPE_TRAILING: 00771 if (CursorPosition.X != 0) 00772 { 00773 fOneMore = TRUE; 00774 CursorPosition.X--; 00775 } 00776 break; 00777 } 00778 00779 CurFrameBufPtr = CalcGRAMAddress (CursorPosition, 00780 DeviceExtension); 00781 00782 /* 00783 * CursorAttributes.Height is top scan lines. 00784 */ 00785 for (i = 0; i < TopScanLine; i++) 00786 { 00787 CurFrameBufPtr = NextGRAMRow(CurFrameBufPtr,DeviceExtension); 00788 } 00789 00790 // 00791 // Set invert mode of graphics register 00792 // 00793 SetGRAMInvertMode(DeviceExtension); 00794 00795 /* 00796 * CursorAttributes.Width is bottom scan lines. 00797 */ 00798 for ( ; i < FontSize.Y; i++) 00799 { 00800 AccessGRAM_AND(CurFrameBufPtr, (BYTE)-1); 00801 if (fOneMore) 00802 AccessGRAM_AND(CurFrameBufPtr+1, (BYTE)-1); 00803 CurFrameBufPtr = NextGRAMRow(CurFrameBufPtr,DeviceExtension); 00804 } 00805 00806 SetGRAMWriteMode(DeviceExtension); 00807 } 00808 00809 return STATUS_SUCCESS; 00810 }

NTSTATUS FsgReverseMousePointer PDEVICE_EXTENSION  DeviceExtension,
PFSVIDEO_REVERSE_MOUSE_POINTER  MouseBuffer,
ULONG  inputBufferLength
 

Definition at line 609 of file drawscrn.c.

References AccessGRAM_AND(), BOOL, BYTE, CalcGRAMAddress(), FALSE, FsgInvertCursor(), NextGRAMRow(), _DEVICE_EXTENSION::ScreenAndFont, SetGRAMInvertMode(), SetGRAMWriteMode(), SHORT, and TRUE.

Referenced by FsVgaReverseMousePointer().

00617 : 00618 00619 This routine reverse the frame buffer for mouse pointer. 00620 00621 Arguments: 00622 00623 DeviceExtension - Pointer to the miniport driver's device extension. 00624 00625 MouseBuffer - Pointer to the structure containing the information about the mouse frame buffer. 00626 00627 inputBufferLength - Length of the input buffer supplied by the user. 00628 00629 Return Value: 00630 00631 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 00632 for the input data. 00633 00634 STATUS_SUCCESS if the operation completed successfully. 00635 00636 --*/ 00637 00638 { 00639 00640 PUCHAR CurFrameBufPtr; 00641 COORD CursorPosition; 00642 COORD FontSize; 00643 SHORT i; 00644 BOOL fOneMore = FALSE; 00645 00646 FsgInvertCursor(DeviceExtension,FALSE); 00647 00648 FontSize = DeviceExtension->ScreenAndFont.FontSize; 00649 00650 CursorPosition.X = MouseBuffer->Screen.Position.X; 00651 CursorPosition.Y = MouseBuffer->Screen.Position.Y; 00652 if ( (0 <= CursorPosition.X && 00653 CursorPosition.X < MouseBuffer->Screen.ScreenSize.X) && 00654 (0 <= CursorPosition.Y && 00655 CursorPosition.Y < MouseBuffer->Screen.ScreenSize.Y) ) 00656 { 00657 switch (MouseBuffer->dwType) 00658 { 00659 case CHAR_TYPE_LEADING: 00660 if (CursorPosition.X != MouseBuffer->Screen.ScreenSize.X-1) 00661 { 00662 fOneMore = TRUE; 00663 } 00664 break; 00665 case CHAR_TYPE_TRAILING: 00666 if (CursorPosition.X != 0) 00667 { 00668 fOneMore = TRUE; 00669 CursorPosition.X--; 00670 } 00671 break; 00672 } 00673 00674 CurFrameBufPtr = CalcGRAMAddress (CursorPosition, 00675 DeviceExtension); 00676 00677 // 00678 // Set invert mode of graphics register 00679 // 00680 SetGRAMInvertMode(DeviceExtension); 00681 00682 /* 00683 * CursorAttributes.Width is bottom scan lines. 00684 */ 00685 for (i=0 ; i < FontSize.Y; i++) 00686 { 00687 AccessGRAM_AND(CurFrameBufPtr, (BYTE)-1); 00688 if (fOneMore) 00689 AccessGRAM_AND(CurFrameBufPtr+1, (BYTE)-1); 00690 CurFrameBufPtr = NextGRAMRow(CurFrameBufPtr,DeviceExtension); 00691 } 00692 00693 SetGRAMWriteMode(DeviceExtension); 00694 } 00695 00696 FsgInvertCursor(DeviceExtension,TRUE); 00697 00698 return STATUS_SUCCESS; 00699 }

NTSTATUS FsgVgaInitializeHWFlags PDEVICE_EXTENSION  DeviceExtension  ) 
 

Definition at line 387 of file drawscrn.c.

References BYTE, _EMULATE_BUFFER_INFORMATION::BytePerLine, CalcGRAMScanLine, _EMULATE_BUFFER_INFORMATION::ColorBg, _EMULATE_BUFFER_INFORMATION::ColorFg, _DEVICE_EXTENSION::Configuration, _EMULATE_BUFFER_INFORMATION::CursorAttributes, _EMULATE_BUFFER_INFORMATION::DeltaNextFontRow, _DEVICE_EXTENSION::EmulateInfo, FALSE, GetBytePerLine, GetHardwareScrollReg(), _FSVGA_CONFIGURATION_INFORMATION::HardwareScroll, Index, LIMIT_64K, _EMULATE_BUFFER_INFORMATION::LimitGRAM, _EMULATE_BUFFER_INFORMATION::MaxScanLine, _DEVICE_EXTENSION::ScreenAndFont, SetGRAMWriteMode(), _EMULATE_BUFFER_INFORMATION::ShowCursor, and USE_LINE_COMPARE.

Referenced by FsVgaSetScreenInformation().

00393 : 00394 00395 This routine initialize the hardware scrolls flag and any values. 00396 00397 Arguments: 00398 00399 EmulateInfo - Pointer to screen emulate information structure. 00400 00401 Return Value: 00402 00403 --*/ 00404 00405 { 00406 ULONG Index; 00407 00408 GetHardwareScrollReg(DeviceExtension); 00409 DeviceExtension->EmulateInfo.BytePerLine = 00410 (WORD)GetBytePerLine(DeviceExtension); 00411 DeviceExtension->EmulateInfo.MaxScanLine = 00412 (WORD)CalcGRAMScanLine(DeviceExtension->ScreenAndFont.ScreenSize.Y, 00413 DeviceExtension->ScreenAndFont.FontSize.Y); 00414 DeviceExtension->EmulateInfo.DeltaNextFontRow = 00415 DeviceExtension->EmulateInfo.BytePerLine * DeviceExtension->ScreenAndFont.FontSize.Y; 00416 00417 if (DeviceExtension->Configuration.HardwareScroll & USE_LINE_COMPARE) { 00418 DeviceExtension->EmulateInfo.LimitGRAM = 00419 DeviceExtension->EmulateInfo.MaxScanLine * DeviceExtension->EmulateInfo.BytePerLine; 00420 } 00421 else { 00422 DeviceExtension->EmulateInfo.LimitGRAM = LIMIT_64K; 00423 } 00424 00425 DeviceExtension->EmulateInfo.ColorFg = (BYTE)-1; 00426 DeviceExtension->EmulateInfo.ColorBg = (BYTE)-1; 00427 00428 DeviceExtension->EmulateInfo.CursorAttributes.Enable = 0; 00429 DeviceExtension->EmulateInfo.ShowCursor = FALSE; 00430 00431 SetGRAMWriteMode(DeviceExtension); 00432 00433 return STATUS_SUCCESS; 00434 }

NTSTATUS FsgWriteToFrameBuffer PDEVICE_EXTENSION  DeviceExtension,
PFSVIDEO_WRITE_TO_FRAME_BUFFER  WriteFrameBuffer,
ULONG  inputBufferLength
 

Definition at line 489 of file drawscrn.c.

References AlignCopyMemory(), BOOL, BYTE, BYTE_ALIGN, CalcBitmapBufferSize(), CalcGRAMAddress(), _EMULATE_BUFFER_INFORMATION::ColorBg, _EMULATE_BUFFER_INFORMATION::ColorFg, DWORD, _DEVICE_EXTENSION::EmulateInfo, ExAllocatePool, EXCEPTION_EXECUTE_HANDLER, ExFreePool(), FALSE, FsgInvertCursor(), FsgWriteToScreen(), NTSTATUS(), NULL, PagedPool, _DEVICE_EXTENSION::ScreenAndFont, Status, TRUE, and WORD_ALIGN.

Referenced by FsVgaWriteToFrameBuffer().

00497 : 00498 00499 This routine write the frame buffer. 00500 00501 Arguments: 00502 00503 DeviceExtension - Pointer to the miniport driver's device extension. 00504 00505 WriteFrameBuffer - Pointer to the structure containing the information about the write frame buffer. 00506 00507 inputBufferLength - Length of the input buffer supplied by the user. 00508 00509 Return Value: 00510 00511 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 00512 for the input data. 00513 00514 STATUS_SUCCESS if the operation completed successfully. 00515 00516 --*/ 00517 00518 { 00519 PCHAR_IMAGE_INFO pCharInfoUni = WriteFrameBuffer->SrcBuffer; 00520 PUCHAR TargetPtr; 00521 COORD Position = WriteFrameBuffer->DestScreen.Position; 00522 DWORD Length = WriteFrameBuffer->DestScreen.nNumberOfChars; 00523 COORD FontSize1 = DeviceExtension->ScreenAndFont.FontSize; 00524 COORD FontSize2; 00525 PVOID pCapBuffer = NULL; 00526 ULONG cCapBuffer = 0; 00527 BOOL fDbcs; 00528 NTSTATUS Status; 00529 00530 FsgInvertCursor(DeviceExtension,FALSE); 00531 00532 DeviceExtension->EmulateInfo.ColorFg = (BYTE)-1; 00533 DeviceExtension->EmulateInfo.ColorBg = (BYTE)-1; 00534 00535 FontSize2 = FontSize1; 00536 FontSize2.X *= 2; 00537 cCapBuffer = CalcBitmapBufferSize(FontSize2,BYTE_ALIGN); 00538 pCapBuffer = ExAllocatePool(PagedPool, cCapBuffer); 00539 00540 while (Length--) 00541 { 00542 if (pCharInfoUni->FontImageInfo.ImageBits != NULL) 00543 { 00544 try 00545 { 00546 fDbcs = pCharInfoUni->CharInfo.Attributes & COMMON_LVB_SBCSDBCS; 00547 AlignCopyMemory((PVOID)pCapBuffer, // pDestBits 00548 BYTE_ALIGN, // dwDestAlign 00549 pCharInfoUni->FontImageInfo.ImageBits,// pSrcBits 00550 WORD_ALIGN, // dwSrcAlign 00551 fDbcs ? FontSize2 : FontSize1); 00552 00553 TargetPtr = CalcGRAMAddress (Position, 00554 DeviceExtension); 00555 if (fDbcs) 00556 { 00557 if (Length) 00558 { 00559 FsgWriteToScreen(TargetPtr, pCapBuffer, 2, fDbcs, 00560 pCharInfoUni->CharInfo.Attributes, 00561 (pCharInfoUni+1)->CharInfo.Attributes, 00562 DeviceExtension); 00563 } 00564 else 00565 { 00566 FsgWriteToScreen(TargetPtr, pCapBuffer, 2, FALSE, 00567 pCharInfoUni->CharInfo.Attributes, 00568 (WORD)-1, 00569 DeviceExtension); 00570 } 00571 } 00572 else 00573 { 00574 FsgWriteToScreen(TargetPtr, pCapBuffer, 1, fDbcs, 00575 pCharInfoUni->CharInfo.Attributes, 00576 (WORD)-1, 00577 DeviceExtension); 00578 } 00579 00580 } 00581 except (EXCEPTION_EXECUTE_HANDLER) 00582 { 00583 } 00584 00585 } 00586 00587 if (fDbcs && Length) 00588 { 00589 Length--; 00590 Position.X += 2; 00591 pCharInfoUni += 2; 00592 } 00593 else 00594 { 00595 Position.X++; 00596 pCharInfoUni++; 00597 } 00598 } 00599 00600 FsgInvertCursor(DeviceExtension,TRUE); 00601 00602 if (pCapBuffer != NULL) 00603 ExFreePool(pCapBuffer); 00604 00605 return STATUS_SUCCESS; 00606 }

NTSTATUS FsgWriteToScreen PUCHAR  FrameBuffer,
PUCHAR  BitmapBuffer,
DWORD  cjBytes,
BOOL  fDbcs,
WORD  Attributes1,
WORD  Attributes2,
PDEVICE_EXTENSION  DeviceExtension
 

Definition at line 813 of file drawscrn.c.

References COMMON_LVB_MASK, _DEVICE_EXTENSION::Configuration, _FSVGA_CONFIGURATION_INFORMATION::EmulationMode, ENABLE_WORD_WRITE_VRAM, EXCEPTION_EXECUTE_HANDLER, FsgWriteToScreenCommonLVB(), Index, IsGRAMRowOver(), NextGRAMRow(), _DEVICE_EXTENSION::ScreenAndFont, and set_opaque_bkgnd_proc().

Referenced by FsgWriteToFrameBuffer().

00822 { 00823 WORD Index; 00824 PCHAR CurFrameBufPtrTmp; 00825 PCHAR CurFrameBufPtr2nd; 00826 PWORD CurFrameBufPtrWord; 00827 PUCHAR BitmapBufferTmp; 00828 00829 #ifdef LATER_HIGH_SPPED_VRAM_ACCESS // kazum 00830 if (! IsGRAMRowOver(FrameBuffer,fDBCS,DeviceExtension)) { 00831 if (!fDbcs) { 00832 if (cjBytes == 2) 00833 BitmapBuffer++; 00834 (*WriteGramInfo->pfnWriteFontToByteGRAM)(WriteGramInfo); 00835 } 00836 else if (cjBytes == 2 && fDBCS) { 00837 if (DeviceExtension->Configuration.EmulationMode & ENABLE_WORD_WRITE_VRAM) { 00838 (*WriteGramInfo->pfnWriteFontToFirstWordGRAM)(WriteGramInfo); 00839 } 00840 else { 00841 (*WriteGramInfo->pfnWriteFontToWordGRAM)(WriteGramInfo); 00842 } 00843 } 00844 } 00845 else 00846 #endif // LATER_HIGH_SPPED_VRAM_ACCESS // kazum 00847 try 00848 { 00849 set_opaque_bkgnd_proc(DeviceExtension,FrameBuffer,Attributes1); 00850 00851 if (!fDbcs) { 00852 CurFrameBufPtrTmp = FrameBuffer; 00853 if (cjBytes == 2) 00854 BitmapBuffer++; 00855 for (Index=0; Index < DeviceExtension->ScreenAndFont.FontSize.Y; Index++) { 00856 *CurFrameBufPtrTmp = *BitmapBuffer; 00857 BitmapBuffer += cjBytes; 00858 CurFrameBufPtrTmp=NextGRAMRow(CurFrameBufPtrTmp,DeviceExtension); 00859 } 00860 } 00861 else if (cjBytes == 2 && fDbcs) { 00862 if ((DeviceExtension->Configuration.EmulationMode & ENABLE_WORD_WRITE_VRAM) && 00863 !((ULONG)FrameBuffer & 1) && 00864 (Attributes2 != -1) && 00865 (Attributes1 == Attributes2) 00866 ) { 00867 CurFrameBufPtrWord = (PWORD)FrameBuffer; 00868 for (Index=0; Index < DeviceExtension->ScreenAndFont.FontSize.Y; Index++) { 00869 *CurFrameBufPtrWord = *((PWORD)BitmapBuffer); 00870 BitmapBuffer += cjBytes; 00871 CurFrameBufPtrWord=(PWORD)NextGRAMRow((PCHAR)CurFrameBufPtrWord,DeviceExtension); 00872 } 00873 } 00874 else { 00875 CurFrameBufPtrTmp = FrameBuffer; 00876 CurFrameBufPtr2nd = FrameBuffer + 1; 00877 BitmapBufferTmp = BitmapBuffer + 1; 00878 for (Index=0; Index < DeviceExtension->ScreenAndFont.FontSize.Y; Index++) { 00879 *CurFrameBufPtrTmp = *BitmapBuffer; 00880 BitmapBuffer += cjBytes; 00881 CurFrameBufPtrTmp=NextGRAMRow(CurFrameBufPtrTmp,DeviceExtension); 00882 } 00883 if (Attributes2 != -1 && 00884 Attributes1 != Attributes2) 00885 set_opaque_bkgnd_proc(DeviceExtension,FrameBuffer,Attributes2); 00886 for (Index=0; Index < DeviceExtension->ScreenAndFont.FontSize.Y; Index++) { 00887 *CurFrameBufPtr2nd = *BitmapBufferTmp; 00888 BitmapBufferTmp += cjBytes; 00889 CurFrameBufPtr2nd=NextGRAMRow(CurFrameBufPtr2nd,DeviceExtension); 00890 } 00891 } 00892 } 00893 } 00894 except (EXCEPTION_EXECUTE_HANDLER) 00895 { 00896 } 00897 00898 if (Attributes1 & COMMON_LVB_MASK) 00899 { 00900 FsgWriteToScreenCommonLVB(FrameBuffer, 00901 Attributes1, 00902 DeviceExtension); 00903 } 00904 if ((Attributes2 != (WORD)-1) && (Attributes2 & COMMON_LVB_MASK)) 00905 { 00906 FsgWriteToScreenCommonLVB(FrameBuffer+1, 00907 Attributes2, 00908 DeviceExtension); 00909 } 00910 00911 return STATUS_SUCCESS; 00912 }

NTSTATUS FsgWriteToScreenCommonLVB PUCHAR  FrameBuffer,
WORD  Attributes,
PDEVICE_EXTENSION  DeviceExtension
 

Definition at line 915 of file drawscrn.c.

References AccessGRAM_RW(), BYTE, _EMULATE_BUFFER_INFORMATION::ColorBg, _EMULATE_BUFFER_INFORMATION::ColorFg, ColorSetDirect(), ColorSetGridMask(), _DEVICE_EXTENSION::EmulateInfo, EXCEPTION_EXECUTE_HANDLER, Index, NextGRAMRow(), _DEVICE_EXTENSION::ScreenAndFont, set_opaque_bkgnd_proc(), and SetGRAMWriteMode().

Referenced by FsgWriteToScreen().

00920 { 00921 WORD Index; 00922 PUCHAR CurFrameBufPtrTmp; 00923 00924 try 00925 { 00926 if (Attributes & COMMON_LVB_UNDERSCORE) 00927 { 00928 set_opaque_bkgnd_proc(DeviceExtension,FrameBuffer,Attributes); 00929 CurFrameBufPtrTmp = FrameBuffer; 00930 for (Index=0; Index < DeviceExtension->ScreenAndFont.FontSize.Y - 1; Index++) 00931 CurFrameBufPtrTmp=NextGRAMRow(CurFrameBufPtrTmp,DeviceExtension); 00932 *CurFrameBufPtrTmp = 0xff; 00933 } 00934 00935 if (Attributes & COMMON_LVB_GRID_HORIZONTAL) 00936 { 00937 ColorSetDirect(DeviceExtension, FrameBuffer, 00938 FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED, 00939 0); 00940 *FrameBuffer = 0xff; 00941 } 00942 00943 if ( (Attributes & COMMON_LVB_GRID_LVERTICAL) || 00944 (Attributes & COMMON_LVB_GRID_RVERTICAL) ) 00945 { 00946 BYTE mask = ((Attributes & COMMON_LVB_GRID_LVERTICAL) ? 0x80 : 0) + 00947 ((Attributes & COMMON_LVB_GRID_RVERTICAL) ? 0x01 : 0); 00948 ColorSetGridMask(DeviceExtension, 00949 mask 00950 ); 00951 CurFrameBufPtrTmp = FrameBuffer; 00952 for (Index=0; Index < DeviceExtension->ScreenAndFont.FontSize.Y; Index++) { 00953 AccessGRAM_RW(CurFrameBufPtrTmp, mask); 00954 CurFrameBufPtrTmp=NextGRAMRow(CurFrameBufPtrTmp,DeviceExtension); 00955 } 00956 00957 SetGRAMWriteMode(DeviceExtension); 00958 } 00959 00960 DeviceExtension->EmulateInfo.ColorFg = (BYTE)-1; 00961 DeviceExtension->EmulateInfo.ColorBg = (BYTE)-1; 00962 00963 } 00964 except (EXCEPTION_EXECUTE_HANDLER) 00965 { 00966 } 00967 00968 return STATUS_SUCCESS; 00969 }

VOID FsVgaBuildResourceList IN PDEVICE_EXTENSION  DeviceExtension,
OUT PCM_RESOURCE_LIST *  ResourceList,
OUT PULONG  ResourceListSize
 

Definition at line 1056 of file fsvga.c.

References DUMP_COUNT, ExAllocatePool, FSVGA_ERROR_VALUE_BASE, FsVgaLogError(), FsVgaPrint, and PagedPool.

Referenced by DriverEntry().

01064 : 01065 01066 Creates a resource list that is used to query or report resource usage. 01067 01068 Arguments: 01069 01070 DeviceExtension - Pointer to the port's device extension. 01071 01072 ResourceList - Pointer to a pointer to the resource list to be allocated 01073 and filled. 01074 01075 ResourceListSize - Pointer to the returned size of the resource 01076 list (in bytes). 01077 01078 Return Value: 01079 01080 None. If the call succeeded, *ResourceList points to the built 01081 resource list and *ResourceListSize is set to the size (in bytes) 01082 of the resource list; otherwise, *ResourceList is NULL. 01083 01084 Note: 01085 01086 Memory may be allocated here for *ResourceList. It must be 01087 freed up by the caller, by calling ExFreePool(); 01088 01089 --*/ 01090 01091 { 01092 ULONG count = 0; 01093 ULONG i = 0; 01094 ULONG j = 0; 01095 #define DUMP_COUNT 4 01096 ULONG dumpData[DUMP_COUNT]; 01097 01098 count += DeviceExtension->Configuration.PortListCount; 01099 01100 *ResourceListSize = sizeof(CM_RESOURCE_LIST) + 01101 ((count - 1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); 01102 01103 *ResourceList = (PCM_RESOURCE_LIST) ExAllocatePool(PagedPool, 01104 *ResourceListSize); 01105 01106 // 01107 // Return NULL if the structure could not be allocated. 01108 // Otherwise, fill in the resource list. 01109 // 01110 01111 if (!*ResourceList) { 01112 01113 // 01114 // Could not allocate memory for the resource list. 01115 // 01116 01117 FsVgaPrint((1, 01118 "FSVGA-FsVgaBuildResourceList: Could not allocate resource list\n")); 01119 01120 // 01121 // Log an error. 01122 // 01123 01124 dumpData[0] = *ResourceListSize; 01125 *ResourceListSize = 0; 01126 01127 FsVgaLogError(DeviceExtension->DeviceObject, 01128 FSVGA_INSUFFICIENT_RESOURCES, 01129 FSVGA_ERROR_VALUE_BASE + 110, 01130 STATUS_INSUFFICIENT_RESOURCES, 01131 dumpData, 01132 1 01133 ); 01134 01135 return; 01136 } 01137 01138 RtlZeroMemory(*ResourceList, 01139 *ResourceListSize); 01140 01141 // 01142 // Concoct one full resource descriptor. 01143 // 01144 01145 (*ResourceList)->Count = 1; 01146 01147 (*ResourceList)->List[0].InterfaceType = 01148 DeviceExtension->Configuration.InterfaceType; 01149 (*ResourceList)->List[0].BusNumber = 01150 DeviceExtension->Configuration.BusNumber; 01151 01152 // 01153 // Build the partial resource descriptors for port 01154 // resources from the saved values. 01155 // 01156 01157 (*ResourceList)->List[0].PartialResourceList.Count = count; 01158 01159 for (j = 0; j < DeviceExtension->Configuration.PortListCount; j++) { 01160 (*ResourceList)->List[0].PartialResourceList.PartialDescriptors[i++] = 01161 DeviceExtension->Configuration.PortList[j]; 01162 } 01163 01164 }

VOID FsVgaConfiguration IN PDEVICE_EXTENSION  DeviceExtension,
IN PUNICODE_STRING  RegistryPath,
IN PUNICODE_STRING  KeyboardDeviceName
 

Definition at line 649 of file fsvga.c.

References FSVGA_HARDWARE_PRESENT, FsVgaPeripheralCallout(), FsVgaPrint, FsVgaServiceParameters(), IoQueryDeviceDescription(), NTSTATUS(), NULL, and PFSVGA_CONFIGURATION_INFORMATION.

Referenced by DriverEntry().

00657 : 00658 00659 This routine retrieves the configuration information for the keyboard. 00660 00661 Arguments: 00662 00663 DeviceExtension - Pointer to the device extension. 00664 00665 RegistryPath - Pointer to the null-terminated Unicode name of the 00666 registry path for this driver. 00667 00668 FsVgaDeviceName - Pointer to the Unicode string that will receive 00669 the Full Screen Video port device name. 00670 00671 Return Value: 00672 00673 None. As a side-effect, may set DeviceExtension->HardwarePresent. 00674 00675 --*/ 00676 { 00677 NTSTATUS status = STATUS_SUCCESS; 00678 PFSVGA_CONFIGURATION_INFORMATION configuration; 00679 INTERFACE_TYPE interfaceType; 00680 ULONG i; 00681 00682 for (i = 0; i < MaximumInterfaceType; i++) 00683 { 00684 00685 // 00686 // Get the registry information for this device. 00687 // 00688 00689 interfaceType = i; 00690 status = IoQueryDeviceDescription(&interfaceType, 00691 NULL, 00692 NULL, 00693 NULL, 00694 NULL, 00695 NULL, 00696 FsVgaPeripheralCallout, 00697 (PVOID) DeviceExtension); 00698 00699 if (DeviceExtension->HardwarePresent & FSVGA_HARDWARE_PRESENT) 00700 { 00701 // 00702 // Get the service parameters (e.g., user-configurable number 00703 // of resends, polling iterations, etc.). 00704 // 00705 00706 FsVgaServiceParameters(DeviceExtension, 00707 RegistryPath, 00708 FsVgaDeviceName); 00709 00710 break; 00711 } 00712 else 00713 { 00714 FsVgaPrint((1, 00715 "FSVGA-FsVgaConfiguration: IoQueryDeviceDescription for bus type %d failed\n", 00716 interfaceType)); 00717 } 00718 } 00719 }

NTSTATUS FsVgaCopyFrameBuffer PDEVICE_EXTENSION  DeviceExtension,
PFSVIDEO_COPY_FRAME_BUFFER  CopyFrameBuffer,
ULONG  inputBufferLength
 

Definition at line 1349 of file fsvga.c.

References _DEVICE_EXTENSION::CurrentMode, FsgCopyFrameBuffer(), and SCREEN_BUFFER_POINTER.

Referenced by FsVgaDeviceControl().

01357 : 01358 01359 This routine copy the frame buffer. 01360 01361 Arguments: 01362 01363 DeviceExtension - Pointer to the miniport driver's device extension. 01364 01365 CopyFrameBuffer - Pointer to the structure containing the information about the copy frame buffer. 01366 01367 inputBufferLength - Length of the input buffer supplied by the user. 01368 01369 Return Value: 01370 01371 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 01372 for the input data. 01373 01374 STATUS_SUCCESS if the operation completed successfully. 01375 01376 --*/ 01377 01378 { 01379 // 01380 // Check if the size of the data in the input buffer is large enough. 01381 // 01382 01383 if (inputBufferLength < sizeof(FSVIDEO_COPY_FRAME_BUFFER)) { 01384 return STATUS_INVALID_BUFFER_SIZE; 01385 } 01386 01387 if (CopyFrameBuffer->SrcScreen.nNumberOfChars != CopyFrameBuffer->DestScreen.nNumberOfChars) { 01388 return STATUS_INVALID_PARAMETER; 01389 } 01390 01391 if (! (DeviceExtension->CurrentMode.VideoMode.AttributeFlags & VIDEO_MODE_GRAPHICS)) 01392 { 01393 /* 01394 * This is the TEXT frame buffer. 01395 */ 01396 01397 ULONG OffsSrc; 01398 ULONG OffsDest; 01399 PUCHAR pFrameBuf = DeviceExtension->CurrentMode.VideoMemory.FrameBufferBase; 01400 01401 OffsSrc = SCREEN_BUFFER_POINTER(CopyFrameBuffer->SrcScreen.Position.X, 01402 CopyFrameBuffer->SrcScreen.Position.Y, 01403 CopyFrameBuffer->SrcScreen.ScreenSize.X, 01404 sizeof(VGA_CHAR)); 01405 01406 OffsDest = SCREEN_BUFFER_POINTER(CopyFrameBuffer->DestScreen.Position.X, 01407 CopyFrameBuffer->DestScreen.Position.Y, 01408 CopyFrameBuffer->DestScreen.ScreenSize.X, 01409 sizeof(VGA_CHAR)); 01410 01411 RtlMoveMemory(pFrameBuf + OffsDest, 01412 pFrameBuf + OffsSrc, 01413 CopyFrameBuffer->SrcScreen.nNumberOfChars * sizeof(VGA_CHAR)); 01414 } 01415 else 01416 { 01417 /* 01418 * This is the GRAPHICS frame buffer. 01419 */ 01420 return FsgCopyFrameBuffer(DeviceExtension, 01421 CopyFrameBuffer, 01422 inputBufferLength); 01423 } 01424 01425 return STATUS_SUCCESS; 01426 }

NTSTATUS FsVgaDeviceControl IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp
 

Definition at line 1213 of file fsvga.c.

References _IRP::AssociatedIrp, FsVgaCopyFrameBuffer(), FsVgaPrint, FsVgaReverseMousePointer(), FsVgaSetCursorAttribute(), FsVgaSetCursorPosition(), FsVgaSetMode(), FsVgaSetScreenInformation(), FsVgaWriteToFrameBuffer(), IO_NO_INCREMENT, IoCompleteRequest, IoGetCurrentIrpStackLocation, _IRP::IoStatus, Irp, NTSTATUS(), PAGED_CODE, and _IO_STACK_LOCATION::Parameters.

Referenced by DriverEntry().

01220 : 01221 01222 This routine is the dispatch routine for device control requests. 01223 01224 Arguments: 01225 01226 DeviceObject - Pointer to the device object. 01227 01228 Irp - Pointer to the request packet. 01229 01230 Return Value: 01231 01232 Status is returned. 01233 01234 --*/ 01235 01236 { 01237 PIO_STACK_LOCATION irpSp; 01238 PVOID ioBuffer; 01239 ULONG inputBufferLength; 01240 ULONG outputBufferLength; 01241 PDEVICE_EXTENSION deviceExtension; 01242 NTSTATUS status = STATUS_SUCCESS; 01243 01244 FsVgaPrint((2,"FSVGA-FsVgaDeviceControl: enter\n")); 01245 01246 PAGED_CODE(); 01247 01248 // 01249 // Get a pointer to the device extension. 01250 // 01251 01252 deviceExtension = DeviceObject->DeviceExtension; 01253 01254 // 01255 // Initialize the returned Information field. 01256 // 01257 01258 Irp->IoStatus.Information = 0; 01259 01260 // 01261 // Get a pointer to the current parameters for this request. The 01262 // information is contained in the current stack location. 01263 // 01264 01265 irpSp = IoGetCurrentIrpStackLocation(Irp); 01266 01267 // 01268 // Get the pointer to the input/output buffer and it's length 01269 // 01270 01271 ioBuffer = Irp->AssociatedIrp.SystemBuffer; 01272 inputBufferLength = irpSp->Parameters.DeviceIoControl.InputBufferLength; 01273 outputBufferLength = irpSp->Parameters.DeviceIoControl.OutputBufferLength; 01274 01275 // 01276 // Case on the device control subfunction that is being performed by the 01277 // requestor. 01278 // 01279 01280 switch (irpSp->Parameters.DeviceIoControl.IoControlCode) 01281 { 01282 case IOCTL_FSVIDEO_COPY_FRAME_BUFFER: 01283 FsVgaPrint((2, "FsVgaDeviceControl - CopyFrameBuffer\n")); 01284 status = FsVgaCopyFrameBuffer(deviceExtension, 01285 (PFSVIDEO_COPY_FRAME_BUFFER) ioBuffer, 01286 inputBufferLength); 01287 break; 01288 01289 case IOCTL_FSVIDEO_WRITE_TO_FRAME_BUFFER: 01290 FsVgaPrint((2, "FsVgaDeviceControl - WriteToFrameBuffer\n")); 01291 status = FsVgaWriteToFrameBuffer(deviceExtension, 01292 (PFSVIDEO_WRITE_TO_FRAME_BUFFER) ioBuffer, 01293 inputBufferLength); 01294 break; 01295 01296 case IOCTL_FSVIDEO_REVERSE_MOUSE_POINTER: 01297 FsVgaPrint((2, "FsVgaDeviceControl - ReverseMousePointer\n")); 01298 status = FsVgaReverseMousePointer(deviceExtension, 01299 (PFSVIDEO_REVERSE_MOUSE_POINTER) ioBuffer, 01300 inputBufferLength); 01301 break; 01302 01303 case IOCTL_FSVIDEO_SET_CURRENT_MODE: 01304 FsVgaPrint((2, "FsVgaDeviceControl - SetCurrentModes\n")); 01305 status = FsVgaSetMode(deviceExtension, 01306 (PFSVIDEO_MODE_INFORMATION) ioBuffer, 01307 inputBufferLength); 01308 break; 01309 01310 case IOCTL_FSVIDEO_SET_SCREEN_INFORMATION: 01311 FsVgaPrint((2, "FsVgaDeviceControl - SetScreenInformation\n")); 01312 status = FsVgaSetScreenInformation(deviceExtension, 01313 (PFSVIDEO_SCREEN_INFORMATION) ioBuffer, 01314 inputBufferLength); 01315 break; 01316 01317 case IOCTL_FSVIDEO_SET_CURSOR_POSITION: 01318 FsVgaPrint((2, "FsVgaDeviceControl - SetCursorPosition\n")); 01319 status = FsVgaSetCursorPosition(deviceExtension, 01320 (PFSVIDEO_CURSOR_POSITION) ioBuffer, 01321 inputBufferLength); 01322 break; 01323 01324 case IOCTL_VIDEO_SET_CURSOR_ATTR: 01325 FsVgaPrint((2, "FsVgaDeviceControl - SetCursorAttribute\n")); 01326 status = FsVgaSetCursorAttribute(deviceExtension, 01327 (PVIDEO_CURSOR_ATTRIBUTES) ioBuffer, 01328 inputBufferLength); 01329 break; 01330 01331 default: 01332 FsVgaPrint((1, 01333 "FSVGA-FsVgaDeviceControl: INVALID REQUEST (0x%x)\n", 01334 irpSp->Parameters.DeviceIoControl.IoControlCode)); 01335 01336 status = STATUS_INVALID_DEVICE_REQUEST; 01337 break; 01338 } 01339 01340 Irp->IoStatus.Status = status; 01341 IoCompleteRequest(Irp, IO_NO_INCREMENT); 01342 01343 FsVgaPrint((2,"FSVGA-FsVgaDeviceControl: exit\n")); 01344 01345 return(status); 01346 }

VOID FsVgaLogError IN PDEVICE_OBJECT  DeviceObject,
IN NTSTATUS  ErrorCode,
IN ULONG  UniqueErrorValue,
IN NTSTATUS  FinalStatus,
IN PULONG  DumpData,
IN ULONG  DumpCount
 

Definition at line 1844 of file fsvga.c.

References IoAllocateErrorLogEntry(), IoWriteErrorLogEntry(), NULL, and USHORT.

Referenced by FsVgaBuildResourceList(), and FsVgaWriteToFrameBuffer().

01855 : 01856 01857 This routine contains common code to write an error log entry. It is 01858 called from other routines, especially FsVgaInitialize, to avoid 01859 duplication of code. Note that some routines continue to have their 01860 own error logging code (especially in the case where the error logging 01861 can be localized and/or the routine has more data because there is 01862 and IRP). 01863 01864 Arguments: 01865 01866 DeviceObject - Pointer to the device object. 01867 01868 ErrorCode - The error code for the error log packet. 01869 01870 UniqueErrorValue - The unique error value for the error log packet. 01871 01872 FinalStatus - The final status of the operation for the error log packet. 01873 01874 DumpData - Pointer to an array of dump data for the error log packet. 01875 01876 DumpCount - The number of entries in the dump data array. 01877 01878 01879 Return Value: 01880 01881 None. 01882 01883 --*/ 01884 01885 { 01886 PIO_ERROR_LOG_PACKET errorLogEntry; 01887 ULONG i; 01888 01889 errorLogEntry = (PIO_ERROR_LOG_PACKET) IoAllocateErrorLogEntry( 01890 DeviceObject, 01891 (UCHAR) 01892 (sizeof(IO_ERROR_LOG_PACKET) 01893 + (DumpCount * sizeof(ULONG))) 01894 ); 01895 01896 if (errorLogEntry != NULL) { 01897 01898 errorLogEntry->ErrorCode = ErrorCode; 01899 errorLogEntry->DumpDataSize = (USHORT) (DumpCount * sizeof(ULONG)); 01900 errorLogEntry->SequenceNumber = 0; 01901 errorLogEntry->MajorFunctionCode = 0; 01902 errorLogEntry->IoControlCode = 0; 01903 errorLogEntry->RetryCount = 0; 01904 errorLogEntry->UniqueErrorValue = UniqueErrorValue; 01905 errorLogEntry->FinalStatus = FinalStatus; 01906 for (i = 0; i < DumpCount; i++) 01907 errorLogEntry->DumpData[i] = DumpData[i]; 01908 01909 IoWriteErrorLogEntry(errorLogEntry); 01910 } 01911 }

NTSTATUS FsVgaOpenCloseDispatch IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp
 

Definition at line 1167 of file fsvga.c.

References FsVgaPrint, IO_NO_INCREMENT, IoCompleteRequest, _IRP::IoStatus, Irp, and PAGED_CODE.

Referenced by DriverEntry().

01174 : 01175 01176 This is the dispatch routine for create/open and close requests. 01177 These requests complete successfully. 01178 01179 Arguments: 01180 01181 DeviceObject - Pointer to the device object. 01182 01183 Irp - Pointer to the request packet. 01184 01185 Return Value: 01186 01187 Status is returned. 01188 01189 --*/ 01190 01191 { 01192 UNREFERENCED_PARAMETER(DeviceObject); 01193 01194 FsVgaPrint((3,"FSVGA-FsVgaOpenCloseDispatch: enter\n")); 01195 01196 PAGED_CODE(); 01197 01198 // 01199 // Complete the request with successful status. 01200 // 01201 01202 Irp->IoStatus.Status = STATUS_SUCCESS; 01203 Irp->IoStatus.Information = 0; 01204 IoCompleteRequest(Irp, IO_NO_INCREMENT); 01205 01206 FsVgaPrint((3,"FSVGA-FsVgaOpenCloseDispatch: exit\n")); 01207 01208 return(STATUS_SUCCESS); 01209 01210 }

NTSTATUS FsVgaPeripheralCallout IN PVOID  Context,
IN PUNICODE_STRING  PathName,
IN INTERFACE_TYPE  BusType,
IN ULONG  BusNumber,
IN PKEY_VALUE_FULL_INFORMATION *  BusInformation,
IN CONFIGURATION_TYPE  ControllerType,
IN ULONG  ControllerNumber,
IN PKEY_VALUE_FULL_INFORMATION *  ControllerInformation,
IN CONFIGURATION_TYPE  PeripheralType,
IN ULONG  PeripheralNumber,
IN PKEY_VALUE_FULL_INFORMATION *  PeripheralInformation
 

Definition at line 722 of file fsvga.c.

References _FSVGA_CONFIGURATION_INFORMATION::BusNumber, BusNumber, _DEVICE_EXTENSION::Configuration, ControllerType, CRTC_ADDRESS_PORT_COLOR, CRTC_DATA_PORT_COLOR, FSVGA_HARDWARE_PRESENT, FsVgaPrint, GRAPH_ADDRESS_PORT, _DEVICE_EXTENSION::HardwarePresent, _FSVGA_CONFIGURATION_INFORMATION::InterfaceType, NTSTATUS(), PeripheralType, _FSVGA_CONFIGURATION_INFORMATION::PortList, _FSVGA_CONFIGURATION_INFORMATION::PortListCount, SEQ_ADDRESS_PORT, and VGA_BASE_IO_PORT.

Referenced by FsVgaConfiguration().

00738 : 00739 00740 This is the callout routine sent as a parameter to 00741 IoQueryDeviceDescription. It grabs the Display controller 00742 configuration information. 00743 00744 Arguments: 00745 00746 Context - Context parameter that was passed in by the routine 00747 that called IoQueryDeviceDescription. 00748 00749 PathName - The full pathname for the registry key. 00750 00751 BusType - Bus interface type (Isa, Eisa, Mca, etc.). 00752 00753 BusNumber - The bus sub-key (0, 1, etc.). 00754 00755 BusInformation - Pointer to the array of pointers to the full value 00756 information for the bus. 00757 00758 ControllerType - The controller type (should be DisplayController). 00759 00760 ControllerNumber - The controller sub-key (0, 1, etc.). 00761 00762 ControllerInformation - Pointer to the array of pointers to the full 00763 value information for the controller key. 00764 00765 PeripheralType - The peripheral type (should be MonitorPeripheral). 00766 00767 PeripheralNumber - The peripheral sub-key. 00768 00769 PeripheralInformation - Pointer to the array of pointers to the full 00770 value information for the peripheral key. 00771 00772 00773 Return Value: 00774 00775 None. If successful, will have the following side-effects: 00776 00777 - Sets DeviceObject->DeviceExtension->HardwarePresent. 00778 - Sets configuration fields in 00779 DeviceObject->DeviceExtension->Configuration. 00780 00781 --*/ 00782 00783 { 00784 PDEVICE_EXTENSION deviceExtension; 00785 PFSVGA_CONFIGURATION_INFORMATION configuration; 00786 NTSTATUS status = STATUS_SUCCESS; 00787 CM_PARTIAL_RESOURCE_DESCRIPTOR ResourceDescriptor; 00788 00789 FsVgaPrint((1, 00790 "FSVGA-FsVgaPeripheralCallout: Path @ 0x%x, Bus Type 0x%x, Bus Number 0x%x\n", 00791 PathName, BusType, BusNumber)); 00792 FsVgaPrint((1, 00793 " Controller Type 0x%x, Controller Number 0x%x, Controller info @ 0x%x\n", 00794 ControllerType, ControllerNumber, ControllerInformation)); 00795 FsVgaPrint((1, 00796 " Peripheral Type 0x%x, Peripheral Number 0x%x, Peripheral info @ 0x%x\n", 00797 PeripheralType, PeripheralNumber, PeripheralInformation)); 00798 00799 // 00800 // If we already have the configuration information for the 00801 // keyboard peripheral, or if the peripheral identifier is missing, 00802 // just return. 00803 // 00804 00805 deviceExtension = (PDEVICE_EXTENSION) Context; 00806 if (deviceExtension->HardwarePresent & FSVGA_HARDWARE_PRESENT) 00807 { 00808 return (status); 00809 } 00810 00811 configuration = &deviceExtension->Configuration; 00812 00813 deviceExtension->HardwarePresent |= FSVGA_HARDWARE_PRESENT; 00814 00815 // 00816 // Get the bus information. 00817 // 00818 00819 configuration->InterfaceType = BusType; 00820 configuration->BusNumber = BusNumber; 00821 00822 // 00823 // Get logical IO port addresses. 00824 // 00825 ResourceDescriptor.Type = CmResourceTypePort; 00826 ResourceDescriptor.ShareDisposition = CmResourceShareShared; 00827 ResourceDescriptor.Flags = CM_RESOURCE_PORT_IO; 00828 00829 ResourceDescriptor.u.Port.Start.LowPart = VGA_BASE_IO_PORT+CRTC_ADDRESS_PORT_COLOR; 00830 ResourceDescriptor.u.Port.Start.HighPart = 0; 00831 ResourceDescriptor.u.Port.Length = 1; 00832 configuration->PortList[configuration->PortListCount] = ResourceDescriptor; 00833 configuration->PortListCount += 1; 00834 00835 ResourceDescriptor.u.Port.Start.LowPart = VGA_BASE_IO_PORT+CRTC_DATA_PORT_COLOR; 00836 ResourceDescriptor.u.Port.Start.HighPart = 0; 00837 ResourceDescriptor.u.Port.Length = 1; 00838 configuration->PortList[configuration->PortListCount] = ResourceDescriptor; 00839 configuration->PortListCount += 1; 00840 00841 ResourceDescriptor.u.Port.Start.LowPart = VGA_BASE_IO_PORT+GRAPH_ADDRESS_PORT; 00842 ResourceDescriptor.u.Port.Start.HighPart = 0; 00843 ResourceDescriptor.u.Port.Length = 2; 00844 configuration->PortList[configuration->PortListCount] = ResourceDescriptor; 00845 configuration->PortListCount += 1; 00846 00847 ResourceDescriptor.u.Port.Start.LowPart = VGA_BASE_IO_PORT+SEQ_ADDRESS_PORT; 00848 ResourceDescriptor.u.Port.Start.HighPart = 0; 00849 ResourceDescriptor.u.Port.Length = 2; 00850 configuration->PortList[configuration->PortListCount] = ResourceDescriptor; 00851 configuration->PortListCount += 1; 00852 00853 return(status); 00854 }

NTSTATUS FsVgaReverseMousePointer PDEVICE_EXTENSION  DeviceExtension,
PFSVIDEO_REVERSE_MOUSE_POINTER  MouseBuffer,
ULONG  inputBufferLength
 

Definition at line 1546 of file fsvga.c.

References BYTE, _DEVICE_EXTENSION::CurrentMode, FsgReverseMousePointer(), and SCREEN_BUFFER_POINTER.

Referenced by FsVgaDeviceControl().

01554 : 01555 01556 This routine reverse the frame buffer for mouse pointer. 01557 01558 Arguments: 01559 01560 DeviceExtension - Pointer to the miniport driver's device extension. 01561 01562 MouseBuffer - Pointer to the structure containing the information about the mouse frame buffer. 01563 01564 inputBufferLength - Length of the input buffer supplied by the user. 01565 01566 Return Value: 01567 01568 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 01569 for the input data. 01570 01571 STATUS_SUCCESS if the operation completed successfully. 01572 01573 --*/ 01574 01575 { 01576 // 01577 // Check if the size of the data in the input buffer is large enough. 01578 // 01579 01580 if (inputBufferLength < sizeof(FSVIDEO_REVERSE_MOUSE_POINTER)) { 01581 return STATUS_INVALID_BUFFER_SIZE; 01582 } 01583 01584 if (! (DeviceExtension->CurrentMode.VideoMode.AttributeFlags & VIDEO_MODE_GRAPHICS)) 01585 { 01586 /* 01587 * This is the TEXT frame buffer. 01588 */ 01589 01590 ULONG Offs; 01591 PUCHAR pFrameBuf = DeviceExtension->CurrentMode.VideoMemory.FrameBufferBase; 01592 BYTE Attribute; 01593 01594 Offs = SCREEN_BUFFER_POINTER(MouseBuffer->Screen.Position.X, 01595 MouseBuffer->Screen.Position.Y, 01596 MouseBuffer->Screen.ScreenSize.X, 01597 sizeof(VGA_CHAR)); 01598 pFrameBuf += Offs; 01599 01600 Attribute = (*(pFrameBuf + 1) & 0xF0) >> 4; 01601 Attribute |= (*(pFrameBuf + 1) & 0x0F) << 4; 01602 *(pFrameBuf + 1) = Attribute; 01603 } 01604 else 01605 { 01606 /* 01607 * This is the GRAPHICS frame buffer. 01608 */ 01609 return FsgReverseMousePointer(DeviceExtension, 01610 MouseBuffer, 01611 inputBufferLength); 01612 } 01613 01614 return STATUS_SUCCESS; 01615 }

VOID FsVgaServiceParameters IN PDEVICE_EXTENSION  DeviceExtension,
IN PUNICODE_STRING  RegistryPath,
IN PUNICODE_STRING  FsVgaDeviceName
 

Definition at line 858 of file fsvga.c.

References _FSVGA_CONFIGURATION_INFORMATION::EmulationMode, ExAllocatePool, ExFreePool(), FsVgaPrint, _FSVGA_CONFIGURATION_INFORMATION::HardwareCursor, _FSVGA_CONFIGURATION_INFORMATION::HardwareScroll, L, NO_HARDWARE_CURSOR, NO_HARDWARE_SCROLL, NT_SUCCESS, NTSTATUS(), NULL, PagedPool, path, RtlAppendUnicodeToString(), RtlCopyUnicodeString(), RtlInitUnicodeString(), RtlQueryRegistryValues(), and USHORT.

Referenced by FsVgaConfiguration().

00866 : 00867 00868 This routine retrieves this driver's service parameters information 00869 from the registry. 00870 00871 Arguments: 00872 00873 DeviceExtension - Pointer to the device extension. 00874 00875 RegistryPath - Pointer to the null-terminated Unicode name of the 00876 registry path for this driver. 00877 00878 FsVgaDeviceName - Pointer to the Unicode string that will receive 00879 the Full Screen Video port device name. 00880 00881 Return Value: 00882 00883 None. As a side-effect, sets fields in DeviceExtension->Configuration. 00884 00885 --*/ 00886 00887 { 00888 PFSVGA_CONFIGURATION_INFORMATION configuration; 00889 UNICODE_STRING parametersPath; 00890 PWSTR path; 00891 PRTL_QUERY_REGISTRY_TABLE parameters = NULL; 00892 USHORT queriesPlusOne = 4; 00893 NTSTATUS status = STATUS_SUCCESS; 00894 #define PARAMETER_MAX 256 00895 ULONG EmulationMode; 00896 ULONG HardwareCursor; 00897 ULONG HardwareScroll; 00898 USHORT defaultEmulationMode = 0; 00899 USHORT defaultHardwareCursor = NO_HARDWARE_CURSOR; 00900 USHORT defaultHardwareScroll = NO_HARDWARE_SCROLL; 00901 UNICODE_STRING defaultFsVgaName; 00902 00903 configuration = &DeviceExtension->Configuration; 00904 parametersPath.Buffer = NULL; 00905 00906 // 00907 // Registry path is already null-terminated, so just use it. 00908 // 00909 00910 path = RegistryPath->Buffer; 00911 00912 // 00913 // Allocate the Rtl query table. 00914 // 00915 00916 parameters = ExAllocatePool(PagedPool, 00917 sizeof(RTL_QUERY_REGISTRY_TABLE) * queriesPlusOne); 00918 if (!parameters) 00919 { 00920 FsVgaPrint((1, 00921 "FSVGA-FsVgaServiceParameters: Couldn't allocate table for Rtl query to parameters for %ws\n", 00922 path)); 00923 status = STATUS_UNSUCCESSFUL; 00924 } 00925 else 00926 { 00927 RtlZeroMemory(parameters, 00928 sizeof(RTL_QUERY_REGISTRY_TABLE) * queriesPlusOne); 00929 00930 // 00931 // Form a path to this driver's Parameters subkey. 00932 // 00933 00934 RtlInitUnicodeString(&parametersPath, 00935 NULL); 00936 00937 parametersPath.MaximumLength = RegistryPath->Length + 00938 sizeof(L"\\Parameters"); 00939 parametersPath.Buffer = ExAllocatePool(PagedPool, 00940 parametersPath.MaximumLength); 00941 if (!parametersPath.Buffer) 00942 { 00943 FsVgaPrint((1, 00944 "FSVGA-FsVgaServiceParameters: Couldn't allocate string for path to parameters for %ws\n", 00945 path)); 00946 status = STATUS_UNSUCCESSFUL; 00947 } 00948 } 00949 00950 if (NT_SUCCESS(status)) 00951 { 00952 // 00953 // Form the parameters path. 00954 // 00955 RtlZeroMemory(parametersPath.Buffer, 00956 parametersPath.MaximumLength); 00957 RtlAppendUnicodeToString(&parametersPath, 00958 path); 00959 RtlAppendUnicodeToString(&parametersPath, 00960 L"\\Parameters"); 00961 00962 FsVgaPrint((1, 00963 "FsVga-FsVgaServiceParameters: parameters path is %ws\n", 00964 parametersPath.Buffer)); 00965 00966 // 00967 // Gather all of the "user specified" information from 00968 // the registry. 00969 // 00970 parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT; 00971 parameters[0].Name = L"ConsoleFullScreen.EmulationMode"; 00972 parameters[0].EntryContext = &EmulationMode; 00973 parameters[0].DefaultType = REG_DWORD; 00974 parameters[0].DefaultData = &defaultEmulationMode; 00975 parameters[0].DefaultLength = sizeof(USHORT); 00976 00977 parameters[1].Flags = RTL_QUERY_REGISTRY_DIRECT; 00978 parameters[1].Name = L"ConsoleFullScreen.HardwareCursor"; 00979 parameters[1].EntryContext = &HardwareCursor; 00980 parameters[1].DefaultType = REG_DWORD; 00981 parameters[1].DefaultData = &defaultHardwareCursor; 00982 parameters[1].DefaultLength = sizeof(USHORT); 00983 00984 parameters[2].Flags = RTL_QUERY_REGISTRY_DIRECT; 00985 parameters[2].Name = L"ConsoleFullScreen.HardwareScroll"; 00986 parameters[2].EntryContext = &HardwareScroll; 00987 parameters[2].DefaultType = REG_DWORD; 00988 parameters[2].DefaultData = &defaultHardwareScroll; 00989 parameters[2].DefaultLength = sizeof(USHORT); 00990 00991 status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL, 00992 parametersPath.Buffer, 00993 parameters, 00994 NULL, 00995 NULL); 00996 if (!NT_SUCCESS(status)) 00997 { 00998 FsVgaPrint((1, 00999 "FsVga-FsVgaServiceParameters: RtlQueryRegistryValues failed with 0x%x\n", 01000 status)); 01001 } 01002 } 01003 01004 if (!NT_SUCCESS(status)) 01005 { 01006 // 01007 // Go ahead and assign driver defaults. 01008 // 01009 configuration->EmulationMode = defaultEmulationMode; 01010 configuration->HardwareCursor = defaultHardwareCursor; 01011 configuration->HardwareScroll = defaultHardwareScroll; 01012 } 01013 else 01014 { 01015 configuration->EmulationMode = (USHORT)EmulationMode; 01016 configuration->HardwareCursor = (USHORT)HardwareCursor; 01017 configuration->HardwareScroll = (USHORT)HardwareScroll; 01018 } 01019 01020 // 01021 // Form the default port device names, in case they are not 01022 // specified in the registry. 01023 // 01024 01025 RtlInitUnicodeString(&defaultFsVgaName, 01026 DD_FULLSCREEN_PORT_BASE_NAME_U); 01027 RtlCopyUnicodeString(FsVgaDeviceName, &defaultFsVgaName); 01028 01029 FsVgaPrint((1, 01030 "FsVga-FsVgaServiceParameters: Full Screen Video port base name = %ws\n", 01031 FsVgaDeviceName->Buffer)); 01032 01033 FsVgaPrint((1, 01034 "FsVga-FsVgaServiceParameters: Emulation Mode = %d\n", 01035 configuration->EmulationMode)); 01036 01037 FsVgaPrint((1, 01038 "FsVga-FsVgaServiceParameters: Hardware Cursor = %d\n", 01039 configuration->HardwareCursor)); 01040 01041 FsVgaPrint((1, 01042 "FsVga-FsVgaServiceParameters: Hardware Scroll = %d\n", 01043 configuration->HardwareScroll)); 01044 01045 // 01046 // Free the allocated memory before returning. 01047 // 01048 01049 if (parametersPath.Buffer) 01050 ExFreePool(parametersPath.Buffer); 01051 if (parameters) 01052 ExFreePool(parameters); 01053 }

NTSTATUS FsVgaSetCursorAttribute PDEVICE_EXTENSION  DeviceExtension,
PVIDEO_CURSOR_ATTRIBUTES  CursorAttributes,
ULONG  inputBufferLength
 

Definition at line 1777 of file fsvga.c.

References _DEVICE_EXTENSION::CurrentMode, _EMULATE_BUFFER_INFORMATION::CursorAttributes, _DEVICE_EXTENSION::EmulateInfo, FALSE, FsgInvertCursor(), and TRUE.

Referenced by FsVgaDeviceControl().

01785 : 01786 01787 This routine sets the cursor attributes. 01788 01789 Arguments: 01790 01791 DeviceExtension - Pointer to the miniport driver's device extension. 01792 01793 CursorAttributes - Pointer to the structure containing the information about the 01794 cursor attributes. 01795 01796 inputBufferLength - Length of the input buffer supplied by the user. 01797 01798 Return Value: 01799 01800 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 01801 for the input data. 01802 01803 STATUS_SUCCESS if the operation completed successfully. 01804 01805 --*/ 01806 01807 { 01808 // 01809 // Check if the size of the data in the input buffer is large enough. 01810 // 01811 01812 if (inputBufferLength < sizeof(VIDEO_CURSOR_ATTRIBUTES)) { 01813 return STATUS_INVALID_BUFFER_SIZE; 01814 } 01815 01816 if (DeviceExtension->CurrentMode.VideoMode.AttributeFlags & VIDEO_MODE_GRAPHICS) 01817 { 01818 FsgInvertCursor(DeviceExtension,FALSE); 01819 } 01820 01821 DeviceExtension->EmulateInfo.CursorAttributes = *CursorAttributes; 01822 01823 if (DeviceExtension->CurrentMode.VideoMode.AttributeFlags & VIDEO_MODE_GRAPHICS) 01824 { 01825 FsgInvertCursor(DeviceExtension,TRUE); 01826 return STATUS_SUCCESS; 01827 } 01828 else 01829 { 01830 /* 01831 * If current video mode is a TEXT MODE. 01832 * FSVGA.SYS didn't handling hardware cursor 01833 * because I don't know device of VGA.SYS or others. 01834 * 01835 * In this case, by returns STATUS_UNSUCCESSFUL, caller 01836 * do DeviceIoControl to VGA miniport driver. 01837 */ 01838 return STATUS_UNSUCCESSFUL; 01839 } 01840 }

NTSTATUS FsVgaSetCursorPosition PDEVICE_EXTENSION  DeviceExtension,
PFSVIDEO_CURSOR_POSITION  CursorPosition,
ULONG  inputBufferLength
 

Definition at line 1710 of file fsvga.c.

References _DEVICE_EXTENSION::CurrentMode, _EMULATE_BUFFER_INFORMATION::CursorPosition, _DEVICE_EXTENSION::EmulateInfo, FALSE, FsgInvertCursor(), and TRUE.

Referenced by FsVgaDeviceControl().

01718 : 01719 01720 This routine sets the cursor position. 01721 01722 Arguments: 01723 01724 DeviceExtension - Pointer to the miniport driver's device extension. 01725 01726 CursorPosition - Pointer to the structure containing the information about the 01727 cursor position. 01728 01729 inputBufferLength - Length of the input buffer supplied by the user. 01730 01731 Return Value: 01732 01733 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 01734 for the input data. 01735 01736 STATUS_SUCCESS if the operation completed successfully. 01737 01738 --*/ 01739 01740 { 01741 // 01742 // Check if the size of the data in the input buffer is large enough. 01743 // 01744 01745 if (inputBufferLength < sizeof(VIDEO_CURSOR_POSITION)) { 01746 return STATUS_INVALID_BUFFER_SIZE; 01747 } 01748 01749 if (DeviceExtension->CurrentMode.VideoMode.AttributeFlags & VIDEO_MODE_GRAPHICS) 01750 { 01751 FsgInvertCursor(DeviceExtension,FALSE); 01752 } 01753 01754 DeviceExtension->EmulateInfo.CursorPosition = *CursorPosition; 01755 01756 if (DeviceExtension->CurrentMode.VideoMode.AttributeFlags & VIDEO_MODE_GRAPHICS) 01757 { 01758 FsgInvertCursor(DeviceExtension,TRUE); 01759 return STATUS_SUCCESS; 01760 } 01761 else 01762 { 01763 /* 01764 * If current video mode is a TEXT MODE. 01765 * FSVGA.SYS didn't handling hardware cursor 01766 * because I don't know device of VGA.SYS or others. 01767 * 01768 * In this case, by returns STATUS_UNSUCCESSFUL, caller 01769 * do DeviceIoControl to VGA miniport driver. 01770 */ 01771 return STATUS_UNSUCCESSFUL; 01772 } 01773 }

NTSTATUS FsVgaSetMode PDEVICE_EXTENSION  DeviceExtension,
PFSVIDEO_MODE_INFORMATION  ModeInformation,
ULONG  inputBufferLength
 

Definition at line 1618 of file fsvga.c.

References _DEVICE_EXTENSION::CurrentMode.

Referenced by FsVgaDeviceControl().

01626 : 01627 01628 This routine sets the current video information. 01629 01630 Arguments: 01631 01632 DeviceExtension - Pointer to the miniport driver's device extension. 01633 01634 ModeInformation - Pointer to the structure containing the information about the 01635 full screen video. 01636 01637 inputBufferLength - Length of the input buffer supplied by the user. 01638 01639 Return Value: 01640 01641 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 01642 for the input data. 01643 01644 STATUS_SUCCESS if the operation completed successfully. 01645 01646 --*/ 01647 01648 { 01649 // 01650 // Check if the size of the data in the input buffer is large enough. 01651 // 01652 01653 if (inputBufferLength < sizeof(FSVIDEO_MODE_INFORMATION)) { 01654 return STATUS_INVALID_BUFFER_SIZE; 01655 } 01656 01657 DeviceExtension->CurrentMode = *ModeInformation; 01658 01659 return STATUS_SUCCESS; 01660 }

NTSTATUS FsVgaSetScreenInformation PDEVICE_EXTENSION  DeviceExtension,
PFSVIDEO_SCREEN_INFORMATION  ScreenInformation,
ULONG  inputBufferLength
 

Definition at line 1663 of file fsvga.c.

References FsgVgaInitializeHWFlags(), and _DEVICE_EXTENSION::ScreenAndFont.

Referenced by FsVgaDeviceControl().

01671 : 01672 01673 This routine sets the screen and font information. 01674 01675 Arguments: 01676 01677 DeviceExtension - Pointer to the miniport driver's device extension. 01678 01679 ScreenInformation - Pointer to the structure containing the information about the 01680 screen anf font. 01681 01682 inputBufferLength - Length of the input buffer supplied by the user. 01683 01684 Return Value: 01685 01686 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 01687 for the input data. 01688 01689 STATUS_SUCCESS if the operation completed successfully. 01690 01691 --*/ 01692 01693 { 01694 // 01695 // Check if the size of the data in the input buffer is large enough. 01696 // 01697 01698 if (inputBufferLength < sizeof(FSVIDEO_SCREEN_INFORMATION)) { 01699 return STATUS_INVALID_BUFFER_SIZE; 01700 } 01701 01702 DeviceExtension->ScreenAndFont = *ScreenInformation; 01703 01704 FsgVgaInitializeHWFlags(DeviceExtension); 01705 01706 return STATUS_SUCCESS; 01707 }

NTSTATUS FsVgaWriteToFrameBuffer PDEVICE_EXTENSION  DeviceExtension,
PFSVIDEO_WRITE_TO_FRAME_BUFFER  WriteFrameBuffer,
ULONG  inputBufferLength
 

Definition at line 1429 of file fsvga.c.

References _DEVICE_EXTENSION::CurrentMode, _DEVICE_EXTENSION::DeviceObject, DUMP_COUNT, DWORD, ExAllocatePool, ExFreePool(), FsgWriteToFrameBuffer(), FSVGA_ERROR_VALUE_BASE, FsVgaLogError(), FsVgaPrint, NULL, PagedPool, SCREEN_BUFFER_POINTER, _DEVICE_EXTENSION::ScreenAndFont, SHORT, and TranslateOutputToOem().

Referenced by FsVgaDeviceControl().

01437 : 01438 01439 This routine write the frame buffer. 01440 01441 Arguments: 01442 01443 DeviceExtension - Pointer to the miniport driver's device extension. 01444 01445 WriteFrameBuffer - Pointer to the structure containing the information about the write frame buffer. 01446 01447 inputBufferLength - Length of the input buffer supplied by the user. 01448 01449 Return Value: 01450 01451 STATUS_INSUFFICIENT_BUFFER if the input buffer was not large enough 01452 for the input data. 01453 01454 STATUS_SUCCESS if the operation completed successfully. 01455 01456 --*/ 01457 01458 { 01459 // 01460 // Check if the size of the data in the input buffer is large enough. 01461 // 01462 01463 if (inputBufferLength < sizeof(FSVIDEO_WRITE_TO_FRAME_BUFFER)) { 01464 return STATUS_INVALID_BUFFER_SIZE; 01465 } 01466 01467 if (WriteFrameBuffer->DestScreen.Position.X < 0 || 01468 WriteFrameBuffer->DestScreen.Position.X > DeviceExtension->ScreenAndFont.ScreenSize.X || 01469 (SHORT)(WriteFrameBuffer->DestScreen.Position.X + 01470 WriteFrameBuffer->DestScreen.nNumberOfChars) 01471 > DeviceExtension->ScreenAndFont.ScreenSize.X || 01472 WriteFrameBuffer->DestScreen.Position.Y < 0 || 01473 WriteFrameBuffer->DestScreen.Position.Y > DeviceExtension->ScreenAndFont.ScreenSize.Y) { 01474 return STATUS_INVALID_BUFFER_SIZE; 01475 } 01476 01477 if (! (DeviceExtension->CurrentMode.VideoMode.AttributeFlags & VIDEO_MODE_GRAPHICS)) 01478 { 01479 /* 01480 * This is the TEXT frame buffer. 01481 */ 01482 01483 ULONG Offs; 01484 PUCHAR pFrameBuf = DeviceExtension->CurrentMode.VideoMemory.FrameBufferBase; 01485 PCHAR_IMAGE_INFO pCharInfoUni = WriteFrameBuffer->SrcBuffer; 01486 PCHAR_IMAGE_INFO pCharInfoAsc; 01487 DWORD Length = WriteFrameBuffer->DestScreen.nNumberOfChars; 01488 PVOID pCapBuffer = NULL; 01489 ULONG cCapBuffer = 0; 01490 01491 Offs = SCREEN_BUFFER_POINTER(WriteFrameBuffer->DestScreen.Position.X, 01492 WriteFrameBuffer->DestScreen.Position.Y, 01493 WriteFrameBuffer->DestScreen.ScreenSize.X, 01494 sizeof(VGA_CHAR)); 01495 01496 cCapBuffer = Length * sizeof(CHAR_IMAGE_INFO); 01497 pCapBuffer = ExAllocatePool(PagedPool, cCapBuffer); 01498 01499 if (!pCapBuffer) { 01500 #define DUMP_COUNT 4 01501 ULONG dumpData[DUMP_COUNT]; 01502 01503 FsVgaPrint((1, 01504 "FSVGA-FsVgaWriteToFrameBuffer: Could not allocate resource list\n")); 01505 // 01506 // Log an error. 01507 // 01508 dumpData[0] = cCapBuffer; 01509 FsVgaLogError(DeviceExtension->DeviceObject, 01510 FSVGA_INSUFFICIENT_RESOURCES, 01511 FSVGA_ERROR_VALUE_BASE + 200, 01512 STATUS_INSUFFICIENT_RESOURCES, 01513 dumpData, 01514 1 01515 ); 01516 return STATUS_UNSUCCESSFUL; 01517 } 01518 01519 TranslateOutputToOem(pCapBuffer, pCharInfoUni, Length); 01520 01521 pCharInfoAsc = pCapBuffer; 01522 pFrameBuf += Offs; 01523 while (Length--) 01524 { 01525 *pFrameBuf++ = pCharInfoAsc->CharInfo.Char.AsciiChar; 01526 *pFrameBuf++ = (UCHAR) (pCharInfoAsc->CharInfo.Attributes); 01527 pCharInfoAsc++; 01528 } 01529 01530 ExFreePool(pCapBuffer); 01531 } 01532 else 01533 { 01534 /* 01535 * This is the GRAPHICS frame buffer. 01536 */ 01537 return FsgWriteToFrameBuffer(DeviceExtension, 01538 WriteFrameBuffer, 01539 inputBufferLength); 01540 } 01541 01542 return STATUS_SUCCESS; 01543 }

VOID GetHardwareScrollReg PDEVICE_EXTENSION  deviceExtension  ) 
 

Definition at line 31 of file port.c.

References CRTCAddressPortColor, CRTCDataPortColor, _DEVICE_EXTENSION::DeviceRegisters, _DEVICE_EXTENSION::EmulateInfo, high, IND_LINE_COMPARE, IND_LINE_COMPARE8, IND_LINE_COMPARE9, IND_START_ADRS_H, IND_START_ADRS_L, _EMULATE_BUFFER_INFORMATION::LineCompare, low, and _EMULATE_BUFFER_INFORMATION::StartAddress.

Referenced by FsgVgaInitializeHWFlags().

00037 : 00038 00039 This routine gets the hardware scrolls register value. 00040 00041 Arguments: 00042 00043 Return Value: 00044 00045 --*/ 00046 00047 { 00048 UCHAR low; 00049 UCHAR high; 00050 UCHAR mid; 00051 00052 WRITE_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCAddressPortColor], 00053 IND_START_ADRS_L); 00054 low = READ_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCDataPortColor]); 00055 00056 WRITE_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCAddressPortColor], 00057 IND_START_ADRS_H); 00058 high = READ_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCDataPortColor]); 00059 00060 deviceExtension->EmulateInfo.StartAddress = MAKEWORD(low, high); 00061 00062 WRITE_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCAddressPortColor], 00063 IND_LINE_COMPARE); 00064 low = READ_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCDataPortColor]); 00065 00066 WRITE_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCAddressPortColor], 00067 IND_LINE_COMPARE8); 00068 mid = READ_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCDataPortColor]); 00069 mid = (mid >> 4) & 1; 00070 00071 WRITE_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCAddressPortColor], 00072 IND_LINE_COMPARE9); 00073 high = READ_PORT_UCHAR(deviceExtension->DeviceRegisters[CRTCDataPortColor]); 00074 high = (high >> 5) & 2; 00075 00076 high |= mid; 00077 deviceExtension->EmulateInfo.LineCompare = MAKEWORD(low, high); 00078 }

BOOL IsGRAMRowOver PUCHAR  BufPtr,
BOOL  fDbcs,
PDEVICE_EXTENSION  DeviceExtension
 

Definition at line 152 of file drawscrn.c.

References _DEVICE_EXTENSION::CurrentMode, _EMULATE_BUFFER_INFORMATION::DeltaNextFontRow, DWORD, _DEVICE_EXTENSION::EmulateInfo, FALSE, _EMULATE_BUFFER_INFORMATION::LimitGRAM, and TRUE.

Referenced by FsgWriteToScreen().

00160 : 00161 00162 This Routine check ROW overflow as GRAM limit line. 00163 00164 Arguments: 00165 00166 BufPtr - Pointer to graphics buffer. 00167 00168 fDbcs - Flag of DBCS(true) or SBCS(false). 00169 00170 Return Value: 00171 TRUE: if font box is overflow as GRAMlimit line. 00172 FALSE: not overflow. 00173 00174 --*/ 00175 00176 { 00177 if (fDbcs) 00178 { 00179 if ((DWORD)(BufPtr + 1 + 00180 DeviceExtension->EmulateInfo.DeltaNextFontRow - 00181 (PUCHAR)DeviceExtension->CurrentMode.VideoMemory.FrameBufferBase) 00182 >= DeviceExtension->EmulateInfo.LimitGRAM) 00183 return TRUE; 00184 else 00185 return FALSE; 00186 } 00187 else 00188 { 00189 if ((DWORD)(BufPtr + 00190 DeviceExtension->EmulateInfo.DeltaNextFontRow - 00191 (PUCHAR)DeviceExtension->CurrentMode.VideoMemory.FrameBufferBase) 00192 >= DeviceExtension->EmulateInfo.LimitGRAM) 00193 return TRUE; 00194 else 00195 return FALSE; 00196 } 00197 }

VOID memcpyGRAM IN PCHAR  TargetPtr,
IN PCHAR  SourcePtr,
IN ULONG  Length
 

Definition at line 233 of file drawscrn.c.

Referenced by memcpyGRAMOver(), and MoveGRAM().

00241 : 00242 00243 This routine is a memory copy for byte order. 00244 00245 Arguments: 00246 00247 TargetPtr - Pointer to target graphics buffer. 00248 00249 SourcePtr - Pointer to source graphics buffer. 00250 00251 Length - Fill length. 00252 00253 Return Value: 00254 00255 --*/ 00256 00257 { 00258 while (Length--) 00259 *TargetPtr++ = *SourcePtr++; 00260 }

VOID memcpyGRAMOver IN PCHAR  TargetPtr,
IN PCHAR  SourcePtr,
IN ULONG  Length,
IN PUCHAR  FrameBufPtr,
IN PDEVICE_EXTENSION  DeviceExtension
 

Definition at line 263 of file drawscrn.c.

References DWORD, and memcpyGRAM().

Referenced by MoveGRAM().

00273 : 00274 00275 This routine move a graphics buffer. 00276 00277 Arguments: 00278 00279 TargetPtr - Pointer to target graphics buffer. 00280 00281 SourcePtr - Pointer to source graphics buffer. 00282 00283 Length - Fill length. 00284 00285 Return Value: 00286 00287 --*/ 00288 00289 { 00290 ULONG tmpLen; 00291 00292 if ((DWORD)(SourcePtr + Length - FrameBufPtr) >= DeviceExtension->EmulateInfo.LimitGRAM) { 00293 tmpLen = DeviceExtension->EmulateInfo.LimitGRAM - (SourcePtr - FrameBufPtr); 00294 memcpyGRAM(TargetPtr, SourcePtr, tmpLen); 00295 TargetPtr += tmpLen; 00296 Length -= tmpLen; 00297 SourcePtr = FrameBufPtr; 00298 } 00299 00300 if ((DWORD)(TargetPtr + Length - FrameBufPtr) >= DeviceExtension->EmulateInfo.LimitGRAM) { 00301 tmpLen = DeviceExtension->EmulateInfo.LimitGRAM - (TargetPtr - FrameBufPtr); 00302 memcpyGRAM(TargetPtr, SourcePtr, tmpLen); 00303 SourcePtr += tmpLen; 00304 Length -= tmpLen; 00305 TargetPtr = FrameBufPtr; 00306 } 00307 00308 if (Length) { 00309 memcpyGRAM(TargetPtr, SourcePtr, Length); 00310 } 00311 }

VOID MoveGRAM IN PCHAR  TargetPtr,
IN PCHAR  SourcePtr,
IN ULONG  Length,
IN PUCHAR  FrameBufPtr,
IN PDEVICE_EXTENSION  DeviceExtension
 

Definition at line 314 of file drawscrn.c.

References DWORD, memcpyGRAM(), memcpyGRAMOver(), SetGRAMCopyMode(), and SetGRAMWriteMode().

Referenced by FsgCopyFrameBuffer().

00324 : 00325 00326 This routine move a graphics buffer. 00327 00328 Arguments: 00329 00330 TargetPtr - Pointer to target graphics buffer. 00331 00332 SourcePtr - Pointer to source graphics buffer. 00333 00334 Length - Fill length. 00335 00336 Return Value: 00337 00338 none. 00339 00340 --*/ 00341 { 00342 PCHAR tmpSrc; 00343 PCHAR tmpTrg; 00344 ULONG tmpLen; 00345 00346 // 00347 // Set copy mode of graphics register 00348 // 00349 00350 SetGRAMCopyMode(DeviceExtension); 00351 00352 if ((DWORD)(SourcePtr + Length - FrameBufPtr) >= DeviceExtension->EmulateInfo.LimitGRAM || 00353 (DWORD)(TargetPtr + Length - FrameBufPtr) >= DeviceExtension->EmulateInfo.LimitGRAM ) { 00354 if (SourcePtr > TargetPtr) { 00355 memcpyGRAMOver(TargetPtr,SourcePtr,Length,FrameBufPtr,DeviceExtension); 00356 } 00357 else if ((ULONG)(TargetPtr - SourcePtr) >= Length) { 00358 memcpyGRAMOver(TargetPtr,SourcePtr,Length,FrameBufPtr,DeviceExtension); 00359 } 00360 else { 00361 if ((DWORD)(SourcePtr + Length - FrameBufPtr) >= DeviceExtension->EmulateInfo.LimitGRAM) { 00362 tmpLen = SourcePtr + Length - FrameBufPtr - DeviceExtension->EmulateInfo.LimitGRAM; 00363 tmpTrg = TargetPtr + Length - tmpLen - DeviceExtension->EmulateInfo.LimitGRAM; 00364 memcpyGRAM(tmpTrg, FrameBufPtr, tmpLen); 00365 Length -= tmpLen; 00366 } 00367 if ((DWORD)(TargetPtr + Length - FrameBufPtr) >= DeviceExtension->EmulateInfo.LimitGRAM) { 00368 tmpLen = TargetPtr + Length - FrameBufPtr - DeviceExtension->EmulateInfo.LimitGRAM; 00369 tmpSrc = SourcePtr + Length - tmpLen; 00370 memcpyGRAM(FrameBufPtr, tmpSrc, tmpLen); 00371 Length -= tmpLen; 00372 } 00373 if (Length) { 00374 memcpyGRAM(TargetPtr, SourcePtr, Length); 00375 } 00376 } 00377 } 00378 else { 00379 memcpyGRAM(TargetPtr, SourcePtr, Length); 00380 } 00381 00382 SetGRAMWriteMode(DeviceExtension); 00383 }

PUCHAR NextGRAMRow PUCHAR  BufPtr,
PDEVICE_EXTENSION  DeviceExtension
 

Definition at line 200 of file drawscrn.c.

References _EMULATE_BUFFER_INFORMATION::BytePerLine, _DEVICE_EXTENSION::CurrentMode, DWORD, _DEVICE_EXTENSION::EmulateInfo, and _EMULATE_BUFFER_INFORMATION::LimitGRAM.

Referenced by FsgInvertCursor(), FsgReverseMousePointer(), FsgWriteToScreen(), and FsgWriteToScreenCommonLVB().

00207 : 00208 This Routine add next row a graphics buffer address. 00209 00210 Arguments: 00211 00212 BufPtr - Pointer to graphics buffer. 00213 00214 Return Value: 00215 00216 Returen to graphics buffer address. 00217 00218 --*/ 00219 00220 { 00221 if ((DWORD)(BufPtr + 00222 DeviceExtension->EmulateInfo.BytePerLine - 00223 (PUCHAR)DeviceExtension->CurrentMode.VideoMemory.FrameBufferBase) 00224 >= DeviceExtension->EmulateInfo.LimitGRAM) 00225 return (BufPtr + 00226 DeviceExtension->EmulateInfo.BytePerLine - 00227 DeviceExtension->EmulateInfo.LimitGRAM); 00228 else 00229 return (BufPtr + DeviceExtension->EmulateInfo.BytePerLine); 00230 }

VOID set_opaque_bkgnd_proc PDEVICE_EXTENSION  deviceExtension,
PUCHAR  FrameBuffer,
WORD  Attributes
 

Definition at line 186 of file port.c.

References BYTE, _EMULATE_BUFFER_INFORMATION::ColorBg, _EMULATE_BUFFER_INFORMATION::ColorFg, ColorSetDirect(), _DEVICE_EXTENSION::EmulateInfo, and LOBYTE.

Referenced by FsgWriteToScreen(), and FsgWriteToScreenCommonLVB().

00203 { 00204 BYTE ColorFg = LOBYTE(Attributes) & 0x0f; 00205 BYTE ColorBg = (LOBYTE(Attributes) & 0xf0) >> 4; 00206 00207 if (Attributes & COMMON_LVB_REVERSE_VIDEO) 00208 { 00209 Attributes = ColorBg; 00210 ColorBg = ColorFg; 00211 ColorFg = (BYTE)Attributes; 00212 } 00213 00214 if (deviceExtension->EmulateInfo.ColorFg == ColorFg && 00215 deviceExtension->EmulateInfo.ColorBg == ColorBg) 00216 return; 00217 00218 deviceExtension->EmulateInfo.ColorFg = ColorFg; 00219 deviceExtension->EmulateInfo.ColorBg = ColorBg; 00220 00221 ColorSetDirect(deviceExtension, FrameBuffer, ColorFg, ColorBg); 00222 }

VOID SetGRAMCopyMode PDEVICE_EXTENSION  deviceExtension  ) 
 

Definition at line 121 of file port.c.

References _DEVICE_EXTENSION::DeviceRegisters, DR_SET, GRAPHAddressPort, IND_COLOR_DONT_CARE, IND_DATA_ROTATE, IND_GRAPH_MODE, M_COLOR_READ, and M_LATCH_WRITE.

Referenced by MoveGRAM().

00127 : 00128 00129 This routine sets the copy mode of graphics register. 00130 00131 Arguments: 00132 00133 Return Value: 00134 00135 --*/ 00136 00137 { 00138 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00139 MAKEWORD(IND_GRAPH_MODE, M_LATCH_WRITE+M_COLOR_READ)); 00140 00141 // 00142 // Set up to write data without interacting with the latches. 00143 // 00144 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00145 MAKEWORD(IND_DATA_ROTATE, DR_SET)); 00146 00147 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00148 MAKEWORD(IND_COLOR_DONT_CARE, 0)); 00149 }

VOID SetGRAMInvertMode PDEVICE_EXTENSION  deviceExtension  ) 
 

Definition at line 152 of file port.c.

References BIT_MASK_DEFAULT, _DEVICE_EXTENSION::DeviceRegisters, DR_XOR, GRAPHAddressPort, IND_BIT_MASK, IND_COLOR_DONT_CARE, IND_DATA_ROTATE, IND_GRAPH_MODE, IND_SET_RESET, M_AND_WRITE, and M_COLOR_READ.

Referenced by FsgInvertCursor(), and FsgReverseMousePointer().

00158 : 00159 00160 This routine sets the invert mode of graphics register. 00161 00162 Arguments: 00163 00164 Return Value: 00165 00166 --*/ 00167 00168 { 00169 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00170 MAKEWORD(IND_GRAPH_MODE, M_AND_WRITE+M_COLOR_READ)); 00171 00172 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00173 MAKEWORD(IND_DATA_ROTATE, DR_XOR)); 00174 00175 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00176 MAKEWORD(IND_BIT_MASK, BIT_MASK_DEFAULT)); 00177 00178 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00179 MAKEWORD(IND_COLOR_DONT_CARE, 0)); 00180 00181 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00182 MAKEWORD(IND_SET_RESET, 0xff)); 00183 }

VOID SetGRAMWriteMode PDEVICE_EXTENSION  deviceExtension  ) 
 

Definition at line 81 of file port.c.

References BIT_MASK_DEFAULT, _DEVICE_EXTENSION::DeviceRegisters, DR_SET, GRAPH_ADDR_MASK, GRAPHAddressPort, IND_BIT_MASK, IND_DATA_ROTATE, IND_GRAPH_MODE, IND_MAP_MASK, M_DATA_READ, M_PROC_WRITE, and SEQUAddressPort.

Referenced by FsgInvertCursor(), FsgReverseMousePointer(), FsgVgaInitializeHWFlags(), FsgWriteToScreenCommonLVB(), and MoveGRAM().

00087 : 00088 00089 This routine sets the write mode of graphics register. 00090 00091 Arguments: 00092 00093 Return Value: 00094 00095 --*/ 00096 00097 { 00098 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00099 MAKEWORD(IND_GRAPH_MODE, M_PROC_WRITE+M_DATA_READ)); 00100 00101 // 00102 // Set up to write data without interacting with the latches. 00103 // 00104 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00105 MAKEWORD(IND_DATA_ROTATE, DR_SET)); 00106 00107 // 00108 // Enable all the available EGA planes. 00109 // 00110 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[SEQUAddressPort], 00111 MAKEWORD(IND_MAP_MASK, GRAPH_ADDR_MASK)); 00112 // 00113 // Use all pixel positions. 00114 // 00115 WRITE_PORT_USHORT(deviceExtension->DeviceRegisters[GRAPHAddressPort], 00116 MAKEWORD(IND_BIT_MASK, BIT_MASK_DEFAULT)); 00117 00118 }

NTSTATUS TranslateOutputToOem OUT PCHAR_IMAGE_INFO  OutputBuffer,
IN PCHAR_IMAGE_INFO  InputBuffer,
IN DWORD  Length
 

Definition at line 86 of file w32/ntcon/fullscr/vga/misc.c.

References CHAR, and ConvertOutputToOem().

Referenced by FsVgaWriteToFrameBuffer(), and SrvReadConsoleOutput().

00091 { 00092 CHAR AsciiDbcs[2]; 00093 ULONG NumBytes; 00094 00095 while (Length--) 00096 { 00097 if (InputBuffer->CharInfo.Attributes & COMMON_LVB_LEADING_BYTE) 00098 { 00099 if (Length >= 2) // Safe DBCS in buffer ? 00100 { 00101 Length--; 00102 NumBytes = sizeof(AsciiDbcs); 00103 NumBytes = ConvertOutputToOem(&InputBuffer->CharInfo.Char.UnicodeChar, 00104 1, 00105 &AsciiDbcs[0], 00106 NumBytes); 00107 OutputBuffer->CharInfo.Char.AsciiChar = AsciiDbcs[0]; 00108 OutputBuffer->CharInfo.Attributes = InputBuffer->CharInfo.Attributes; 00109 OutputBuffer++; 00110 InputBuffer++; 00111 OutputBuffer->CharInfo.Char.AsciiChar = AsciiDbcs[1]; 00112 OutputBuffer->CharInfo.Attributes = InputBuffer->CharInfo.Attributes; 00113 OutputBuffer++; 00114 InputBuffer++; 00115 } 00116 else 00117 { 00118 OutputBuffer->CharInfo.Char.AsciiChar = ' '; 00119 OutputBuffer->CharInfo.Attributes = InputBuffer->CharInfo.Attributes & ~COMMON_LVB_SBCSDBCS; 00120 OutputBuffer++; 00121 InputBuffer++; 00122 } 00123 } 00124 else if (! (InputBuffer->CharInfo.Attributes & COMMON_LVB_SBCSDBCS)) 00125 { 00126 ConvertOutputToOem(&InputBuffer->CharInfo.Char.UnicodeChar, 00127 1, 00128 &OutputBuffer->CharInfo.Char.AsciiChar, 00129 1); 00130 OutputBuffer->CharInfo.Attributes = InputBuffer->CharInfo.Attributes; 00131 OutputBuffer++; 00132 InputBuffer++; 00133 } 00134 } 00135 00136 return STATUS_SUCCESS; 00137 }


Generated on Sat May 15 19:43:48 2004 for test by doxygen 1.3.7