[Wine-patches] [eterhack] ntoskrnl.exe: Fix handling unsupported requests (eterbug #6942).
Alexander Morozov
amorozov на etersoft.ru
Ср Мар 9 17:25:49 MSK 2011
----------- следующая часть -----------
From 58aafd3397a9c06afb04ac51e2302c2691701f57 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Wed, 9 Mar 2011 16:40:26 +0300
Subject: [PATCH] ntoskrnl.exe: Fix handling unsupported requests (eterbug #6942).
---
dlls/ntoskrnl.exe/ntoskrnl.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 690ccbf..98597f7 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -1858,6 +1858,14 @@ NTSTATUS WINAPI IoGetDeviceProperty( DEVICE_OBJECT *device, DEVICE_REGISTRY_PROP
}
+static NTSTATUS WINAPI invalid_request_handler( DEVICE_OBJECT *device, IRP *irp )
+{
+ irp->IoStatus.u.Status = STATUS_INVALID_DEVICE_REQUEST;
+ IoCompleteRequest( irp, IO_NO_INCREMENT );
+ return STATUS_INVALID_DEVICE_REQUEST;
+}
+
+
/***********************************************************************
* IoCallDriver (NTOSKRNL.EXE.@)
*/
@@ -1873,6 +1881,8 @@ NTSTATUS WINAPI IoCallDriver( DEVICE_OBJECT *device, IRP *irp )
irpsp = --irp->Tail.Overlay.s.u2.CurrentStackLocation;
irpsp->DeviceObject = device;
dispatch = device->DriverObject->MajorFunction[irpsp->MajorFunction];
+ if (!dispatch)
+ dispatch = invalid_request_handler;
if (TRACE_ON(relay))
DPRINTF( "%04x:Call driver dispatch %p (device=%p,irp=%p)\n",
--
1.7.4.1
Подробная информация о списке рассылки Wine-patches