ReactOS  0.4.15-dev-1070-ge1a01de
pnpinit.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Kernel
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * FILE: ntoskrnl/io/pnpmgr/pnpinit.c
5  * PURPOSE: PnP Initialization Code
6  * PROGRAMMERS: ReactOS Portable Systems Group
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include <ntoskrnl.h>
12 #define NDEBUG
13 #include <debug.h>
14 
15 /* GLOBALS ********************************************************************/
16 
18 {
22 
27 
33 
35 
41 
42 /* FUNCTIONS ******************************************************************/
43 
45 NTAPI
47 {
48  /* FIXME: ReactOS doesn't support MicroChannel yet */
49  return Isa;
50 }
51 
53 NTAPI
55 {
57 
59  if (!NT_SUCCESS(Status))
60  {
61  DPRINT1("IopPortInitialize() return %X\n", Status);
62  return Status;
63  }
64 
66  if (!NT_SUCCESS(Status))
67  {
68  DPRINT1("IopMemInitialize() return %X\n", Status);
69  return Status;
70  }
71 
73  if (!NT_SUCCESS(Status))
74  {
75  DPRINT1("IopDmaInitialize() return %X\n", Status);
76  return Status;
77  }
78 
80  if (!NT_SUCCESS(Status))
81  {
82  DPRINT1("IopIrqInitialize() return %X\n", Status);
83  return Status;
84  }
85 
87  if (!NT_SUCCESS(Status))
88  {
89  DPRINT1("IopBusNumberInitialize() return %X\n", Status);
90  }
91 
92  return Status;
93 }
94 
95 
96 INIT_FUNCTION
98 NTAPI
100 {
103  PKEY_VALUE_FULL_INFORMATION KeyValueInformation;
104  PUNICODE_STRING GroupTable;
105  ULONG Count;
106  UNICODE_STRING GroupString =
107  RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet"
108  L"\\Control\\ServiceGroupOrder");
109 
110  /* Open the registry key */
112  NULL,
113  &GroupString,
114  KEY_READ);
115  if (NT_SUCCESS(Status))
116  {
117  /* Get the list */
118  Status = IopGetRegistryValue(KeyHandle, L"List", &KeyValueInformation);
120 
121  /* Make sure we got it */
122  if (NT_SUCCESS(Status))
123  {
124  /* Make sure it's valid */
125  if ((KeyValueInformation->Type == REG_MULTI_SZ) &&
126  (KeyValueInformation->DataLength))
127  {
128  /* Convert it to unicode strings */
129  Status = PnpRegMultiSzToUnicodeStrings(KeyValueInformation,
130  &GroupTable,
131  &Count);
132 
133  /* Cache it for later */
134  PiInitGroupOrderTable = GroupTable;
136  }
137  else
138  {
139  /* Fail */
141  }
142 
143  /* Free the information */
144  ExFreePool(KeyValueInformation);
145  }
146  }
147 
148  /* Return status */
149  return Status;
150 }
151 
152 USHORT
153 NTAPI
155 {
157  PKEY_VALUE_FULL_INFORMATION KeyValueInformation;
158  USHORT i;
159  PVOID Buffer;
161  PAGED_CODE();
162 
163  /* Make sure we have a cache */
164  if (!PiInitGroupOrderTable) return -1;
165 
166  /* If we don't have a handle, the rest is easy -- return the count */
167  if (!ServiceHandle) return PiInitGroupOrderTableCount + 1;
168 
169  /* Otherwise, get the group value */
170  Status = IopGetRegistryValue(ServiceHandle, L"Group", &KeyValueInformation);
172 
173  /* Make sure we have a valid string */
174  ASSERT(KeyValueInformation->Type == REG_SZ);
175  ASSERT(KeyValueInformation->DataLength);
176 
177  /* Convert to unicode string */
178  Buffer = (PVOID)((ULONG_PTR)KeyValueInformation + KeyValueInformation->DataOffset);
179  PnpRegSzToString(Buffer, KeyValueInformation->DataLength, &Group.Length);
180  Group.MaximumLength = (USHORT)KeyValueInformation->DataLength;
181  Group.Buffer = Buffer;
182 
183  /* Loop the groups */
184  for (i = 0; i < PiInitGroupOrderTableCount; i++)
185  {
186  /* Try to find a match */
188  }
189 
190  /* We're done */
191  ExFreePool(KeyValueInformation);
192  return i;
193 }
194 
195 USHORT
196 NTAPI
198 {
201  PKEY_VALUE_FULL_INFORMATION KeyValueInformation = NULL;
202  PKEY_VALUE_FULL_INFORMATION KeyValueInformationTag;
203  PKEY_VALUE_FULL_INFORMATION KeyValueInformationGroupOrderList;
204  PVOID Buffer;
206  PULONG GroupOrder;
207  ULONG Count, Tag = 0;
208  USHORT i = -1;
209  UNICODE_STRING GroupString =
210  RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet"
211  L"\\Control\\ServiceGroupOrder");
212 
213  /* Open the key */
214  Status = IopOpenRegistryKeyEx(&KeyHandle, NULL, &GroupString, KEY_READ);
215  if (!NT_SUCCESS(Status)) goto Quickie;
216 
217  /* Read the group */
218  Status = IopGetRegistryValue(ServiceHandle, L"Group", &KeyValueInformation);
219  if (!NT_SUCCESS(Status)) goto Quickie;
220 
221  /* Make sure we have a group */
222  if ((KeyValueInformation->Type == REG_SZ) &&
223  (KeyValueInformation->DataLength))
224  {
225  /* Convert to unicode string */
226  Buffer = (PVOID)((ULONG_PTR)KeyValueInformation + KeyValueInformation->DataOffset);
227  PnpRegSzToString(Buffer, KeyValueInformation->DataLength, &Group.Length);
228  Group.MaximumLength = (USHORT)KeyValueInformation->DataLength;
229  Group.Buffer = Buffer;
230  }
231 
232  /* Now read the tag */
233  Status = IopGetRegistryValue(ServiceHandle, L"Tag", &KeyValueInformationTag);
234  if (!NT_SUCCESS(Status)) goto Quickie;
235 
236  /* Make sure we have a tag */
237  if ((KeyValueInformationTag->Type == REG_DWORD) &&
238  (KeyValueInformationTag->DataLength))
239  {
240  /* Read it */
241  Tag = *(PULONG)((ULONG_PTR)KeyValueInformationTag +
242  KeyValueInformationTag->DataOffset);
243  }
244 
245  /* We can get rid of this now */
246  ExFreePool(KeyValueInformationTag);
247 
248  /* Now let's read the group's tag order */
250  Group.Buffer,
251  &KeyValueInformationGroupOrderList);
252 
253  /* We can get rid of this now */
254 Quickie:
255  if (KeyValueInformation) ExFreePool(KeyValueInformation);
257  if (!NT_SUCCESS(Status)) return -1;
258 
259  /* We're on the success path -- validate the tag order*/
260  if ((KeyValueInformationGroupOrderList->Type == REG_BINARY) &&
261  (KeyValueInformationGroupOrderList->DataLength))
262  {
263  /* Get the order array */
264  GroupOrder = (PULONG)((ULONG_PTR)KeyValueInformationGroupOrderList +
265  KeyValueInformationGroupOrderList->DataOffset);
266 
267  /* Get the count */
268  Count = *GroupOrder;
269  ASSERT(((Count + 1) * sizeof(ULONG)) <=
270  KeyValueInformationGroupOrderList->DataLength);
271 
272  /* Now loop each tag */
273  GroupOrder++;
274  for (i = 1; i <= Count; i++)
275  {
276  /* If we found it, we're out */
277  if (Tag == *GroupOrder) break;
278 
279  /* Try the next one */
280  GroupOrder++;
281  }
282  }
283 
284  /* Last buffer to free */
285  ExFreePool(KeyValueInformationGroupOrderList);
286  return i;
287 }
288 
289 NTSTATUS
290 NTAPI
292  IN BOOLEAN LoadDriver,
294 {
296  HANDLE EnumRootKey, SubKey;
297  HANDLE ControlKey, ClassKey = NULL, PropertiesKey;
298  UNICODE_STRING ClassGuid, Properties;
301  RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Class");
302  PKEY_VALUE_FULL_INFORMATION KeyValueInformation = NULL;
303  PWCHAR Buffer;
304 
305  /* Open enumeration root key */
306  Status = IopOpenRegistryKeyEx(&EnumRootKey,
307  NULL,
308  &EnumRoot,
309  KEY_READ);
310  if (!NT_SUCCESS(Status))
311  {
312  DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
313  &EnumRoot, Status);
314  return Status;
315  }
316 
317  /* Open instance subkey */
318  Status = IopOpenRegistryKeyEx(&SubKey,
319  EnumRootKey,
320  &DeviceNode->InstancePath,
321  KEY_READ);
322  ZwClose(EnumRootKey);
323  if (!NT_SUCCESS(Status))
324  {
325  DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
326  &DeviceNode->InstancePath, Status);
327  return Status;
328  }
329 
330  /* Get class GUID */
331  Status = IopGetRegistryValue(SubKey,
333  &KeyValueInformation);
334  if (NT_SUCCESS(Status))
335  {
336  /* Convert to unicode string */
337  Buffer = (PVOID)((ULONG_PTR)KeyValueInformation + KeyValueInformation->DataOffset);
338  PnpRegSzToString(Buffer, KeyValueInformation->DataLength, &ClassGuid.Length);
339  ClassGuid.MaximumLength = (USHORT)KeyValueInformation->DataLength;
340  ClassGuid.Buffer = Buffer;
341 
342  /* Open the key */
343  Status = IopOpenRegistryKeyEx(&ControlKey,
344  NULL,
345  &ControlClass,
346  KEY_READ);
347  if (!NT_SUCCESS(Status))
348  {
349  /* No class key */
350  DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
351  &ControlClass, Status);
352  }
353  else
354  {
355  /* Open the class key */
356  Status = IopOpenRegistryKeyEx(&ClassKey,
357  ControlKey,
358  &ClassGuid,
359  KEY_READ);
360  ZwClose(ControlKey);
361  if (!NT_SUCCESS(Status))
362  {
363  /* No class key */
364  DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
365  &ClassGuid, Status);
366  }
367  }
368 
369  /* Check if we made it till here */
370  if (ClassKey)
371  {
372  /* Get the device properties */
374  Status = IopOpenRegistryKeyEx(&PropertiesKey,
375  ClassKey,
376  &Properties,
377  KEY_READ);
378  if (!NT_SUCCESS(Status))
379  {
380  /* No properties */
381  DPRINT("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
382  &Properties, Status);
383  PropertiesKey = NULL;
384  }
385  else
386  {
387  ZwClose(PropertiesKey);
388  }
389  }
390 
391  /* Free the registry data */
392  ExFreePool(KeyValueInformation);
393  }
394 
395  /* Do ReactOS-style setup */
396  Status = IopAttachFilterDrivers(DeviceNode, SubKey, ClassKey, TRUE);
397  if (!NT_SUCCESS(Status))
398  {
400  goto Exit;
401  }
402 
404  if (!NT_SUCCESS(Status))
405  {
406  goto Exit;
407  }
408 
409  Status = IopAttachFilterDrivers(DeviceNode, SubKey, ClassKey, FALSE);
410  if (!NT_SUCCESS(Status))
411  {
413  goto Exit;
414  }
415 
417 
418 Exit:
419  /* Close keys and return status */
420  ZwClose(SubKey);
421  if (ClassKey != NULL)
422  {
423  ZwClose(ClassKey);
424  }
425  return Status;
426 }
427 
428 INIT_FUNCTION
429 NTSTATUS
430 NTAPI
432 {
435  HANDLE KeyHandle, EnumHandle, ParentHandle, TreeHandle, ControlHandle;
436  UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET");
437  UNICODE_STRING PnpManagerDriverName = RTL_CONSTANT_STRING(DRIVER_ROOT_NAME L"PnpManager");
439 
440  /* Initialize locks and such */
445 
446  /* Get the default interface */
448 
449  /* Initialize arbiters */
451  if (!NT_SUCCESS(Status)) return Status;
452 
453  /* Setup the group cache */
455  if (!NT_SUCCESS(Status)) return Status;
456 
457  /* Open the current control set */
459  NULL,
460  &KeyName,
462  if (!NT_SUCCESS(Status)) return Status;
463 
464  /* Create the control key */
465  RtlInitUnicodeString(&KeyName, L"Control");
466  Status = IopCreateRegistryKeyEx(&ControlHandle,
467  KeyHandle,
468  &KeyName,
471  &Disposition);
472  if (!NT_SUCCESS(Status)) return Status;
473 
474  /* Check if it's a new key */
476  {
477  HANDLE DeviceClassesHandle;
478 
479  /* Create the device classes key */
480  RtlInitUnicodeString(&KeyName, L"DeviceClasses");
481  Status = IopCreateRegistryKeyEx(&DeviceClassesHandle,
482  ControlHandle,
483  &KeyName,
486  &Disposition);
487  if (!NT_SUCCESS(Status)) return Status;
488 
489  ZwClose(DeviceClassesHandle);
490  }
491 
492  ZwClose(ControlHandle);
493 
494  /* Create the enum key */
496  Status = IopCreateRegistryKeyEx(&EnumHandle,
497  KeyHandle,
498  &KeyName,
501  &Disposition);
502  if (!NT_SUCCESS(Status)) return Status;
503 
504  /* Check if it's a new key */
506  {
507  /* FIXME: DACLs */
508  }
509 
510  /* Create the root key */
511  ParentHandle = EnumHandle;
513  Status = IopCreateRegistryKeyEx(&EnumHandle,
514  ParentHandle,
515  &KeyName,
518  &Disposition);
519  NtClose(ParentHandle);
520  if (!NT_SUCCESS(Status)) return Status;
521  NtClose(EnumHandle);
522 
523  /* Open the root key now */
524  RtlInitUnicodeString(&KeyName, L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET\\ENUM");
525  Status = IopOpenRegistryKeyEx(&EnumHandle,
526  NULL,
527  &KeyName,
529  if (NT_SUCCESS(Status))
530  {
531  /* Create the root dev node */
533  Status = IopCreateRegistryKeyEx(&TreeHandle,
534  EnumHandle,
535  &KeyName,
538  NULL);
539  NtClose(EnumHandle);
540  if (NT_SUCCESS(Status)) NtClose(TreeHandle);
541  }
542 
543  /* Create the root driver */
544  Status = IoCreateDriver(&PnpManagerDriverName, PnpRootDriverEntry);
545  if (!NT_SUCCESS(Status))
546  {
547  DPRINT1("IoCreateDriverObject() failed\n");
548  KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
549  }
550 
551  /* Create the root PDO */
553  sizeof(IOPNP_DEVICE_EXTENSION),
554  NULL,
556  0,
557  FALSE,
558  &Pdo);
559  if (!NT_SUCCESS(Status))
560  {
561  DPRINT1("IoCreateDevice() failed\n");
562  KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
563  }
564 
565  /* This is a bus enumerated device */
567 
568  /* Create the root device node */
570 
571  /* Set flags */
574  DNF_ADDED;
575 
576  /* Create instance path */
579 
580  /* Call the add device routine */
583 
584  /* Initialize PnP-Event notification support */
586  if (!NT_SUCCESS(Status)) return Status;
587 
588  /* Report the device to the user-mode pnp manager */
589  IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
591 
592  /* Initialize the Bus Type GUID List */
596 
597  /* Launch the firmware mapper */
599  if (!NT_SUCCESS(Status)) return Status;
600 
601  /* Close the handle to the control set */
603 
604  /* Initialize PnP root relations (this is a syncronous operation) */
606 
607  /* We made it */
608  return STATUS_SUCCESS;
609 }
610 
611 /* EOF */
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
#define IN
Definition: typedefs.h:39
ULONG Flags
Definition: iotypes.h:836
PDEVICE_OBJECT PhysicalDeviceObject
Definition: iotypes.h:839
PDEVICE_NODE IopRootDeviceNode
Definition: devnode.c:18
#define DNF_PROCESSED
Definition: iotypes.h:167
KEVENT PiEnumerationFinished
Definition: devaction.c:49
enum _INTERFACE_TYPE INTERFACE_TYPE
_In_ PDEVICE_OBJECT Pdo
Definition: classpnp.h:318
INIT_FUNCTION NTSTATUS NTAPI IopInitializePlugPlayServices(VOID)
Definition: pnpinit.c:431
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:2472
static const WCHAR ControlClass[]
Definition: cfgmgr.c:41
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
USHORT MaximumLength
Definition: env_spec_w32.h:370
INIT_FUNCTION NTSTATUS NTAPI PiInitCacheGroupInformation(VOID)
Definition: pnpinit.c:99
#define REG_BINARY
Definition: nt_native.h:1496
NTSTATUS NTAPI IopMemInitialize(VOID)
Definition: arbs.c:89
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
INTERFACE_TYPE PnpDefaultInterfaceType
Definition: pnpinit.c:25
_In_opt_ PSID Group
Definition: rtlfuncs.h:1605
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN PnPBootDriversLoaded
Definition: pnpinit.c:26
USHORT NTAPI PpInitGetGroupOrderIndex(IN HANDLE ServiceHandle)
Definition: pnpinit.c:154
#define DNF_NO_RESOURCE_REQUIRED
Definition: iotypes.h:174
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1223
FAST_MUTEX Lock
Definition: io.h:439
#define REGSTR_VAL_ROOT_DEVNODE
Definition: regstr.h:405
uint16_t * PWCHAR
Definition: typedefs.h:56
NTSTATUS NTAPI PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode, IN BOOLEAN LoadDriver, IN PDRIVER_OBJECT DriverObject)
Definition: pnpinit.c:291
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:50
INIT_FUNCTION NTSTATUS IopInitPlugPlayEvents(VOID)
Definition: plugplay.c:34
KSPIN_LOCK IopDeviceActionLock
Definition: devaction.c:48
uint32_t ULONG_PTR
Definition: typedefs.h:65
ARBITER_INSTANCE IopRootIrqArbiter
Definition: pnpinit.c:29
ARBITER_INSTANCE IopRootMemArbiter
Definition: pnpinit.c:31
NTSTATUS IopStartDevice(IN PDEVICE_NODE DeviceNode)
NTSTATUS NTAPI IopCreateRegistryKeyEx(OUT PHANDLE Handle, IN HANDLE BaseHandle OPTIONAL, IN PUNICODE_STRING KeyName, IN ACCESS_MASK DesiredAccess, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PDEVICE_NODE NTAPI PipAllocateDeviceNode(IN PDEVICE_OBJECT PhysicalDeviceObject)
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FILE_DEVICE_CONTROLLER
Definition: winioctl.h:109
#define FALSE
Definition: types.h:117
NTSTATUS IopRemoveDevice(IN PDEVICE_NODE DeviceNode)
#define REGSTR_KEY_ROOTENUM
Definition: regstr.h:10
#define REG_MULTI_SZ
Definition: nt_native.h:1501
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2262
USHORT PiInitGroupOrderTableCount
Definition: pnpinit.c:24
struct _IOPNP_DEVICE_EXTENSION IOPNP_DEVICE_EXTENSION
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
LIST_ENTRY IopDeviceActionRequestList
Definition: devaction.c:45
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define DO_BUS_ENUMERATED_DEVICE
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
NTSTATUS FASTCALL IopInitializeDevice(IN PDEVICE_NODE DeviceNode, IN PDRIVER_OBJECT DriverObject)
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1084
void * PVOID
Definition: retypes.h:9
#define DNF_STARTED
Definition: iotypes.h:168
NTSTATUS NTAPI PnpRootDriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: pnproot.c:1470
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
NTSTATUS IopQueueTargetDeviceEvent(const GUID *Guid, PUNICODE_STRING DeviceIds)
Definition: plugplay.c:46
ULONG CompatibleIdListSize
Definition: pnpinit.c:20
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static void Exit(void)
Definition: sock.c:1331
#define ENUM_ROOT
Definition: io.h:53
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
#define for
Definition: utility.h:88
NTSTATUS NTAPI IopPortInitialize(VOID)
Definition: arbs.c:108
#define REGSTR_VAL_CLASSGUID
Definition: regstr.h:422
NTSTATUS NTAPI IopIrqInitialize(VOID)
Definition: arbs.c:51
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
Definition: Node.h:9
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
PDRIVER_OBJECT IopRootDriverObject
Definition: pnpmgr.c:27
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI IopInitializeArbiters(VOID)
Definition: pnpinit.c:54
static const WCHAR L[]
Definition: oid.c:1250
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
NTSTATUS NTAPI PnpRegMultiSzToUnicodeStrings(IN PKEY_VALUE_FULL_INFORMATION KeyValueInformation, OUT PUNICODE_STRING *UnicodeStringList, OUT PULONG UnicodeStringCount)
Definition: pnputil.c:47
ARBITER_INSTANCE IopRootPortArbiter
Definition: pnpinit.c:32
#define REGSTR_KEY_DEVICE_PROPERTIES
Definition: regstr.h:752
#define REGSTR_KEY_ENUM
Definition: regstr.h:9
UNICODE_STRING InstancePath
Definition: iotypes.h:842
NTSTATUS NTAPI IopBusNumberInitialize(VOID)
Definition: arbs.c:32
KSPIN_LOCK IopDeviceTreeLock
Definition: devnode.c:19
PDRIVER_ADD_DEVICE AddDevice
Definition: iotypes.h:2200
NTSTATUS NTAPI IopGetRegistryValue(IN HANDLE Handle, IN PWSTR ValueName, OUT PKEY_VALUE_FULL_INFORMATION *Information)
Definition: pnpmgr.c:1742
NTSTATUS NTAPI IoCreateDriver(IN PUNICODE_STRING DriverName OPTIONAL, IN PDRIVER_INITIALIZE InitializationFunction)
Definition: driver.c:1707
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
NTSTATUS NTAPI IopOpenRegistryKeyEx(PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name, ACCESS_MASK DesiredAccess)
Definition: pnpmgr.c:1591
unsigned short USHORT
Definition: pedump.c:61
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList
Definition: pnpmgr.c:28
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
INTERFACE_TYPE NTAPI IopDetermineDefaultInterfaceType(VOID)
Definition: pnpinit.c:46
NTSTATUS FASTCALL IopAttachFilterDrivers(IN PDEVICE_NODE DeviceNode, IN HANDLE EnumSubKey, IN HANDLE ClassKey, IN BOOLEAN Lower)
unsigned int * PULONG
Definition: retypes.h:1
INIT_FUNCTION NTSTATUS NTAPI IopUpdateRootKey(VOID)
Definition: pnpmgr.c:1533
ARBITER_INSTANCE IopRootBusNumberArbiter
Definition: pnpinit.c:28
BOOLEAN NTAPI PnpRegSzToString(IN PWCHAR RegSzData, IN ULONG RegSzLength, OUT PUSHORT StringLength OPTIONAL)
Definition: pnputil.c:171
#define DPRINT1
Definition: precomp.h:8
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define DNF_ENUMERATED
Definition: iotypes.h:170
PUNICODE_STRING PiInitGroupOrderTable
Definition: pnpinit.c:23
#define DNF_MADEUP
Definition: iotypes.h:172
USHORT NTAPI PipGetDriverTagPriority(IN HANDLE ServiceHandle)
Definition: pnpinit.c:197
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define DNF_ADDED
Definition: iotypes.h:179
#define REG_DWORD
Definition: sdbapi.c:596
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
NTSTATUS NTAPI IopDmaInitialize(VOID)
Definition: arbs.c:70
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
ARBITER_INSTANCE IopRootDmaArbiter
Definition: pnpinit.c:30
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
struct _IOPNP_DEVICE_EXTENSION * PIOPNP_DEVICE_EXTENSION
#define DRIVER_ROOT_NAME
Definition: ldr.h:5
#define PAGED_CODE()
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
#define REG_SZ
Definition: layer.c:22