[httpdisk/bus] Initialize the bus FDO device extension
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sat, 8 Jan 2011 01:42:04 +0000 (20:42 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sat, 8 Jan 2011 01:42:04 +0000 (20:42 -0500)
src/httpdisk/bus.c

index 58a2c7b..0098db7 100644 (file)
@@ -31,6 +31,7 @@
 #include "dummy.h"
 #include "bus.h"
 #include "irp.h"
+#include "httpdisk.h"
 
 /** From httpdisk.c */
 extern PDRIVER_OBJECT HttpdiskDriverObj;
@@ -108,10 +109,11 @@ NTSTATUS HttpdiskBusIrp(IN PDEVICE_OBJECT DevObj, IN PIRP Irp) {
 
 static NTSTATUS STDCALL HttpdiskBusCreateFdo_(void) {
     NTSTATUS status;
+    HTTPDISK_SP_DEV dev;
 
     status = IoCreateDevice(
         HttpdiskDriverObj,
-        0,
+        sizeof *dev,
         &HttpdiskBusName_,
         FILE_DEVICE_CONTROLLER,
         FILE_DEVICE_SECURE_OPEN,
@@ -123,6 +125,10 @@ static NTSTATUS STDCALL HttpdiskBusCreateFdo_(void) {
         return status;
       }
 
+    /* Initialize device extension. */
+    dev = HttpdiskBus_.Fdo->DeviceExtension;
+    dev->bus = TRUE;
+
     DBG("FDO created: %p.\n", (PVOID) HttpdiskBus_.Fdo);
     return STATUS_SUCCESS;
   }