[httpdisk] Create PDO on WinVBlock bus
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sat, 8 Jan 2011 00:00:46 +0000 (19:00 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sat, 8 Jan 2011 00:01:19 +0000 (19:01 -0500)
src/httpdisk/bus.c

index 83cab9d..c4fd61f 100644 (file)
@@ -28,6 +28,7 @@
 #include "portable.h"
 #include "winvblock.h"
 #include "debug.h"
+#include "dummy.h"
 
 /** Exports. */
 NTSTATUS STDCALL HttpdiskBusEstablish(void);
@@ -94,6 +95,26 @@ static NTSTATUS STDCALL HttpdiskBusCreateFdo_(void) {
   }
 
 static NTSTATUS STDCALL HttpdiskBusCreatePdo_(void) {
+    NTSTATUS status;
+
+    /* Generate dummy IDs for the HTTPDisk bus PDO. */
+    WV_M_DUMMY_ID_GEN(
+        static const,
+        HttpdiskBusDummyIds_,
+        WVL_M_WLIT L"\\HTTPDisk",
+        L"0",
+        WVL_M_WLIT L"\\HTTPDisk\0",
+        WVL_M_WLIT L"\\HTTPDisk\0",
+        FILE_DEVICE_CONTROLLER,
+        FILE_DEVICE_SECURE_OPEN
+      );
+
+    status = WvDummyAdd(&HttpdiskBusDummyIds_.DummyIds);
+    if (!NT_SUCCESS(status)) {
+        DBG("PDO not created.\n");
+        return status;
+      }
+
     DBG("PDO created.\n");
     return STATUS_SUCCESS;
   }