[Wine-patches] [eter-1.0.10 1/7] ntoskrnl.exe: Improve initialization of MDL.
Alexander Morozov
amorozov на etersoft.ru
Вт Июн 30 15:55:07 MSD 2009
Эта серия патчей портирует поддержку LPT-ключа Катран в eter-1.0.10. Для того,
чтобы всё работало, необходима также последняя версия закрытой части.
----------- следующая часть -----------
From fce5945468494ad41a0d330289bbfd3896e16760 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Fri, 29 May 2009 17:32:12 +0400
Subject: [eter-1.0.10 1/7] 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 8a74616..d78ad0d 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -533,7 +533,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;
@@ -1083,7 +1084,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 3a369ec..081aec1 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.2
Подробная информация о списке рассылки Wine-patches