ReactOS 0.4.15-dev-7846-g8ba6c66
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
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
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
100VOID
101NTAPI
103{
105
107 PpSetCustomTargetEvent(Item->PhysicalDeviceObject, NULL, NULL, Item->Callback, Item->Context, Item->NotificationStructure);
108 ObDereferenceObject(Item->PhysicalDeviceObject);
110}
111
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 */
147NTAPI
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 */
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 = {0};
228 {
229 Pdo = *DeviceObject;
230 }
231 else
232 {
233 /* Create the PDO */
234 Status = PnpRootCreateDevice(&ServiceName, &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 // The string comes from PnpRootCreateDevice, so it can be used right away
251 DeviceNode->InstancePath = instancePath;
252
253 /* Open a handle to the instance path key */
254 Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_NON_VOLATILE, &InstanceKey);
255 if (!NT_SUCCESS(Status))
256 return Status;
257
258 /* Save the driver name */
259 RtlInitUnicodeString(&ValueName, L"Service");
260 Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_SZ, ServiceLongName.Buffer, ServiceLongName.Length + sizeof(UNICODE_NULL));
261 if (!NT_SUCCESS(Status))
262 {
263 DPRINT("Failed to write the Service name value: 0x%x\n", Status);
264 }
265
266 /* Report as non-legacy driver */
268 LegacyValue = 0;
269 Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_DWORD, &LegacyValue, sizeof(LegacyValue));
270 if (!NT_SUCCESS(Status))
271 {
272 DPRINT("Failed to write the Legacy value: 0x%x\n", Status);
273 }
274 Status = ZwSetValueKey(InstanceKey, &DeviceReportedName, 0, REG_DWORD, &DeviceReported, sizeof(DeviceReported));
275 if (!NT_SUCCESS(Status))
276 {
277 DPRINT("Failed to write the DeviceReported value: 0x%x\n", Status);
278 }
279
280 /* Set DeviceReported=1 in Control subkey */
282 &Control,
284 InstanceKey,
285 NULL);
286 Status = ZwCreateKey(&ControlKey,
289 0,
290 NULL,
292 NULL);
293 if (NT_SUCCESS(Status))
294 {
295 Status = ZwSetValueKey(ControlKey,
296 &DeviceReportedName,
297 0,
298 REG_DWORD,
299 &DeviceReported,
300 sizeof(DeviceReported));
301 ZwClose(ControlKey);
302 }
303 if (!NT_SUCCESS(Status))
304 {
305 DPRINT1("Failed to set ReportedDevice=1 for device %wZ (status 0x%08lx)\n", &instancePath, 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 // Set the device's DeviceDesc and LocationInformation fields
336 PiSetDevNodeText(DeviceNode, InstanceKey);
337
338 /* Assign the resources to the device node */
339 DeviceNode->BootResources = ResourceList;
340 DeviceNode->ResourceRequirements = ResourceRequirements;
341
342 /* Set appropriate flags */
343 if (DeviceNode->BootResources)
345
346 if (!DeviceNode->ResourceRequirements && !DeviceNode->BootResources)
348
349 /* Write the resource information to the registry */
351
352 /* If the caller didn't get the resources assigned for us, do it now */
353 if (!ResourceAssigned)
354 {
356
357 /* See if we failed */
358 if (!NT_SUCCESS(Status))
359 {
360 DPRINT("Assigning resources failed: 0x%x\n", Status);
361 ZwClose(InstanceKey);
362 return Status;
363 }
364 }
365
366 /* Close the instance key handle */
367 ZwClose(InstanceKey);
368
369 /* Register the given DO with PnP root if required */
372
375
376 // we still need to query IDs, send events and reenumerate this node
378
379 DPRINT("Reported device: %S (%wZ)\n", HardwareId, &DeviceNode->InstancePath);
380
382
383 /* Return the PDO */
385
386 return STATUS_SUCCESS;
387}
388
389/*
390 * @halfplemented
391 */
393NTAPI
395 IN PCM_RESOURCE_LIST DriverList OPTIONAL,
396 IN ULONG DriverListSize OPTIONAL,
399 IN ULONG DeviceListSize OPTIONAL,
400 OUT PBOOLEAN ConflictDetected)
401{
404
405 *ConflictDetected = FALSE;
406
407 if (!DriverList && !DeviceList)
409
410 /* Find the real list */
411 if (!DriverList)
413 else
414 ResourceList = DriverList;
415
416 /* Look for a resource conflict */
419 {
420 /* Oh noes */
421 *ConflictDetected = TRUE;
422 }
423 else if (NT_SUCCESS(Status))
424 {
425 /* Looks like we're good to go */
426
427 /* TODO: Claim the resources in the ResourceMap */
428 }
429
430 return Status;
431}
432
433VOID
434NTAPI
436{
438
439 /* Set the event */
441}
442
443/*
444 * @implemented
445 */
447NTAPI
450{
451 KEVENT NotifyEvent;
452 NTSTATUS Status, NotifyStatus;
454
455 ASSERT(notifyStruct);
456
457 /* Check for valid PDO */
459 {
460 KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
461 }
462
463 /* FileObject must be null. PnP will fill in it */
464 ASSERT(notifyStruct->FileObject == NULL);
465
466 /* Do not handle system PnP events */
467 if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
468 (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
469 (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
470 {
472 }
473
474 if (notifyStruct->Version != 1)
475 {
477 }
478
479 /* Initialize even that will let us know when PnP will have finished notify */
481
482 Status = PpSetCustomTargetEvent(PhysicalDeviceObject, &NotifyEvent, &NotifyStatus, NULL, NULL, notifyStruct);
483 /* If no error, wait for the notify to end and return the status of the notify and not of the event */
484 if (NT_SUCCESS(Status))
485 {
487 Status = NotifyStatus;
488 }
489
490 return Status;
491}
492
493/*
494 * @implemented
495 */
497NTAPI
502{
505
506 ASSERT(notifyStruct);
507
508 /* Check for valid PDO */
510 {
511 KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
512 }
513
514 /* FileObject must be null. PnP will fill in it */
515 ASSERT(notifyStruct->FileObject == NULL);
516
517 /* Do not handle system PnP events */
518 if ((RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
519 (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
520 (RtlCompareMemory(&(notifyStruct->Event), &(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
521 {
523 }
524
525 if (notifyStruct->Version != 1)
526 {
528 }
529
530 /* We need to store all the data given by the caller with the WorkItem, so use our own struct */
533
534 /* Initialize all stuff */
536 Item->NotificationStructure = notifyStruct;
537 Item->PhysicalDeviceObject = PhysicalDeviceObject;
538 Item->Callback = Callback;
539 Item->Context = Context;
541
542 /* Finally, queue the item, our work here is done */
544
545 return STATUS_PENDING;
546}
@ DeviceNode
Definition: Node.h:9
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
static WCHAR ServiceName[]
Definition: browser.c:19
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PDEVICE_LIST DeviceList
Definition: utils.c:27
#define swprintf
Definition: precomp.h:40
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
#define NonPagedPool
Definition: env_spec_w32.h:307
Status
Definition: gdiplustypes.h:25
@ Eisa
Definition: hwresource.cpp:139
@ VMEBus
Definition: hwresource.cpp:143
@ InterfaceTypeUndefined
Definition: hwresource.cpp:136
@ CBus
Definition: hwresource.cpp:146
@ TurboChannel
Definition: hwresource.cpp:141
@ PNPBus
Definition: hwresource.cpp:152
@ PCIBus
Definition: hwresource.cpp:142
@ MPIBus
Definition: hwresource.cpp:147
@ Vmcs
Definition: hwresource.cpp:153
@ MPSABus
Definition: hwresource.cpp:148
@ Internal
Definition: hwresource.cpp:137
@ NuBus
Definition: hwresource.cpp:144
@ MicroChannel
Definition: hwresource.cpp:140
@ PNPISABus
Definition: hwresource.cpp:151
@ ProcessorInternal
Definition: hwresource.cpp:149
@ Isa
Definition: hwresource.cpp:138
@ PCMCIABus
Definition: hwresource.cpp:145
enum _INTERFACE_TYPE INTERFACE_TYPE
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
SYNC_STATUS SyncStatus
Definition: internettime.c:14
#define REG_SZ
Definition: layer.c:22
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
* PNTSTATUS
Definition: strlen.c:14
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define _Inout_
Definition: ms_sal.h:378
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define KernelMode
Definition: asm.h:34
#define DNF_ENUMERATED
Definition: iotypes.h:174
@ DeviceNodeStartPostWork
Definition: iotypes.h:428
#define DNF_NO_RESOURCE_REQUIRED
Definition: iotypes.h:178
#define DNF_HAS_BOOT_CONFIG
Definition: iotypes.h:176
#define DNF_MADEUP
Definition: iotypes.h:170
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1060
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define UNICODE_NULL
@ NotificationEvent
#define IopIsValidPhysicalDeviceObject(PhysicalDeviceObject)
Definition: io.h:242
@ PiActionEnumDeviceTree
Definition: io.h:526
VOID PiInsertDevNode(_In_ PDEVICE_NODE DeviceNode, _In_ PDEVICE_NODE ParentNode)
Definition: devnode.c:80
NTSTATUS NTAPI IopAssignDeviceResources(IN PDEVICE_NODE DeviceNode)
Definition: pnpres.c:1116
PDEVICE_NODE PipAllocateDeviceNode(IN PDEVICE_OBJECT PhysicalDeviceObject)
NTSTATUS NTAPI IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, IN ULONG CreateOptions, OUT PHANDLE Handle)
Definition: pnpmgr.c:522
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
NTSTATUS PnpRootRegisterDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: pnproot.c:107
NTSTATUS PnpRootCreateDevice(IN PUNICODE_STRING ServiceName, OUT PDEVICE_OBJECT *PhysicalDeviceObject, OUT PUNICODE_STRING FullInstancePath)
Definition: pnproot.c:184
#define IopDeviceNodeSetFlag(DeviceNode, Flag)
Definition: io.h:146
VOID PiSetDevNodeText(_In_ PDEVICE_NODE DeviceNode, _In_ HANDLE InstanceKey)
Sets the DeviceNode's DeviceDesc and LocationInformation registry values.
Definition: devaction.c:1089
PNP_DEVNODE_STATE PiSetDevNodeState(_In_ PDEVICE_NODE DeviceNode, _In_ PNP_DEVNODE_STATE NewState)
Definition: devnode.c:108
NTSTATUS NTAPI IopDetectResourceConflict(IN PCM_RESOURCE_LIST ResourceList, IN BOOLEAN Silent, OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
Definition: pnpres.c:1255
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:2659
PDEVICE_NODE IopRootDeviceNode
Definition: devnode.c:18
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_CONFLICTING_ADDRESSES
Definition: ntstatus.h:261
#define L(x)
Definition: ntvdm.h:50
NTSTATUS IopSetDeviceInstanceData(HANDLE InstanceKey, PDEVICE_NODE DeviceNode)
Definition: pnpmgr.c:606
VOID NTAPI IopReportTargetDeviceChangeAsyncWorker(PVOID Context)
Definition: pnpreport.c:102
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:394
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)
Definition: pnpreport.c:113
VOID NTAPI IopSetEvent(IN PVOID Context)
Definition: pnpreport.c:435
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
PWCHAR IopGetInterfaceTypeString(INTERFACE_TYPE IfType)
Definition: pnpreport.c:42
NTSTATUS NTAPI IoReportTargetDeviceChange(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PVOID NotificationStructure)
Definition: pnpreport.c:448
NTSTATUS NTAPI IoReportTargetDeviceChangeAsynchronous(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PVOID NotificationStructure, IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, IN PVOID Context OPTIONAL)
Definition: pnpreport.c:498
struct _INTERNAL_WORK_QUEUE_ITEM * PINTERNAL_WORK_QUEUE_ITEM
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
#define REG_DWORD
Definition: sdbapi.c:596
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
PDEVICE_OBJECT PhysicalDeviceObject
Definition: pnpreport.c:21
PDEVICE_CHANGE_COMPLETE_CALLBACK Callback
Definition: pnpreport.c:22
PTARGET_DEVICE_CUSTOM_NOTIFICATION NotificationStructure
Definition: pnpreport.c:24
WORK_QUEUE_ITEM WorkItem
Definition: pnpreport.c:20
struct _FILE_OBJECT * FileObject
Definition: iotypes.h:1012
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
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:72
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:68
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:723
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
@ DelayedWorkQueue
Definition: extypes.h:190
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST _In_ BOOLEAN ResourceAssigned
Definition: iofuncs.h:1552
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements
Definition: iofuncs.h:1551
_In_ INTERFACE_TYPE LegacyBusType
Definition: iofuncs.h:1547
_In_ PVOID NotificationStructure
Definition: iofuncs.h:1206
struct _TARGET_DEVICE_CUSTOM_NOTIFICATION * PTARGET_DEVICE_CUSTOM_NOTIFICATION
DEVICE_CHANGE_COMPLETE_CALLBACK * PDEVICE_CHANGE_COMPLETE_CALLBACK
Definition: iotypes.h:1254
#define DRVO_BUILTIN_DRIVER
Definition: iotypes.h:2227
#define IO_NO_INCREMENT
Definition: iotypes.h:598
@ Executive
Definition: ketypes.h:415
#define ObDereferenceObject
Definition: obfuncs.h:203
#define ObReferenceObject
Definition: obfuncs.h:204
__wchar_t WCHAR
Definition: xmlstorage.h:180