56 return L"MicroChannel";
59 return L"TurboChannel";
83 return L"ProcessorInternal";
95 DPRINT1(
"Invalid bus type: %d\n", IfType);
164 HANDLE InstanceKey, ControlKey;
166 WCHAR HardwareId[256];
170 ULONG DeviceReported = 1;
172 DPRINT(
"IoReportDetectedDevice (DeviceObject %p, *DeviceObject %p)\n",
175 ServiceLongName =
DriverObject->DriverExtension->ServiceKeyName;
237 DPRINT(
"PnpRootCreateDevice() failed (Status 0x%08lx)\n",
Status);
246 DPRINT(
"PipAllocateDeviceNode() failed\n");
263 DPRINT(
"Failed to write the Service name value: 0x%x\n",
Status);
272 DPRINT(
"Failed to write the Legacy value: 0x%x\n",
Status);
274 Status = ZwSetValueKey(InstanceKey, &DeviceReportedName, 0,
REG_DWORD, &DeviceReported,
sizeof(DeviceReported));
277 DPRINT(
"Failed to write the DeviceReported value: 0x%x\n",
Status);
286 Status = ZwCreateKey(&ControlKey,
295 Status = ZwSetValueKey(ControlKey,
300 sizeof(DeviceReported));
305 DPRINT1(
"Failed to set ReportedDevice=1 for device %wZ (status 0x%08lx)\n", &instancePath,
Status);
310 IdLength +=
swprintf(&HardwareId[IdLength],
317 IdLength +=
swprintf(&HardwareId[IdLength],
330 DPRINT(
"Failed to write the compatible IDs: 0x%x\n",
Status);
379 DPRINT(
"Reported device: %S (%wZ)\n", HardwareId, &
DeviceNode->InstancePath);
405 *ConflictDetected =
FALSE;
421 *ConflictDetected =
TRUE;
467 if (
IsEqualGUID(&(notifyStruct->
Event), &GUID_TARGET_DEVICE_QUERY_REMOVE) ||
468 IsEqualGUID(&(notifyStruct->
Event), &GUID_TARGET_DEVICE_REMOVE_CANCELLED) ||
474 if (notifyStruct->
Version != 1)
519 if (
IsEqualGUID(&(notifyStruct->
Event), &GUID_TARGET_DEVICE_QUERY_REMOVE) ||
520 IsEqualGUID(&(notifyStruct->
Event), &GUID_TARGET_DEVICE_REMOVE_CANCELLED) ||
526 if (notifyStruct->
Version != 1)
533 + notifyStruct->
Size;
static WCHAR ServiceName[]
PDEVICE_OBJECT PhysicalDeviceObject
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeSetEvent(pEvt, foo, foo2)
enum _INTERFACE_TYPE INTERFACE_TYPE
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
#define ExFreePoolWithTag(_P, _T)
#define InitializeObjectAttributes(p, n, a, r, s)
@ DeviceNodeStartPostWork
#define DNF_NO_RESOURCE_REQUIRED
#define DNF_HAS_BOOT_CONFIG
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define REG_OPTION_NON_VOLATILE
#define REG_OPTION_VOLATILE
#define IopIsValidPhysicalDeviceObject(PhysicalDeviceObject)
VOID PiInsertDevNode(_In_ PDEVICE_NODE DeviceNode, _In_ PDEVICE_NODE ParentNode)
NTSTATUS NTAPI IopAssignDeviceResources(IN PDEVICE_NODE DeviceNode)
PDEVICE_NODE PipAllocateDeviceNode(IN PDEVICE_OBJECT PhysicalDeviceObject)
NTSTATUS NTAPI IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, IN ULONG CreateOptions, OUT PHANDLE Handle)
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 PnpRootRegisterDevice(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS PnpRootCreateDevice(IN PUNICODE_STRING ServiceName, OUT PDEVICE_OBJECT *PhysicalDeviceObject, OUT PUNICODE_STRING FullInstancePath)
#define IopDeviceNodeSetFlag(DeviceNode, Flag)
VOID PiSetDevNodeText(_In_ PDEVICE_NODE DeviceNode, _In_ HANDLE InstanceKey)
Sets the DeviceNode's DeviceDesc and LocationInformation registry values.
PNP_DEVNODE_STATE PiSetDevNodeState(_In_ PDEVICE_NODE DeviceNode, _In_ PNP_DEVNODE_STATE NewState)
NTSTATUS NTAPI IopDetectResourceConflict(IN PCM_RESOURCE_LIST ResourceList, IN BOOLEAN Silent, OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
VOID PiQueueDeviceAction(_In_ PDEVICE_OBJECT DeviceObject, _In_ DEVICE_ACTION Action, _In_opt_ PKEVENT CompletionEvent, _Out_opt_ NTSTATUS *CompletionStatus)
Queue a device operation to a worker thread.
PDEVICE_NODE IopRootDeviceNode
#define STATUS_CONFLICTING_ADDRESSES
NTSTATUS IopSetDeviceInstanceData(HANDLE InstanceKey, PDEVICE_NODE DeviceNode)
VOID NTAPI IopReportTargetDeviceChangeAsyncWorker(PVOID Context)
NTSTATUS NTAPI IoReportResourceForDetection(IN PDRIVER_OBJECT DriverObject, IN PCM_RESOURCE_LIST DriverList OPTIONAL, IN ULONG DriverListSize OPTIONAL, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PCM_RESOURCE_LIST DeviceList OPTIONAL, IN ULONG DeviceListSize OPTIONAL, OUT PBOOLEAN ConflictDetected)
struct _INTERNAL_WORK_QUEUE_ITEM INTERNAL_WORK_QUEUE_ITEM
NTSTATUS PpSetCustomTargetEvent(IN PDEVICE_OBJECT DeviceObject, IN OUT PKEVENT SyncEvent OPTIONAL, IN OUT PNTSTATUS SyncStatus OPTIONAL, IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, IN PVOID Context OPTIONAL, IN PTARGET_DEVICE_CUSTOM_NOTIFICATION NotificationStructure)
VOID NTAPI IopSetEvent(IN PVOID Context)
NTSTATUS NTAPI IoReportDetectedDevice(_In_ PDRIVER_OBJECT DriverObject, _In_ INTERFACE_TYPE LegacyBusType, _In_ ULONG BusNumber, _In_ ULONG SlotNumber, _In_opt_ PCM_RESOURCE_LIST ResourceList, _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements, _In_ BOOLEAN ResourceAssigned, _Inout_ PDEVICE_OBJECT *DeviceObject)
PWCHAR IopGetInterfaceTypeString(INTERFACE_TYPE IfType)
NTSTATUS NTAPI IoReportTargetDeviceChange(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PVOID NotificationStructure)
NTSTATUS NTAPI IoReportTargetDeviceChangeAsynchronous(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PVOID NotificationStructure, IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, IN PVOID Context OPTIONAL)
struct _INTERNAL_WORK_QUEUE_ITEM * PINTERNAL_WORK_QUEUE_ITEM
#define IsEqualGUID(rguid1, rguid2)
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
PULONG MinorVersion OPTIONAL
PDEVICE_OBJECT PhysicalDeviceObject
PDEVICE_CHANGE_COMPLETE_CALLBACK Callback
TARGET_DEVICE_CUSTOM_NOTIFICATION NotificationStructure
struct _FILE_OBJECT * FileObject
#define RTL_CONSTANT_STRING(s)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
_In_ WDF_WMI_PROVIDER_CONTROL Control
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
#define ExInitializeWorkItem(Item, Routine, Context)
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST _In_ BOOLEAN ResourceAssigned
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements
_In_ INTERFACE_TYPE LegacyBusType
_In_ PVOID NotificationStructure
struct _TARGET_DEVICE_CUSTOM_NOTIFICATION * PTARGET_DEVICE_CUSTOM_NOTIFICATION
DEVICE_CHANGE_COMPLETE_CALLBACK * PDEVICE_CHANGE_COMPLETE_CALLBACK
#define DRVO_BUILTIN_DRIVER
#define ObDereferenceObject
#define ObReferenceObject