31typedef struct _PNP_NOTIFY_ENTRY
75 if (
Entry->RefCount == 0)
127PiProcessSingleNotification(
147 *NextEntry =
Entry->PnpNotifyList.Flink;
183 DPRINT(
"Delivering a DeviceInterfaceChange PnP event\n");
188 while (
entry != &PiNotifyDeviceInterfaceListHead)
232 DPRINT(
"Delivering a HardwareProfileChange PnP event\n");
237 while (
entry != &PiNotifyHwProfileListHead)
265 PVOID notificationStruct;
287 notificationStruct = notifStruct;
289 DPRINT(
"Delivering a (non-custom) TargetDeviceChange PnP event\n");
293 ASSERT(CustomNotification);
296 notificationStruct = CustomNotification;
298 DPRINT(
"Delivering a (custom) TargetDeviceChange PnP event\n");
318 if (notificationStruct != CustomNotification)
360 DPRINT(
"%s(EventCategory 0x%x, EventCategoryFlags 0x%lx, DriverObject %p) called.\n",
369 DPRINT(
"ExAllocatePool() failed\n");
378 .EventCategory = EventCategory,
382 switch (EventCategory)
458 DPRINT1(
"%s: unknown EventCategory 0x%x UNIMPLEMENTED\n",
490 switch (
Entry->EventCategory)
#define _Guarded_by_(lock)
#define _Requires_lock_held_(lock)
#define STATUS_NOT_SUPPORTED
#define NT_SUCCESS(StatCode)
static const WCHAR SymbolicLink[]
const GUID GUID_DEVICE_INTERFACE_ARRIVAL
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeGetCurrentIrql()
#define InitializeListHead(ListHead)
_Must_inspect_result_ _In_ PFLT_GET_OPERATION_STATUS_CALLBACK CallbackRoutine
VOID FASTCALL KeInitializeGuardedMutex(OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeAcquireGuardedMutex(IN PKGUARDED_MUTEX GuardedMutex)
#define KeGetCurrentThread
#define ExFreePoolWithTag(_P, _T)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
PDEVICE_NODE FASTCALL IopGetDeviceNode(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI IopGetRelatedTargetDevice(IN PFILE_OBJECT FileObject, OUT PDEVICE_NODE *DeviceNode)
NTSTATUS NTAPI IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid, IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL, IN ULONG Flags, OUT PWSTR *SymbolicLinkList)
ULONG NTAPI IoPnPDeliverServicePowerNotification(_In_ ULONG VetoedPowerOperation, _In_ ULONG PowerNotificationCode, _In_ ULONG PowerNotificationData, _In_ BOOLEAN Synchronous)
VOID PiNotifyTargetDeviceChange(_In_ LPCGUID Event, _In_ PDEVICE_OBJECT DeviceObject, _In_opt_ PTARGET_DEVICE_CUSTOM_NOTIFICATION CustomNotification)
Delivers the event to all drivers subscribed to EventCategoryTargetDeviceChange PnP event.
NTSTATUS NTAPI IoRegisterPlugPlayNotification(_In_ IO_NOTIFICATION_EVENT_CATEGORY EventCategory, _In_ ULONG EventCategoryFlags, _In_opt_ PVOID EventCategoryData, _In_ PDRIVER_OBJECT DriverObject, _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, _Inout_opt_ PVOID Context, _Out_ PVOID *NotificationEntry)
KGUARDED_MUTEX PiNotifyDeviceInterfaceLock
VOID PiNotifyDeviceInterfaceChange(_In_ LPCGUID Event, _In_ LPCGUID InterfaceClassGuid, _In_ PUNICODE_STRING SymbolicLinkName)
Delivers the event to all drivers subscribed to EventCategoryDeviceInterfaceChange.
static VOID PiCallNotifyProc(_In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE Proc, _In_ PVOID NotificationStructure, _In_ PVOID Context)
Calls PnP notification routine and makes some checks to detect faulty drivers.
KGUARDED_MUTEX PiNotifyTargetDeviceLock
static VOID PiDereferencePnpNotifyEntry(_In_ PPNP_NOTIFY_ENTRY Entry)
NTSTATUS NTAPI IoUnregisterPlugPlayNotification(_In_ PVOID NotificationEntry)
KGUARDED_MUTEX PiNotifyHwProfileLock
VOID PiInitializeNotifications(VOID)
static VOID PiReferencePnpNotifyEntry(_In_ PPNP_NOTIFY_ENTRY Entry)
VOID PiNotifyHardwareProfileChange(_In_ LPCGUID Event)
Delivers the event to all drivers subscribed to EventCategoryHardwareProfileChange PnP event.
#define IsEqualGUID(rguid1, rguid2)
base of all file and directory entries
PUNICODE_STRING SymbolicLinkName
PDEVICE_OBJECT PhysicalDeviceObject
LIST_ENTRY TargetDeviceNotify
struct _LIST_ENTRY * Flink
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
_In_opt_ PDEVICE_OBJECT _In_ ULONG _Outptr_result_nullonfailure_ _At_ * SymbolicLinkList(return==0, __drv_allocatesMem(Mem))) PZZWSTR *SymbolicLinkList
_In_ ULONG EventCategoryFlags
_In_ CONST GUID * InterfaceClassGuid
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE _Inout_opt_ __drv_aliasesMem PVOID _Outptr_result_nullonfailure_ _At_ * NotificationEntry(return==0, __drv_allocatesMem(Mem))) PVOID *NotificationEntry
_In_ ULONG _In_opt_ PVOID EventCategoryData
_In_ PVOID NotificationStructure
enum _IO_NOTIFICATION_EVENT_CATEGORY IO_NOTIFICATION_EVENT_CATEGORY
struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION DEVICE_INTERFACE_CHANGE_NOTIFICATION
@ EventCategoryTargetDeviceChange
@ EventCategoryDeviceInterfaceChange
@ EventCategoryHardwareProfileChange
struct _HWPROFILE_CHANGE_NOTIFICATION HWPROFILE_CHANGE_NOTIFICATION
DRIVER_NOTIFICATION_CALLBACK_ROUTINE * PDRIVER_NOTIFICATION_CALLBACK_ROUTINE
struct _TARGET_DEVICE_REMOVAL_NOTIFICATION TARGET_DEVICE_REMOVAL_NOTIFICATION
struct _TARGET_DEVICE_REMOVAL_NOTIFICATION * PTARGET_DEVICE_REMOVAL_NOTIFICATION
#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES
#define ObDereferenceObject
#define ObReferenceObject