ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2019
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
36 participants
217 discussions
Start a n
N
ew thread
[reactos] 01/01: [NTOS:IO] Send IRPs to the correct device in IoVolumeDeviceToDosName. CORE-15415
by Thomas Faber
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d605b5063fa4e659b371f…
commit d605b5063fa4e659b371fbd4a37a85953dea6039 Author: Thomas Faber <thomas.faber(a)reactos.org> AuthorDate: Fri Mar 29 09:08:36 2019 +0100 Commit: Thomas Faber <thomas.faber(a)reactos.org> CommitDate: Sat Mar 30 10:13:27 2019 +0100 [NTOS:IO] Send IRPs to the correct device in IoVolumeDeviceToDosName. CORE-15415 --- modules/rostests/kmtests/CMakeLists.txt | 1 + modules/rostests/kmtests/kmtest_drv/testlist.c | 2 + modules/rostests/kmtests/ntos_io/IoVolume.c | 122 +++++++++++++++++++++++++ ntoskrnl/io/iomgr/volume.c | 4 +- 4 files changed, 127 insertions(+), 2 deletions(-) diff --git a/modules/rostests/kmtests/CMakeLists.txt b/modules/rostests/kmtests/CMakeLists.txt index 8d56d61b2d..c12751eaa0 100644 --- a/modules/rostests/kmtests/CMakeLists.txt +++ b/modules/rostests/kmtests/CMakeLists.txt @@ -67,6 +67,7 @@ list(APPEND KMTEST_DRV_SOURCE ntos_io/IoInterrupt.c ntos_io/IoIrp.c ntos_io/IoMdl.c + ntos_io/IoVolume.c ntos_ke/KeApc.c ntos_ke/KeDevQueue.c ntos_ke/KeDpc.c diff --git a/modules/rostests/kmtests/kmtest_drv/testlist.c b/modules/rostests/kmtests/kmtest_drv/testlist.c index 11d63bbad2..3dc3a6d0fc 100644 --- a/modules/rostests/kmtests/kmtest_drv/testlist.c +++ b/modules/rostests/kmtests/kmtest_drv/testlist.c @@ -33,6 +33,7 @@ KMT_TESTFUNC Test_IoFilesystem; KMT_TESTFUNC Test_IoInterrupt; KMT_TESTFUNC Test_IoIrp; KMT_TESTFUNC Test_IoMdl; +KMT_TESTFUNC Test_IoVolume; KMT_TESTFUNC Test_KeApc; KMT_TESTFUNC Test_KeDeviceQueue; KMT_TESTFUNC Test_KeDpc; @@ -106,6 +107,7 @@ const KMT_TEST TestList[] = { "IoInterrupt", Test_IoInterrupt }, { "IoIrp", Test_IoIrp }, { "IoMdl", Test_IoMdl }, + { "IoVolume", Test_IoVolume }, { "KeApc", Test_KeApc }, { "KeDeviceQueue", Test_KeDeviceQueue }, { "KeDpc", Test_KeDpc }, diff --git a/modules/rostests/kmtests/ntos_io/IoVolume.c b/modules/rostests/kmtests/ntos_io/IoVolume.c new file mode 100644 index 0000000000..ad862f49aa --- /dev/null +++ b/modules/rostests/kmtests/ntos_io/IoVolume.c @@ -0,0 +1,122 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: Kernel-Mode Test Suite Volume Device test + * COPYRIGHT: Copyright 2019 Thomas Faber (thomas.faber(a)reactos.org) + */ + +#include <kmt_test.h> + +static +NTSTATUS +GetNextVolumeDevice( + _Inout_ PUNICODE_STRING VolumeDeviceName, + _Inout_ PULONG VolumeNumber, + _In_ NTSTATUS PreviousStatus) +{ + NTSTATUS Status; + +#ifndef __REACTOS__ + *VolumeNumber++; + Status = RtlStringCbPrintfW(VolumeDeviceName->Buffer, + VolumeDeviceName->MaximumLength, + L"\\Device\\HarddiskVolume%lu", + *VolumeNumber); +#else + /* ROS's storage stack is old an broken, we don't have HarddiskVolumeN */ + ULONG DiskNumber, PartitionNumber; + DiskNumber = *VolumeNumber >> 16; + PartitionNumber = *VolumeNumber & 0xffff; + if (!NT_SUCCESS(PreviousStatus)) + { + if (PartitionNumber == 1) + { + /* Looks like this disk doesn't exist (or has no partitions), + * so we're done */ + return STATUS_NO_MORE_ENTRIES; + } + DiskNumber++; + PartitionNumber = 0; + } + PartitionNumber++; + Status = RtlStringCbPrintfW(VolumeDeviceName->Buffer, + VolumeDeviceName->MaximumLength, + L"\\Device\\Harddisk%lu\\Partition%lu", + DiskNumber, + PartitionNumber); + *VolumeNumber = DiskNumber << 16 | PartitionNumber; +#endif + return Status; +} + +static +void +TestIoVolumeDeviceToDosName(void) +{ + NTSTATUS Status; + ULONG VolumeNumber; + WCHAR VolumeDeviceNameBuffer[32]; + UNICODE_STRING VolumeDeviceName; + PFILE_OBJECT FileObject; + PDEVICE_OBJECT DeviceObject; + UNICODE_STRING DosName; + UNICODE_STRING DosVolumePrefix = RTL_CONSTANT_STRING(L"\\\\?\\Volume"); + + RtlInitEmptyUnicodeString(&VolumeDeviceName, + VolumeDeviceNameBuffer, + sizeof(VolumeDeviceNameBuffer)); + VolumeNumber = 0; + Status = STATUS_SUCCESS; + while (1) + { + Status = GetNextVolumeDevice(&VolumeDeviceName, + &VolumeNumber, + Status); + if (!NT_SUCCESS(Status)) + { + trace("GetNextVolumeDevice(0x%lx) failed with %lx\n", + VolumeNumber, Status); + break; + } + + RtlInitUnicodeString(&VolumeDeviceName, VolumeDeviceNameBuffer); + Status = IoGetDeviceObjectPointer(&VolumeDeviceName, + READ_CONTROL, + &FileObject, + &DeviceObject); + if (!NT_SUCCESS(Status)) + { + trace("IoGetDeviceObjectPointer(%wZ) failed with %lx\n", + &VolumeDeviceName, Status); + continue; + } + + Status = IoVolumeDeviceToDosName(DeviceObject, &DosName); + ok_eq_hex(Status, STATUS_SUCCESS); + if (!skip(NT_SUCCESS(Status), "No DOS name\n")) + { + trace("DOS name for %wZ is %wZ\n", &VolumeDeviceName, &DosName); + if (DosName.Length == 2 * sizeof(WCHAR)) + { + ok(DosName.Buffer[0] >= L'A' && + DosName.Buffer[0] <= L'Z' && + DosName.Buffer[1] == L':', + "Unexpected drive letter: %wZ\n", &DosName); + } + else + { + ok(RtlPrefixUnicodeString(&DosVolumePrefix, &DosName, FALSE), + "Unexpected volume path: %wZ\n", &DosName); + } + RtlFreeUnicodeString(&DosName); + } + ObDereferenceObject(FileObject); + Status = STATUS_SUCCESS; + } + ok(VolumeNumber > 1, "No volumes found\n"); +} + +START_TEST(IoVolume) +{ + TestIoVolumeDeviceToDosName(); +} diff --git a/ntoskrnl/io/iomgr/volume.c b/ntoskrnl/io/iomgr/volume.c index d5ab2ec17d..6c2e3191e9 100644 --- a/ntoskrnl/io/iomgr/volume.c +++ b/ntoskrnl/io/iomgr/volume.c @@ -1346,7 +1346,7 @@ IoVolumeDeviceToDosName(IN PVOID VolumeDeviceObject, goto DereferenceFO; } - Status = IoCallDriver(VolumeDeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -1396,7 +1396,7 @@ IoVolumeDeviceToDosName(IN PVOID VolumeDeviceObject, goto ReleaseMemory; } - Status = IoCallDriver(VolumeDeviceObject, Irp); + Status = IoCallDriver(DeviceObject, Irp); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
5 years, 8 months
1
0
0
0
[reactos] 01/01: [MEH] Forgot that file :-(
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3a5063948ed8d2248f278…
commit 3a5063948ed8d2248f2785d2abed7e82f1cc893c Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri Mar 29 21:51:41 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri Mar 29 21:51:41 2019 +0100 [MEH] Forgot that file :-( --- ntoskrnl/include/internal/io.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ntoskrnl/include/internal/io.h b/ntoskrnl/include/internal/io.h index 7e93ca8856..14a427973b 100644 --- a/ntoskrnl/include/internal/io.h +++ b/ntoskrnl/include/internal/io.h @@ -934,6 +934,12 @@ IopUnloadDevice( IN PDEVICE_OBJECT DeviceObject ); +PDEVICE_OBJECT +NTAPI +IopGetDeviceAttachmentBase( + IN PDEVICE_OBJECT DeviceObject +); + // // IRP Routines //
5 years, 8 months
1
0
0
0
[reactos] 02/02: [NTOSKRNL] We don't need an event if we don't issue an IRP
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef8b1a1907a4601ba5723…
commit ef8b1a1907a4601ba57231949a57147173fac9ff Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri Mar 29 21:47:34 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri Mar 29 21:47:34 2019 +0100 [NTOSKRNL] We don't need an event if we don't issue an IRP --- ntoskrnl/io/iomgr/iofunc.c | 67 ++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index 5831b55896..627ff9644b 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -4164,18 +4164,6 @@ NtQueryVolumeInformationFile(IN HANDLE FileHandle, return Status; } } - else - { - /* Use local event */ - Event = ExAllocatePoolWithTag(NonPagedPool, sizeof(KEVENT), TAG_IO); - if (!Event) - { - ObDereferenceObject(FileObject); - return STATUS_INSUFFICIENT_RESOURCES; - } - KeInitializeEvent(Event, SynchronizationEvent, FALSE); - LocalEvent = TRUE; - } /* * Quick path for FileFsDeviceInformation - the kernel has enough @@ -4203,18 +4191,29 @@ NtQueryVolumeInformationFile(IN HANDLE FileHandle, } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - /* Cleanup */ - IopCleanupAfterException(FileObject, NULL, NULL, Event); + /* Check if we had a file lock */ + if (BooleanFlagOn(FileObject->Flags, FO_SYNCHRONOUS_IO)) + { + /* Release it */ + IopUnlockFileObject(FileObject); + } + + /* Dereference the FO */ + ObDereferenceObject(FileObject); + _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; - /* - * We didn't have an exception, but we didn't issue an IRP - * to complete either, so avoid duplicating code and - * call appropriate helper - */ - IopCleanupAfterException(FileObject, NULL, NULL, Event); + /* Check if we had a file lock */ + if (BooleanFlagOn(FileObject->Flags, FO_SYNCHRONOUS_IO)) + { + /* Release it */ + IopUnlockFileObject(FileObject); + } + + /* Dereference the FO */ + ObDereferenceObject(FileObject); return STATUS_SUCCESS; } @@ -4258,16 +4257,32 @@ NtQueryVolumeInformationFile(IN HANDLE FileHandle, ExFreePoolWithTag(DriverPathInfo, TAG_IO); } - /* - * We didn't have an exception, but we didn't issue an IRP - * to complete either, so avoid duplicating code and - * call appropriate helper - */ - IopCleanupAfterException(FileObject, NULL, NULL, Event); + /* Check if we had a file lock */ + if (BooleanFlagOn(FileObject->Flags, FO_SYNCHRONOUS_IO)) + { + /* Release it */ + IopUnlockFileObject(FileObject); + } + + /* Dereference the FO */ + ObDereferenceObject(FileObject); return Status; } + if (!BooleanFlagOn(FileObject->Flags, FO_SYNCHRONOUS_IO)) + { + /* Use local event */ + Event = ExAllocatePoolWithTag(NonPagedPool, sizeof(KEVENT), TAG_IO); + if (!Event) + { + ObDereferenceObject(FileObject); + return STATUS_INSUFFICIENT_RESOURCES; + } + KeInitializeEvent(Event, SynchronizationEvent, FALSE); + LocalEvent = TRUE; + } + /* Get the device object */ DeviceObject = IoGetRelatedDeviceObject(FileObject);
5 years, 8 months
1
0
0
0
[reactos] 01/02: [NTOSKRNL] Implement support for FileFsDriverPathInformation in NtQueryVolumeInformationFile
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=28ba29e4576541efa6ba9…
commit 28ba29e4576541efa6ba9bd07fc4e0381b719bbe Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri Mar 29 21:42:42 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri Mar 29 21:42:42 2019 +0100 [NTOSKRNL] Implement support for FileFsDriverPathInformation in NtQueryVolumeInformationFile --- ntoskrnl/io/iomgr/iofunc.c | 131 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index e6ecefc7ff..5831b55896 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -1052,6 +1052,88 @@ IopGetMountFlag(IN PDEVICE_OBJECT DeviceObject) return Mounted; } +static +BOOLEAN +IopVerifyDriverObjectOnStack(IN PDEVICE_OBJECT DeviceObject, + IN PDRIVER_OBJECT DriverObject) +{ + PDEVICE_OBJECT StackDO; + + /* Browse our whole device stack, trying to find the appropriate driver */ + StackDO = IopGetDeviceAttachmentBase(DeviceObject); + while (StackDO != NULL) + { + /* We've found the driver, return success */ + if (StackDO->DriverObject == DriverObject) + { + return TRUE; + } + + /* Move to the next */ + StackDO = StackDO->AttachedDevice; + } + + /* We only reach there if driver was not found */ + return FALSE; +} + +static +NTSTATUS +IopGetDriverPathInformation(IN PFILE_OBJECT FileObject, + IN PFILE_FS_DRIVER_PATH_INFORMATION DriverPathInfo, + IN ULONG Length) +{ + KIRQL OldIrql; + NTSTATUS Status; + UNICODE_STRING DriverName; + PDRIVER_OBJECT DriverObject; + + /* Make sure the structure is consistent (ie, driver name fits into the buffer) */ + if (Length - FIELD_OFFSET(FILE_FS_DRIVER_PATH_INFORMATION, DriverName) < DriverPathInfo->DriverNameLength) + { + return STATUS_INVALID_PARAMETER; + } + + /* Setup the whole driver name */ + DriverName.Length = DriverPathInfo->DriverNameLength; + DriverName.MaximumLength = DriverPathInfo->DriverNameLength; + DriverName.Buffer = &DriverPathInfo->DriverName[0]; + + /* Ask Ob for such driver */ + Status = ObReferenceObjectByName(&DriverName, + OBJ_CASE_INSENSITIVE, + NULL, + 0, + IoDriverObjectType, + KernelMode, + NULL, + (PVOID*)&DriverObject); + /* No such driver, bail out */ + if (!NT_SUCCESS(Status)) + { + return Status; + } + + /* Lock the devices database, we'll browse it */ + OldIrql = KeAcquireQueuedSpinLock(LockQueueIoDatabaseLock); + /* If we have a VPB, browse the stack from the volume */ + if (FileObject->Vpb != NULL && FileObject->Vpb->DeviceObject != NULL) + { + DriverPathInfo->DriverInPath = IopVerifyDriverObjectOnStack(FileObject->Vpb->DeviceObject, DriverObject); + } + /* Otherwise, do it from the normal device */ + else + { + DriverPathInfo->DriverInPath = IopVerifyDriverObjectOnStack(FileObject->DeviceObject, DriverObject); + } + KeReleaseQueuedSpinLock(LockQueueIoDatabaseLock, OldIrql); + + /* No longer needed */ + ObDereferenceObject(DriverObject); + + return STATUS_SUCCESS; +} + /* PUBLIC FUNCTIONS **********************************************************/ /* @@ -4136,6 +4218,55 @@ NtQueryVolumeInformationFile(IN HANDLE FileHandle, return STATUS_SUCCESS; } + /* This is to be handled by the kernel, not by FSD */ + else if (FsInformationClass == FileFsDriverPathInformation) + { + PFILE_FS_DRIVER_PATH_INFORMATION DriverPathInfo; + + _SEH2_TRY + { + /* Allocate our local structure */ + DriverPathInfo = ExAllocatePoolWithQuotaTag(NonPagedPool, Length, TAG_IO); + + /* And copy back caller data */ + RtlCopyMemory(DriverPathInfo, FsInformation, Length); + + /* Is the driver in the IO path? */ + Status = IopGetDriverPathInformation(FileObject, DriverPathInfo, Length); + /* We failed, don't continue execution */ + if (!NT_SUCCESS(Status)) + { + RtlRaiseStatus(Status); + } + + /* We succeed, copy back info */ + ((PFILE_FS_DRIVER_PATH_INFORMATION)FsInformation)->DriverInPath = DriverPathInfo->DriverInPath; + + /* We're done */ + IoStatusBlock->Information = sizeof(FILE_FS_DRIVER_PATH_INFORMATION); + IoStatusBlock->Status = STATUS_SUCCESS; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + /* Don't leak */ + if (DriverPathInfo != NULL) + { + ExFreePoolWithTag(DriverPathInfo, TAG_IO); + } + + /* + * We didn't have an exception, but we didn't issue an IRP + * to complete either, so avoid duplicating code and + * call appropriate helper + */ + IopCleanupAfterException(FileObject, NULL, NULL, Event); + + return Status; + } /* Get the device object */ DeviceObject = IoGetRelatedDeviceObject(FileObject);
5 years, 8 months
1
0
0
0
[reactos] 01/01: [NTOSKRNL] Do. Not. L. E. A. K.
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=092c37f845cd76bd5821d…
commit 092c37f845cd76bd5821d5fcd6e7fdd57ba96dd9 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri Mar 29 19:51:38 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri Mar 29 19:51:38 2019 +0100 [NTOSKRNL] Do. Not. L. E. A. K. --- ntoskrnl/io/iomgr/iofunc.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index 5fd1a130ef..e6ecefc7ff 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -4121,29 +4121,18 @@ NtQueryVolumeInformationFile(IN HANDLE FileHandle, } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - /* Check if we had a file lock */ - if (FileObject->Flags & FO_SYNCHRONOUS_IO) - { - /* Release it */ - IopUnlockFileObject(FileObject); - } - - /* Dereference the FO */ - ObDereferenceObject(FileObject); - + /* Cleanup */ + IopCleanupAfterException(FileObject, NULL, NULL, Event); _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; - /* Check if we had a file lock */ - if (FileObject->Flags & FO_SYNCHRONOUS_IO) - { - /* Release it */ - IopUnlockFileObject(FileObject); - } - - /* Dereference the FO */ - ObDereferenceObject(FileObject); + /* + * We didn't have an exception, but we didn't issue an IRP + * to complete either, so avoid duplicating code and + * call appropriate helper + */ + IopCleanupAfterException(FileObject, NULL, NULL, Event); return STATUS_SUCCESS; }
5 years, 8 months
1
0
0
0
[reactos] 03/03: [NULL] Use correct device characteristics value for the null device
by Maxim Smirnov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5570cde2717a9a21f004f…
commit 5570cde2717a9a21f004fc647172e18ac55744cc Author: Maxim Smirnov <33279413+Simi4(a)users.noreply.github.com> AuthorDate: Wed Mar 27 04:23:21 2019 +0300 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Thu Mar 28 22:46:04 2019 +0100 [NULL] Use correct device characteristics value for the null device --- drivers/base/null/null.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/null/null.c b/drivers/base/null/null.c index 0d4ed541de2..54cb9bea114 100644 --- a/drivers/base/null/null.c +++ b/drivers/base/null/null.c @@ -186,7 +186,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, 0, &DeviceName, FILE_DEVICE_NULL, - 0, + FILE_DEVICE_SECURE_OPEN, FALSE, &DeviceObject); if (!NT_SUCCESS(Status))
5 years, 9 months
1
0
0
0
[reactos] 02/03: [NTOSKRNL] Only allow direct device open for FileFsDeviceInformation
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d75ccd01f7a9cf94293e6…
commit d75ccd01f7a9cf94293e6c12503e44c2bf768f34 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Thu Mar 28 22:39:15 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Thu Mar 28 22:39:38 2019 +0100 [NTOSKRNL] Only allow direct device open for FileFsDeviceInformation --- ntoskrnl/io/iomgr/iofunc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index 73938adb93a..5fd1a130ef7 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -4063,6 +4063,14 @@ NtQueryVolumeInformationFile(IN HANDLE FileHandle, NULL); if (!NT_SUCCESS(Status)) return Status; + /* Only allow direct device open for FileFsDeviceInformation */ + if (BooleanFlagOn(FileObject->Flags, FO_DIRECT_DEVICE_OPEN) && + FsInformationClass != FileFsDeviceInformation) + { + ObDereferenceObject(FileObject); + return STATUS_INVALID_DEVICE_REQUEST; + } + /* Check if we should use Sync IO or not */ if (FileObject->Flags & FO_SYNCHRONOUS_IO) {
5 years, 9 months
1
0
0
0
[reactos] 01/03: [NTOSKRNL] Add a quick path for FileFsDeviceInformation in NtQueryVolumeInformationFile
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ce6488df31de64092f41a…
commit ce6488df31de64092f41aa78bb87e829ded3dc6b Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Thu Mar 28 22:29:22 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Thu Mar 28 22:39:38 2019 +0100 [NTOSKRNL] Add a quick path for FileFsDeviceInformation in NtQueryVolumeInformationFile This allows querying volume information without issuing an IRP to the owner device. The kernel is supposed to already have all the required information to return to the caller. Side effect: this allows querying volume information for devices not implementing IRP_MJ_QUERY_VOLUME_INFORMATION such as null.sys This fixes opening null device in Python. Fix based on debugging by Maxim Smirnov in PR #1442 CORE-14551 --- ntoskrnl/io/iomgr/iofunc.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index f2d3e59dd2c..73938adb93a 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -1026,6 +1026,32 @@ IopGetFileMode(IN PFILE_OBJECT FileObject) return Mode; } +static +BOOLEAN +IopGetMountFlag(IN PDEVICE_OBJECT DeviceObject) +{ + KIRQL OldIrql; + PVPB Vpb; + BOOLEAN Mounted; + + /* Assume not mounted */ + Mounted = FALSE; + + /* Check whether we have the mount flag */ + IoAcquireVpbSpinLock(&OldIrql); + + Vpb = DeviceObject->Vpb; + if (Vpb != NULL && + BooleanFlagOn(Vpb->Flags, VPB_MOUNTED)) + { + Mounted = TRUE; + } + + IoReleaseVpbSpinLock(OldIrql); + + return Mounted; +} + /* PUBLIC FUNCTIONS **********************************************************/ /* @@ -4061,6 +4087,59 @@ NtQueryVolumeInformationFile(IN HANDLE FileHandle, LocalEvent = TRUE; } + /* + * Quick path for FileFsDeviceInformation - the kernel has enough + * info to reply instead of the driver, excepted for network file systems + */ + if (FsInformationClass == FileFsDeviceInformation && + (BooleanFlagOn(FileObject->Flags, FO_DIRECT_DEVICE_OPEN) || FileObject->DeviceObject->DeviceType != FILE_DEVICE_NETWORK_FILE_SYSTEM)) + { + PFILE_FS_DEVICE_INFORMATION FsDeviceInfo = FsInformation; + DeviceObject = FileObject->DeviceObject; + + _SEH2_TRY + { + FsDeviceInfo->DeviceType = DeviceObject->DeviceType; + + /* Complete characteristcs with mount status if relevant */ + FsDeviceInfo->Characteristics = DeviceObject->Characteristics; + if (IopGetMountFlag(DeviceObject)) + { + SetFlag(FsDeviceInfo->Characteristics, FILE_DEVICE_IS_MOUNTED); + } + + IoStatusBlock->Information = sizeof(FILE_FS_DEVICE_INFORMATION); + IoStatusBlock->Status = STATUS_SUCCESS; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Check if we had a file lock */ + if (FileObject->Flags & FO_SYNCHRONOUS_IO) + { + /* Release it */ + IopUnlockFileObject(FileObject); + } + + /* Dereference the FO */ + ObDereferenceObject(FileObject); + + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + + /* Check if we had a file lock */ + if (FileObject->Flags & FO_SYNCHRONOUS_IO) + { + /* Release it */ + IopUnlockFileObject(FileObject); + } + + /* Dereference the FO */ + ObDereferenceObject(FileObject); + + return STATUS_SUCCESS; + } + /* Get the device object */ DeviceObject = IoGetRelatedDeviceObject(FileObject);
5 years, 9 months
1
0
0
0
[reactos] 01/01: [OSK] Initialize the common controls
by Bișoc George
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f8e0b4675f1293acf6f5b…
commit f8e0b4675f1293acf6f5b5fcddb5083636ee3d12 Author: Bișoc George <fraizeraust99(a)gmail.com> AuthorDate: Thu Mar 28 16:09:16 2019 +0100 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Mar 28 19:02:48 2019 +0100 [OSK] Initialize the common controls On-Screen Keyboard has a manifest which is used for visual styles. However, the common controls aren't initialized and as a general rule the controls have to be loaded in the application's handle instance. --- base/applications/osk/main.c | 6 ++++++ base/applications/osk/osk.h | 1 + 2 files changed, 7 insertions(+) diff --git a/base/applications/osk/main.c b/base/applications/osk/main.c index 30e97941140..e12d68dedf0 100644 --- a/base/applications/osk/main.c +++ b/base/applications/osk/main.c @@ -587,6 +587,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HANDLE hMutex; DWORD dwError; INT LayoutResource; + INITCOMMONCONTROLSEX iccex; UNREFERENCED_PARAMETER(prev); UNREFERENCED_PARAMETER(cmdline); @@ -615,6 +616,11 @@ int WINAPI wWinMain(HINSTANCE hInstance, } } + /* Load the common controls */ + iccex.dwSize = sizeof(INITCOMMONCONTROLSEX); + iccex.dwICC = ICC_STANDARD_CLASSES | ICC_WIN95_CLASSES; + InitCommonControlsEx(&iccex); + ZeroMemory(&Globals, sizeof(Globals)); Globals.hInstance = hInstance; diff --git a/base/applications/osk/osk.h b/base/applications/osk/osk.h index 5de39d32115..f320d14c4f4 100644 --- a/base/applications/osk/osk.h +++ b/base/applications/osk/osk.h @@ -14,6 +14,7 @@ #include <stdio.h> #include <windows.h> +#include <commctrl.h> #include <debug.h> #include "main.h"
5 years, 9 months
1
0
0
0
[reactos] 01/01: [NtUser] Fix maximizing to window edge
by jimtabor
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0197c4f875d3332dbc465…
commit 0197c4f875d3332dbc4656a6360e3c7e9def2ed5 Author: jimtabor <james.tabor(a)reactos.org> AuthorDate: Wed Mar 27 17:39:04 2019 -0500 Commit: jimtabor <james.tabor(a)reactos.org> CommitDate: Wed Mar 27 17:39:04 2019 -0500 [NtUser] Fix maximizing to window edge Cover up the edge of the frame while maximizing the window to desktop. Fixes CORE-15893. --- win32ss/user/ntuser/winpos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/win32ss/user/ntuser/winpos.c b/win32ss/user/ntuser/winpos.c index 2083526ee3b..d7f5ad6a639 100644 --- a/win32ss/user/ntuser/winpos.c +++ b/win32ss/user/ntuser/winpos.c @@ -958,6 +958,10 @@ co_WinPosGetMinMaxInfo(PWND Window, POINT* MaxSize, POINT* MaxPos, adjust = IntGetWindowBorders(adjustedStyle, exstyle); + // Handle special case while maximized. CORE-15893 + if ((adjustedStyle & WS_THICKFRAME) && !(adjustedStyle & WS_CHILD) && !(adjustedStyle & WS_MINIMIZE)) + adjust += 2; + xinc = yinc = adjust; if ((adjustedStyle & WS_THICKFRAME) && (adjustedStyle & WS_CHILD) && !(adjustedStyle & WS_MINIMIZE))
5 years, 9 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
22
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Results per page:
10
25
50
100
200