[ros-diffs] [ekohl] 48896: [NTOSKRNL] IoRegisterPlugPlayNotification: Do not fail if no Interface can be found for the given GUID. Just do not call the Callback-Routine in this case. The Interface could be cre...

ekohl at svn.reactos.org ekohl at svn.reactos.org
Sat Sep 25 21:49:16 UTC 2010


Author: ekohl
Date: Sat Sep 25 21:49:15 2010
New Revision: 48896

URL: http://svn.reactos.org/svn/reactos?rev=48896&view=rev
Log:
[NTOSKRNL]
IoRegisterPlugPlayNotification: Do not fail if no Interface can be found for the given GUID. Just do not call the Callback-Routine in this case. The Interface could be created later.

Modified:
    trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c

Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c?rev=48896&r1=48895&r2=48896&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c [iso-8859-1] Sat Sep 25 21:49:15 2010
@@ -290,36 +290,30 @@
                                        NULL, /* PhysicalDeviceObject OPTIONAL */
                                        0, /* Flags */
                                        &SymbolicLinkList);
-        if (!NT_SUCCESS(Status))
-        {
-            DPRINT("IoGetDeviceInterfaces() failed with status 0x%08lx\n",
-              Status);
-            ExFreePoolWithTag(Entry, TAG_PNP_NOTIFY);
-            ObDereferenceObject(DriverObject);
-            return Status;
-        }
-
-        /* Enumerate SymbolicLinkList */
-        NotificationInfos.Version = 1;
-        NotificationInfos.Size = sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION);
-        RtlCopyMemory(&NotificationInfos.Event,
-                      &GUID_DEVICE_INTERFACE_ARRIVAL,
-                      sizeof(GUID));
-        RtlCopyMemory(&NotificationInfos.InterfaceClassGuid,
-                      EventCategoryData,
-                      sizeof(GUID));
-        NotificationInfos.SymbolicLinkName = &SymbolicLinkU;
-
-        for (SymbolicLink = SymbolicLinkList;
-             *SymbolicLink;
-             SymbolicLink += wcslen(SymbolicLink) + 1)
-        {
-            RtlInitUnicodeString(&SymbolicLinkU, SymbolicLink);
-            DPRINT("Calling callback routine for %S\n", SymbolicLink);
-            (*CallbackRoutine)(&NotificationInfos, Context);
-        }
-
-        ExFreePool(SymbolicLinkList);
+        if (NT_SUCCESS(Status))
+        {
+            /* Enumerate SymbolicLinkList */
+            NotificationInfos.Version = 1;
+            NotificationInfos.Size = sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION);
+            RtlCopyMemory(&NotificationInfos.Event,
+                          &GUID_DEVICE_INTERFACE_ARRIVAL,
+                          sizeof(GUID));
+            RtlCopyMemory(&NotificationInfos.InterfaceClassGuid,
+                          EventCategoryData,
+                          sizeof(GUID));
+            NotificationInfos.SymbolicLinkName = &SymbolicLinkU;
+
+            for (SymbolicLink = SymbolicLinkList;
+                 *SymbolicLink;
+                 SymbolicLink += wcslen(SymbolicLink) + 1)
+            {
+                RtlInitUnicodeString(&SymbolicLinkU, SymbolicLink);
+                DPRINT("Calling callback routine for %S\n", SymbolicLink);
+                (*CallbackRoutine)(&NotificationInfos, Context);
+            }
+
+            ExFreePool(SymbolicLinkList);
+        }
     }
 
     Entry->PnpNotificationProc = CallbackRoutine;




More information about the Ros-diffs mailing list