[STORPORT] Add the InitializeDpc code path to StorPortNotification().
authorEric Kohl <eric.kohl@reactos.org>
Sun, 22 Oct 2017 07:25:36 +0000 (09:25 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 22 Oct 2017 07:25:36 +0000 (09:25 +0200)
CORE-13866

drivers/storage/port/storport/storport.c

index 39c6564..61982fc 100644 (file)
@@ -996,6 +996,8 @@ StorPortNotification(
     PFDO_DEVICE_EXTENSION DeviceExtension = NULL;
     PHW_PASSIVE_INITIALIZE_ROUTINE HwPassiveInitRoutine;
     PBOOLEAN Result;
+    PSTOR_DPC Dpc;
+    PHW_DPC_ROUTINE HwDpcRoutine;
     va_list ap;
 
     DPRINT1("StorPortNotification(%x %p)\n",
@@ -1033,6 +1035,19 @@ StorPortNotification(
             }
             break;
 
+        case InitializeDpc:
+            DPRINT1("InitializeDpc\n");
+            Dpc = (PSTOR_DPC)va_arg(ap, PSTOR_DPC);
+            DPRINT1("Dpc %p\n", Dpc);
+            HwDpcRoutine = (PHW_DPC_ROUTINE)va_arg(ap, PHW_DPC_ROUTINE);
+            DPRINT1("HwDpcRoutine %p\n", HwDpcRoutine);
+
+            KeInitializeDpc((PRKDPC)&Dpc->Dpc,
+                            (PKDEFERRED_ROUTINE)HwDpcRoutine,
+                            (PVOID)DeviceExtension);
+            KeInitializeSpinLock(&Dpc->Lock);
+            break;
+
         default:
             DPRINT1("Unsupported Notification %lx\n", NotificationType);
             break;