Complete the IRP in IRP Pending state and fill the usermode buffers with pool data.
1351{
1353 PIRP Irp;
1355
1356 UNREFERENCED_PARAMETER(Dpc);
1357 UNREFERENCED_PARAMETER(SystemArgument1);
1358 UNREFERENCED_PARAMETER(SystemArgument2);
1359
1360 NotifyRecord = DeferredContext;
1361
1362 ASSERT(NotifyRecord != NULL);
1363 _Analysis_assume_(NotifyRecord != NULL);
1364
1365 switch (NotifyRecord->
Type)
1366 {
1369
1370 if (Irp != NULL)
1371 {
1372 PCHAR OutBuff;
1374 ULONG OutBuffLength;
1375 PIO_STACK_LOCATION IrpSp;
1376
1377
1378
1379
1380 if (!(Irp->CurrentLocation <= Irp->StackCount + 1))
1381 {
1382 DbgPrint("Err, probably two or more functions called DPC for an object");
1383 return;
1384 }
1385
1386 IrpSp = IoGetCurrentIrpStackLocation(Irp);
1387 InBuffLength = IrpSp->Parameters.DeviceIoControl.InputBufferLength;
1388 OutBuffLength = IrpSp->Parameters.DeviceIoControl.OutputBufferLength;
1389
1390 if (!InBuffLength || !OutBuffLength)
1391 {
1392 Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
1393 IoCompleteRequest(Irp, IO_NO_INCREMENT);
1394 break;
1395 }
1396
1397
1398
1399
1400 if (!Irp->AssociatedIrp.SystemBuffer)
1401 {
1402
1403
1404
1405 return;
1406 }
1407
1408 OutBuff = Irp->AssociatedIrp.SystemBuffer;
1409 Length = 0;
1410
1411
1412
1413
1415 {
1416
1417
1418
1419 Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
1420 IoCompleteRequest(Irp, IO_NO_INCREMENT);
1421 break;
1422 }
1423
1424 Irp->IoStatus.Information = Length;
1425
1426 Irp->IoStatus.Status = STATUS_SUCCESS;
1427 IoCompleteRequest(Irp, IO_NO_INCREMENT);
1428 }
1429 break;
1430
1432
1433
1434
1436
1437
1438
1439
1441
1442 break;
1443
1444 default:
1446 break;
1447 }
1448
1449 if (NotifyRecord != NULL)
1450 {
1452 }
1453}
#define FALSE
Definition BasicTypes.h:54
unsigned int UINT32
Definition BasicTypes.h:48
unsigned long ULONG
Definition BasicTypes.h:37
@ EVENT_BASED
Definition DataTypes.h:256
@ IRP_BASED
Definition DataTypes.h:255
BOOLEAN LogReadBuffer(BOOLEAN IsVmxRoot, PVOID BufferToSaveMessage, UINT32 *ReturnedLength)
Attempt to read the buffer.
Definition Logging.c:697
VOID PlatformMemFreePool(PVOID BufferAddress)
Free (dellocate) a non-paged buffer.
Definition Mem.c:86
The usermode request.
Definition Logging.h:40
PIRP PendingIrp
Definition Logging.h:46
NOTIFY_TYPE Type
Definition Logging.h:41
union _NOTIFY_RECORD::@55 Message
PKEVENT Event
Definition Logging.h:45
BOOLEAN CheckVmxRootMessagePool
Definition Logging.h:50