Author: cgutman
Date: Sun Apr 4 23:43:51 2010
New Revision: 46724
URL: http://svn.reactos.org/svn/reactos?rev=46724&view=rev
Log:
[NTOSKRNL]
- Revert r46720 and fix the issue properly
Modified:
trunk/reactos/ntoskrnl/io/iomgr/irp.c
trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Sun Apr 4 23:43:51 2010
@@ -460,22 +460,6 @@
}
else
{
- /* Check if we have an associated user IOSB */
- if (Irp->UserIosb)
- {
- /* We do, so let's give them the final status */
- _SEH2_TRY
- {
- /* Save the IOSB Information */
- *Irp->UserIosb = Irp->IoStatus;
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- /* Ignore any error */
- }
- _SEH2_END;
- }
-
/*
* Either we didn't return from the request, or we did return but this
* request was synchronous.
@@ -485,6 +469,9 @@
/* So we did return with a synch operation, was it the IRP? */
if (Irp->Flags & IRP_SYNCHRONOUS_API)
{
+ /* Yes, this IRP was synchronous, so return the I/O Status */
+ *Irp->UserIosb = Irp->IoStatus;
+
/* Now check if the user gave an event */
if (Irp->UserEvent)
{
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] Sun Apr 4 23:43:51 2010
@@ -163,7 +163,10 @@
DPRINT("IopInitiatePnpIrp(IRP_MN_FILTER_RESOURCE_REQUIREMENTS) failed\n");
return Status;
}
- DeviceNode->ResourceRequirements = (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information;
+ else if (NT_SUCCESS(Status))
+ {
+ DeviceNode->ResourceRequirements = (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information;
+ }
Status = IopAssignDeviceResources(DeviceNode, &RequiredLength);
if (NT_SUCCESS(Status))
Author: cgutman
Date: Sun Apr 4 20:22:54 2010
New Revision: 46720
URL: http://svn.reactos.org/svn/reactos?rev=46720&view=rev
Log:
- Move the code from my previous commit before signalling the user event
- Sorry for the wasted commit number
Modified:
trunk/reactos/ntoskrnl/io/iomgr/irp.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Sun Apr 4 20:22:54 2010
@@ -460,6 +460,22 @@
}
else
{
+ /* Check if we have an associated user IOSB */
+ if (Irp->UserIosb)
+ {
+ /* We do, so let's give them the final status */
+ _SEH2_TRY
+ {
+ /* Save the IOSB Information */
+ *Irp->UserIosb = Irp->IoStatus;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Ignore any error */
+ }
+ _SEH2_END;
+ }
+
/*
* Either we didn't return from the request, or we did return but this
* request was synchronous.
@@ -490,22 +506,6 @@
FileObject->FinalStatus = Irp->IoStatus.Status;
KeSetEvent(&FileObject->Event, 0, FALSE);
}
- }
-
- /* Check if we have an associated user IOSB */
- if (Irp->UserIosb)
- {
- /* We do, so let's give them the final status */
- _SEH2_TRY
- {
- /* Save the IOSB Information */
- *Irp->UserIosb = Irp->IoStatus;
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- /* Ignore any error */
- }
- _SEH2_END;
}
/* Now that we got here, we do this for incomplete I/Os as well */
Author: cgutman
Date: Sun Apr 4 20:17:51 2010
New Revision: 46719
URL: http://svn.reactos.org/svn/reactos?rev=46719&view=rev
Log:
[NTOSKRNL]
- Fix a case where we miss copying back the IO_STATUS_BLOCK into the UserIosb buffer
- Fixes the registry corruption caused when PnP wrote an invalid resource list (passed back via UserIosb->Information) to the registry
- Hopefully this also fixes a few other nasty bugs in other areas related to this issue
Modified:
trunk/reactos/ntoskrnl/io/iomgr/irp.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Sun Apr 4 20:17:51 2010
@@ -469,9 +469,6 @@
/* So we did return with a synch operation, was it the IRP? */
if (Irp->Flags & IRP_SYNCHRONOUS_API)
{
- /* Yes, this IRP was synchronous, so return the I/O Status */
- *Irp->UserIosb = Irp->IoStatus;
-
/* Now check if the user gave an event */
if (Irp->UserEvent)
{
@@ -493,6 +490,22 @@
FileObject->FinalStatus = Irp->IoStatus.Status;
KeSetEvent(&FileObject->Event, 0, FALSE);
}
+ }
+
+ /* Check if we have an associated user IOSB */
+ if (Irp->UserIosb)
+ {
+ /* We do, so let's give them the final status */
+ _SEH2_TRY
+ {
+ /* Save the IOSB Information */
+ *Irp->UserIosb = Irp->IoStatus;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Ignore any error */
+ }
+ _SEH2_END;
}
/* Now that we got here, we do this for incomplete I/Os as well */