[Wine-patches] [eter-1.0.12] ntoskrnl.exe: Fix handling unsupported requests (eterbug #6942).

Alexander Morozov amorozov на etersoft.ru
Ср Мар 9 17:04:56 MSK 2011


----------- следующая часть -----------
From 05d11fd242fe64671aa48253bec941085358765c 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 304ac7f..f859995 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -1900,6 +1900,14 @@ NTSTATUS WINAPI IoGetDeviceProperty( PDEVICE_OBJECT DeviceObject,
 }
 
 
+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.@)
  */
@@ -1915,6 +1923,8 @@ NTSTATUS WINAPI IoCallDriver( DEVICE_OBJECT *device, IRP *irp )
     irpsp = --irp->Tail.Overlay.s.u.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