ReactOS  0.4.15-dev-4927-gfe8f806
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  IN OUT PKEVENT SyncEvent OPTIONAL,
38 
39 /* PRIVATE FUNCTIONS *********************************************************/
40 
41 PWCHAR
43 {
44  switch (IfType)
45  {
46  case Internal:
47  return L"Internal";
48 
49  case Isa:
50  return L"Isa";
51 
52  case Eisa:
53  return L"Eisa";
54 
55  case MicroChannel:
56  return L"MicroChannel";
57 
58  case TurboChannel:
59  return L"TurboChannel";
60 
61  case PCIBus:
62  return L"PCIBus";
63 
64  case VMEBus:
65  return L"VMEBus";
66 
67  case NuBus:
68  return L"NuBus";
69 
70  case PCMCIABus:
71  return L"PCMCIABus";
72 
73  case CBus:
74  return L"CBus";
75 
76  case MPIBus:
77  return L"MPIBus";
78 
79  case MPSABus:
80  return L"MPSABus";
81 
82  case ProcessorInternal:
83  return L"ProcessorInternal";
84 
85  case PNPISABus:
86  return L"PNPISABus";
87 
88  case PNPBus:
89  return L"PNPBus";
90 
91  case Vmcs:
92  return L"Vmcs";
93 
94  default:
95  DPRINT1("Invalid bus type: %d\n", IfType);
96  return NULL;
97  }
98 }
99 
100 VOID
101 NTAPI
103 {
105 
107  PpSetCustomTargetEvent(Item->PhysicalDeviceObject, NULL, NULL, Item->Callback, Item->Context, Item->NotificationStructure);
108  ObDereferenceObject(Item->PhysicalDeviceObject);
109  ExFreePoolWithTag(Context, ' pP');
110 }
111 
112 NTSTATUS
114  IN OUT PKEVENT SyncEvent OPTIONAL,
119 {
122 
123  if (SyncEvent)
124  {
127  }
128 
129  /* That call is totally wrong but notifications handler must be fixed first */
130  PiNotifyTargetDeviceChange(&GUID_PNP_CUSTOM_NOTIFICATION, DeviceObject, NotificationStructure);
131 
132  if (SyncEvent)
133  {
134  KeSetEvent(SyncEvent, IO_NO_INCREMENT, FALSE);
136  }
137 
138  return STATUS_SUCCESS;
139 }
140 
141 /* PUBLIC FUNCTIONS **********************************************************/
142 
143 /*
144  * @implemented
145  */
146 NTSTATUS
147 NTAPI
157 {
159  UNICODE_STRING DeviceReportedName = RTL_CONSTANT_STRING(L"DeviceReported");
164  HANDLE InstanceKey, ControlKey;
165  UNICODE_STRING ValueName, ServiceLongName, ServiceName;
166  WCHAR HardwareId[256];
167  PWCHAR IfString;
168  ULONG IdLength;
169  ULONG LegacyValue;
170  ULONG DeviceReported = 1;
171 
172  DPRINT("IoReportDetectedDevice (DeviceObject %p, *DeviceObject %p)\n",
174 
175  ServiceLongName = DriverObject->DriverExtension->ServiceKeyName;
176  ServiceName = ServiceLongName;
177 
178  /* If the interface type is unknown, treat it as internal */
181 
182  /* Get the string equivalent of the interface type */
184 
185  /* If NULL is returned then it's a bad type */
186  if (!IfString)
188 
189  /*
190  * Drivers that have been created via a direct IoCreateDriver() call
191  * have their ServiceKeyName set to \Driver\DriverName. We need to
192  * strip everything up to the last path separator and keep what remains.
193  */
194  if (DriverObject->Flags & DRVO_BUILTIN_DRIVER)
195  {
196  /*
197  * Find the last path separator.
198  * NOTE: Since ServiceName is not necessarily NULL-terminated,
199  * we cannot use wcsrchr().
200  */
201  if (ServiceName.Buffer && ServiceName.Length >= sizeof(WCHAR))
202  {
203  ValueName.Length = 1;
204  ValueName.Buffer = ServiceName.Buffer + (ServiceName.Length / sizeof(WCHAR)) - 1;
205 
206  while ((ValueName.Buffer > ServiceName.Buffer) && (*ValueName.Buffer != L'\\'))
207  {
208  --ValueName.Buffer;
209  ++ValueName.Length;
210  }
211  if (*ValueName.Buffer == L'\\')
212  {
213  ++ValueName.Buffer;
214  --ValueName.Length;
215  }
216  ValueName.Length *= sizeof(WCHAR);
217 
218  /* Shorten the string */
219  ServiceName.MaximumLength -= (ServiceName.Length - ValueName.Length);
220  ServiceName.Length = ValueName.Length;
221  ServiceName.Buffer = ValueName.Buffer;
222  }
223  }
224 
225  /* We use the caller's PDO if they supplied one */
226  UNICODE_STRING instancePath;
227  if (DeviceObject && *DeviceObject)
228  {
229  Pdo = *DeviceObject;
230  }
231  else
232  {
233  /* Create the PDO */
234  Status = PnpRootCreateDevice(&ServiceName, NULL, &Pdo, &instancePath);
235  if (!NT_SUCCESS(Status))
236  {
237  DPRINT("PnpRootCreateDevice() failed (Status 0x%08lx)\n", Status);
238  return Status;
239  }
240  }
241 
242  /* Create the device node for the new PDO */
244  if (!DeviceNode)
245  {
246  DPRINT("PipAllocateDeviceNode() failed\n");
248  }
249 
250  Status = RtlDuplicateUnicodeString(0, &instancePath, &DeviceNode->InstancePath);
251 
252  /* Open a handle to the instance path key */
253  Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_NON_VOLATILE, &InstanceKey);
254  if (!NT_SUCCESS(Status))
255  return Status;
256 
257  /* Save the driver name */
258  RtlInitUnicodeString(&ValueName, L"Service");
259  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_SZ, ServiceLongName.Buffer, ServiceLongName.Length + sizeof(UNICODE_NULL));
260  if (!NT_SUCCESS(Status))
261  {
262  DPRINT("Failed to write the Service name value: 0x%x\n", Status);
263  }
264 
265  /* Report as non-legacy driver */
266  RtlInitUnicodeString(&ValueName, L"Legacy");
267  LegacyValue = 0;
268  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_DWORD, &LegacyValue, sizeof(LegacyValue));
269  if (!NT_SUCCESS(Status))
270  {
271  DPRINT("Failed to write the Legacy value: 0x%x\n", Status);
272  }
273  Status = ZwSetValueKey(InstanceKey, &DeviceReportedName, 0, REG_DWORD, &DeviceReported, sizeof(DeviceReported));
274  if (!NT_SUCCESS(Status))
275  {
276  DPRINT("Failed to write the DeviceReported value: 0x%x\n", Status);
277  }
278 
279  /* Set DeviceReported=1 in Control subkey */
281  &Control,
283  InstanceKey,
284  NULL);
285  Status = ZwCreateKey(&ControlKey,
288  0,
289  NULL,
291  NULL);
292  if (NT_SUCCESS(Status))
293  {
294  Status = ZwSetValueKey(ControlKey,
295  &DeviceReportedName,
296  0,
297  REG_DWORD,
298  &DeviceReported,
299  sizeof(DeviceReported));
300  ZwClose(ControlKey);
301  }
302  if (!NT_SUCCESS(Status))
303  {
304  DPRINT1("Failed to set ReportedDevice=1 for device %wZ (status 0x%08lx)\n", &instancePath, Status);
305  }
306 
307  /* Add DETECTEDInterfaceType\DriverName */
308  IdLength = 0;
309  IdLength += swprintf(&HardwareId[IdLength],
310  L"DETECTED%ls\\%wZ",
311  IfString,
312  &ServiceName);
313  IdLength++;
314 
315  /* Add DETECTED\DriverName */
316  IdLength += swprintf(&HardwareId[IdLength],
317  L"DETECTED\\%wZ",
318  &ServiceName);
319  IdLength++;
320 
321  /* Terminate the string with another null */
322  HardwareId[IdLength++] = UNICODE_NULL;
323 
324  /* Store the value for CompatibleIDs */
325  RtlInitUnicodeString(&ValueName, L"CompatibleIDs");
326  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR));
327  if (!NT_SUCCESS(Status))
328  {
329  DPRINT("Failed to write the compatible IDs: 0x%x\n", Status);
330  ZwClose(InstanceKey);
331  return Status;
332  }
333 
334  // Set the device's DeviceDesc and LocationInformation fields
335  PiSetDevNodeText(DeviceNode, InstanceKey);
336 
337  /* Assign the resources to the device node */
338  DeviceNode->BootResources = ResourceList;
339  DeviceNode->ResourceRequirements = ResourceRequirements;
340 
341  /* Set appropriate flags */
342  if (DeviceNode->BootResources)
344 
345  if (!DeviceNode->ResourceRequirements && !DeviceNode->BootResources)
347 
348  /* Write the resource information to the registry */
349  IopSetDeviceInstanceData(InstanceKey, DeviceNode);
350 
351  /* If the caller didn't get the resources assigned for us, do it now */
352  if (!ResourceAssigned)
353  {
355 
356  /* See if we failed */
357  if (!NT_SUCCESS(Status))
358  {
359  DPRINT("Assigning resources failed: 0x%x\n", Status);
360  ZwClose(InstanceKey);
361  return Status;
362  }
363  }
364 
365  /* Close the instance key handle */
366  ZwClose(InstanceKey);
367 
368  /* Register the given DO with PnP root if required */
369  if (DeviceObject && *DeviceObject)
371 
374 
375  // we still need to query IDs, send events and reenumerate this node
377 
378  DPRINT("Reported device: %S (%wZ)\n", HardwareId, &DeviceNode->InstancePath);
379 
381 
382  /* Return the PDO */
383  if (DeviceObject) *DeviceObject = Pdo;
384 
385  return STATUS_SUCCESS;
386 }
387 
388 /*
389  * @halfplemented
390  */
391 NTSTATUS
392 NTAPI
394  IN PCM_RESOURCE_LIST DriverList OPTIONAL,
395  IN ULONG DriverListSize OPTIONAL,
398  IN ULONG DeviceListSize OPTIONAL,
399  OUT PBOOLEAN ConflictDetected)
400 {
403 
404  *ConflictDetected = FALSE;
405 
406  if (!DriverList && !DeviceList)
408 
409  /* Find the real list */
410  if (!DriverList)
412  else
413  ResourceList = DriverList;
414 
415  /* Look for a resource conflict */
418  {
419  /* Oh noes */
420  *ConflictDetected = TRUE;
421  }
422  else if (NT_SUCCESS(Status))
423  {
424  /* Looks like we're good to go */
425 
426  /* TODO: Claim the resources in the ResourceMap */
427  }
428 
429  return Status;
430 }
431 
432 VOID
433 NTAPI
435 {
437 
438  /* Set the event */
440 }
441 
442 /*
443  * @implemented
444  */
445 NTSTATUS
446 NTAPI
449 {
450  KEVENT NotifyEvent;
451  NTSTATUS Status, NotifyStatus;
453 
454  ASSERT(notifyStruct);
455 
456  /* Check for valid PDO */
458  {
459  KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
460  }
461 
462  /* FileObject must be null. PnP will fill in it */
463  ASSERT(notifyStruct->FileObject == NULL);
464 
465  /* Do not handle system PnP events */
466  if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
467  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
468  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
469  {
471  }
472 
473  if (notifyStruct->Version != 1)
474  {
476  }
477 
478  /* Initialize even that will let us know when PnP will have finished notify */
479  KeInitializeEvent(&NotifyEvent, NotificationEvent, FALSE);
480 
481  Status = PpSetCustomTargetEvent(PhysicalDeviceObject, &NotifyEvent, &NotifyStatus, NULL, NULL, notifyStruct);
482  /* If no error, wait for the notify to end and return the status of the notify and not of the event */
483  if (NT_SUCCESS(Status))
484  {
486  Status = NotifyStatus;
487  }
488 
489  return Status;
490 }
491 
492 /*
493  * @implemented
494  */
495 NTSTATUS
496 NTAPI
501 {
504 
505  ASSERT(notifyStruct);
506 
507  /* Check for valid PDO */
509  {
510  KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
511  }
512 
513  /* FileObject must be null. PnP will fill in it */
514  ASSERT(notifyStruct->FileObject == NULL);
515 
516  /* Do not handle system PnP events */
517  if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
518  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
519  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
520  {
522  }
523 
524  if (notifyStruct->Version != 1)
525  {
527  }
528 
529  /* We need to store all the data given by the caller with the WorkItem, so use our own struct */
531  if (!Item) return STATUS_INSUFFICIENT_RESOURCES;
532 
533  /* Initialize all stuff */
535  Item->NotificationStructure = notifyStruct;
536  Item->PhysicalDeviceObject = PhysicalDeviceObject;
537  Item->Callback = Callback;
538  Item->Context = Context;
540 
541  /* Finally, queue the item, our work here is done */
542  ExQueueWorkItem(&(Item->WorkItem), DelayedWorkQueue);
543 
544  return STATUS_PENDING;
545 }
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:65
NTSTATUS PnpRootRegisterDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: pnproot.c:130
* PNTSTATUS
Definition: strlen.c:14
_In_ PVOID NotificationStructure
Definition: iofuncs.h:1206
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define DRVO_BUILTIN_DRIVER
Definition: iotypes.h:2227
#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:723
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
enum _INTERFACE_TYPE INTERFACE_TYPE
#define _In_opt_
Definition: ms_sal.h:309
PNP_DEVNODE_STATE PiSetDevNodeState(_In_ PDEVICE_NODE DeviceNode, _In_ PNP_DEVNODE_STATE NewState)
Definition: devnode.c:108
#define _Inout_
Definition: ms_sal.h:378
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:2655
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#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:522
LONG NTSTATUS
Definition: precomp.h:26
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:393
#define DNF_NO_RESOURCE_REQUIRED
Definition: iotypes.h:178
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define DNF_HAS_BOOT_CONFIG
Definition: iotypes.h:176
PDEVICE_LIST DeviceList
Definition: utils.c:27
uint16_t * PWCHAR
Definition: typedefs.h:56
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1149
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
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
_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:606
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define L(x)
Definition: ntvdm.h:50
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
PDEVICE_NODE PipAllocateDeviceNode(IN PDEVICE_OBJECT PhysicalDeviceObject)
#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:146
unsigned char BOOLEAN
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166
NTSTATUS NTAPI IoReportTargetDeviceChange(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PVOID NotificationStructure)
Definition: pnpreport.c:447
struct _INTERNAL_WORK_QUEUE_ITEM * PINTERNAL_WORK_QUEUE_ITEM
struct _INTERNAL_WORK_QUEUE_ITEM INTERNAL_WORK_QUEUE_ITEM
#define _In_
Definition: ms_sal.h:308
_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
Status
Definition: gdiplustypes.h:24
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
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:113
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:44
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
NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int, const UNICODE_STRING *, UNICODE_STRING *)
#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:1547
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
char * PBOOLEAN
Definition: retypes.h:11
PDEVICE_CHANGE_COMPLETE_CALLBACK Callback
Definition: pnpreport.c:22
int _cdecl swprintf(const WCHAR *,...)
#define IopIsValidPhysicalDeviceObject(PhysicalDeviceObject)
Definition: io.h:242
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)
Definition: pnpreport.c:148
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
VOID NTAPI IopSetEvent(IN PVOID Context)
Definition: pnpreport.c:434
VOID PiSetDevNodeText(_In_ PDEVICE_NODE DeviceNode, _In_ HANDLE InstanceKey)
Sets the DeviceNode's DeviceDesc and LocationInformation registry values.
Definition: devaction.c:1089
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
VOID NTAPI IopReportTargetDeviceChangeAsyncWorker(PVOID Context)
Definition: pnpreport.c:102
DEVICE_CHANGE_COMPLETE_CALLBACK * PDEVICE_CHANGE_COMPLETE_CALLBACK
Definition: iotypes.h:1254
#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
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.
Definition: pnpnotify.c:258
struct tagContext Context
Definition: acpixf.h:1034
VOID PiInsertDevNode(_In_ PDEVICE_NODE DeviceNode, _In_ PDEVICE_NODE ParentNode)
Definition: devnode.c:80
#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:1116
PDEVICE_OBJECT PhysicalDeviceObject
Definition: pnpreport.c:21
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:598
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define DNF_ENUMERATED
Definition: iotypes.h:174
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements
Definition: iofuncs.h:1547
struct _FILE_OBJECT * FileObject
Definition: iotypes.h:1012
#define DNF_MADEUP
Definition: iotypes.h:170
#define STATUS_SUCCESS
Definition: shellext.h:65
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1060
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST _In_ BOOLEAN ResourceAssigned
Definition: iofuncs.h:1547
#define DPRINT
Definition: sndvol32.h:71
PWCHAR IopGetInterfaceTypeString(INTERFACE_TYPE IfType)
Definition: pnpreport.c:42
#define STATUS_CONFLICTING_ADDRESSES
Definition: ntstatus.h:261
NTSTATUS NTAPI IoReportTargetDeviceChangeAsynchronous(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PVOID NotificationStructure, IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, IN PVOID Context OPTIONAL)
Definition: pnpreport.c:497
#define REG_DWORD
Definition: sdbapi.c:596
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
NTSTATUS NTAPI IopDetectResourceConflict(IN PCM_RESOURCE_LIST ResourceList, IN BOOLEAN Silent, OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
Definition: pnpres.c:1255
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:186
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
#define REG_SZ
Definition: layer.c:22
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68