[Wine-patches] [eterhack 2/3] ntoskrnl.exe: Improve initialization of MDL.
Alexander Morozov
=?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Пт Май 29 18:23:16 MSD 2009
----------- следующая часть -----------
From a225ad696d7184bc60e5d2380c0d4bad9d24d763 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Fri, 29 May 2009 17:32:12 +0400
Subject: [eterhack 2/3] ntoskrnl.exe: Improve initialization of MDL.
---
dlls/ntoskrnl.exe/ntoskrnl.c | 6 ++++--
include/ddk/wdm.h | 15 +++++++++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index a05f419..c96ccc0 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -593,7 +593,8 @@ static NTSTATUS process_read( DEVICE_OBJECT *device, void *buff, ULONG *size )
if (device->Flags & DO_DIRECT_IO)
{
mdl.Next = NULL;
- mdl.Size = 0;
+ mdl.Size = sizeof(mdl);
+ mdl.MdlFlags = MDL_PAGES_LOCKED;
mdl.StartVa = buff;
mdl.MappedSystemVa = buff;
mdl.ByteCount = *size;
@@ -1143,7 +1144,8 @@ PIRP WINAPI IoBuildDeviceIoControlRequest( ULONG IoControlCode,
if (mdl == NULL)
goto err;
mdl->Next = NULL;
- mdl->Size = 0;
+ mdl->Size = sizeof(mdl);
+ mdl->MdlFlags = MDL_PAGES_LOCKED;
mdl->StartVa = OutputBuffer;
mdl->MappedSystemVa = OutputBuffer;
mdl->ByteCount = OutputBufferLength;
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 1e01dc3..9b55ac8 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -951,6 +951,21 @@ typedef struct _MDL {
ULONG ByteOffset;
} MDL, *PMDL;
+#define MDL_MAPPED_TO_SYSTEM_VA 0x0001
+#define MDL_PAGES_LOCKED 0x0002
+#define MDL_SOURCE_IS_NONPAGED_POOL 0x0004
+#define MDL_ALLOCATED_FIXED_SIZE 0x0008
+#define MDL_PARTIAL 0x0010
+#define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020
+#define MDL_IO_PAGE_READ 0x0040
+#define MDL_WRITE_OPERATION 0x0080
+#define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100
+#define MDL_FREE_EXTRA_PTES 0x0200
+#define MDL_IO_SPACE 0x0800
+#define MDL_NETWORK_HEADER 0x1000
+#define MDL_MAPPING_CAN_FAIL 0x2000
+#define MDL_ALLOCATED_MUST_SUCCEED 0x4000
+
typedef struct _KTIMER {
DISPATCHER_HEADER Header;
ULARGE_INTEGER DueTime;
--
1.6.3.1
Подробная информация о списке рассылки Wine-patches