[Wine-patches] [2/3] Revert "ntoskrnl.exe: Fix mountmgr.sys crash."

Alexander Morozov =?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Пт Окт 31 14:56:19 MSK 2008


----------- следующая часть -----------
From f71f9410dca4e0e272b32999735e3fa6c9a2f27d Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Fri, 31 Oct 2008 13:48:47 +0300
Subject: [PATCH] Revert "ntoskrnl.exe: Fix mountmgr.sys crash."

This reverts commit df8e4e787d2b885a9d6b04c1c6391c0a4cfbbf54.
---
 dlls/ntoskrnl.exe/ntoskrnl.c |   34 ++++++++++++++++------------------
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 52139bd..e7a884f 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -152,8 +152,9 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
     --irp->CurrentLocation;
     irpsp = --irp->Tail.Overlay.s.u.CurrentStackLocation;
 
-    if (METHOD_BUFFERED == code & 3)
+    switch (code & 3)
     {
+    case METHOD_BUFFERED:
         buf = ExAllocatePool( NonPagedPool, (*out_size > in_size) ? *out_size : in_size );
         if (buf == NULL)
         {
@@ -162,32 +163,29 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff,
         }
         memcpy( buf, in_buff, in_size );
         irp->AssociatedIrp.SystemBuffer = buf;
-    }
-    else
+        irp->UserBuffer = out_buff;
+        break;
+    case METHOD_NEITHER:
+        irpsp->Parameters.DeviceIoControl.Type3InputBuffer = in_buff;
+        irp->UserBuffer = out_buff;
+        break;
+    default:
         irp->AssociatedIrp.SystemBuffer = in_buff;
-
-    /* When METHOD_BUFFERED is used MdlAddress and Type3InputBuffer
-       are equal to NULL on Windows XP. But we initialize them
-       for compatibility with mountmgr.sys from winehq.org. */
+        irp->MdlAddress = &mdl;
+        mdl.Next = NULL;
+        mdl.Size = 0;
+        mdl.StartVa = out_buff;
+        mdl.ByteCount = *out_size;
+        mdl.ByteOffset = 0;
+    }
 
     irp->RequestorMode = UserMode;
-    irp->UserBuffer = out_buff;
-    irp->MdlAddress = &mdl;
     irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED;
-
     irpsp->MajorFunction = IRP_MJ_DEVICE_CONTROL;
     irpsp->Parameters.DeviceIoControl.OutputBufferLength = *out_size;
     irpsp->Parameters.DeviceIoControl.InputBufferLength = in_size;
     irpsp->Parameters.DeviceIoControl.IoControlCode = code;
-    irpsp->Parameters.DeviceIoControl.Type3InputBuffer = in_buff;
     irpsp->DeviceObject = device;
-
-    mdl.Next = NULL;
-    mdl.Size = 0;
-    mdl.StartVa = out_buff;
-    mdl.ByteCount = *out_size;
-    mdl.ByteOffset = 0;
-
     device->CurrentIrp = irp;
 
     KeQueryTickCount( &count );  /* update the global KeTickCount */
-- 
1.5.6.5.GIT



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