[Wine-patches] [5/8] ntoskrnl.exe: Use __regs_IofCallDriver in process_ioctl.

Alexander Morozov =?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Чт Дек 11 11:47:22 MSK 2008


----------- следующая часть -----------
From 3863cd95eec22011ba0b77a6d08dbfc4cfe0f03d Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Fri, 5 Dec 2008 17:32:03 +0300
Subject: [PATCH] ntoskrnl.exe: Use __regs_IofCallDriver in process_ioctl.

---
 dlls/ntoskrnl.exe/ntoskrnl.c |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 02a4992..fad71b9 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -225,6 +225,8 @@ static LONG WINAPI memory_handler( EXCEPTION_POINTERS* except )
 }
 #endif  /* __i386__ */
 
+NTSTATUS WINAPI __regs_IofCallDriver( DEVICE_OBJECT *device, IRP *irp );
+
 /* process an ioctl request for a given device */
 static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, ULONG in_size,
                                void *out_buff, ULONG *out_size )
@@ -232,7 +234,6 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
     PIRP irp;
     MDL mdl;
     PIO_STACK_LOCATION irpsp;
-    PDRIVER_DISPATCH dispatch = device->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL];
     NTSTATUS status;
     LARGE_INTEGER count;
     CHAR *buf = NULL;
@@ -249,9 +250,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
     irp = IoAllocateIrp( device->StackSize, FALSE );
     if (irp == NULL)
         return STATUS_UNSUCCESSFUL;
-
-    --irp->CurrentLocation;
-    irpsp = --irp->Tail.Overlay.s.u.CurrentStackLocation;
+    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
 
     switch (code & 3)
     {
@@ -290,17 +289,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
     device->CurrentIrp = irp;
 
     KeQueryTickCount( &count );  /* update the global KeTickCount */
-
-    if (TRACE_ON(relay))
-        DPRINTF( "%04x:Call driver dispatch %p (device=%p,irp=%p)\n",
-                 GetCurrentThreadId(), dispatch, device, irp );
-
-    status = dispatch( device, irp );
-
-    if (TRACE_ON(relay))
-        DPRINTF( "%04x:Ret  driver dispatch %p (device=%p,irp=%p) retval=%08x\n",
-                 GetCurrentThreadId(), dispatch, device, irp, status );
-
+    __regs_IofCallDriver( device, irp );
     status = irp->IoStatus.u.Status;
     *out_size = (status >= 0) ? irp->IoStatus.Information : 0;
     IoFreeIrp( irp );
-- 
1.6.0.2.GIT



Подробная информация о списке рассылки Wine-patches