mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:33:07 +00:00
[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. svn path=/trunk/; revision=48896
This commit is contained in:
parent
d695e74a70
commit
1f2f04ed9b
1 changed files with 22 additions and 28 deletions
|
@ -290,36 +290,30 @@ IoRegisterPlugPlayNotification(IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory,
|
||||||
NULL, /* PhysicalDeviceObject OPTIONAL */
|
NULL, /* PhysicalDeviceObject OPTIONAL */
|
||||||
0, /* Flags */
|
0, /* Flags */
|
||||||
&SymbolicLinkList);
|
&SymbolicLinkList);
|
||||||
if (!NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("IoGetDeviceInterfaces() failed with status 0x%08lx\n",
|
/* Enumerate SymbolicLinkList */
|
||||||
Status);
|
NotificationInfos.Version = 1;
|
||||||
ExFreePoolWithTag(Entry, TAG_PNP_NOTIFY);
|
NotificationInfos.Size = sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION);
|
||||||
ObDereferenceObject(DriverObject);
|
RtlCopyMemory(&NotificationInfos.Event,
|
||||||
return Status;
|
&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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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;
|
Entry->PnpNotificationProc = CallbackRoutine;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue