851{
855
857 {
859 {
861
862
864 {
866 break;
867 }
869
871
872
875 Irp->IoStatus.Information = 0;
876 break;
877 }
878
880 {
882 USHORT rows = DeviceExtension->Rows;
883 USHORT columns = DeviceExtension->Columns;
884
885
887 {
889 break;
890 }
892
895
898
901
902 pcsbi->
wAttributes = DeviceExtension->CharAttribute;
903
908
911
914 break;
915 }
916
918 {
920
921
923 {
925 break;
926 }
928
930
933 {
934 Irp->IoStatus.Information = 0;
936 break;
937 }
938
939 DeviceExtension->CharAttribute = pcsbi->
wAttributes;
940
941
946 if (DeviceExtension->Enabled)
948
949 Irp->IoStatus.Information = 0;
951 break;
952 }
953
955 {
957
958
960 {
962 break;
963 }
965
968
969 pcci->
dwSize = DeviceExtension->CursorSize;
970 pcci->
bVisible = DeviceExtension->CursorVisible;
971
974 break;
975 }
976
978 {
980
981
983 {
985 break;
986 }
988
990
991 DeviceExtension->CursorSize = pcci->
dwSize;
992 DeviceExtension->CursorVisible = pcci->
bVisible;
993 if (DeviceExtension->Enabled)
995
996 Irp->IoStatus.Information = 0;
998 break;
999 }
1000
1002 {
1004
1005
1007 {
1009 break;
1010 }
1011 ASSERT(
Irp->AssociatedIrp.SystemBuffer);
1012
1015
1016 pcm->
dwMode = DeviceExtension->Mode;
1017
1020 break;
1021 }
1022
1024 {
1026
1027
1029 {
1031 break;
1032 }
1033 ASSERT(
Irp->AssociatedIrp.SystemBuffer);
1034
1036 DeviceExtension->Mode = pcm->
dwMode;
1037
1038 Irp->IoStatus.Information = 0;
1040 break;
1041 }
1042
1044 {
1050
1051
1054 {
1056 break;
1057 }
1058 ASSERT(
Irp->AssociatedIrp.SystemBuffer);
1059
1062
1065
1068 nMaxLength == 0 )
1069 {
1071 break;
1072 }
1073
1074 if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
1075 {
1077
1078 vidmem = DeviceExtension->VideoMemory;
1080
1081 nMaxLength =
min(nMaxLength,
1082 (DeviceExtension->Rows - Buf->
dwCoord.
Y)
1083 * DeviceExtension->Columns - Buf->
dwCoord.
X);
1084
1085 for (dwCount = 0; dwCount < nMaxLength; dwCount++)
1086 {
1088 }
1090 }
1091
1093 break;
1094 }
1095
1097 {
1104
1105
1107 {
1109 break;
1110 }
1111 ASSERT(
Irp->AssociatedIrp.SystemBuffer);
1112
1114 Irp->IoStatus.Information = 0;
1115
1116
1118 {
1120 break;
1121 }
1125 {
1127 break;
1128 }
1129
1132 {
1134 break;
1135 }
1136
1138 nMaxLength /=
sizeof(
USHORT);
1139
1140 if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
1141 {
1142 vidmem = DeviceExtension->VideoMemory;
1144
1145 nMaxLength =
min(nMaxLength,
1146 (DeviceExtension->Rows - Buf->
dwCoord.
Y)
1147 * DeviceExtension->Columns - Buf->
dwCoord.
X);
1148
1149 for (dwCount = 0; dwCount < nMaxLength; dwCount++, pAttr++)
1150 {
1152 }
1153 Irp->IoStatus.Information = dwCount *
sizeof(
USHORT);
1154 }
1155
1157 break;
1158 }
1159
1161 {
1169
1170
1171
1172
1173
1174
1175
1177 {
1179 break;
1180 }
1184 {
1186 break;
1187 }
1188
1189 dwCoord = *pCoord;
1190
1192 nMaxLength /=
sizeof(
USHORT);
1193
1194 Irp->IoStatus.Information = 0;
1195
1196 if ( dwCoord.
X < 0 || dwCoord.
X >= DeviceExtension->Columns ||
1197 dwCoord.
Y < 0 || dwCoord.
Y >= DeviceExtension->Rows ||
1198 nMaxLength == 0 )
1199 {
1201 break;
1202 }
1203
1204 pAttr = (
PUSHORT)(pCoord + 1);
1205
1206 if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
1207 {
1208 vidmem = DeviceExtension->VideoMemory;
1209 offset = (dwCoord.
X + dwCoord.
Y * DeviceExtension->Columns) * 2 + 1;
1210
1211 nMaxLength =
min(nMaxLength,
1212 (DeviceExtension->Rows - dwCoord.
Y)
1213 * DeviceExtension->Columns - dwCoord.
X);
1214
1215 for (dwCount = 0; dwCount < nMaxLength; dwCount++, pAttr++)
1216 {
1218 }
1219 Irp->IoStatus.Information = dwCount *
sizeof(
USHORT);
1220 }
1221
1223 break;
1224 }
1225
1227 {
1228
1230 {
1232 break;
1233 }
1234 ASSERT(
Irp->AssociatedIrp.SystemBuffer);
1235
1236 DeviceExtension->CharAttribute = *(
PUSHORT)
Irp->AssociatedIrp.SystemBuffer;
1237
1238 Irp->IoStatus.Information = 0;
1240 break;
1241 }
1242
1244 {
1250
1251
1254 {
1256 break;
1257 }
1258 ASSERT(
Irp->AssociatedIrp.SystemBuffer);
1259
1262
1265
1268 nMaxLength == 0 )
1269 {
1271 break;
1272 }
1273
1274 if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
1275 {
1277
1278 vidmem = DeviceExtension->VideoMemory;
1280
1281 nMaxLength =
min(nMaxLength,
1282 (DeviceExtension->Rows - Buf->
dwCoord.
Y)
1283 * DeviceExtension->Columns - Buf->
dwCoord.
X);
1284
1285 for (dwCount = 0; dwCount < nMaxLength; dwCount++)
1286 {
1288 }
1290 }
1291
1293 break;
1294 }
1295
1297 {
1304
1305
1307 {
1309 break;
1310 }
1311 ASSERT(
Irp->AssociatedIrp.SystemBuffer);
1312
1314 Irp->IoStatus.Information = 0;
1315
1316
1318 {
1320 break;
1321 }
1325 {
1327 break;
1328 }
1329
1332 {
1334 break;
1335 }
1336
1338
1339 if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
1340 {
1341 vidmem = DeviceExtension->VideoMemory;
1343
1344 nMaxLength =
min(nMaxLength,
1345 (DeviceExtension->Rows - Buf->
dwCoord.
Y)
1346 * DeviceExtension->Columns - Buf->
dwCoord.
X);
1347
1348 for (dwCount = 0; dwCount < nMaxLength; dwCount++, pChar++)
1349 {
1351 }
1352 Irp->IoStatus.Information = dwCount *
sizeof(
CHAR);
1353 }
1354
1356 break;
1357 }
1358
1360 {
1368
1369
1370
1371
1372
1373
1374
1376 {
1378 break;
1379 }
1383 {
1385 break;
1386 }
1387
1388 dwCoord = *pCoord;
1389
1391 Irp->IoStatus.Information = 0;
1392
1393 if ( dwCoord.
X < 0 || dwCoord.
X >= DeviceExtension->Columns ||
1394 dwCoord.
Y < 0 || dwCoord.
Y >= DeviceExtension->Rows ||
1395 nMaxLength == 0 )
1396 {
1398 break;
1399 }
1400
1401 pChar = (
PCHAR)(pCoord + 1);
1402
1403 if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
1404 {
1405 vidmem = DeviceExtension->VideoMemory;
1406 offset = (dwCoord.
X + dwCoord.
Y * DeviceExtension->Columns) * 2;
1407
1408 nMaxLength =
min(nMaxLength,
1409 (DeviceExtension->Rows - dwCoord.
Y)
1410 * DeviceExtension->Columns - dwCoord.
X);
1411
1412 for (dwCount = 0; dwCount < nMaxLength; dwCount++, pChar++)
1413 {
1415 }
1416 Irp->IoStatus.Information = dwCount *
sizeof(
CHAR);
1417 }
1418
1420 break;
1421 }
1422
1424 {
1428 UINT32 SrcDelta, DestDelta,
i;
1429
1430
1432 {
1434 break;
1435 }
1438 if (pConsoleDraw ==
NULL)
1439 {
1441 break;
1442 }
1443
1444 ConsoleDraw = *pConsoleDraw;
1445
1446
1449 {
1451 break;
1452 }
1453
1454 Irp->IoStatus.Information = 0;
1455
1456
1457 DeviceExtension->CursorX =
min(
max(ConsoleDraw.
CursorX, 0), DeviceExtension->Columns - 1);
1458 DeviceExtension->CursorY =
min(
max(ConsoleDraw.
CursorY, 0), DeviceExtension->Rows - 1);
1459 if (DeviceExtension->Enabled)
1461
1462
1463
1464
1465 if ( ConsoleDraw.
X < 0 || ConsoleDraw.
X >= DeviceExtension->Columns ||
1466 ConsoleDraw.
Y < 0 || ConsoleDraw.
Y >= DeviceExtension->Rows )
1467 {
1469 break;
1470 }
1471 if ( ConsoleDraw.
SizeX > DeviceExtension->Columns - ConsoleDraw.
X ||
1472 ConsoleDraw.
SizeY > DeviceExtension->Rows - ConsoleDraw.
Y )
1473 {
1475 break;
1476 }
1477
1478 if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
1479 {
1480 Src = (
PUCHAR)(pConsoleDraw + 1);
1481 SrcDelta = ConsoleDraw.
SizeX * 2;
1482 Dest = DeviceExtension->VideoMemory +
1483 (ConsoleDraw.
X + ConsoleDraw.
Y * DeviceExtension->Columns) * 2;
1484 DestDelta = DeviceExtension->Columns * 2;
1485
1486
1487
1488 for (
i = 0;
i < ConsoleDraw.
SizeY;
i++)
1489 {
1491 Src += SrcDelta;
1492 Dest += DestDelta;
1493 }
1494 }
1495
1497 break;
1498 }
1499
1501 {
1502
1503
1504
1505
1506
1508 {
1510 break;
1511 }
1512 ASSERT(
Irp->AssociatedIrp.SystemBuffer);
1513
1514 if (DeviceExtension->FontBitfield)
1517 if (!DeviceExtension->FontBitfield)
1518 {
1520 break;
1521 }
1522 RtlCopyMemory(DeviceExtension->FontBitfield,
Irp->AssociatedIrp.SystemBuffer, 256 * 8);
1523
1524
1525 if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
1527
1528 Irp->IoStatus.Information = 0;
1530 break;
1531 }
1532
1533 default:
1535 }
1536
1539
1541}
static VOID FASTCALL ScrSetCursorShape(_In_ PDEVICE_EXTENSION DeviceExtension)
static VOID FASTCALL ScrSetCursor(_In_ PDEVICE_EXTENSION DeviceExtension)
struct tagCONSOLE_SCREEN_BUFFER_INFO CONSOLE_SCREEN_BUFFER_INFO
struct tagCONSOLE_CURSOR_INFO CONSOLE_CURSOR_INFO
struct tagCONSOLE_CURSOR_INFO * PCONSOLE_CURSOR_INFO
struct tagCONSOLE_SCREEN_BUFFER_INFO * PCONSOLE_SCREEN_BUFFER_INFO
#define ExAllocatePoolWithTag(hernya, size, tag)
#define ExFreePoolWithTag(_P, _T)
#define IOCTL_CONSOLE_DRAW
struct tagOUTPUT_ATTRIBUTE * POUTPUT_ATTRIBUTE
#define IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE
#define IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER
struct tagOUTPUT_ATTRIBUTE OUTPUT_ATTRIBUTE
struct tagOUTPUT_CHARACTER * POUTPUT_CHARACTER
struct tagOUTPUT_CHARACTER OUTPUT_CHARACTER
#define IOCTL_CONSOLE_GET_MODE
#define IOCTL_CONSOLE_LOADFONT
#define IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER
#define IOCTL_CONSOLE_READ_OUTPUT_CHARACTER
#define IOCTL_CONSOLE_SET_MODE
#define IOCTL_CONSOLE_RESET_SCREEN
#define IOCTL_CONSOLE_WRITE_OUTPUT_ATTRIBUTE
struct tagCONSOLE_MODE CONSOLE_MODE
#define IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE
struct tagCONSOLE_MODE * PCONSOLE_MODE
#define IOCTL_CONSOLE_GET_CURSOR_INFO
#define IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO
#define IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO
#define IOCTL_CONSOLE_SET_CURSOR_INFO
#define IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
#define STATUS_INVALID_BUFFER_SIZE
struct _IO_STACK_LOCATION::@1584::@1585 DeviceIoControl
union _IO_STACK_LOCATION::@1584 Parameters
COORD dwMaximumWindowSize
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
#define IO_VIDEO_INCREMENT
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)