From f290137ce4a0072e427d517f822090e449dfa167 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Sun, 21 Nov 2004 10:59:11 +0000 Subject: [PATCH] properly copy the device map - it's still not initialized properly svn path=/trunk/; revision=11736 --- reactos/ntoskrnl/ob/namespc.c | 7 +++---- reactos/ntoskrnl/ps/process.c | 16 +++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/reactos/ntoskrnl/ob/namespc.c b/reactos/ntoskrnl/ob/namespc.c index 8ccb9aa6281..0b273031430 100644 --- a/reactos/ntoskrnl/ob/namespc.c +++ b/reactos/ntoskrnl/ob/namespc.c @@ -1,4 +1,4 @@ -/* $Id: namespc.c,v 1.49 2004/11/21 06:51:18 ion Exp $ +/* $Id: namespc.c,v 1.50 2004/11/21 10:59:10 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -164,20 +164,19 @@ STDCALL ObQueryDeviceMapInformation(PEPROCESS Process, PPROCESS_DEVICEMAP_INFORMATION DeviceMapInfo) { - PDEVICE_MAP DeviceMap; //KIRQL OldIrql ; /* * FIXME: This is an ugly hack for now, to always return the System Device Map * instead of returning the Process Device Map. Not important yet since we don't use it */ - DeviceMap = ObSystemDeviceMap; /* FIXME: Acquire the DeviceMap Spinlock */ // KeAcquireSpinLock(DeviceMap->Lock, &OldIrql); /* Make a copy */ - RtlMoveMemory(DeviceMapInfo, &DeviceMap->DriveMap, sizeof(DeviceMapInfo->Query)); + DeviceMapInfo->Query.DriveMap = ObSystemDeviceMap->DriveMap; + RtlMoveMemory(DeviceMapInfo->Query.DriveType, ObSystemDeviceMap->DriveType, sizeof(ObSystemDeviceMap->DriveType)); /* FIXME: Release the DeviceMap Spinlock */ // KeReleasepinLock(DeviceMap->Lock, OldIrql); diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index d4ac3075bd3..1690c634bcf 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.153 2004/11/21 06:51:18 ion Exp $ +/* $Id: process.c,v 1.154 2004/11/21 10:59:11 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -1224,13 +1224,15 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle, break; case ProcessDeviceMap: - if (ProcessInformationLength != sizeof(PROCESS_DEVICEMAP_INFORMATION)) { + if (ProcessInformationLength != sizeof(PROCESS_DEVICEMAP_INFORMATION)) + { Status = STATUS_INFO_LENGTH_MISMATCH; - } else { - PPROCESS_DEVICEMAP_INFORMATION DeviceMapInfo; - DeviceMapInfo = (PPROCESS_DEVICEMAP_INFORMATION)ProcessInformation; - ObQueryDeviceMapInformation(Process, DeviceMapInfo); - if (ReturnLength) { + } + else + { + ObQueryDeviceMapInformation(Process, (PPROCESS_DEVICEMAP_INFORMATION)ProcessInformation); + if (ReturnLength) + { *ReturnLength = sizeof(PROCESS_DEVICEMAP_INFORMATION); } }