[irp,bus] Send and handle IRP completion properly for detach
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sun, 23 May 2010 17:36:53 +0000 (13:36 -0400)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sun, 23 May 2010 17:36:53 +0000 (13:36 -0400)
The disk detach handler was not completing the IRP and the
IRP processor was not checking for completion in an outer
while() loop.  Both fixed.

src/winvblock/bus/dev_ctl.c
src/winvblock/irp.c

index 446f909..cd393ae 100644 (file)
@@ -70,6 +70,7 @@ irp__handler_decl (
        {
          DBG ( "Cannot unmount a boot drive.\n" );
          Irp->IoStatus.Information = 0;
+         *completion_ptr = TRUE;
          return STATUS_INVALID_DEVICE_REQUEST;
        }
       DBG ( "Deleting disk %d\n", disk_walker->DiskNumber );
@@ -90,6 +91,7 @@ irp__handler_decl (
     }
   bus_ptr->Children--;
   Irp->IoStatus.Information = 0;
+  *completion_ptr = TRUE;
   return STATUS_SUCCESS;
 }
 
index 213f05a..c062447 100644 (file)
@@ -196,6 +196,8 @@ irp__handler_decl ( irp__process )
          if ( *completion_ptr )
            break;
        }
+      if ( *completion_ptr )
+       break;
       link = link->next;
     }
   return status;