ReactOS  0.4.15-dev-1367-g07cc0b5
pnpreport.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Kernel
3  * COPYRIGHT: GPL - See COPYING in the top level directory
4  * FILE: ntoskrnl/io/pnpmgr/pnpreport.c
5  * PURPOSE: Device Changes Reporting Functions
6  * PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
7  * Pierre Schweitzer
8  */
9 
10 /* INCLUDES ******************************************************************/
11 
12 #include <ntoskrnl.h>
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* TYPES *******************************************************************/
17 
19 {
26 
30 
33  PVOID Context);
34 
37  IN OUT PKEVENT SyncEvent OPTIONAL,
42 
43 /* PRIVATE FUNCTIONS *********************************************************/
44 
45 PWCHAR
47 {
48  switch (IfType)
49  {
50  case Internal:
51  return L"Internal";
52 
53  case Isa:
54  return L"Isa";
55 
56  case Eisa:
57  return L"Eisa";
58 
59  case MicroChannel:
60  return L"MicroChannel";
61 
62  case TurboChannel:
63  return L"TurboChannel";
64 
65  case PCIBus:
66  return L"PCIBus";
67 
68  case VMEBus:
69  return L"VMEBus";
70 
71  case NuBus:
72  return L"NuBus";
73 
74  case PCMCIABus:
75  return L"PCMCIABus";
76 
77  case CBus:
78  return L"CBus";
79 
80  case MPIBus:
81  return L"MPIBus";
82 
83  case MPSABus:
84  return L"MPSABus";
85 
86  case ProcessorInternal:
87  return L"ProcessorInternal";
88 
89  case PNPISABus:
90  return L"PNPISABus";
91 
92  case PNPBus:
93  return L"PNPBus";
94 
95  case Vmcs:
96  return L"Vmcs";
97 
98  default:
99  DPRINT1("Invalid bus type: %d\n", IfType);
100  return NULL;
101  }
102 }
103 
104 VOID
105 NTAPI
107 {
109 
111  PpSetCustomTargetEvent(Item->PhysicalDeviceObject, NULL, NULL, Item->Callback, Item->Context, Item->NotificationStructure);
112  ObDereferenceObject(Item->PhysicalDeviceObject);
113  ExFreePoolWithTag(Context, ' pP');
114 }
115 
116 NTSTATUS
118  IN OUT PKEVENT SyncEvent OPTIONAL,
123 {
126 
127  if (SyncEvent)
128  {
131  }
132 
133  /* That call is totally wrong but notifications handler must be fixed first */
136  &GUID_PNP_CUSTOM_NOTIFICATION,
138  NULL);
139 
140  if (SyncEvent)
141  {
142  KeSetEvent(SyncEvent, IO_NO_INCREMENT, FALSE);
144  }
145 
146  return STATUS_SUCCESS;
147 }
148 
149 /* PUBLIC FUNCTIONS **********************************************************/
150 
151 /*
152  * @implemented
153  */
154 NTSTATUS
155 NTAPI
164 {
168  HANDLE InstanceKey;
170  UNICODE_STRING ValueName, ServiceLongName, ServiceName;
171  WCHAR HardwareId[256];
172  PWCHAR IfString;
173  ULONG IdLength;
174  ULONG LegacyValue;
175 
176  DPRINT("IoReportDetectedDevice (DeviceObject %p, *DeviceObject %p)\n",
178 
179  ServiceLongName = DriverObject->DriverExtension->ServiceKeyName;
180  ServiceName = ServiceLongName;
181 
182  /* If the interface type is unknown, treat it as internal */
185 
186  /* Get the string equivalent of the interface type */
188 
189  /* If NULL is returned then it's a bad type */
190  if (!IfString)
192 
193  /*
194  * Drivers that have been created via a direct IoCreateDriver() call
195  * have their ServiceKeyName set to \Driver\DriverName. We need to
196  * strip everything up to the last path separator and keep what remains.
197  */
198  if (DriverObject->Flags & DRVO_BUILTIN_DRIVER)
199  {
200  /*
201  * Find the last path separator.
202  * NOTE: Since ServiceName is not necessarily NULL-terminated,
203  * we cannot use wcsrchr().
204  */
205  if (ServiceName.Buffer && ServiceName.Length >= sizeof(WCHAR))
206  {
207  ValueName.Length = 1;
208  ValueName.Buffer = ServiceName.Buffer + (ServiceName.Length / sizeof(WCHAR)) - 1;
209 
210  while ((ValueName.Buffer > ServiceName.Buffer) && (*ValueName.Buffer != L'\\'))
211  {
212  --ValueName.Buffer;
213  ++ValueName.Length;
214  }
215  if (*ValueName.Buffer == L'\\')
216  {
217  ++ValueName.Buffer;
218  --ValueName.Length;
219  }
220  ValueName.Length *= sizeof(WCHAR);
221 
222  /* Shorten the string */
223  ServiceName.MaximumLength -= (ServiceName.Length - ValueName.Length);
224  ServiceName.Length = ValueName.Length;
225  ServiceName.Buffer = ValueName.Buffer;
226  }
227  }
228 
229  /* We use the caller's PDO if they supplied one */
230  if (DeviceObject && *DeviceObject)
231  {
232  Pdo = *DeviceObject;
233  }
234  else
235  {
236  /* Create the PDO */
238  NULL,
239  &Pdo,
240  NULL);
241  if (!NT_SUCCESS(Status))
242  {
243  DPRINT("PnpRootCreateDevice() failed (Status 0x%08lx)\n", Status);
244  return Status;
245  }
246  }
247 
248  /* Create the device node for the new PDO */
250  Pdo,
251  NULL,
252  &DeviceNode);
253  if (!NT_SUCCESS(Status))
254  {
255  DPRINT("IopCreateDeviceNode() failed (Status 0x%08lx)\n", Status);
256  return Status;
257  }
258 
259  /* We're enumerated already */
261 
262  /* We don't call AddDevice for devices reported this way */
264 
265  /* We don't send IRP_MN_START_DEVICE */
267 
268  /* We need to get device IDs */
269 #if 0
270  IopDeviceNodeSetFlag(DeviceNode, DNF_NEED_QUERY_IDS);
271 #endif
272 
273  /* This is a legacy driver for this device */
275 
276  /* Perform a manual configuration of our device */
279 
280  /* Open a handle to the instance path key */
281  Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_NON_VOLATILE, &InstanceKey);
282  if (!NT_SUCCESS(Status))
283  return Status;
284 
285  /* Save the driver name */
286  RtlInitUnicodeString(&ValueName, L"Service");
287  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_SZ, ServiceLongName.Buffer, ServiceLongName.Length + sizeof(UNICODE_NULL));
288  if (!NT_SUCCESS(Status))
289  {
290  DPRINT("Failed to write the Service name value: 0x%x\n", Status);
291  }
292 
293  /* Report as non-legacy driver */
294  RtlInitUnicodeString(&ValueName, L"Legacy");
295  LegacyValue = 0;
296  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_DWORD, &LegacyValue, sizeof(LegacyValue));
297  if (!NT_SUCCESS(Status))
298  {
299  DPRINT("Failed to write the Legacy value: 0x%x\n", Status);
300  }
301 
302  /* Add DETECTEDInterfaceType\DriverName */
303  IdLength = 0;
304  IdLength += swprintf(&HardwareId[IdLength],
305  L"DETECTED%ls\\%wZ",
306  IfString,
307  &ServiceName);
308  IdLength++;
309 
310  /* Add DETECTED\DriverName */
311  IdLength += swprintf(&HardwareId[IdLength],
312  L"DETECTED\\%wZ",
313  &ServiceName);
314  IdLength++;
315 
316  /* Terminate the string with another null */
317  HardwareId[IdLength++] = UNICODE_NULL;
318 
319  /* Store the value for CompatibleIDs */
320  RtlInitUnicodeString(&ValueName, L"CompatibleIDs");
321  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR));
322  if (!NT_SUCCESS(Status))
323  {
324  DPRINT("Failed to write the compatible IDs: 0x%x\n", Status);
325  ZwClose(InstanceKey);
326  return Status;
327  }
328 
329  /* Add a hardware ID if the driver didn't report one */
330  RtlInitUnicodeString(&ValueName, L"HardwareID");
331  if (ZwQueryValueKey(InstanceKey, &ValueName, KeyValueBasicInformation, NULL, 0, &RequiredLength) == STATUS_OBJECT_NAME_NOT_FOUND)
332  {
333  /* Just use our most specific compatible ID */
334  IdLength = 0;
335  IdLength += swprintf(&HardwareId[IdLength],
336  L"DETECTED%ls\\%wZ",
337  IfString,
338  &ServiceName);
339  IdLength++;
340 
341  HardwareId[IdLength++] = UNICODE_NULL;
342 
343  /* Write the value to the registry */
344  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR));
345  if (!NT_SUCCESS(Status))
346  {
347  DPRINT("Failed to write the hardware ID: 0x%x\n", Status);
348  ZwClose(InstanceKey);
349  return Status;
350  }
351  }
352 
353  /* Assign the resources to the device node */
354  DeviceNode->BootResources = ResourceList;
355  DeviceNode->ResourceRequirements = ResourceRequirements;
356 
357  /* Set appropriate flags */
358  if (DeviceNode->BootResources)
360 
361  if (!DeviceNode->ResourceRequirements && !DeviceNode->BootResources)
363 
364  /* Write the resource information to the registry */
365  IopSetDeviceInstanceData(InstanceKey, DeviceNode);
366 
367  /* If the caller didn't get the resources assigned for us, do it now */
368  if (!ResourceAssigned)
369  {
371 
372  /* See if we failed */
373  if (!NT_SUCCESS(Status))
374  {
375  DPRINT("Assigning resources failed: 0x%x\n", Status);
376  ZwClose(InstanceKey);
377  return Status;
378  }
379  }
380 
381  /* Close the instance key handle */
382  ZwClose(InstanceKey);
383 
384  /* Register the given DO with PnP root if required */
385  if (DeviceObject && *DeviceObject)
387 
388  /* Report the device's enumeration to umpnpmgr */
389  IopQueueTargetDeviceEvent(&GUID_DEVICE_ENUMERATED,
390  &DeviceNode->InstancePath);
391 
392  /* Report the device's arrival to umpnpmgr */
393  IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
394  &DeviceNode->InstancePath);
395 
396  DPRINT("Reported device: %S (%wZ)\n", HardwareId, &DeviceNode->InstancePath);
397 
399 
400  /* Return the PDO */
401  if (DeviceObject) *DeviceObject = Pdo;
402 
403  return STATUS_SUCCESS;
404 }
405 
406 /*
407  * @halfplemented
408  */
409 NTSTATUS
410 NTAPI
412  IN PCM_RESOURCE_LIST DriverList OPTIONAL,
413  IN ULONG DriverListSize OPTIONAL,
416  IN ULONG DeviceListSize OPTIONAL,
417  OUT PBOOLEAN ConflictDetected)
418 {
421 
422  *ConflictDetected = FALSE;
423 
424  if (!DriverList && !DeviceList)
426 
427  /* Find the real list */
428  if (!DriverList)
430  else
431  ResourceList = DriverList;
432 
433  /* Look for a resource conflict */
436  {
437  /* Oh noes */
438  *ConflictDetected = TRUE;
439  }
440  else if (NT_SUCCESS(Status))
441  {
442  /* Looks like we're good to go */
443 
444  /* TODO: Claim the resources in the ResourceMap */
445  }
446 
447  return Status;
448 }
449 
450 VOID
451 NTAPI
453 {
455 
456  /* Set the event */
458 }
459 
460 /*
461  * @implemented
462  */
463 NTSTATUS
464 NTAPI
467 {
468  KEVENT NotifyEvent;
469  NTSTATUS Status, NotifyStatus;
471 
472  ASSERT(notifyStruct);
473 
474  /* Check for valid PDO */
476  {
477  KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
478  }
479 
480  /* FileObject must be null. PnP will fill in it */
481  ASSERT(notifyStruct->FileObject == NULL);
482 
483  /* Do not handle system PnP events */
484  if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
485  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
486  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
487  {
489  }
490 
491  if (notifyStruct->Version != 1)
492  {
494  }
495 
496  /* Initialize even that will let us know when PnP will have finished notify */
497  KeInitializeEvent(&NotifyEvent, NotificationEvent, FALSE);
498 
499  Status = PpSetCustomTargetEvent(PhysicalDeviceObject, &NotifyEvent, &NotifyStatus, NULL, NULL, notifyStruct);
500  /* If no error, wait for the notify to end and return the status of the notify and not of the event */
501  if (NT_SUCCESS(Status))
502  {
504  Status = NotifyStatus;
505  }
506 
507  return Status;
508 }
509 
510 /*
511  * @implemented
512  */
513 NTSTATUS
514 NTAPI
519 {
522 
523  ASSERT(notifyStruct);
524 
525  /* Check for valid PDO */
527  {
528  KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
529  }
530 
531  /* FileObject must be null. PnP will fill in it */
532  ASSERT(notifyStruct->FileObject == NULL);
533 
534  /* Do not handle system PnP events */
535  if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
536  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
537  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
538  {
540  }
541 
542  if (notifyStruct->Version != 1)
543  {
545  }
546 
547  /* We need to store all the data given by the caller with the WorkItem, so use our own struct */
549  if (!Item) return STATUS_INSUFFICIENT_RESOURCES;
550 
551  /* Initialize all stuff */
553  Item->NotificationStructure = notifyStruct;
554  Item->PhysicalDeviceObject = PhysicalDeviceObject;
555  Item->Callback = Callback;
556  Item->Context = Context;
558 
559  /* Finally, queue the item, our work here is done */
560  ExQueueWorkItem(&(Item->WorkItem), DelayedWorkQueue);
561 
562  return STATUS_PENDING;
563 }
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:65
NTSTATUS IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode, PVOID Context)
Definition: devaction.c:577
NTSTATUS PnpRootRegisterDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: pnproot.c:129
* PNTSTATUS
Definition: strlen.c:14
_In_ PVOID NotificationStructure
Definition: iofuncs.h:1203
#define DRVO_BUILTIN_DRIVER
Definition: iotypes.h:2207
#define IN
Definition: typedefs.h:39
PDEVICE_NODE IopRootDeviceNode
Definition: devnode.c:18
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:711
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
enum _INTERFACE_TYPE INTERFACE_TYPE
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.
Definition: devaction.c:2474
#define TRUE
Definition: types.h:120
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
NTSTATUS NTAPI IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, IN ULONG CreateOptions, OUT PHANDLE Handle)
Definition: pnpmgr.c:666
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS IopCreateDeviceNode(IN PDEVICE_NODE ParentNode, IN PDEVICE_OBJECT PhysicalDeviceObject, IN PUNICODE_STRING ServiceName, OUT PDEVICE_NODE *DeviceNode)
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)
Definition: pnpreport.c:411
#define DNF_NO_RESOURCE_REQUIRED
Definition: iotypes.h:174
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define DNF_HAS_BOOT_CONFIG
Definition: iotypes.h:196
PDEVICE_LIST DeviceList
Definition: utils.c:27
uint16_t * PWCHAR
Definition: typedefs.h:56
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1155
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
NTSTATUS IopSetDeviceInstanceData(HANDLE InstanceKey, PDEVICE_NODE DeviceNode)
Definition: pnpmgr.c:750
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
NTSTATUS NTAPI IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject, IN INTERFACE_TYPE LegacyBusType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PCM_RESOURCE_LIST ResourceList, IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL, IN BOOLEAN ResourceAssigned, IN OUT PDEVICE_OBJECT *DeviceObject OPTIONAL)
Definition: pnpreport.c:156
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
#define REG_MULTI_SZ
Definition: nt_native.h:1501
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
Definition: wdfminiport.h:64
#define IopDeviceNodeSetFlag(DeviceNode, Flag)
Definition: io.h:142
unsigned char BOOLEAN
NTSTATUS NTAPI IoReportTargetDeviceChange(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PVOID NotificationStructure)
Definition: pnpreport.c:465
struct _INTERNAL_WORK_QUEUE_ITEM * PINTERNAL_WORK_QUEUE_ITEM
struct _INTERNAL_WORK_QUEUE_ITEM INTERNAL_WORK_QUEUE_ITEM
void DPRINT(...)
Definition: polytest.cpp:61
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define DNF_STARTED
Definition: iotypes.h:168
Status
Definition: gdiplustypes.h:24
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
NTSTATUS IopQueueTargetDeviceEvent(const GUID *Guid, PUNICODE_STRING DeviceIds)
Definition: plugplay.c:43
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)
Definition: pnpreport.c:117
struct _TARGET_DEVICE_CUSTOM_NOTIFICATION * PTARGET_DEVICE_CUSTOM_NOTIFICATION
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
LPTSTR ServiceName
Definition: ServiceMain.c:15
#define ASSERT(a)
Definition: mode.c:45
SYNC_STATUS SyncStatus
Definition: internettime.c:14
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define ObDereferenceObject
Definition: obfuncs.h:203
Definition: Node.h:9
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_In_ INTERFACE_TYPE LegacyBusType
Definition: iofuncs.h:1543
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
VOID IopNotifyPlugPlayNotification(IN PDEVICE_OBJECT DeviceObject, IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, IN LPCGUID Event, IN PVOID EventCategoryData1, IN PVOID EventCategoryData2)
Definition: pnpnotify.c:36
char * PBOOLEAN
Definition: retypes.h:11
static const WCHAR L[]
Definition: oid.c:1250
#define DNF_LEGACY_DRIVER
Definition: iotypes.h:181
PDEVICE_CHANGE_COMPLETE_CALLBACK Callback
Definition: pnpreport.c:22
#define IopIsValidPhysicalDeviceObject(PhysicalDeviceObject)
Definition: io.h:238
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
VOID NTAPI IopSetEvent(IN PVOID Context)
Definition: pnpreport.c:452
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
VOID NTAPI IopReportTargetDeviceChangeAsyncWorker(PVOID Context)
Definition: pnpreport.c:106
_In_ ULONG _Out_opt_ PULONG RequiredLength
Definition: wmifuncs.h:29
DEVICE_CHANGE_COMPLETE_CALLBACK * PDEVICE_CHANGE_COMPLETE_CALLBACK
Definition: iotypes.h:1234
#define NULL
Definition: types.h:112
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
#define DPRINT1
Definition: precomp.h:8
struct tagContext Context
Definition: acpixf.h:1034
#define OUT
Definition: typedefs.h:40
#define ObReferenceObject
Definition: obfuncs.h:204
WORK_QUEUE_ITEM WorkItem
Definition: pnpreport.c:20
NTSTATUS NTAPI IopAssignDeviceResources(IN PDEVICE_NODE DeviceNode)
Definition: pnpres.c:1106
PDEVICE_OBJECT PhysicalDeviceObject
Definition: pnpreport.c:21
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:581
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define DNF_ENUMERATED
Definition: iotypes.h:170
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements
Definition: iofuncs.h:1543
struct _FILE_OBJECT * FileObject
Definition: iotypes.h:995
#define STATUS_SUCCESS
Definition: shellext.h:65
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST _In_ BOOLEAN ResourceAssigned
Definition: iofuncs.h:1543
PWCHAR IopGetInterfaceTypeString(INTERFACE_TYPE IfType)
Definition: pnpreport.c:46
#define STATUS_CONFLICTING_ADDRESSES
Definition: ntstatus.h:261
#define DNF_ADDED
Definition: iotypes.h:179
NTSTATUS NTAPI IoReportTargetDeviceChangeAsynchronous(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PVOID NotificationStructure, IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, IN PVOID Context OPTIONAL)
Definition: pnpreport.c:515
#define REG_DWORD
Definition: sdbapi.c:596
NTSTATUS NTAPI IopDetectResourceConflict(IN PCM_RESOURCE_LIST ResourceList, IN BOOLEAN Silent, OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
Definition: pnpres.c:1252
NTSTATUS IopActionConfigureChildServices(IN PDEVICE_NODE DeviceNode, IN PVOID Context)
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:108
PTARGET_DEVICE_CUSTOM_NOTIFICATION NotificationStructure
Definition: pnpreport.c:24
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
NTSTATUS PnpRootCreateDevice(IN PUNICODE_STRING ServiceName, IN OPTIONAL PDRIVER_OBJECT DriverObject, OUT PDEVICE_OBJECT *PhysicalDeviceObject, OUT OPTIONAL PUNICODE_STRING FullInstancePath)
Definition: pnproot.c:185
#define REG_SZ
Definition: layer.c:22
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68