ReactOS  0.4.15-dev-439-g292f67a
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 
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  */
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 
398  /* Return the PDO */
399  if (DeviceObject) *DeviceObject = Pdo;
400 
401  return STATUS_SUCCESS;
402 }
403 
404 /*
405  * @halfplemented
406  */
407 NTSTATUS
408 NTAPI
410  IN PCM_RESOURCE_LIST DriverList OPTIONAL,
411  IN ULONG DriverListSize OPTIONAL,
414  IN ULONG DeviceListSize OPTIONAL,
415  OUT PBOOLEAN ConflictDetected)
416 {
419 
420  *ConflictDetected = FALSE;
421 
422  if (!DriverList && !DeviceList)
424 
425  /* Find the real list */
426  if (!DriverList)
428  else
429  ResourceList = DriverList;
430 
431  /* Look for a resource conflict */
434  {
435  /* Oh noes */
436  *ConflictDetected = TRUE;
437  }
438  else if (NT_SUCCESS(Status))
439  {
440  /* Looks like we're good to go */
441 
442  /* TODO: Claim the resources in the ResourceMap */
443  }
444 
445  return Status;
446 }
447 
448 VOID
449 NTAPI
451 {
453 
454  /* Set the event */
456 }
457 
458 /*
459  * @implemented
460  */
461 NTSTATUS
462 NTAPI
465 {
466  KEVENT NotifyEvent;
467  NTSTATUS Status, NotifyStatus;
469 
470  ASSERT(notifyStruct);
471 
472  /* Check for valid PDO */
474  {
475  KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
476  }
477 
478  /* FileObject must be null. PnP will fill in it */
479  ASSERT(notifyStruct->FileObject == NULL);
480 
481  /* Do not handle system PnP events */
482  if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
483  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
484  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
485  {
487  }
488 
489  if (notifyStruct->Version != 1)
490  {
492  }
493 
494  /* Initialize even that will let us know when PnP will have finished notify */
495  KeInitializeEvent(&NotifyEvent, NotificationEvent, FALSE);
496 
497  Status = PpSetCustomTargetEvent(PhysicalDeviceObject, &NotifyEvent, &NotifyStatus, NULL, NULL, notifyStruct);
498  /* If no error, wait for the notify to end and return the status of the notify and not of the event */
499  if (NT_SUCCESS(Status))
500  {
502  Status = NotifyStatus;
503  }
504 
505  return Status;
506 }
507 
508 /*
509  * @implemented
510  */
511 NTSTATUS
512 NTAPI
517 {
520 
521  ASSERT(notifyStruct);
522 
523  /* Check for valid PDO */
525  {
526  KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
527  }
528 
529  /* FileObject must be null. PnP will fill in it */
530  ASSERT(notifyStruct->FileObject == NULL);
531 
532  /* Do not handle system PnP events */
533  if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
534  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
535  (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
536  {
538  }
539 
540  if (notifyStruct->Version != 1)
541  {
543  }
544 
545  /* We need to store all the data given by the caller with the WorkItem, so use our own struct */
547  if (!Item) return STATUS_INSUFFICIENT_RESOURCES;
548 
549  /* Initialize all stuff */
551  Item->NotificationStructure = notifyStruct;
553  Item->Callback = Callback;
554  Item->Context = Context;
556 
557  /* Finally, queue the item, our work here is done */
559 
560  return STATUS_PENDING;
561 }
NTSTATUS IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode, PVOID Context)
Definition: devaction.c:548
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:2119
#define IN
Definition: typedefs.h:39
#define TRUE
Definition: types.h:120
PDEVICE_NODE IopRootDeviceNode
Definition: devnode.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)
NTSTATUS NTAPI IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, IN ULONG CreateOptions, OUT PHANDLE Handle)
Definition: pnpmgr.c:661
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:409
#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:55
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
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
NTSTATUS IopSetDeviceInstanceData(HANDLE InstanceKey, PDEVICE_NODE DeviceNode)
Definition: pnpmgr.c:745
uint32_t ULONG_PTR
Definition: typedefs.h:64
_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:156
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:2174
#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:463
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
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: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
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
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
#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:2114
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
VOID NTAPI IopSetEvent(IN PVOID Context)
Definition: pnpreport.c:450
#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
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:1211
_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: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:1105
struct tagContext Context
Definition: acpixf.h:1034
PDEVICE_OBJECT PhysicalDeviceObject
Definition: pnpreport.c:21
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:566
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:975
#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:247
return STATUS_SUCCESS
Definition: btrfs.c:3014
#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:513
#define REG_DWORD
Definition: sdbapi.c:596
LPFNPSPCALLBACK Callback
Definition: desk.c:112
NTSTATUS NTAPI IopDetectResourceConflict(IN PCM_RESOURCE_LIST ResourceList, IN BOOLEAN Silent, OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
Definition: pnpres.c:1251
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