[Wine-patches] [eterhack] ntoskrnl.exe: Fix hack for Katran key driver (eterbug #3834).

Alexander Morozov =?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Пн Май 25 13:14:36 MSD 2009


Оказывается, хак для драйверов Катран был сломан.
----------- следующая часть -----------
From d05dcbd72c5bb146d4fdbe7e792574c5a4f570a5 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Mon, 25 May 2009 12:48:36 +0400
Subject: [eterhack] ntoskrnl.exe: Fix hack for Katran key driver (eterbug #3834).

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

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index fd371bf..903f383 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -456,17 +456,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
 
     TRACE( "ioctl %x device %p in_size %u out_size %u\n", code, device, in_size, *out_size );
 
-    irp = IoBuildDeviceIoControlRequest( code, device, in_buff, in_size,
-            out_buff, *out_size, FALSE, NULL, &iosb );
-    if (irp == NULL)
-        return STATUS_NO_MEMORY;
-    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
-    irp->RequestorMode = UserMode;
-    irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED;
-    irpsp->DeviceObject = device;
-    device->CurrentIrp = irp;
-
-    /* HACK for UPKey.sys */
+    /* HACK for Katran key driver */
     if (0x3fc == code) offset = 2;
     if (0x222044 == code || 0x44c == code || 0x456 == code) offset = 8;
     if (offset && in_buff)
@@ -481,8 +471,22 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
         }
     }
 
+    irp = IoBuildDeviceIoControlRequest( code, device, in_buff, in_size,
+            out_buff, *out_size, FALSE, NULL, &iosb );
+    if (irp == NULL)
+    {
+        status = STATUS_NO_MEMORY;
+        goto end;
+    }
+    irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation - 1;
+    irp->RequestorMode = UserMode;
+    irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED;
+    irpsp->DeviceObject = device;
+    device->CurrentIrp = irp;
+
     KeQueryTickCount( &count );  /* update the global KeTickCount */
     status = IoCallDriver( device, irp );
+end:
     if (process)
     {
         NtWriteVirtualMemory( process, saved_ptr, data, sizeof(data), NULL );
-- 
1.6.3.1



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