[Wine-patches] [1/2] Revert "ntdll: Use additional buffers in COMM_DeviceIoControl (eterbug #2827)."
Alexander Morozov
=?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Ср Фев 4 14:17:47 MSK 2009
----------- следующая часть -----------
From d1ebd0c47ad2bd7eabd37312f8f79b6f26674810 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Wed, 4 Feb 2009 13:16:34 +0300
Subject: [PATCH] Revert "ntdll: Use additional buffers in COMM_DeviceIoControl (eterbug #2827)."
This reverts commit dd76cb51c646188c6fe63ce1c33d2e878ceb75d0.
---
dlls/ntdll/serial.c | 21 +++++----------------
1 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c
index 55eeb77..3fae4ac 100644
--- a/dlls/ntdll/serial.c
+++ b/dlls/ntdll/serial.c
@@ -1344,12 +1344,7 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
LPVOID lpInBuffer, DWORD nInBufferSize,
LPVOID lpOutBuffer, DWORD nOutBufferSize)
{
- NTSTATUS status = STATUS_NO_MEMORY;
- void *in_buff = RtlAllocateHeap(GetProcessHeap(), 0, nInBufferSize);
- void *out_buff = RtlAllocateHeap(GetProcessHeap(), 0, nOutBufferSize);
-
- if (!in_buff || !out_buff) goto done;
- memcpy(in_buff, lpInBuffer, nInBufferSize);
+ NTSTATUS status;
if (dwIoControlCode == IOCTL_SERIAL_WAIT_ON_MASK)
{
@@ -1374,8 +1369,8 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
if (status) goto done;
}
status = io_control(hDevice, hev, UserApcRoutine, UserApcContext,
- piosb, dwIoControlCode, in_buff, nInBufferSize,
- out_buff, nOutBufferSize);
+ piosb, dwIoControlCode, lpInBuffer, nInBufferSize,
+ lpOutBuffer, nOutBufferSize);
if (hev != hEvent)
{
if (status == STATUS_PENDING)
@@ -1387,14 +1382,8 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
}
}
else status = io_control(hDevice, hEvent, UserApcRoutine, UserApcContext,
- piosb, dwIoControlCode, in_buff, nInBufferSize,
- out_buff, nOutBufferSize);
+ piosb, dwIoControlCode, lpInBuffer, nInBufferSize,
+ lpOutBuffer, nOutBufferSize);
done:
- if (in_buff) RtlFreeHeap(GetProcessHeap(), 0, in_buff);
- if (out_buff)
- {
- memcpy(lpOutBuffer, out_buff, nOutBufferSize);
- RtlFreeHeap(GetProcessHeap(), 0, out_buff);
- }
return status;
}
--
1.6.0.2.GIT
Подробная информация о списке рассылки Wine-patches