mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 13:05:44 +00:00
- Get beep and blue to compile/link on MSVC.
svn path=/trunk/; revision=20643
This commit is contained in:
parent
fd3573b0ed
commit
5e8ce117ba
2 changed files with 67 additions and 48 deletions
|
@ -199,7 +199,7 @@ BeepDeviceControl(PDEVICE_OBJECT DeviceObject,
|
||||||
FALSE,
|
FALSE,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
else if (BeepParam->Duration == (DWORD)-1)
|
else if (BeepParam->Duration == (ULONG)-1)
|
||||||
{
|
{
|
||||||
if (DeviceExtension->BeepOn == TRUE)
|
if (DeviceExtension->BeepOn == TRUE)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,6 +12,26 @@
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
#include <ntddk.h>
|
#include <ntddk.h>
|
||||||
|
|
||||||
|
/* FIXME: W32API NEEDS TO BE FIXED */
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
/*
|
||||||
|
* Wincon.h can't be included due to missing user-mode types,
|
||||||
|
* so we'll define them here
|
||||||
|
*/
|
||||||
|
typedef ULONG DWORD, *LPDWORD;
|
||||||
|
typedef USHORT UINT, *LPWORD;
|
||||||
|
typedef USHORT WORD;
|
||||||
|
typedef UCHAR BYTE;
|
||||||
|
typedef INT BOOL;
|
||||||
|
typedef PVOID HWND;
|
||||||
|
typedef PVOID LPVOID;
|
||||||
|
#define WINAPI NTAPI
|
||||||
|
#define APIENTRY WINAPI
|
||||||
|
#define WINBASEAPI
|
||||||
|
typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES;
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <wincon.h>
|
#include <wincon.h>
|
||||||
#include <blue/ntddblue.h>
|
#include <blue/ntddblue.h>
|
||||||
#include <ndk/halfuncs.h>
|
#include <ndk/halfuncs.h>
|
||||||
|
@ -19,7 +39,6 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
|
||||||
/* DEFINITIONS ***************************************************************/
|
/* DEFINITIONS ***************************************************************/
|
||||||
|
|
||||||
#define VIDMEM_BASE 0xb8000
|
#define VIDMEM_BASE 0xb8000
|
||||||
|
@ -53,14 +72,14 @@
|
||||||
|
|
||||||
typedef struct _DEVICE_EXTENSION
|
typedef struct _DEVICE_EXTENSION
|
||||||
{
|
{
|
||||||
PBYTE VideoMemory; /* Pointer to video memory */
|
PUCHAR VideoMemory; /* Pointer to video memory */
|
||||||
DWORD CursorSize;
|
ULONG CursorSize;
|
||||||
BOOL CursorVisible;
|
INT CursorVisible;
|
||||||
WORD CharAttribute;
|
USHORT CharAttribute;
|
||||||
DWORD Mode;
|
ULONG Mode;
|
||||||
BYTE ScanLines; /* Height of a text line */
|
UCHAR ScanLines; /* Height of a text line */
|
||||||
WORD Rows; /* Number of rows */
|
USHORT Rows; /* Number of rows */
|
||||||
WORD Columns; /* Number of columns */
|
USHORT Columns; /* Number of columns */
|
||||||
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
|
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,12 +96,12 @@ ScrCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
PHYSICAL_ADDRESS BaseAddress;
|
PHYSICAL_ADDRESS BaseAddress;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
BYTE data, value;
|
UCHAR data, value;
|
||||||
|
|
||||||
DeviceExtension = DeviceObject->DeviceExtension;
|
DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
/* disable interrupts */
|
/* disable interrupts */
|
||||||
__asm__("cli\n\t");
|
_disable();
|
||||||
|
|
||||||
/* get current output position */
|
/* get current output position */
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
||||||
|
@ -113,7 +132,7 @@ ScrCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
DeviceExtension->ScanLines = (READ_PORT_UCHAR (CRTC_DATA) & 0x1F) + 1;
|
DeviceExtension->ScanLines = (READ_PORT_UCHAR (CRTC_DATA) & 0x1F) + 1;
|
||||||
|
|
||||||
/* enable interrupts */
|
/* enable interrupts */
|
||||||
__asm__("sti\n\t");
|
_enable();
|
||||||
|
|
||||||
/* calculate number of text rows */
|
/* calculate number of text rows */
|
||||||
DeviceExtension->Rows =
|
DeviceExtension->Rows =
|
||||||
|
@ -130,7 +149,7 @@ ScrCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
/* get pointer to video memory */
|
/* get pointer to video memory */
|
||||||
BaseAddress.QuadPart = VIDMEM_BASE;
|
BaseAddress.QuadPart = VIDMEM_BASE;
|
||||||
DeviceExtension->VideoMemory =
|
DeviceExtension->VideoMemory =
|
||||||
(PBYTE)MmMapIoSpace (BaseAddress, DeviceExtension->Rows * DeviceExtension->Columns * 2, MmNonCached);
|
(PUCHAR)MmMapIoSpace (BaseAddress, DeviceExtension->Rows * DeviceExtension->Columns * 2, MmNonCached);
|
||||||
|
|
||||||
DeviceExtension->CursorSize = 5; /* FIXME: value correct?? */
|
DeviceExtension->CursorSize = 5; /* FIXME: value correct?? */
|
||||||
DeviceExtension->CursorVisible = TRUE;
|
DeviceExtension->CursorVisible = TRUE;
|
||||||
|
@ -141,14 +160,14 @@ ScrCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
ENABLE_WRAP_AT_EOL_OUTPUT;
|
ENABLE_WRAP_AT_EOL_OUTPUT;
|
||||||
|
|
||||||
/* show blinking cursor */
|
/* show blinking cursor */
|
||||||
__asm__("cli\n\t");
|
_disable();
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORSTART);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORSTART);
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA, (DeviceExtension->ScanLines - 1) & 0x1F);
|
WRITE_PORT_UCHAR (CRTC_DATA, (DeviceExtension->ScanLines - 1) & 0x1F);
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSOREND);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSOREND);
|
||||||
data = READ_PORT_UCHAR (CRTC_DATA) & 0xE0;
|
data = READ_PORT_UCHAR (CRTC_DATA) & 0xE0;
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA,
|
WRITE_PORT_UCHAR (CRTC_DATA,
|
||||||
data | ((DeviceExtension->ScanLines - 1) & 0x1F));
|
data | ((DeviceExtension->ScanLines - 1) & 0x1F));
|
||||||
__asm__("sti\n\t");
|
_enable();
|
||||||
|
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -167,7 +186,7 @@ ScrWrite(PDEVICE_OBJECT DeviceObject,
|
||||||
PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
|
PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
char *pch = Irp->UserBuffer;
|
char *pch = Irp->UserBuffer;
|
||||||
PBYTE vidmem;
|
PUCHAR vidmem;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int j, offset;
|
int j, offset;
|
||||||
int cursorx, cursory;
|
int cursorx, cursory;
|
||||||
|
@ -189,12 +208,12 @@ ScrWrite(PDEVICE_OBJECT DeviceObject,
|
||||||
rows = DeviceExtension->Rows;
|
rows = DeviceExtension->Rows;
|
||||||
columns = DeviceExtension->Columns;
|
columns = DeviceExtension->Columns;
|
||||||
|
|
||||||
__asm__ ("cli\n\t");
|
_disable();
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
||||||
offset = READ_PORT_UCHAR (CRTC_DATA)<<8;
|
offset = READ_PORT_UCHAR (CRTC_DATA)<<8;
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
||||||
offset += READ_PORT_UCHAR (CRTC_DATA);
|
offset += READ_PORT_UCHAR (CRTC_DATA);
|
||||||
__asm__ ("sti\n\t");
|
_enable();
|
||||||
|
|
||||||
cursory = offset / columns;
|
cursory = offset / columns;
|
||||||
cursorx = offset % columns;
|
cursorx = offset % columns;
|
||||||
|
@ -284,13 +303,13 @@ ScrWrite(PDEVICE_OBJECT DeviceObject,
|
||||||
/* Set the cursor position */
|
/* Set the cursor position */
|
||||||
offset = (cursory * columns) + cursorx;
|
offset = (cursory * columns) + cursorx;
|
||||||
}
|
}
|
||||||
__asm__ ("cli\n\t");
|
_disable();
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA, offset);
|
WRITE_PORT_UCHAR (CRTC_DATA, offset);
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
||||||
offset >>= 8;
|
offset >>= 8;
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA, offset);
|
WRITE_PORT_UCHAR (CRTC_DATA, offset);
|
||||||
__asm__ ("sti\n\t");
|
_enable();
|
||||||
|
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -320,12 +339,12 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
|
|
||||||
/* read cursor position from crtc */
|
/* read cursor position from crtc */
|
||||||
__asm__("cli\n\t");
|
_disable();
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
||||||
offset = READ_PORT_UCHAR (CRTC_DATA);
|
offset = READ_PORT_UCHAR (CRTC_DATA);
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
||||||
offset += (READ_PORT_UCHAR (CRTC_DATA) << 8);
|
offset += (READ_PORT_UCHAR (CRTC_DATA) << 8);
|
||||||
__asm__("sti\n\t");
|
_enable();
|
||||||
|
|
||||||
pcsbi->dwSize.X = columns;
|
pcsbi->dwSize.X = columns;
|
||||||
pcsbi->dwSize.Y = rows;
|
pcsbi->dwSize.Y = rows;
|
||||||
|
@ -357,12 +376,12 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
offset = (pcsbi->dwCursorPosition.Y * DeviceExtension->Columns) +
|
offset = (pcsbi->dwCursorPosition.Y * DeviceExtension->Columns) +
|
||||||
pcsbi->dwCursorPosition.X;
|
pcsbi->dwCursorPosition.X;
|
||||||
|
|
||||||
__asm__("cli\n\t");
|
_disable();
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA, offset);
|
WRITE_PORT_UCHAR (CRTC_DATA, offset);
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA, offset>>8);
|
WRITE_PORT_UCHAR (CRTC_DATA, offset>>8);
|
||||||
__asm__("sti\n\t");
|
_enable();
|
||||||
|
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
|
@ -384,8 +403,8 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
case IOCTL_CONSOLE_SET_CURSOR_INFO:
|
case IOCTL_CONSOLE_SET_CURSOR_INFO:
|
||||||
{
|
{
|
||||||
PCONSOLE_CURSOR_INFO pcci = (PCONSOLE_CURSOR_INFO)Irp->AssociatedIrp.SystemBuffer;
|
PCONSOLE_CURSOR_INFO pcci = (PCONSOLE_CURSOR_INFO)Irp->AssociatedIrp.SystemBuffer;
|
||||||
BYTE data, value;
|
UCHAR data, value;
|
||||||
DWORD size, height;
|
ULONG size, height;
|
||||||
|
|
||||||
DeviceExtension->CursorSize = pcci->dwSize;
|
DeviceExtension->CursorSize = pcci->dwSize;
|
||||||
DeviceExtension->CursorVisible = pcci->bVisible;
|
DeviceExtension->CursorVisible = pcci->bVisible;
|
||||||
|
@ -398,16 +417,16 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
size = 1;
|
size = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
data |= (BYTE)(height - size);
|
data |= (UCHAR)(height - size);
|
||||||
|
|
||||||
__asm__("cli\n\t");
|
_disable();
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORSTART);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORSTART);
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA, data);
|
WRITE_PORT_UCHAR (CRTC_DATA, data);
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSOREND);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSOREND);
|
||||||
value = READ_PORT_UCHAR (CRTC_DATA) & 0xE0;
|
value = READ_PORT_UCHAR (CRTC_DATA) & 0xE0;
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA, value | (height - 1));
|
WRITE_PORT_UCHAR (CRTC_DATA, value | (height - 1));
|
||||||
|
|
||||||
__asm__("sti\n\t");
|
_enable();
|
||||||
|
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
|
@ -439,9 +458,9 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
case IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE:
|
case IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE:
|
||||||
{
|
{
|
||||||
POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer;
|
POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer;
|
||||||
PBYTE vidmem;
|
PUCHAR vidmem;
|
||||||
int offset;
|
int offset;
|
||||||
DWORD dwCount;
|
ULONG dwCount;
|
||||||
|
|
||||||
vidmem = DeviceExtension->VideoMemory;
|
vidmem = DeviceExtension->VideoMemory;
|
||||||
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
|
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
|
||||||
|
@ -462,10 +481,10 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
case IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE:
|
case IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE:
|
||||||
{
|
{
|
||||||
POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer;
|
POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer;
|
||||||
PWORD pAttr = (PWORD)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
PUSHORT pAttr = (PUSHORT)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
||||||
PBYTE vidmem;
|
PUCHAR vidmem;
|
||||||
int offset;
|
int offset;
|
||||||
DWORD dwCount;
|
ULONG dwCount;
|
||||||
|
|
||||||
vidmem = DeviceExtension->VideoMemory;
|
vidmem = DeviceExtension->VideoMemory;
|
||||||
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
|
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
|
||||||
|
@ -487,9 +506,9 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
{
|
{
|
||||||
COORD *pCoord = (COORD *)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
COORD *pCoord = (COORD *)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
||||||
CHAR *pAttr = (CHAR *)(pCoord + 1);
|
CHAR *pAttr = (CHAR *)(pCoord + 1);
|
||||||
PBYTE vidmem;
|
PUCHAR vidmem;
|
||||||
int offset;
|
int offset;
|
||||||
DWORD dwCount;
|
ULONG dwCount;
|
||||||
|
|
||||||
vidmem = DeviceExtension->VideoMemory;
|
vidmem = DeviceExtension->VideoMemory;
|
||||||
offset = (pCoord->Y * DeviceExtension->Columns * 2) +
|
offset = (pCoord->Y * DeviceExtension->Columns * 2) +
|
||||||
|
@ -505,7 +524,7 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE:
|
case IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE:
|
||||||
DeviceExtension->CharAttribute = (WORD)*(PWORD)Irp->AssociatedIrp.SystemBuffer;
|
DeviceExtension->CharAttribute = (USHORT)*(PUSHORT)Irp->AssociatedIrp.SystemBuffer;
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
break;
|
break;
|
||||||
|
@ -513,9 +532,9 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
case IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER:
|
case IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER:
|
||||||
{
|
{
|
||||||
POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer;
|
POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer;
|
||||||
PBYTE vidmem;
|
PUCHAR vidmem;
|
||||||
int offset;
|
int offset;
|
||||||
DWORD dwCount;
|
ULONG dwCount;
|
||||||
|
|
||||||
vidmem = DeviceExtension->VideoMemory;
|
vidmem = DeviceExtension->VideoMemory;
|
||||||
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
|
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
|
||||||
|
@ -539,9 +558,9 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
{
|
{
|
||||||
POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer;
|
POUTPUT_CHARACTER Buf = (POUTPUT_CHARACTER)Irp->AssociatedIrp.SystemBuffer;
|
||||||
LPSTR pChar = (LPSTR)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
LPSTR pChar = (LPSTR)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
||||||
PBYTE vidmem;
|
PUCHAR vidmem;
|
||||||
int offset;
|
int offset;
|
||||||
DWORD dwCount;
|
ULONG dwCount;
|
||||||
|
|
||||||
vidmem = DeviceExtension->VideoMemory;
|
vidmem = DeviceExtension->VideoMemory;
|
||||||
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
|
offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) +
|
||||||
|
@ -563,9 +582,9 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
{
|
{
|
||||||
COORD *pCoord;
|
COORD *pCoord;
|
||||||
LPSTR pChar;
|
LPSTR pChar;
|
||||||
PBYTE vidmem;
|
PUCHAR vidmem;
|
||||||
int offset;
|
int offset;
|
||||||
DWORD dwCount;
|
ULONG dwCount;
|
||||||
|
|
||||||
pCoord = (COORD *)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
pCoord = (COORD *)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
||||||
pChar = (CHAR *)(pCoord + 1);
|
pChar = (CHAR *)(pCoord + 1);
|
||||||
|
@ -586,11 +605,11 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
case IOCTL_CONSOLE_DRAW:
|
case IOCTL_CONSOLE_DRAW:
|
||||||
{
|
{
|
||||||
PCONSOLE_DRAW ConsoleDraw;
|
PCONSOLE_DRAW ConsoleDraw;
|
||||||
PBYTE Src, Dest;
|
PUCHAR Src, Dest;
|
||||||
UINT SrcDelta, DestDelta, i, Offset;
|
UINT SrcDelta, DestDelta, i, Offset;
|
||||||
|
|
||||||
ConsoleDraw = (PCONSOLE_DRAW) MmGetSystemAddressForMdl(Irp->MdlAddress);
|
ConsoleDraw = (PCONSOLE_DRAW) MmGetSystemAddressForMdl(Irp->MdlAddress);
|
||||||
Src = (PBYTE) (ConsoleDraw + 1);
|
Src = (PUCHAR) (ConsoleDraw + 1);
|
||||||
SrcDelta = ConsoleDraw->SizeX * 2;
|
SrcDelta = ConsoleDraw->SizeX * 2;
|
||||||
Dest = DeviceExtension->VideoMemory +
|
Dest = DeviceExtension->VideoMemory +
|
||||||
(ConsoleDraw->Y * DeviceExtension->Columns + ConsoleDraw->X) * 2;
|
(ConsoleDraw->Y * DeviceExtension->Columns + ConsoleDraw->X) * 2;
|
||||||
|
@ -606,12 +625,12 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
|
||||||
Offset = (ConsoleDraw->CursorY * DeviceExtension->Columns) +
|
Offset = (ConsoleDraw->CursorY * DeviceExtension->Columns) +
|
||||||
ConsoleDraw->CursorX;
|
ConsoleDraw->CursorX;
|
||||||
|
|
||||||
__asm__("cli\n\t");
|
_disable();
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSLO);
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA, Offset);
|
WRITE_PORT_UCHAR (CRTC_DATA, Offset);
|
||||||
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
WRITE_PORT_UCHAR (CRTC_COMMAND, CRTC_CURSORPOSHI);
|
||||||
WRITE_PORT_UCHAR (CRTC_DATA, Offset >> 8);
|
WRITE_PORT_UCHAR (CRTC_DATA, Offset >> 8);
|
||||||
__asm__("sti\n\t");
|
_enable();
|
||||||
|
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue