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
April 2022
----- 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
22 participants
157 discussions
Start a n
N
ew thread
[reactos] 01/01: [NTOS:PNP] Fix GCC build (ignoring return value) (#4473)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=55065d3b519eb02248c11…
commit 55065d3b519eb02248c11acf354fe5261067e7d6 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Apr 28 22:16:37 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Apr 28 22:16:37 2022 +0900 [NTOS:PNP] Fix GCC build (ignoring return value) (#4473) [NTOS:PNP] Fix GCC build (ignoring return value) Properly handle RtlDuplicateUnicodeString return status. Addendum to de316477. Thanks to @HBelusca and @Doug-Lyons. --- ntoskrnl/io/pnpmgr/plugplay.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/io/pnpmgr/plugplay.c b/ntoskrnl/io/pnpmgr/plugplay.c index 46093b252b5..e3412c4cfa3 100644 --- a/ntoskrnl/io/pnpmgr/plugplay.c +++ b/ntoskrnl/io/pnpmgr/plugplay.c @@ -245,8 +245,14 @@ IopInitializeDevice( } /* Set the device instance of the device node */ - RtlDuplicateUnicodeString(0, &DeviceInstance, &DeviceNode->InstancePath); - + Status = RtlDuplicateUnicodeString(0, &DeviceInstance, &DeviceNode->InstancePath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlDuplicateUnicodeString() failed (Status 0x%08lx)\n", Status); + IopFreeDeviceNode(DeviceNode); + IoDeleteDevice(DeviceObject); + goto done; + } /* Insert as a root enumerated device node */ PiInsertDevNode(DeviceNode, IopRootDeviceNode);
2 years, 8 months
1
0
0
0
[reactos] 01/01: [NTOS:PNP] IopInitializeDevice: Create a device, allocate a device node and attach it to the root node
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=de316477b9aaaf830d1e9…
commit de316477b9aaaf830d1e9802bc5fec1800140461 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Wed Apr 27 21:52:21 2022 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Wed Apr 27 21:52:21 2022 +0200 [NTOS:PNP] IopInitializeDevice: Create a device, allocate a device node and attach it to the root node --- ntoskrnl/io/pnpmgr/plugplay.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/io/pnpmgr/plugplay.c b/ntoskrnl/io/pnpmgr/plugplay.c index c1f108da332..46093b252b5 100644 --- a/ntoskrnl/io/pnpmgr/plugplay.c +++ b/ntoskrnl/io/pnpmgr/plugplay.c @@ -194,6 +194,7 @@ IopInitializeDevice( { UNICODE_STRING DeviceInstance; PDEVICE_OBJECT DeviceObject; + PDEVICE_NODE DeviceNode; NTSTATUS Status = STATUS_SUCCESS; DPRINT("IopInitializeDevice(%p)\n", ControlData); @@ -210,7 +211,7 @@ IopInitializeDevice( DeviceObject = IopGetDeviceObjectFromDeviceInstance(&DeviceInstance); if (DeviceInstance.Buffer != NULL) { - DPRINT("Device %wZ already exists!\n", &DeviceInstance); + DPRINT1("Device %wZ already exists!\n", &DeviceInstance); Status = STATUS_SUCCESS; goto done; } @@ -219,7 +220,36 @@ IopInitializeDevice( DPRINT("Device %wZ does not exist!\n", &DeviceInstance); - /* FIXME: Create a device node for the device instan*/ + /* Create a device node for the device instance */ + Status = IoCreateDevice(IopRootDriverObject, + 0, + NULL, + FILE_DEVICE_CONTROLLER, + FILE_AUTOGENERATED_DEVICE_NAME, + FALSE, + &DeviceObject); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IoCreateDevice() failed (Status 0x%08lx)\n", Status); + goto done; + } + + /* Allocate a new device node */ + DeviceNode = PipAllocateDeviceNode(DeviceObject); + if (DeviceNode == NULL) + { + DPRINT1("Failed to allocate a device node!\n"); + IoDeleteDevice(DeviceObject); + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + /* Set the device instance of the device node */ + RtlDuplicateUnicodeString(0, &DeviceInstance, &DeviceNode->InstancePath); + + + /* Insert as a root enumerated device node */ + PiInsertDevNode(DeviceNode, IopRootDeviceNode); done: ExFreePool(DeviceInstance.Buffer);
2 years, 8 months
1
0
0
0
[reactos] 01/01: [BOOT:RTL] Fix GCC configuration problem for ARM platform
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03c8832a777ee04a108c7…
commit 03c8832a777ee04a108c7891ef4575f3500b9f97 Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Wed Apr 27 21:52:05 2022 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Wed Apr 27 21:52:05 2022 +0300 [BOOT:RTL] Fix GCC configuration problem for ARM platform Addendum to 24cb57fd. CORE-17604 --- boot/rtl/blrtl.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boot/rtl/blrtl.cmake b/boot/rtl/blrtl.cmake index 754116c5d3a..692727892b0 100644 --- a/boot/rtl/blrtl.cmake +++ b/boot/rtl/blrtl.cmake @@ -47,7 +47,8 @@ elseif(ARCH STREQUAL "amd64") ${NTOS_RTL_SOURCE_DIR}/byteswap.c ${NTOS_RTL_SOURCE_DIR}/mem.c) elseif(ARCH STREQUAL "arm") - list(APPEND ASM_SOURCE arm/debug_asm.S) + list(APPEND ASM_SOURCE + ${NTOS_RTL_SOURCE_DIR}/arm/debug_asm.S) list(APPEND SOURCE ${NTOS_RTL_SOURCE_DIR}/byteswap.c ${NTOS_RTL_SOURCE_DIR}/mem.c)
2 years, 8 months
1
0
0
0
[reactos] 01/01: [EXPLORER] syspager.cpp: Add '\n' to debug logs (#4470)
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7486dbe83378aaf39c932…
commit 7486dbe83378aaf39c932828fe65a47aad4804fb Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com> AuthorDate: Wed Apr 27 14:40:13 2022 +0200 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Apr 27 15:40:13 2022 +0300 [EXPLORER] syspager.cpp: Add '\n' to debug logs (#4470) --- base/shell/explorer/syspager.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/base/shell/explorer/syspager.cpp b/base/shell/explorer/syspager.cpp index 072f1ef522b..1bb2691b40f 100644 --- a/base/shell/explorer/syspager.cpp +++ b/base/shell/explorer/syspager.cpp @@ -717,7 +717,7 @@ BOOL CNotifyToolbar::AddButton(_In_ CONST NOTIFYICONDATA *iconData) InternalIconData * notifyItem; WCHAR text[] = L""; - TRACE("Adding icon %d from hWnd %08x flags%s%s state%s%s", + TRACE("Adding icon %d from hWnd %08x flags%s%s state%s%s\n", iconData->uID, iconData->hWnd, (iconData->uFlags & NIF_ICON) ? " ICON" : "", (iconData->uFlags & NIF_STATE) ? " STATE" : "", @@ -727,7 +727,7 @@ BOOL CNotifyToolbar::AddButton(_In_ CONST NOTIFYICONDATA *iconData) int index = FindItem(iconData->hWnd, iconData->uID, ¬ifyItem); if (index >= 0) { - TRACE("Icon %d from hWnd %08x ALREADY EXISTS!", iconData->uID, iconData->hWnd); + TRACE("Icon %d from hWnd %08x ALREADY EXISTS!\n", iconData->uID, iconData->hWnd); return FALSE; } @@ -764,7 +764,7 @@ BOOL CNotifyToolbar::AddButton(_In_ CONST NOTIFYICONDATA *iconData) if (iIcon < 0) { notifyItem->hIcon = NULL; - TRACE("Shared icon requested, but HICON not found!!!"); + TRACE("Shared icon requested, but HICON not found!!!\n"); } tbBtn.iBitmap = iIcon; } @@ -816,13 +816,13 @@ BOOL CNotifyToolbar::SwitchVersion(_In_ CONST NOTIFYICONDATA *iconData) int index = FindItem(iconData->hWnd, iconData->uID, ¬ifyItem); if (index < 0) { - WARN("Icon %d from hWnd %08x DOES NOT EXIST!", iconData->uID, iconData->hWnd); + WARN("Icon %d from hWnd %08x DOES NOT EXIST!\n", iconData->uID, iconData->hWnd); return FALSE; } if (iconData->uVersion != 0 && iconData->uVersion != NOTIFYICON_VERSION) { - WARN("Tried to set the version of icon %d from hWnd %08x, to an unknown value %d. Vista+ program?", iconData->uID, iconData->hWnd, iconData->uVersion); + WARN("Tried to set the version of icon %d from hWnd %08x, to an unknown value %d. Vista+ program?\n", iconData->uID, iconData->hWnd, iconData->uVersion); return FALSE; } @@ -901,7 +901,7 @@ BOOL CNotifyToolbar::UpdateButton(_In_ CONST NOTIFYICONDATA *iconData) } else { - TRACE("Shared icon requested, but HICON not found!!! IGNORING!"); + TRACE("Shared icon requested, but HICON not found!!! IGNORING!\n"); } } else @@ -942,7 +942,7 @@ BOOL CNotifyToolbar::RemoveButton(_In_ CONST NOTIFYICONDATA *iconData) { InternalIconData * notifyItem; - TRACE("Removing icon %d from hWnd %08x", iconData->uID, iconData->hWnd); + TRACE("Removing icon %d from hWnd %08x\n", iconData->uID, iconData->hWnd); int index = FindItem(iconData->hWnd, iconData->uID, ¬ifyItem); if (index < 0)
2 years, 8 months
1
0
0
0
[reactos] 01/01: [NTOS:PNP] Halfplement IoInvalidateDeviceState
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cf0bc1c1321047b879edc…
commit cf0bc1c1321047b879edcd19bfbf08138ba9c988 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Wed Oct 13 02:28:24 2021 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Wed Apr 27 02:42:20 2022 +0300 [NTOS:PNP] Halfplement IoInvalidateDeviceState Implement the correct start-stop sequence for resource rebalancing without the actual rebalancing. Also move IoInvalidateDeviceState processing into the enumeration thread as it should be. CORE-17519 --- ntoskrnl/include/internal/io.h | 13 ++- ntoskrnl/io/pnpmgr/devaction.c | 174 ++++++++++++++++++++++------------------- ntoskrnl/io/pnpmgr/pnpirp.c | 55 ++++++++++++- ntoskrnl/io/pnpmgr/pnpmgr.c | 8 ++ 4 files changed, 167 insertions(+), 83 deletions(-) diff --git a/ntoskrnl/include/internal/io.h b/ntoskrnl/include/internal/io.h index ca18912a941..d877bd6fa97 100644 --- a/ntoskrnl/include/internal/io.h +++ b/ntoskrnl/include/internal/io.h @@ -527,7 +527,8 @@ typedef enum _DEVICE_ACTION PiActionEnumRootDevices, PiActionResetDevice, PiActionAddBootDevices, - PiActionStartDevice + PiActionStartDevice, + PiActionQueryState, } DEVICE_ACTION; // @@ -1403,6 +1404,16 @@ PiIrpQueryDeviceRelations( _In_ PDEVICE_NODE DeviceNode, _In_ DEVICE_RELATION_TYPE Type); +NTSTATUS +PiIrpQueryResources( + _In_ PDEVICE_NODE DeviceNode, + _Out_ PCM_RESOURCE_LIST *Resources); + +NTSTATUS +PiIrpQueryResourceRequirements( + _In_ PDEVICE_NODE DeviceNode, + _Out_ PIO_RESOURCE_REQUIREMENTS_LIST *Resources); + NTSTATUS PiIrpQueryDeviceText( _In_ PDEVICE_NODE DeviceNode, diff --git a/ntoskrnl/io/pnpmgr/devaction.c b/ntoskrnl/io/pnpmgr/devaction.c index 559fc087b0c..a3b03d5bd2c 100644 --- a/ntoskrnl/io/pnpmgr/devaction.c +++ b/ntoskrnl/io/pnpmgr/devaction.c @@ -1552,8 +1552,8 @@ PiStartDeviceFinal( DPRINT("IopInitiatePnpIrp() failed (Status 0x%08lx)\n", Status); } - /* Invalidate device state so IRP_MN_QUERY_PNP_DEVICE_STATE is sent */ - IoInvalidateDeviceState(DeviceNode->PhysicalDeviceObject); + // Query the device state (IRP_MN_QUERY_PNP_DEVICE_STATE) + PiQueueDeviceAction(DeviceNode->PhysicalDeviceObject, PiActionQueryState, NULL, NULL); DPRINT("Sending GUID_DEVICE_ARRIVAL %wZ\n", &DeviceNode->InstancePath); IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL, &DeviceNode->InstancePath); @@ -2025,25 +2025,27 @@ IopRemoveDevice(PDEVICE_NODE DeviceNode) return Status; } -/* - * @implemented +/** + * @brief Processes the IoInvalidateDeviceState request + * + * Sends IRP_MN_QUERY_PNP_DEVICE_STATE request and sets device node's flags + * according to the result. + * Tree reenumeration should be started upon a successful return of the function. + * + * @todo Do not return STATUS_SUCCESS if nothing is changed. */ -VOID -NTAPI -IoInvalidateDeviceState(IN PDEVICE_OBJECT PhysicalDeviceObject) +static +NTSTATUS +PiUpdateDeviceState( + _In_ PDEVICE_NODE DeviceNode) { - PDEVICE_NODE DeviceNode = IopGetDeviceNode(PhysicalDeviceObject); PNP_DEVICE_STATE PnPFlags; NTSTATUS Status; Status = PiIrpQueryPnPDeviceState(DeviceNode, &PnPFlags); if (!NT_SUCCESS(Status)) { - if (Status != STATUS_NOT_SUPPORTED) - { - DPRINT1("IRP_MN_QUERY_PNP_DEVICE_STATE failed with status 0x%lx\n", Status); - } - return; + return Status; } if (PnPFlags & PNP_DEVICE_NOT_DISABLEABLE) @@ -2056,83 +2058,37 @@ IoInvalidateDeviceState(IN PDEVICE_OBJECT PhysicalDeviceObject) else DeviceNode->UserFlags &= ~DNUF_DONT_SHOW_IN_UI; - if ((PnPFlags & PNP_DEVICE_REMOVED) || - ((PnPFlags & PNP_DEVICE_FAILED) && !(PnPFlags & PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED))) + if (PnPFlags & PNP_DEVICE_REMOVED || PnPFlags & PNP_DEVICE_DISABLED) { - /* Flag it if it's failed */ - if (PnPFlags & PNP_DEVICE_FAILED) - { - PiSetDevNodeProblem(DeviceNode, CM_PROB_FAILED_POST_START); - } + PiSetDevNodeProblem(DeviceNode, + PnPFlags & PNP_DEVICE_DISABLED + ? CM_PROB_HARDWARE_DISABLED + : CM_PROB_DEVICE_NOT_THERE); - DeviceNode->Flags |= DNF_DEVICE_GONE; PiSetDevNodeState(DeviceNode, DeviceNodeAwaitingQueuedRemoval); } - // it doesn't work anyway. A real resource rebalancing should be implemented -#if 0 - else if ((PnPFlags & PNP_DEVICE_FAILED) && (PnPFlags & PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED)) - { - /* Stop for resource rebalance */ - Status = IopStopDevice(DeviceNode); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to stop device for rebalancing\n"); - - /* Stop failed so don't rebalance */ - PnPFlags &= ~PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED; - } - } - - /* Resource rebalance */ - if (PnPFlags & PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED) + else if (PnPFlags & PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED) { - DPRINT("Sending IRP_MN_QUERY_RESOURCES to device stack\n"); + // Query resource rebalance - Status = IopInitiatePnpIrp(PhysicalDeviceObject, - &IoStatusBlock, - IRP_MN_QUERY_RESOURCES, - NULL); - if (NT_SUCCESS(Status) && IoStatusBlock.Information) - { - DeviceNode->BootResources = - (PCM_RESOURCE_LIST)IoStatusBlock.Information; - IopDeviceNodeSetFlag(DeviceNode, DNF_HAS_BOOT_CONFIG); - } - else - { - DPRINT("IopInitiatePnpIrp() failed (Status %x) or IoStatusBlock.Information=NULL\n", Status); - DeviceNode->BootResources = NULL; - } - - DPRINT("Sending IRP_MN_QUERY_RESOURCE_REQUIREMENTS to device stack\n"); - - Status = IopInitiatePnpIrp(PhysicalDeviceObject, - &IoStatusBlock, - IRP_MN_QUERY_RESOURCE_REQUIREMENTS, - NULL); - if (NT_SUCCESS(Status)) - { - DeviceNode->ResourceRequirements = - (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information; - } + if (PnPFlags & PNP_DEVICE_FAILED) + DeviceNode->Flags &= DNF_NON_STOPPED_REBALANCE; else - { - DPRINT("IopInitiatePnpIrp() failed (Status %08lx)\n", Status); - DeviceNode->ResourceRequirements = NULL; - } - - /* IRP_MN_FILTER_RESOURCE_REQUIREMENTS is called indirectly by IopStartDevice */ - if (IopStartDevice(DeviceNode) != STATUS_SUCCESS) - { - DPRINT1("Restart after resource rebalance failed\n"); + DeviceNode->Flags |= DNF_NON_STOPPED_REBALANCE; - DeviceNode->Flags &= ~(DNF_STARTED | DNF_START_REQUEST_PENDING); - DeviceNode->Flags |= DNF_START_FAILED; + // Clear DNF_NO_RESOURCE_REQUIRED just in case (will be set back if needed) + DeviceNode->Flags &= ~DNF_NO_RESOURCE_REQUIRED; - IopRemoveDevice(DeviceNode); - } + // This will be caught up later by enumeration + DeviceNode->Flags |= DNF_RESOURCE_REQUIREMENTS_CHANGED; } -#endif + else if (PnPFlags & PNP_DEVICE_FAILED) + { + PiSetDevNodeProblem(DeviceNode, CM_PROB_FAILED_POST_START); + PiSetDevNodeState(DeviceNode, DeviceNodeAwaitingQueuedRemoval); + } + + return STATUS_SUCCESS; } static @@ -2327,6 +2283,30 @@ cleanup: &DeviceNode->InstancePath); } +static +VOID +PiFakeResourceRebalance( + _In_ PDEVICE_NODE DeviceNode) +{ + ASSERT(DeviceNode->Flags & DNF_RESOURCE_REQUIREMENTS_CHANGED); + + PCM_RESOURCE_LIST bootConfig = NULL; + PIO_RESOURCE_REQUIREMENTS_LIST resourceRequirements = NULL; + + PiIrpQueryResources(DeviceNode, &bootConfig); + PiIrpQueryResourceRequirements(DeviceNode, &resourceRequirements); + + DeviceNode->BootResources = bootConfig; + DeviceNode->ResourceRequirements = resourceRequirements; + + if (bootConfig) + { + DeviceNode->Flags |= DNF_HAS_BOOT_CONFIG; + } + + DeviceNode->Flags &= ~DNF_RESOURCE_REQUIREMENTS_CHANGED; +} + static VOID PiDevNodeStateMachine( @@ -2420,12 +2400,28 @@ PiDevNodeStateMachine( PiSetDevNodeState(currentNode, DeviceNodeEnumerateCompletion); doProcessAgain = TRUE; } + else if (currentNode->Flags & DNF_RESOURCE_REQUIREMENTS_CHANGED) + { + if (currentNode->Flags & DNF_NON_STOPPED_REBALANCE) + { + PiFakeResourceRebalance(currentNode); + currentNode->Flags &= ~DNF_NON_STOPPED_REBALANCE; + } + else + { + PiIrpQueryStopDevice(currentNode); + PiSetDevNodeState(currentNode, DeviceNodeQueryStopped); + } + + doProcessAgain = TRUE; + } break; case DeviceNodeQueryStopped: // we're here after sending IRP_MN_QUERY_STOP_DEVICE status = currentNode->CompletionStatus; if (NT_SUCCESS(status)) { + PiIrpStopDevice(currentNode); PiSetDevNodeState(currentNode, DeviceNodeStopped); } else @@ -2433,10 +2429,14 @@ PiDevNodeStateMachine( PiIrpCancelStopDevice(currentNode); PiSetDevNodeState(currentNode, DeviceNodeStarted); } + doProcessAgain = TRUE; break; case DeviceNodeStopped: // TODO: do resource rebalance (not implemented) - ASSERT(FALSE); + PiFakeResourceRebalance(currentNode); + + PiSetDevNodeState(currentNode, DeviceNodeDriversAdded); + doProcessAgain = TRUE; break; case DeviceNodeRestartCompletion: break; @@ -2522,6 +2522,8 @@ ActionToStr( return "PiActionAddBootDevices"; case PiActionStartDevice: return "PiActionStartDevice"; + case PiActionQueryState: + return "PiActionQueryState"; default: return "(request unknown)"; } @@ -2596,6 +2598,16 @@ PipDeviceActionWorker( } break; + case PiActionQueryState: + // First, do a IRP_MN_QUERY_PNP_DEVICE_STATE request, + // it will update node's flags and then do enumeration if something changed + status = PiUpdateDeviceState(deviceNode); + if (NT_SUCCESS(status)) + { + PiDevNodeStateMachine(deviceNode); + } + break; + default: DPRINT1("Unimplemented device action %u\n", Request->Action); status = STATUS_NOT_IMPLEMENTED; diff --git a/ntoskrnl/io/pnpmgr/pnpirp.c b/ntoskrnl/io/pnpmgr/pnpirp.c index 66e4382bdc6..952150b2731 100644 --- a/ntoskrnl/io/pnpmgr/pnpirp.c +++ b/ntoskrnl/io/pnpmgr/pnpirp.c @@ -196,6 +196,58 @@ PiIrpQueryDeviceRelations( return status; } +// IRP_MN_QUERY_RESOURCES (0x0A) +NTSTATUS +PiIrpQueryResources( + _In_ PDEVICE_NODE DeviceNode, + _Out_ PCM_RESOURCE_LIST *Resources) +{ + PAGED_CODE(); + + ASSERT(DeviceNode); + + ULONG_PTR longRes; + IO_STACK_LOCATION stack = { + .MajorFunction = IRP_MJ_PNP, + .MinorFunction = IRP_MN_QUERY_RESOURCES + }; + + NTSTATUS status; + status = IopSynchronousCall(DeviceNode->PhysicalDeviceObject, &stack, (PVOID)&longRes); + if (NT_SUCCESS(status)) + { + *Resources = (PVOID)longRes; + } + + return status; +} + +// IRP_MN_QUERY_RESOURCE_REQUIREMENTS (0x0B) +NTSTATUS +PiIrpQueryResourceRequirements( + _In_ PDEVICE_NODE DeviceNode, + _Out_ PIO_RESOURCE_REQUIREMENTS_LIST *Resources) +{ + PAGED_CODE(); + + ASSERT(DeviceNode); + + ULONG_PTR longRes; + IO_STACK_LOCATION stack = { + .MajorFunction = IRP_MJ_PNP, + .MinorFunction = IRP_MN_QUERY_RESOURCE_REQUIREMENTS + }; + + NTSTATUS status; + status = IopSynchronousCall(DeviceNode->PhysicalDeviceObject, &stack, (PVOID)&longRes); + if (NT_SUCCESS(status)) + { + *Resources = (PVOID)longRes; + } + + return status; +} + // IRP_MN_QUERY_DEVICE_TEXT (0x0C) NTSTATUS PiIrpQueryDeviceText( @@ -236,7 +288,8 @@ PiIrpQueryPnPDeviceState( PAGED_CODE(); ASSERT(DeviceNode); - ASSERT(DeviceNode->State == DeviceNodeStartPostWork || + ASSERT(DeviceNode->State == DeviceNodeResourcesAssigned || + DeviceNode->State == DeviceNodeStartPostWork || DeviceNode->State == DeviceNodeStarted); ULONG_PTR longState; diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index 1d06943032a..e2f7ba98da5 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -2412,3 +2412,11 @@ IoTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, AddressSpace, TranslatedAddress); } + +VOID +NTAPI +IoInvalidateDeviceState( + IN PDEVICE_OBJECT DeviceObject) +{ + PiQueueDeviceAction(DeviceObject, PiActionQueryState, NULL, NULL); +}
2 years, 8 months
1
0
0
0
[reactos] 14/14: [CMAKE] Build GCC and Clang builds with -fno-common
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8f40fc7ede620213ef6d6…
commit 8f40fc7ede620213ef6d647d4c0ae5aa66bacf12 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Tue Apr 26 03:15:46 2022 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Apr 26 04:22:27 2022 +0300 [CMAKE] Build GCC and Clang builds with -fno-common --- sdk/cmake/gcc.cmake | 4 ++-- sdk/cmake/msvc.cmake | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index 921583cb276..076a9fc5731 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -39,7 +39,8 @@ if(STACK_PROTECTOR) endif() # Compiler Core -add_compile_options(-pipe -fms-extensions -fno-strict-aliasing) +# note: -fno-common is default since GCC 10 +add_compile_options(-pipe -fms-extensions -fno-strict-aliasing -fno-common) # Prevent GCC from searching any of the default directories. # The case for C++ is handled through the reactos_c++ INTERFACE library @@ -54,7 +55,6 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wno-microsoft>") add_compile_options(-Wno-pragma-pack) add_compile_options(-fno-associative-math) - add_compile_options(-fcommon) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0) # disable "libcall optimization" diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake index 5c6492f448e..cfd852211f6 100644 --- a/sdk/cmake/msvc.cmake +++ b/sdk/cmake/msvc.cmake @@ -55,11 +55,6 @@ if(ARCH STREQUAL "i386") endif() endif() -# CLang default to -fno-common from version 11 onward. We are not ready for this now -if (USE_CLANG_CL) - add_compile_options(-fcommon) -endif() - # VS 12+ requires /FS when used in parallel compilations if(NOT MSVC_IDE) add_compile_options(/FS)
2 years, 8 months
1
0
0
0
[reactos] 13/14: [WBEMPROX] Global variable compatibility update for gcc 10.
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=93dcc8436ce7828244e5e…
commit 93dcc8436ce7828244e5ea99614a6a8610b4ccd0 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Tue Apr 26 03:08:02 2022 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Apr 26 03:38:38 2022 +0300 [WBEMPROX] Global variable compatibility update for gcc 10. Imported Wine commit da21c305164c3e585e29e20242afc5a31f91989f Signed-off-by: Michael Cronenworth <mike(a)cchtml.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dll/win32/wbemprox/main.c | 2 ++ dll/win32/wbemprox/wbemprox_private.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dll/win32/wbemprox/main.c b/dll/win32/wbemprox/main.c index d90f4f8cc63..09084414983 100644 --- a/dll/win32/wbemprox/main.c +++ b/dll/win32/wbemprox/main.c @@ -35,6 +35,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); static HINSTANCE instance; +struct list *table_list; + typedef HRESULT (*fnCreateInstance)( LPVOID *ppObj ); typedef struct diff --git a/dll/win32/wbemprox/wbemprox_private.h b/dll/win32/wbemprox/wbemprox_private.h index 5c04c45d973..78254755fd1 100644 --- a/dll/win32/wbemprox/wbemprox_private.h +++ b/dll/win32/wbemprox/wbemprox_private.h @@ -25,8 +25,8 @@ #include <winnls.h> #endif -IClientSecurity client_security DECLSPEC_HIDDEN; -struct list *table_list DECLSPEC_HIDDEN; +extern IClientSecurity client_security DECLSPEC_HIDDEN; +extern struct list *table_list DECLSPEC_HIDDEN; enum param_direction {
2 years, 8 months
1
0
0
0
[reactos] 12/14: [TWAIN_32] Global variable compatibility update for gcc 10.
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c6aac2bbfd8aaa192e5c9…
commit c6aac2bbfd8aaa192e5c9f2d2115660589f1fd00 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Tue Apr 26 03:05:26 2022 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Apr 26 03:38:38 2022 +0300 [TWAIN_32] Global variable compatibility update for gcc 10. Imported Wine commit 4a91eb362666b3af549c48b95e093051756628e0 Signed-off-by: Michael Cronenworth <mike(a)cchtml.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dll/win32/twain_32/twain32_main.c | 4 +++- dll/win32/twain_32/twain_i.h | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dll/win32/twain_32/twain32_main.c b/dll/win32/twain_32/twain32_main.c index b1beb969580..0f8ee144306 100644 --- a/dll/win32/twain_32/twain32_main.c +++ b/dll/win32/twain_32/twain32_main.c @@ -29,7 +29,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(twain); -extern HINSTANCE DSM_hinstance; +TW_UINT16 DSM_twCC; +activeDS *activeSources; +HINSTANCE DSM_hinstance; BOOL WINAPI DllMain (HINSTANCE hinstance, DWORD reason, LPVOID reserved) { diff --git a/dll/win32/twain_32/twain_i.h b/dll/win32/twain_32/twain_i.h index 7939d233bb0..fb3a4ec1a65 100644 --- a/dll/win32/twain_32/twain_i.h +++ b/dll/win32/twain_32/twain_i.h @@ -45,11 +45,11 @@ typedef struct tagActiveDS HWND event_window; } activeDS; -TW_UINT16 DSM_twCC DECLSPEC_HIDDEN; /* current condition code of Source Manager */ +extern TW_UINT16 DSM_twCC DECLSPEC_HIDDEN; /* current condition code of Source Manager */ -activeDS *activeSources DECLSPEC_HIDDEN; /* list of active data sources */ +extern activeDS *activeSources DECLSPEC_HIDDEN; /* list of active data sources */ -HINSTANCE DSM_hinstance DECLSPEC_HIDDEN; +extern HINSTANCE DSM_hinstance DECLSPEC_HIDDEN; /* Implementation of operation triplets (From Application to Source Manager) */ extern TW_UINT16 TWAIN_CloseDS
2 years, 8 months
1
0
0
0
[reactos] 11/14: [MSHTML] Global variable compatibility update for gcc 10.
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f4a01431cab7a461c5c33…
commit f4a01431cab7a461c5c336b173484cf3f30dcbd3 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Tue Apr 26 03:00:27 2022 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Apr 26 03:38:38 2022 +0300 [MSHTML] Global variable compatibility update for gcc 10. Imported Wine commit e402fdf364fc76838ba4e11a11fef3c552110639 Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dll/win32/mshtml/main.c | 7 +++++++ dll/win32/mshtml/mshtml_private.h | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dll/win32/mshtml/main.c b/dll/win32/mshtml/main.c index 9ea088e73c1..18e4ffb7730 100644 --- a/dll/win32/mshtml/main.c +++ b/dll/win32/mshtml/main.c @@ -30,6 +30,13 @@ HINSTANCE hInst; DWORD mshtml_tls = TLS_OUT_OF_INDEXES; +void (__cdecl *ccp_init)(ExternalCycleCollectionParticipant*,const CCObjCallback*); +nsrefcnt (__cdecl *ccref_incr)(nsCycleCollectingAutoRefCnt*,nsISupports*); +nsrefcnt (__cdecl *ccref_decr)(nsCycleCollectingAutoRefCnt*,nsISupports*,ExternalCycleCollectionParticipant*); +void (__cdecl *ccref_init)(nsCycleCollectingAutoRefCnt*,nsrefcnt); +void (__cdecl *describe_cc_node)(nsCycleCollectingAutoRefCnt*,const char*,nsCycleCollectionTraversalCallback*); +void (__cdecl *note_cc_edge)(nsISupports*,const char*,nsCycleCollectionTraversalCallback*); + static HINSTANCE shdoclc = NULL; static HDC display_dc; static WCHAR *status_strings[IDS_STATUS_LAST-IDS_STATUS_FIRST+1]; diff --git a/dll/win32/mshtml/mshtml_private.h b/dll/win32/mshtml/mshtml_private.h index fb375b4afa9..df72fda159c 100644 --- a/dll/win32/mshtml/mshtml_private.h +++ b/dll/win32/mshtml/mshtml_private.h @@ -298,12 +298,12 @@ typedef struct { DEFINE_GUID(IID_nsXPCOMCycleCollectionParticipant, 0x9674489b,0x1f6f,0x4550,0xa7,0x30, 0xcc,0xae,0xdd,0x10,0x4c,0xf9); -nsrefcnt (__cdecl *ccref_incr)(nsCycleCollectingAutoRefCnt*,nsISupports*) DECLSPEC_HIDDEN; -nsrefcnt (__cdecl *ccref_decr)(nsCycleCollectingAutoRefCnt*,nsISupports*,ExternalCycleCollectionParticipant*) DECLSPEC_HIDDEN; -void (__cdecl *ccref_init)(nsCycleCollectingAutoRefCnt*,nsrefcnt) DECLSPEC_HIDDEN; -void (__cdecl *ccp_init)(ExternalCycleCollectionParticipant*,const CCObjCallback*) DECLSPEC_HIDDEN; -void (__cdecl *describe_cc_node)(nsCycleCollectingAutoRefCnt*,const char*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN; -void (__cdecl *note_cc_edge)(nsISupports*,const char*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN; +extern nsrefcnt (__cdecl *ccref_incr)(nsCycleCollectingAutoRefCnt*,nsISupports*) DECLSPEC_HIDDEN; +extern nsrefcnt (__cdecl *ccref_decr)(nsCycleCollectingAutoRefCnt*,nsISupports*,ExternalCycleCollectionParticipant*) DECLSPEC_HIDDEN; +extern void (__cdecl *ccref_init)(nsCycleCollectingAutoRefCnt*,nsrefcnt) DECLSPEC_HIDDEN; +extern void (__cdecl *ccp_init)(ExternalCycleCollectionParticipant*,const CCObjCallback*) DECLSPEC_HIDDEN; +extern void (__cdecl *describe_cc_node)(nsCycleCollectingAutoRefCnt*,const char*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN; +extern void (__cdecl *note_cc_edge)(nsISupports*,const char*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN; void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*) DECLSPEC_HIDDEN; void release_dispex(DispatchEx*) DECLSPEC_HIDDEN;
2 years, 8 months
1
0
0
0
[reactos] 10/14: [CRYPT32] Global variable compatibility update for gcc 10.
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=351fa5120a6b1a8728090…
commit 351fa5120a6b1a8728090da96eecec6eee9fd959 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Tue Apr 26 02:55:36 2022 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Apr 26 03:38:38 2022 +0300 [CRYPT32] Global variable compatibility update for gcc 10. Imported Wine commit 5740b735cdb44fb89a41f3090dcc3dabf360ab41 Signed-off-by: Michael Cronenworth <mike(a)cchtml.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dll/win32/crypt32/crypt32_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/crypt32/crypt32_private.h b/dll/win32/crypt32/crypt32_private.h index ac70fe04f82..838d76a91a9 100644 --- a/dll/win32/crypt32/crypt32_private.h +++ b/dll/win32/crypt32/crypt32_private.h @@ -152,7 +152,7 @@ BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType, */ HCRYPTPROV WINAPI I_CryptGetDefaultCryptProv(ALG_ID); -HINSTANCE hInstance DECLSPEC_HIDDEN; +extern HINSTANCE hInstance DECLSPEC_HIDDEN; void crypt_oid_init(void) DECLSPEC_HIDDEN; void crypt_oid_free(void) DECLSPEC_HIDDEN;
2 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200