ReactOS  0.4.13-dev-464-g6b95727
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 
28 NTAPI
32 
36 
39  PVOID Context);
40 
43  IN OUT PKEVENT SyncEvent OPTIONAL,
44  IN OUT PNTSTATUS SyncStatus OPTIONAL,
48 
49 /* PRIVATE FUNCTIONS *********************************************************/
50 
51 PWCHAR
53 {
54  switch (IfType)
55  {
56  case Internal:
57  return L"Internal";
58 
59  case Isa:
60  return L"Isa";
61 
62  case Eisa:
63  return L"Eisa";
64 
65  case MicroChannel:
66  return L"MicroChannel";
67 
68  case TurboChannel:
69  return L"TurboChannel";
70 
71  case PCIBus:
72  return L"PCIBus";
73 
74  case VMEBus:
75  return L"VMEBus";
76 
77  case NuBus:
78  return L"NuBus";
79 
80  case PCMCIABus:
81  return L"PCMCIABus";
82 
83  case CBus:
84  return L"CBus";
85 
86  case MPIBus:
87  return L"MPIBus";
88 
89  case MPSABus:
90  return L"MPSABus";
91 
92  case ProcessorInternal:
93  return L"ProcessorInternal";
94 
95  case PNPISABus:
96  return L"PNPISABus";
97 
98  case PNPBus:
99  return L"PNPBus";
100 
101  case Vmcs:
102  return L"Vmcs";
103 
104  default:
105  DPRINT1("Invalid bus type: %d\n", IfType);
106  return NULL;
107  }
108 }
109 
110 VOID
111 NTAPI
113 {
115 
119  ExFreePoolWithTag(Context, ' pP');
120 }
121 
122 NTSTATUS
124  IN OUT PKEVENT SyncEvent OPTIONAL,
125  IN OUT PNTSTATUS SyncStatus OPTIONAL,
129 {
132 
133  if (SyncEvent)
134  {
135  ASSERT(SyncStatus);
136  *SyncStatus = STATUS_PENDING;
137  }
138 
139  /* That call is totally wrong but notifications handler must be fixed first */
142  &GUID_PNP_CUSTOM_NOTIFICATION,
144  NULL);
145 
146  if (SyncEvent)
147  {
148  KeSetEvent(SyncEvent, IO_NO_INCREMENT, FALSE);
149  *SyncStatus = STATUS_SUCCESS;
150  }
151 
152  return STATUS_SUCCESS;
153 }
154 
155 /* PUBLIC FUNCTIONS **********************************************************/
156 
157 /*
158  * @implemented
159  */
160 NTSTATUS
161 NTAPI
170 {
174  HANDLE InstanceKey;
176  UNICODE_STRING ValueName, ServiceLongName, ServiceName;
177  WCHAR HardwareId[256];
178  PWCHAR IfString;
179  ULONG IdLength;
180  ULONG LegacyValue;
181 
182  DPRINT("IoReportDetectedDevice (DeviceObject %p, *DeviceObject %p)\n",
184 
185  ServiceLongName = DriverObject->DriverExtension->ServiceKeyName;
186  ServiceName = ServiceLongName;
187 
188  /* If the interface type is unknown, treat it as internal */
191 
192  /* Get the string equivalent of the interface type */
194 
195  /* If NULL is returned then it's a bad type */
196  if (!IfString)
198 
199  /*
200  * Drivers that have been created via a direct IoCreateDriver() call
201  * have their ServiceKeyName set to \Driver\DriverName. We need to
202  * strip everything up to the last path separator and keep what remains.
203  */
205  {
206  /*
207  * Find the last path separator.
208  * NOTE: Since ServiceName is not necessarily NULL-terminated,
209  * we cannot use wcsrchr().
210  */
211  if (ServiceName.Buffer && ServiceName.Length >= sizeof(WCHAR))
212  {
213  ValueName.Length = 1;
214  ValueName.Buffer = ServiceName.Buffer + (ServiceName.Length / sizeof(WCHAR)) - 1;
215 
216  while ((ValueName.Buffer > ServiceName.Buffer) && (*ValueName.Buffer != L'\\'))
217  {
218  --ValueName.Buffer;
219  ++ValueName.Length;
220  }
221  if (*ValueName.Buffer == L'\\')
222  {
223  ++ValueName.Buffer;
224  --ValueName.Length;
225  }
226  ValueName.Length *= sizeof(WCHAR);
227 
228  /* Shorten the string */
229  ServiceName.MaximumLength -= (ServiceName.Length - ValueName.Length);
230  ServiceName.Length = ValueName.Length;
231  ServiceName.Buffer = ValueName.Buffer;
232  }
233  }
234 
235  /* We use the caller's PDO if they supplied one */
236  if (DeviceObject && *DeviceObject)
237  {
238  Pdo = *DeviceObject;
239  }
240  else
241  {
242  /* Create the PDO */
244  NULL,
245  &Pdo,
246  NULL);
247  if (!NT_SUCCESS(Status))
248  {
249  DPRINT("PnpRootCreateDevice() failed (Status 0x%08lx)\n", Status);
250  return Status;
251  }
252  }
253 
254  /* Create the device node for the new PDO */
256  Pdo,
257  NULL,
258  &DeviceNode);
259  if (!NT_SUCCESS(Status))
260  {
261  DPRINT("IopCreateDeviceNode() failed (Status 0x%08lx)\n", Status);
262  return Status;
263  }
264 
265  /* We're enumerated already */
267 
268  /* We don't call AddDevice for devices reported this way */
270 
271  /* We don't send IRP_MN_START_DEVICE */
273 
274  /* We need to get device IDs */
275 #if 0
276  IopDeviceNodeSetFlag(DeviceNode, DNF_NEED_QUERY_IDS);
277 #endif
278 
279  /* This is a legacy driver for this device */
281 
282  /* Perform a manual configuration of our device */
285 
286  /* Open a handle to the instance path key */
287  Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_NON_VOLATILE, &InstanceKey);
288  if (!NT_SUCCESS(Status))
289  return Status;
290 
291  /* Save the driver name */
292  RtlInitUnicodeString(&ValueName, L"Service");
293  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_SZ, ServiceLongName.Buffer, ServiceLongName.Length + sizeof(UNICODE_NULL));
294  if (!NT_SUCCESS(Status))
295  {
296  DPRINT("Failed to write the Service name value: 0x%x\n", Status);
297  }
298 
299  /* Report as non-legacy driver */
300  RtlInitUnicodeString(&ValueName, L"Legacy");
301  LegacyValue = 0;
302  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_DWORD, &LegacyValue, sizeof(LegacyValue));
303  if (!NT_SUCCESS(Status))
304  {
305  DPRINT("Failed to write the Legacy value: 0x%x\n", Status);
306  }
307 
308  /* Add DETECTEDInterfaceType\DriverName */
309  IdLength = 0;
310  IdLength += swprintf(&HardwareId[IdLength],
311  L"DETECTED%ls\\%wZ",
312  IfString,
313  &ServiceName);
314  IdLength++;
315 
316  /* Add DETECTED\DriverName */
317  IdLength += swprintf(&HardwareId[IdLength],
318  L"DETECTED\\%wZ",
319  &ServiceName);
320  IdLength++;
321 
322  /* Terminate the string with another null */
323  HardwareId[IdLength++] = UNICODE_NULL;
324 
325  /* Store the value for CompatibleIDs */
326  RtlInitUnicodeString(&ValueName, L"CompatibleIDs");
327  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR));
328  if (!NT_SUCCESS(Status))
329  {
330  DPRINT("Failed to write the compatible IDs: 0x%x\n", Status);
331  ZwClose(InstanceKey);
332  return Status;
333  }
334 
335  /* Add a hardware ID if the driver didn't report one */
336  RtlInitUnicodeString(&ValueName, L"HardwareID");
337  if (ZwQueryValueKey(InstanceKey, &ValueName, KeyValueBasicInformation, NULL, 0, &RequiredLength) == STATUS_OBJECT_NAME_NOT_FOUND)
338  {
339  /* Just use our most specific compatible ID */
340  IdLength = 0;
341  IdLength += swprintf(&HardwareId[IdLength],
342  L"DETECTED%ls\\%wZ",
343  IfString,
344  &ServiceName);
345  IdLength++;
346 
347  HardwareId[IdLength++] = UNICODE_NULL;
348 
349  /* Write the value to the registry */
350  Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR));
351  if (!NT_SUCCESS(Status))
352  {
353  DPRINT("Failed to write the hardware ID: 0x%x\n", Status);
354  ZwClose(InstanceKey);
355  return Status;
356  }
357  }
358 
359  /* Assign the resources to the device node */
360  DeviceNode->BootResources = ResourceList;
361  DeviceNode->ResourceRequirements = ResourceRequirements;
362 
363  /* Set appropriate flags */
364  if (DeviceNode->BootResources)
366 
367  if (!DeviceNode->ResourceRequirements && !DeviceNode->BootResources)
369 
370  /* Write the resource information to the registry */
371  IopSetDeviceInstanceData(InstanceKey, DeviceNode);
372 
373  /* If the caller didn't get the resources assigned for us, do it now */
374  if (!ResourceAssigned)
375  {
377 
378  /* See if we failed */
379  if (!NT_SUCCESS(Status))
380  {
381  DPRINT("Assigning resources failed: 0x%x\n", Status);
382  ZwClose(InstanceKey);
383  return Status;
384  }
385  }
386 
387  /* Close the instance key handle */
388  ZwClose(InstanceKey);
389 
390  /* Register the given DO with PnP root if required */
391  if (DeviceObject && *DeviceObject)
393 
394  /* Report the device's enumeration to umpnpmgr */
395  IopQueueTargetDeviceEvent(&GUID_DEVICE_ENUMERATED,
396  &DeviceNode->InstancePath);
397 
398  /* Report the device's arrival to umpnpmgr */
399  IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
400  &DeviceNode->InstancePath);
401 
402  DPRINT("Reported device: %S (%wZ)\n", HardwareId, &DeviceNode->InstancePath);
403 
404  /* Return the PDO */
405  if (DeviceObject) *DeviceObject = Pdo;
406 
407  return STATUS_SUCCESS;
408 }
409 
410 /*
411  * @halfplemented
412  */
413 NTSTATUS
414 NTAPI
416  IN PCM_RESOURCE_LIST DriverList OPTIONAL,
417  IN ULONG DriverListSize OPTIONAL,
420  IN ULONG DeviceListSize OPTIONAL,
421  OUT PBOOLEAN ConflictDetected)
422 {
425 
426  *ConflictDetected = FALSE;
427 
428  if (!DriverList && !DeviceList)
430 
431  /* Find the real list */
432  if (!DriverList)
434  else
435  ResourceList = DriverList;
436 
437  /* Look for a resource conflict */
440  {
441  /* Oh noes */
442  *ConflictDetected = TRUE;
443  }
444  else if (NT_SUCCESS(Status))
445  {
446  /* Looks like we're good to go */
447 
448  /* TODO: Claim the resources in the ResourceMap */
449  }
450 
451  return Status;
452 }
453 
454 VOID
455 NTAPI
457 {
459 
460  /* Set the event */
462 }
463 
464 /*
465  * @implemented
466  */
467 NTSTATUS
468 NTAPI
471 {
472  KEVENT NotifyEvent;
473  NTSTATUS Status, NotifyStatus;
475 
476  ASSERT(notifyStruct);
477 
478  /* Check for valid PDO */
480  {
481  KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
482  }
483 
484  /* FileObject must be null. PnP will fill in it */
485  ASSERT(notifyStruct->FileObject == NULL);
486 
487  /* Do not handle system PnP events */
488  if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
489  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
490  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
491  {
493  }
494 
495  if (notifyStruct->Version != 1)
496  {
498  }
499 
500  /* Initialize even that will let us know when PnP will have finished notify */
501  KeInitializeEvent(&NotifyEvent, NotificationEvent, FALSE);
502 
503  Status = PpSetCustomTargetEvent(PhysicalDeviceObject, &NotifyEvent, &NotifyStatus, NULL, NULL, notifyStruct);
504  /* If no error, wait for the notify to end and return the status of the notify and not of the event */
505  if (NT_SUCCESS(Status))
506  {
508  Status = NotifyStatus;
509  }
510 
511  return Status;
512 }
513 
514 /*
515  * @implemented
516  */
517 NTSTATUS
518 NTAPI
523 {
526 
527  ASSERT(notifyStruct);
528 
529  /* Check for valid PDO */
531  {
532  KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
533  }
534 
535  /* FileObject must be null. PnP will fill in it */
536  ASSERT(notifyStruct->FileObject == NULL);
537 
538  /* Do not handle system PnP events */
539  if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
540  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
541  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
542  {
544  }
545 
546  if (notifyStruct->Version != 1)
547  {
549  }
550 
551  /* We need to store all the data given by the caller with the WorkItem, so use our own struct */
553  if (!Item) return STATUS_INSUFFICIENT_RESOURCES;
554 
555  /* Initialize all stuff */
557  Item->NotificationStructure = notifyStruct;
559  Item->Callback = Callback;
560  Item->Context = Context;
562 
563  /* Finally, queue the item, our work here is done */
565 
566  return STATUS_PENDING;
567 }
NTSTATUS IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode, PVOID Context)
Definition: pnpmgr.c:2337
NTSTATUS PnpRootRegisterDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: pnproot.c:130
* PNTSTATUS
Definition: strlen.c:14
_In_ PVOID NotificationStructure
Definition: iofuncs.h:1203
#define DRVO_BUILTIN_DRIVER
Definition: iotypes.h:2118
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
PDEVICE_NODE IopRootDeviceNode
Definition: pnpmgr.c:18
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:717
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
enum _INTERFACE_TYPE INTERFACE_TYPE
_In_ PDEVICE_OBJECT Pdo
Definition: classpnp.h:301
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
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:415
#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
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
uint16_t * PWCHAR
Definition: typedefs.h:54
NTSTATUS NTAPI IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, IN ULONG CreateOptions, OUT PHANDLE Handle)
Definition: pnpmgr.c:1594
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
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
NTSTATUS IopSetDeviceInstanceData(HANDLE InstanceKey, PDEVICE_NODE DeviceNode)
Definition: pnpmgr.c:1678
uint32_t ULONG_PTR
Definition: typedefs.h:63
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
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:162
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define UNICODE_NULL
#define REG_MULTI_SZ
Definition: nt_native.h:1501
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2173
#define IopDeviceNodeSetFlag(DeviceNode, Flag)
Definition: io.h:142
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI IoReportTargetDeviceChange(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PVOID NotificationStructure)
Definition: pnpreport.c:469
struct _INTERNAL_WORK_QUEUE_ITEM * PINTERNAL_WORK_QUEUE_ITEM
struct _INTERNAL_WORK_QUEUE_ITEM INTERNAL_WORK_QUEUE_ITEM
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
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
#define DNF_STARTED
Definition: iotypes.h:168
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
_In_ HANDLE Handle
Definition: extypes.h:390
NTSTATUS IopQueueTargetDeviceEvent(const GUID *Guid, PUNICODE_STRING DeviceIds)
Definition: plugplay.c:46
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:123
struct _TARGET_DEVICE_CUSTOM_NOTIFICATION * PTARGET_DEVICE_CUSTOM_NOTIFICATION
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
LPTSTR ServiceName
Definition: ServiceMain.c:15
__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
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG CreateOptions
Definition: fltkernel.h:1230
Definition: Node.h:9
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_In_ INTERFACE_TYPE LegacyBusType
Definition: iofuncs.h:1543
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
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
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
#define DNF_LEGACY_DRIVER
Definition: iotypes.h:181
PDEVICE_CHANGE_COMPLETE_CALLBACK Callback
Definition: pnpreport.c:22
#define IopIsValidPhysicalDeviceObject(PhysicalDeviceObject)
Definition: io.h:238
Status
Definition: gdiplustypes.h:24
UNICODE_STRING ServiceKeyName
Definition: iotypes.h:2113
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IopSetEvent(IN PVOID Context)
Definition: pnpreport.c:456
#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:112
PDEVICE_LIST DeviceList
Definition: utils.c:27
_In_ ULONG _Out_opt_ PULONG RequiredLength
Definition: wmifuncs.h:29
DEVICE_CHANGE_COMPLETE_CALLBACK * PDEVICE_CHANGE_COMPLETE_CALLBACK
Definition: iotypes.h:1210
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
#define DPRINT1
Definition: precomp.h:8
#define OUT
Definition: typedefs.h:39
#define ObReferenceObject
Definition: obfuncs.h:204
WORK_QUEUE_ITEM WorkItem
Definition: pnpreport.c:20
NTSTATUS NTAPI IopAssignDeviceResources(IN PDEVICE_NODE DeviceNode)
Definition: pnpres.c:1060
struct tagContext Context
Definition: acpixf.h:1012
PDEVICE_OBJECT PhysicalDeviceObject
Definition: pnpreport.c:21
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:565
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
#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:974
#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:52
#define STATUS_CONFLICTING_ADDRESSES
Definition: ntstatus.h:247
return STATUS_SUCCESS
Definition: btrfs.c:2777
#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:519
#define REG_DWORD
Definition: sdbapi.c:596
LPFNPSPCALLBACK Callback
Definition: desk.c:111
NTSTATUS NTAPI IopDetectResourceConflict(IN PCM_RESOURCE_LIST ResourceList, IN BOOLEAN Silent, OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
Definition: pnpres.c:1200
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:107
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 REG_SZ
Definition: layer.c:22
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68