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
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
April 2010
----- 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
22 participants
435 discussions
Start a n
N
ew thread
[cgutman] 46997: [NTOSKRNL] - Add a stub for IRP_MN_REMOVE_DEVICE in PnpRoot - Revert 2 incorrect changes from r46983 (DNF_ENUMERATED added to the DNF_ADDED assertion and setting the DNF_RESOURCE_REPORTED flag in IopStartDevice2) - Set the DNF_LEGACY_DRIVER flag if the AddDevice handler is missing - Add a helper function called IopSendRemoveDevice which sends IRP_MN_REMOVE_DEVICE to a device object - Call IopSendRemoveDevice if IRP_MN_START_DEVICE fails - Set the DNF_STARTED and DNF_ADDED flags
by cgutman@svn.reactos.org
Author: cgutman Date: Thu Apr 22 23:07:46 2010 New Revision: 46997 URL:
http://svn.reactos.org/svn/reactos?rev=46997&view=rev
Log: [NTOSKRNL] - Add a stub for IRP_MN_REMOVE_DEVICE in PnpRoot - Revert 2 incorrect changes from r46983 (DNF_ENUMERATED added to the DNF_ADDED assertion and setting the DNF_RESOURCE_REPORTED flag in IopStartDevice2) - Set the DNF_LEGACY_DRIVER flag if the AddDevice handler is missing - Add a helper function called IopSendRemoveDevice which sends IRP_MN_REMOVE_DEVICE to a device object - Call IopSendRemoveDevice if IRP_MN_START_DEVICE fails - Set the DNF_STARTED and DNF_ADDED flags for legacy drivers - Enable the DNF_ADDED assertion in IopStartDevice2 Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Thu Apr 22 23:07:46 2010 @@ -66,18 +66,19 @@ NTSTATUS Status; if (!DriverObject->DriverExtension->AddDevice) + { + DeviceNode->Flags |= DNF_LEGACY_DRIVER; + } + + if (DeviceNode->Flags & DNF_LEGACY_DRIVER) + { + DeviceNode->Flags |= DNF_ADDED + DNF_STARTED; return STATUS_SUCCESS; + } /* This is a Plug and Play driver */ DPRINT("Plug and Play driver found\n"); ASSERT(DeviceNode->PhysicalDeviceObject); - - /* Check if this plug-and-play driver is used as a legacy one for this device node */ - if (IopDeviceNodeHasFlag(DeviceNode, DNF_LEGACY_DRIVER)) - { - IopDeviceNodeSetFlag(DeviceNode, DNF_ADDED); - return STATUS_SUCCESS; - } DPRINT("Calling %wZ->AddDevice(%wZ)\n", &DriverObject->DriverName, @@ -120,6 +121,21 @@ IopDeviceNodeSetFlag(DeviceNode, DNF_ADDED); return STATUS_SUCCESS; +} + +VOID +NTAPI +IopSendRemoveDevice(IN PDEVICE_OBJECT DeviceObject) +{ + IO_STACK_LOCATION Stack; + PVOID Dummy; + + RtlZeroMemory(&Stack, sizeof(IO_STACK_LOCATION)); + Stack.MajorFunction = IRP_MJ_PNP; + Stack.MinorFunction = IRP_MN_REMOVE_DEVICE; + + /* Drivers should never fail a IRP_MN_REMOVE_DEVICE request */ + IopSynchronousCall(DeviceObject, &Stack, &Dummy); } VOID @@ -156,10 +172,11 @@ Status = IopSynchronousCall(DeviceObject, &Stack, &Dummy); if (!NT_SUCCESS(Status)) { - /* We failed start */ + /* Send an IRP_MN_REMOVE_DEVICE request */ + IopSendRemoveDevice(DeviceObject); + + /* Set the appropriate flag */ DeviceNode->Flags |= DNF_START_FAILED; - - /* TODO: Undo all the stuff we did up to this point */ DPRINT1("Warning: PnP Start failed (%wZ)\n", &DeviceNode->InstancePath); return; @@ -168,9 +185,6 @@ /* Otherwise, mark us as started */ DeviceNode->Flags |= DNF_STARTED; - /* We reported the resources */ - DeviceNode->Flags |= DNF_RESOURCE_REPORTED; - /* We now need enumeration */ DeviceNode->Flags |= DNF_NEED_ENUMERATION_ONLY; } @@ -184,10 +198,7 @@ PAGED_CODE(); /* Sanity check */ - // ASSERT((DeviceNode->Flags & DNF_ADDED) || (DeviceNode->Flags & DNF_ENUMERATED)); - if (!(DeviceNode->Flags & DNF_ADDED) && !(DeviceNode->Flags & DNF_ENUMERATED)) - DPRINT1("Warning: Starting a device node without DNF_ADDED or DNF_ENUMERATED (%wZ)\n", - &DeviceNode->InstancePath); + ASSERT((DeviceNode->Flags & DNF_ADDED)); ASSERT((DeviceNode->Flags & (DNF_RESOURCE_ASSIGNED | DNF_RESOURCE_REPORTED | DNF_NO_RESOURCE_REQUIRED))); @@ -243,6 +254,12 @@ UNICODE_STRING KeyName; OBJECT_ATTRIBUTES ObjectAttributes; + if (DeviceNode->Flags & (DNF_STARTED | DNF_START_REQUEST_PENDING)) + { + /* Nothing to do here */ + return STATUS_SUCCESS; + } + Status = IopAssignDeviceResources(DeviceNode); if (!NT_SUCCESS(Status)) goto ByeBye; @@ -542,8 +559,9 @@ return Status; } - /* This is for drivers passed on the command line to ntoskrnl.exe */ IopDeviceNodeSetFlag(Node, DNF_LEGACY_DRIVER); + IopDeviceNodeSetFlag(Node, DNF_ADDED); + IopDeviceNodeSetFlag(Node, DNF_STARTED); } Node->PhysicalDeviceObject = PhysicalDeviceObject; Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] Thu Apr 22 23:07:46 2010 @@ -1069,6 +1069,11 @@ DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n"); break; + case IRP_MN_REMOVE_DEVICE: + DPRINT1("IRP_MN_REMOVE_DEVICE is UNIMPLEMENTED!\n"); + Status = STATUS_SUCCESS; + break; + case IRP_MN_QUERY_ID: /* 0x13 */ Status = PdoQueryId(DeviceObject, Irp, IrpSp); break;
14 years, 6 months
1
0
0
0
[cgutman] 46996: [PCI] - Forward IRPs to our PDO instead of just completing them - Handle IRP_MN_START_DEVICE on the way back up the stack (allows the PDO code to assign resources to the bus) - Add some synchronous IRP forwarding copied from i8042prt
by cgutman@svn.reactos.org
Author: cgutman Date: Thu Apr 22 22:35:58 2010 New Revision: 46996 URL:
http://svn.reactos.org/svn/reactos?rev=46996&view=rev
Log: [PCI] - Forward IRPs to our PDO instead of just completing them - Handle IRP_MN_START_DEVICE on the way back up the stack (allows the PDO code to assign resources to the bus) - Add some synchronous IRP forwarding copied from i8042prt Modified: trunk/reactos/drivers/bus/pci/fdo.c Modified: trunk/reactos/drivers/bus/pci/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pci/fdo.c?rev=…
============================================================================== --- trunk/reactos/drivers/bus/pci/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pci/fdo.c [iso-8859-1] Thu Apr 22 22:35:58 2010 @@ -15,6 +15,46 @@ #include <debug.h> /*** PRIVATE *****************************************************************/ + +static IO_COMPLETION_ROUTINE ForwardIrpAndWaitCompletion; + +static NTSTATUS NTAPI +ForwardIrpAndWaitCompletion( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PVOID Context) +{ + UNREFERENCED_PARAMETER(DeviceObject); + if (Irp->PendingReturned) + KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE); + return STATUS_MORE_PROCESSING_REQUIRED; +} + +NTSTATUS NTAPI +ForwardIrpAndWait( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + KEVENT Event; + NTSTATUS Status; + PDEVICE_OBJECT LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Ldo; + ASSERT(LowerDevice); + + KeInitializeEvent(&Event, NotificationEvent, FALSE); + IoCopyCurrentIrpStackLocationToNext(Irp); + + IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE); + + Status = IoCallDriver(LowerDevice, Irp); + if (Status == STATUS_PENDING) + { + Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL); + if (NT_SUCCESS(Status)) + Status = Irp->IoStatus.Status; + } + + return Status; +} static NTSTATUS FdoLocateChildDevice( @@ -466,7 +506,7 @@ { PFDO_DEVICE_EXTENSION DeviceExtension; PIO_STACK_LOCATION IrpSp; - NTSTATUS Status; + NTSTATUS Status = Irp->IoStatus.Status; DPRINT("Called\n"); @@ -492,8 +532,13 @@ break; #endif case IRP_MN_QUERY_DEVICE_RELATIONS: + if (IrpSp->Parameters.QueryDeviceRelations.Type != BusRelations) + break; + Status = FdoQueryBusRelations(DeviceObject, Irp, IrpSp); - break; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; #if 0 case IRP_MN_QUERY_PNP_DEVICE_STATE: Status = STATUS_NOT_IMPLEMENTED; @@ -513,38 +558,37 @@ #endif case IRP_MN_START_DEVICE: DPRINT("IRP_MN_START_DEVICE received\n"); - Status = FdoStartDevice(DeviceObject, Irp); - break; + Status = ForwardIrpAndWait(DeviceObject, Irp); + if (NT_SUCCESS(Status)) + Status = FdoStartDevice(DeviceObject, Irp); + + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; case IRP_MN_STOP_DEVICE: /* Currently not supported */ Status = STATUS_UNSUCCESSFUL; - break; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; #if 0 case IRP_MN_SURPRISE_REMOVAL: Status = STATUS_NOT_IMPLEMENTED; break; #endif + case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: + break; + case IRP_MN_REMOVE_DEVICE: + DPRINT1("IRP_MN_REMOVE_DEVICE is UNIMPLEMENTED!\n"); + break; default: DPRINT1("Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction); - /* fall through */ - - case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: - /* - * Do NOT complete the IRP as it will be processed by the lower - * device object, which will complete the IRP - */ - IoSkipCurrentIrpStackLocation(Irp); - Status = IoCallDriver(DeviceExtension->Ldo, Irp); - return Status; - break; - } - - - if (Status != STATUS_PENDING) { - if (Status != STATUS_NOT_IMPLEMENTED) - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - } + break; + } + + Irp->IoStatus.Status = Status; + IoSkipCurrentIrpStackLocation(Irp); + Status = IoCallDriver(DeviceExtension->Ldo, Irp); DPRINT("Leaving. Status 0x%X\n", Status);
14 years, 6 months
1
0
0
0
[tkreuzer] 46995: Update TODO.txt
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Apr 22 21:14:15 2010 New Revision: 46995 URL:
http://svn.reactos.org/svn/reactos?rev=46995&view=rev
Log: Update TODO.txt Modified: branches/reactos-yarotows/subsystems/win32/win32k/TODO.txt Modified: branches/reactos-yarotows/subsystems/win32/win32k/TODO.txt URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/TODO.txt [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/TODO.txt [iso-8859-1] Thu Apr 22 21:14:15 2010 @@ -10,9 +10,8 @@ Before the merge: ----------------- -# Resize the desktop window after mode switch -# Update mouse area after mode switch # Invalidate the whole Window content after mode switch +# Fix hotizontal size of the taskbar after mode switch # Validate object type in GDIOBJ_LockMultipleObjs
14 years, 6 months
1
0
0
0
[gadamopoulos] 46994: [win32csr] -Handle WM_DISPLAYCHANGE
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Thu Apr 22 21:10:46 2010 New Revision: 46994 URL:
http://svn.reactos.org/svn/reactos?rev=46994&view=rev
Log: [win32csr] -Handle WM_DISPLAYCHANGE Modified: branches/reactos-yarotows/subsystems/win32/csrss/win32csr/desktopbg.c Modified: branches/reactos-yarotows/subsystems/win32/csrss/win32csr/desktopbg.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/csrss/win32csr/desktopbg.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/csrss/win32csr/desktopbg.c [iso-8859-1] Thu Apr 22 21:10:46 2010 @@ -67,6 +67,10 @@ case WM_CREATE: case WM_CLOSE: return 0; + + case WM_DISPLAYCHANGE: + MoveWindow(Wnd, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE); + break; case WM_NOTIFY: {
14 years, 6 months
1
0
0
0
[fireball] 46993: - Merge 46959, fixes arwinss-in-trunk booting.
by fireball@svn.reactos.org
Author: fireball Date: Thu Apr 22 19:37:20 2010 New Revision: 46993 URL:
http://svn.reactos.org/svn/reactos?rev=46993&view=rev
Log: - Merge 46959, fixes arwinss-in-trunk booting. Modified: branches/arwinss/reactos/dll/win32/kernel32/ (props changed) branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec (contents, props changed) Propchange: branches/arwinss/reactos/dll/win32/kernel32/ ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Thu Apr 22 19:37:20 2010 @@ -1,0 +1,2 @@ +/branches/ros-amd64-bringup/reactos/dll/win32/kernel32:34711-34712,34743,34780-34782,34812,34839,34842,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35683,35739,35746,35762,35771,35777,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36013,36172,36360,36388-36389,36445,36502-36503,36505,36570,36614,36899,36930,36936,36992,37323,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38148-38151,38264-38265,38268,38355,39151,39333,39345,39639,40122-40123,40125,40128,40155,40247,40324,40753,40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41082-41086,41097-41098,41101,41449,41479,41484-41485,41499,41531,41536,41540,41546-41547,41549,43080,43426,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43838-43840,43857-43858,43860,43905-43907,43969,44002,44037,44039-44040,44044-44045,44065,44095,44123,44144,44205,44238,44294,44338,44389,44391,44426,44460,44530,44540,44601 +/trunk/reactos/dll/win32/kernel32:42000-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688,46959 Modified: branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/kerne…
============================================================================== --- branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] Thu Apr 22 19:37:20 2010 @@ -957,11 +957,9 @@ @ stdcall WaitNamedPipeW (wstr long) @ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) @ stdcall WinExec(str long) -#ifdef _M_AMD64 @ stdcall Wow64EnableWow64FsRedirection(long) @ stdcall Wow64DisableWow64FsRedirection(long) @ stdcall Wow64RevertWow64FsRedirection(long) -#endif @ stdcall WriteConsoleA(long ptr long ptr ptr) @ stdcall WriteConsoleInputA(long ptr long ptr) @ stdcall WriteConsoleInputVDMA(long long long long) Propchange: branches/arwinss/reactos/dll/win32/kernel32/kernel32.pspec ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Apr 22 19:37:20 2010 @@ -1,2 +1,2 @@ /branches/ros-amd64-bringup/reactos/dll/win32/kernel32/kernel32.pspec:34711-34712,34743,34812,34839,34842,34917,35323-35324,35347-35348,35361,35436,35509,35515,35588,35739,35746,35771,35789,35823,35902,35904-35906,35942,35947-35949,35952-35953,35966,36013,36360,36388-36389,36570,36614,36930,37323,37434,37472,37475,37536,37820-37821,37869,37873,37990-37991,38013-38014,38148,38151,38265,38268,39151,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080,43426,43454 -/trunk/reactos/dll/win32/kernel32/kernel32.pspec:42000-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688 +/trunk/reactos/dll/win32/kernel32/kernel32.pspec:42000-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688,46959
14 years, 6 months
1
0
0
0
[gschneider] 46992: [REGEDIT] - Don't assign an uninitialized custom filter buffer to the OPENFILENAME structure, clean up commented out code - Allows standard file type filters to show up See issue #5307 for more details.
by gschneider@svn.reactos.org
Author: gschneider Date: Thu Apr 22 14:49:20 2010 New Revision: 46992 URL:
http://svn.reactos.org/svn/reactos?rev=46992&view=rev
Log: [REGEDIT] - Don't assign an uninitialized custom filter buffer to the OPENFILENAME structure, clean up commented out code - Allows standard file type filters to show up See issue #5307 for more details. Modified: trunk/reactos/base/applications/regedit/framewnd.c Modified: trunk/reactos/base/applications/regedit/framewnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] Thu Apr 22 14:49:20 2010 @@ -228,8 +228,6 @@ return TRUE; } -#define MAX_CUSTOM_FILTER_SIZE 50 -TCHAR CustomFilterBuffer[MAX_CUSTOM_FILTER_SIZE]; TCHAR FileNameBuffer[_MAX_PATH]; TCHAR FileTitleBuffer[_MAX_PATH]; @@ -275,25 +273,11 @@ BuildFilterStrings(Filter, FilterPairs, sizeof(FilterPairs) / sizeof(FILTERPAIR)); pofn->lpstrFilter = Filter; - pofn->lpstrCustomFilter = CustomFilterBuffer; - pofn->nMaxCustFilter = MAX_CUSTOM_FILTER_SIZE; - pofn->nFilterIndex = 0; pofn->lpstrFile = FileNameBuffer; pofn->nMaxFile = _MAX_PATH; pofn->lpstrFileTitle = FileTitleBuffer; pofn->nMaxFileTitle = _MAX_PATH; - /* pofn->lpstrInitialDir = _T("");*/ - /* pofn->lpstrTitle = _T("Import Registry File");*/ - /* pofn->Flags = OFN_ENABLETEMPLATE + OFN_EXPLORER + OFN_ENABLESIZING;*/ pofn->Flags = OFN_HIDEREADONLY; - /* pofn->nFileOffset = ;*/ - /* pofn->nFileExtension = ;*/ - /* pofn->lpstrDefExt = _T("");*/ - /* pofn->lCustData = ;*/ - /* pofn->lpfnHook = ImportRegistryFile_OFNHookProc;*/ - /* pofn->lpTemplateName = _T("ID_DLG_IMPORT_REGFILE");*/ - /* pofn->lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);*/ - /* pofn->FlagsEx = ;*/ return TRUE; }
14 years, 6 months
1
0
0
0
[gschneider] 46991: [REGEDIT] Only set a registry path if the root node is not selected, adjust checks See issue #5297 for more details.
by gschneider@svn.reactos.org
Author: gschneider Date: Thu Apr 22 13:25:56 2010 New Revision: 46991 URL:
http://svn.reactos.org/svn/reactos?rev=46991&view=rev
Log: [REGEDIT] Only set a registry path if the root node is not selected, adjust checks See issue #5297 for more details. Modified: trunk/reactos/base/applications/regedit/framewnd.c Modified: trunk/reactos/base/applications/regedit/framewnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] Thu Apr 22 13:25:56 2010 @@ -356,11 +356,11 @@ hwndExportAll = GetDlgItem(hdlg, IDC_EXPORT_ALL); if (hwndExportAll) - SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey[0] ? BST_UNCHECKED : BST_CHECKED, 0); + SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey ? BST_UNCHECKED : BST_CHECKED, 0); hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH); if (hwndExportBranch) - SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey[0] ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey ? BST_CHECKED : BST_UNCHECKED, 0); hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT); if (hwndExportBranchText) @@ -406,7 +406,12 @@ InitOpenFileName(hWnd, &ofn); LoadString(hInst, IDS_EXPORT_REG_FILE, Caption, sizeof(Caption)/sizeof(TCHAR)); ofn.lpstrTitle = Caption; - ofn.lCustData = (LPARAM) ExportKeyPath; + + /* Only set the path if a key (not the root node) is selected */ + if (hKeyRoot != 0) + { + ofn.lCustData = (LPARAM) ExportKeyPath; + } ofn.Flags = OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_ENABLEHOOK; ofn.lpfnHook = ExportRegistryFile_OFNHookProc; ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EXPORTRANGE);
14 years, 6 months
1
0
0
0
[fireball] 46990: [KERNEL32] - Update kernel32_winetests to Wine-1.1.43.
by fireball@svn.reactos.org
Author: fireball Date: Thu Apr 22 10:47:47 2010 New Revision: 46990 URL:
http://svn.reactos.org/svn/reactos?rev=46990&view=rev
Log: [KERNEL32] - Update kernel32_winetests to Wine-1.1.43. Modified: trunk/rostests/winetests/kernel32/comm.c trunk/rostests/winetests/kernel32/console.c trunk/rostests/winetests/kernel32/debugger.c trunk/rostests/winetests/kernel32/generated.c trunk/rostests/winetests/kernel32/heap.c trunk/rostests/winetests/kernel32/path.c trunk/rostests/winetests/kernel32/thread.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/rostests/winetests/kernel32/comm.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/comm.c…
Modified: trunk/rostests/winetests/kernel32/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/consol…
Modified: trunk/rostests/winetests/kernel32/debugger.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/debugg…
Modified: trunk/rostests/winetests/kernel32/generated.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/genera…
Modified: trunk/rostests/winetests/kernel32/heap.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/heap.c…
Modified: trunk/rostests/winetests/kernel32/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/path.c…
Modified: trunk/rostests/winetests/kernel32/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/thread…
14 years, 6 months
1
0
0
0
[sir_richard] 46989: [NTOS]: Implement and call MiBuildImportsForBootDrivers. We now have full dependency tracking for correct unloading. [NTOS]: Implement and call MiLocateKernelSections. Pool code and paging paths will require this information later. Loader work done for now.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Thu Apr 22 10:13:56 2010 New Revision: 46989 URL:
http://svn.reactos.org/svn/reactos?rev=46989&view=rev
Log: [NTOS]: Implement and call MiBuildImportsForBootDrivers. We now have full dependency tracking for correct unloading. [NTOS]: Implement and call MiLocateKernelSections. Pool code and paging paths will require this information later. Loader work done for now. Modified: trunk/reactos/ntoskrnl/mm/sysldr.c Modified: trunk/reactos/ntoskrnl/mm/sysldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/sysldr.c?rev=4…
============================================================================== --- trunk/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] Thu Apr 22 10:13:56 2010 @@ -46,6 +46,10 @@ BOOLEAN MmMakeLowMemory; BOOLEAN MmEnforceWriteProtection = TRUE; + +PMMPTE MiKernelResourceStartPte, MiKernelResourceEndPte; +ULONG_PTR ExPoolCodeStart, ExPoolCodeEnd, MmPoolCodeStart, MmPoolCodeEnd; +ULONG_PTR MmPteCodeStart, MmPteCodeEnd; /* FUNCTIONS ******************************************************************/ @@ -1508,6 +1512,331 @@ } } +NTSTATUS +NTAPI +MiBuildImportsForBootDrivers(VOID) +{ + PLIST_ENTRY NextEntry, NextEntry2; + PLDR_DATA_TABLE_ENTRY LdrEntry, KernelEntry, HalEntry, LdrEntry2, LastEntry; + PLDR_DATA_TABLE_ENTRY* EntryArray; + UNICODE_STRING KernelName = RTL_CONSTANT_STRING(L"ntoskrnl.exe"); + UNICODE_STRING HalName = RTL_CONSTANT_STRING(L"hal.dll"); + PLOAD_IMPORTS LoadedImports; + ULONG LoadedImportsSize, ImportSize; + PULONG_PTR ImageThunk; + ULONG_PTR DllBase, DllEnd; + ULONG Modules = 0, i, j = 0; + PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor; + + /* Initialize variables */ + KernelEntry = HalEntry = LastEntry = NULL; + + /* Loop the loaded module list... we are early enough that no lock is needed */ + NextEntry = PsLoadedModuleList.Flink; + while (NextEntry != &PsLoadedModuleList) + { + /* Get the entry */ + LdrEntry = CONTAINING_RECORD(NextEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + + /* Check if it's the kernel or HAL */ + if (RtlEqualUnicodeString(&KernelName, &LdrEntry->BaseDllName, TRUE)) + { + /* Found it */ + KernelEntry = LdrEntry; + } + else if (RtlEqualUnicodeString(&HalName, &LdrEntry->BaseDllName, TRUE)) + { + /* Found it */ + HalEntry = LdrEntry; + } + + /* Check if this is a driver DLL */ + if (LdrEntry->Flags & LDRP_DRIVER_DEPENDENT_DLL) + { + /* Check if this is the HAL or kernel */ + if ((LdrEntry == HalEntry) || (LdrEntry == KernelEntry)) + { + /* Add a reference */ + LdrEntry->LoadCount = 1; + } + else + { + /* No referencing needed */ + LdrEntry->LoadCount = 0; + } + } + else + { + /* No referencing needed */ + LdrEntry->LoadCount = 0; + } + + /* Remember this came from the loader */ + LdrEntry->LoadedImports = MM_SYSLDR_BOOT_LOADED; + + /* Keep looping */ + NextEntry = NextEntry->Flink; + Modules++; + } + + /* We must have at least found the kernel and HAL */ + if (!(HalEntry) || (!KernelEntry)) return STATUS_NOT_FOUND; + + /* Allocate the list */ + EntryArray = ExAllocatePoolWithTag(PagedPool, Modules * sizeof(PVOID), 'TDmM'); + if (!EntryArray) return STATUS_INSUFFICIENT_RESOURCES; + + /* Loop the loaded module list again */ + NextEntry = PsLoadedModuleList.Flink; + while (NextEntry != &PsLoadedModuleList) + { + /* Get the entry */ + LdrEntry = CONTAINING_RECORD(NextEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); +#ifdef _WORKING_LOADER_ + /* Get its imports */ + ImageThunk = RtlImageDirectoryEntryToData(LdrEntry->DllBase, + TRUE, + IMAGE_DIRECTORY_ENTRY_IAT, + &ImportSize); + if (!ImageThunk) +#else + /* Get its imports */ + ImportDescriptor = RtlImageDirectoryEntryToData(LdrEntry->DllBase, + TRUE, + IMAGE_DIRECTORY_ENTRY_IMPORT, + &ImportSize); + if (!ImportDescriptor) +#endif + { + /* None present */ + LdrEntry->LoadedImports = MM_SYSLDR_NO_IMPORTS; + NextEntry = NextEntry->Flink; + continue; + } + + /* Clear the list and count the number of IAT thunks */ + RtlZeroMemory(EntryArray, Modules * sizeof(PVOID)); +#ifdef _WORKING_LOADER_ + ImportSize /= sizeof(ULONG_PTR); + + /* Scan the thunks */ + for (i = 0, DllBase = 0, DllEnd = 0; i < ImportSize; i++, ImageThunk++) +#else + i = DllBase = DllEnd = 0; + while ((ImportDescriptor->Name) && + (ImportDescriptor->OriginalFirstThunk)) + { + /* Get the image thunk */ + ImageThunk = (PVOID)((ULONG_PTR)LdrEntry->DllBase + + ImportDescriptor->FirstThunk); + while (*ImageThunk) +#endif + { + /* Do we already have an address? */ + if (DllBase) + { + /* Is the thunk in the same address? */ + if ((*ImageThunk >= DllBase) && (*ImageThunk < DllEnd)) + { + /* Skip it, we already have a reference for it */ + ASSERT(EntryArray[j]); + ImageThunk++; + continue; + } + } + + /* Loop the loaded module list to locate this address owner */ + j = 0; + NextEntry2 = PsLoadedModuleList.Flink; + while (NextEntry2 != &PsLoadedModuleList) + { + /* Get the entry */ + LdrEntry2 = CONTAINING_RECORD(NextEntry2, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + + /* Get the address range for this module */ + DllBase = (ULONG_PTR)LdrEntry2->DllBase; + DllEnd = DllBase + LdrEntry2->SizeOfImage; + + /* Check if this IAT entry matches it */ + if ((*ImageThunk >= DllBase) && (*ImageThunk < DllEnd)) + { + /* Save it */ + //DPRINT1("Found imported dll: %wZ\n", &LdrEntry2->BaseDllName); + EntryArray[j] = LdrEntry2; + break; + } + + /* Keep searching */ + NextEntry2 = NextEntry2->Flink; + j++; + } + + /* Do we have a thunk outside the range? */ + if ((*ImageThunk < DllBase) || (*ImageThunk >= DllEnd)) + { + /* Could be 0... */ + if (*ImageThunk) + { + /* Should not be happening */ + DPRINT1("Broken IAT entry for %p at %p (%lx)\n", + LdrEntry, ImageThunk, *ImageThunk); + ASSERT(FALSE); + } + + /* Reset if we hit this */ + DllBase = 0; + } +#ifndef _WORKING_LOADER_ + ImageThunk++; + } + + i++; + ImportDescriptor++; +#endif + } + + /* Now scan how many imports we really have */ + for (i = 0, ImportSize = 0; i < Modules; i++) + { + /* Skip HAL and kernel */ + if ((EntryArray[i]) && + (EntryArray[i] != HalEntry) && + (EntryArray[i] != KernelEntry)) + { + /* A valid reference */ + LastEntry = EntryArray[i]; + ImportSize++; + } + } + + /* Do we have any imports after all? */ + if (!ImportSize) + { + /* No */ + LdrEntry->LoadedImports = MM_SYSLDR_NO_IMPORTS; + } + else if (ImportSize == 1) + { + /* A single entry import */ + LdrEntry->LoadedImports = (PVOID)((ULONG_PTR)LastEntry | MM_SYSLDR_SINGLE_ENTRY); + LastEntry->LoadCount++; + } + else + { + /* We need an import table */ + LoadedImportsSize = ImportSize * sizeof(PVOID) + sizeof(SIZE_T); + LoadedImports = ExAllocatePoolWithTag(PagedPool, + LoadedImportsSize, + 'TDmM'); + ASSERT(LoadedImports); + + /* Save the count */ + LoadedImports->Count = ImportSize; + + /* Now copy all imports */ + for (i = 0, j = 0; i < Modules; i++) + { + /* Skip HAL and kernel */ + if ((EntryArray[i]) && + (EntryArray[i] != HalEntry) && + (EntryArray[i] != KernelEntry)) + { + /* A valid reference */ + //DPRINT1("Found valid entry: %p\n", EntryArray[i]); + LoadedImports->Entry[j] = EntryArray[i]; + EntryArray[i]->LoadCount++; + j++; + } + } + + /* Should had as many entries as we expected */ + ASSERT(j == ImportSize); + LdrEntry->LoadedImports = LoadedImports; + } + + /* Next */ + NextEntry = NextEntry->Flink; + } + + /* Free the initial array */ + ExFreePool(EntryArray); + + /* FIXME: Might not need to keep the HAL/Kernel imports around */ + + /* Kernel and HAL are loaded at boot */ + KernelEntry->LoadedImports = MM_SYSLDR_BOOT_LOADED; + HalEntry->LoadedImports = MM_SYSLDR_BOOT_LOADED; + + /* All worked well */ + return STATUS_SUCCESS; +} + +VOID +NTAPI +MiLocateKernelSections(IN PLDR_DATA_TABLE_ENTRY LdrEntry) +{ + ULONG_PTR DllBase; + PIMAGE_NT_HEADERS NtHeaders; + PIMAGE_SECTION_HEADER SectionHeader; + ULONG Sections, Size; + + /* Get the kernel section header */ + DllBase = (ULONG_PTR)LdrEntry->DllBase; + NtHeaders = RtlImageNtHeader((PVOID)DllBase); + SectionHeader = IMAGE_FIRST_SECTION(NtHeaders); + + /* Loop all the sections */ + Sections = NtHeaders->FileHeader.NumberOfSections; + while (Sections) + { + /* Grab the size of the section */ + Size = max(SectionHeader->SizeOfRawData, SectionHeader->Misc.VirtualSize); + + /* Check for .RSRC section */ + if (*(PULONG)SectionHeader->Name == 'rsr.') + { + /* Remember the PTEs so we can modify them later */ + MiKernelResourceStartPte = MiAddressToPte(DllBase + + SectionHeader->VirtualAddress); + MiKernelResourceEndPte = MiKernelResourceStartPte + + BYTES_TO_PAGES(SectionHeader->VirtualAddress + Size); + } + else if (*(PULONG)SectionHeader->Name == 'LOOP') + { + /* POOLCODE vs. POOLMI */ + if (*(PULONG)&SectionHeader->Name[4] == 'EDOC') + { + /* Found Ex* Pool code */ + ExPoolCodeStart = DllBase + SectionHeader->VirtualAddress; + ExPoolCodeEnd = ExPoolCodeStart + Size; + } + else if (*(PUSHORT)&SectionHeader->Name[4] == 'MI') + { + /* Found Mm* Pool code */ + MmPoolCodeStart = DllBase + SectionHeader->VirtualAddress; + MmPoolCodeEnd = ExPoolCodeStart + Size; + } + } + else if ((*(PULONG)SectionHeader->Name == 'YSIM') && + (*(PULONG)&SectionHeader->Name[4] == 'ETPS')) + { + /* Found MISYSPTE (Mm System PTE code)*/ + MmPteCodeStart = DllBase + SectionHeader->VirtualAddress; + MmPteCodeEnd = ExPoolCodeStart + Size; + } + + /* Keep going */ + Sections--; + SectionHeader++; + } +} + BOOLEAN NTAPI MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock) @@ -1528,6 +1857,9 @@ LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); PsNtosImageBase = (ULONG_PTR)LdrEntry->DllBase; + + /* Locate resource section, pool code, and system pte code */ + MiLocateKernelSections(LdrEntry); /* Loop the loader block */ while (NextEntry != ListHead) @@ -1541,7 +1873,7 @@ if (!RtlImageNtHeader(LdrEntry->DllBase)) { /* Skip this entry */ - NextEntry= NextEntry->Flink; + NextEntry = NextEntry->Flink; continue; } @@ -1584,7 +1916,7 @@ } /* Build the import lists for the boot drivers */ - //MiBuildImportsForBootDrivers(); + MiBuildImportsForBootDrivers(); /* We're done */ return TRUE;
14 years, 6 months
1
0
0
0
[sir_richard] 46988: [NTOS]: Implement and call MiUseLargeDriverPage. [NTOS]: MmCheckSystemImage: Check for 32-bit/64-bit image/OS mismatch. [NTOS]: MmCheckSystemImage: Return invalid checksum if couldn't get the NT header from the image. [NTOS]: MmCheckSystemImage: Map images as SEC_IMAGE instead of SEC_COMMIT, and simply read the size off that way.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Thu Apr 22 10:04:57 2010 New Revision: 46988 URL:
http://svn.reactos.org/svn/reactos?rev=46988&view=rev
Log: [NTOS]: Implement and call MiUseLargeDriverPage. [NTOS]: MmCheckSystemImage: Check for 32-bit/64-bit image/OS mismatch. [NTOS]: MmCheckSystemImage: Return invalid checksum if couldn't get the NT header from the image. [NTOS]: MmCheckSystemImage: Map images as SEC_IMAGE instead of SEC_COMMIT, and simply read the size off that way. Modified: trunk/reactos/ntoskrnl/mm/sysldr.c Modified: trunk/reactos/ntoskrnl/mm/sysldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/sysldr.c?rev=4…
============================================================================== --- trunk/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] Thu Apr 22 10:04:57 2010 @@ -1590,6 +1590,63 @@ return TRUE; } +LOGICAL +NTAPI +MiUseLargeDriverPage(IN ULONG NumberOfPtes, + IN OUT PVOID *ImageBaseAddress, + IN PUNICODE_STRING BaseImageName, + IN BOOLEAN BootDriver) +{ + PLIST_ENTRY NextEntry; + BOOLEAN DriverFound = FALSE; + PMI_LARGE_PAGE_DRIVER_ENTRY LargePageDriverEntry; + ASSERT(KeGetCurrentIrql () <= APC_LEVEL); + ASSERT(*ImageBaseAddress >= MmSystemRangeStart); + +#ifdef _X86_ + if (!(KeFeatureBits & KF_LARGE_PAGE)) return FALSE; + if (!(__readcr4() & CR4_PSE)) return FALSE; +#endif + + /* Make sure there's enough system PTEs for a large page driver */ + if (MmTotalFreeSystemPtes[SystemPteSpace] < (16 * (PDE_MAPPED_VA >> PAGE_SHIFT))) + { + return FALSE; + } + + /* This happens if the registry key had a "*" (wildcard) in it */ + if (MiLargePageAllDrivers == 0) + { + /* It didn't, so scan the list */ + NextEntry = MiLargePageDriverList.Flink; + while (NextEntry != &MiLargePageDriverList) + { + /* Check if the driver name matches */ + LargePageDriverEntry = CONTAINING_RECORD(NextEntry, + MI_LARGE_PAGE_DRIVER_ENTRY, + Links); + if (RtlEqualUnicodeString(BaseImageName, + &LargePageDriverEntry->BaseName, + TRUE)) + { + /* Enable large pages for this driver */ + DriverFound = TRUE; + break; + } + + /* Keep trying */ + NextEntry = NextEntry->Flink; + } + + /* If we didn't find the driver, it doesn't need large pages */ + if (DriverFound == FALSE) return FALSE; + } + + /* Nothing to do yet */ + DPRINT1("Large pages not supported!\n"); + return FALSE; +} + ULONG NTAPI MiComputeDriverProtection(IN BOOLEAN SessionSpace, @@ -1994,15 +2051,24 @@ IO_STATUS_BLOCK IoStatusBlock; FILE_STANDARD_INFORMATION FileStandardInfo; KAPC_STATE ApcState; + PIMAGE_NT_HEADERS NtHeaders; + OBJECT_ATTRIBUTES ObjectAttributes; PAGED_CODE(); + + /* Setup the object attributes */ + InitializeObjectAttributes(&ObjectAttributes, + NULL, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); /* Create a section for the DLL */ Status = ZwCreateSection(&SectionHandle, SECTION_MAP_EXECUTE, - NULL, + &ObjectAttributes, NULL, PAGE_EXECUTE, - SEC_COMMIT, + SEC_IMAGE, ImageHandle); if (!NT_SUCCESS(Status)) return Status; @@ -2034,17 +2100,35 @@ &FileStandardInfo, sizeof(FileStandardInfo), FileStandardInformation); - if ( NT_SUCCESS(Status) ) + if (NT_SUCCESS(Status)) { /* First, verify the checksum */ if (!LdrVerifyMappedImageMatchesChecksum(ViewBase, - FileStandardInfo. - EndOfFile.LowPart, + ViewSize, FileStandardInfo. EndOfFile.LowPart)) { /* Set checksum failure */ Status = STATUS_IMAGE_CHECKSUM_MISMATCH; + goto Fail; + } + + /* Make sure it's a real image */ + NtHeaders = RtlImageNtHeader(ViewBase); + if (!NtHeaders) + { + /* Set checksum failure */ + Status = STATUS_IMAGE_CHECKSUM_MISMATCH; + goto Fail; + } + + /* Make sure it's for the correct architecture */ + if ((NtHeaders->FileHeader.Machine != IMAGE_FILE_MACHINE_NATIVE) || + (NtHeaders->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR_MAGIC)) + { + /* Set protection failure */ + Status = STATUS_INVALID_IMAGE_PROTECT; + goto Fail; } /* Check that it's a valid SMP image if we have more then one CPU */ @@ -2056,6 +2140,7 @@ } /* Unmap the section, close the handle, and return status */ +Fail: ZwUnmapViewOfSection(NtCurrentProcess(), ViewBase); KeUnstackDetachProcess(&ApcState); ZwClose(SectionHandle); @@ -2330,13 +2415,11 @@ /* Check for success */ if (NT_SUCCESS(Status)) { - #if 0 /* Support large pages for drivers */ MiUseLargeDriverPage(DriverSize / PAGE_SIZE, &ModuleLoadBase, &BaseName, TRUE); - #endif } /* Dereference the section */
14 years, 6 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
44
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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Results per page:
10
25
50
100
200