ReactOS  0.4.13-dev-455-g28ed234
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 
26 
27 /* FUNCTIONS ******************************************************************/
28 
30 NTAPI
32 {
33  /* FIXME: ReactOS doesn't support MicroChannel yet */
34  return Isa;
35 }
36 
38 NTAPI
40 {
41  /* FIXME: TODO */
42  return STATUS_SUCCESS;
43 }
44 
45 INIT_FUNCTION
47 NTAPI
49 {
52  PKEY_VALUE_FULL_INFORMATION KeyValueInformation;
53  PUNICODE_STRING GroupTable;
54  ULONG Count;
55  UNICODE_STRING GroupString =
56  RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet"
57  L"\\Control\\ServiceGroupOrder");
58 
59  /* Open the registry key */
61  NULL,
62  &GroupString,
63  KEY_READ);
64  if (NT_SUCCESS(Status))
65  {
66  /* Get the list */
67  Status = IopGetRegistryValue(KeyHandle, L"List", &KeyValueInformation);
69 
70  /* Make sure we got it */
71  if (NT_SUCCESS(Status))
72  {
73  /* Make sure it's valid */
74  if ((KeyValueInformation->Type == REG_MULTI_SZ) &&
75  (KeyValueInformation->DataLength))
76  {
77  /* Convert it to unicode strings */
78  Status = PnpRegMultiSzToUnicodeStrings(KeyValueInformation,
79  &GroupTable,
80  &Count);
81 
82  /* Cache it for later */
83  PiInitGroupOrderTable = GroupTable;
85  }
86  else
87  {
88  /* Fail */
90  }
91 
92  /* Free the information */
93  ExFreePool(KeyValueInformation);
94  }
95  }
96 
97  /* Return status */
98  return Status;
99 }
100 
101 USHORT
102 NTAPI
104 {
106  PKEY_VALUE_FULL_INFORMATION KeyValueInformation;
107  USHORT i;
108  PVOID Buffer;
110  PAGED_CODE();
111 
112  /* Make sure we have a cache */
113  if (!PiInitGroupOrderTable) return -1;
114 
115  /* If we don't have a handle, the rest is easy -- return the count */
116  if (!ServiceHandle) return PiInitGroupOrderTableCount + 1;
117 
118  /* Otherwise, get the group value */
119  Status = IopGetRegistryValue(ServiceHandle, L"Group", &KeyValueInformation);
121 
122  /* Make sure we have a valid string */
123  ASSERT(KeyValueInformation->Type == REG_SZ);
124  ASSERT(KeyValueInformation->DataLength);
125 
126  /* Convert to unicode string */
127  Buffer = (PVOID)((ULONG_PTR)KeyValueInformation + KeyValueInformation->DataOffset);
128  PnpRegSzToString(Buffer, KeyValueInformation->DataLength, &Group.Length);
129  Group.MaximumLength = (USHORT)KeyValueInformation->DataLength;
130  Group.Buffer = Buffer;
131 
132  /* Loop the groups */
133  for (i = 0; i < PiInitGroupOrderTableCount; i++)
134  {
135  /* Try to find a match */
137  }
138 
139  /* We're done */
140  ExFreePool(KeyValueInformation);
141  return i;
142 }
143 
144 USHORT
145 NTAPI
147 {
150  PKEY_VALUE_FULL_INFORMATION KeyValueInformation = NULL;
151  PKEY_VALUE_FULL_INFORMATION KeyValueInformationTag;
152  PKEY_VALUE_FULL_INFORMATION KeyValueInformationGroupOrderList;
153  PVOID Buffer;
155  PULONG GroupOrder;
156  ULONG Count, Tag = 0;
157  USHORT i = -1;
158  UNICODE_STRING GroupString =
159  RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet"
160  L"\\Control\\ServiceGroupOrder");
161 
162  /* Open the key */
163  Status = IopOpenRegistryKeyEx(&KeyHandle, NULL, &GroupString, KEY_READ);
164  if (!NT_SUCCESS(Status)) goto Quickie;
165 
166  /* Read the group */
167  Status = IopGetRegistryValue(ServiceHandle, L"Group", &KeyValueInformation);
168  if (!NT_SUCCESS(Status)) goto Quickie;
169 
170  /* Make sure we have a group */
171  if ((KeyValueInformation->Type == REG_SZ) &&
172  (KeyValueInformation->DataLength))
173  {
174  /* Convert to unicode string */
175  Buffer = (PVOID)((ULONG_PTR)KeyValueInformation + KeyValueInformation->DataOffset);
176  PnpRegSzToString(Buffer, KeyValueInformation->DataLength, &Group.Length);
177  Group.MaximumLength = (USHORT)KeyValueInformation->DataLength;
178  Group.Buffer = Buffer;
179  }
180 
181  /* Now read the tag */
182  Status = IopGetRegistryValue(ServiceHandle, L"Tag", &KeyValueInformationTag);
183  if (!NT_SUCCESS(Status)) goto Quickie;
184 
185  /* Make sure we have a tag */
186  if ((KeyValueInformationTag->Type == REG_DWORD) &&
187  (KeyValueInformationTag->DataLength))
188  {
189  /* Read it */
190  Tag = *(PULONG)((ULONG_PTR)KeyValueInformationTag +
191  KeyValueInformationTag->DataOffset);
192  }
193 
194  /* We can get rid of this now */
195  ExFreePool(KeyValueInformationTag);
196 
197  /* Now let's read the group's tag order */
199  Group.Buffer,
200  &KeyValueInformationGroupOrderList);
201 
202  /* We can get rid of this now */
203 Quickie:
204  if (KeyValueInformation) ExFreePool(KeyValueInformation);
206  if (!NT_SUCCESS(Status)) return -1;
207 
208  /* We're on the success path -- validate the tag order*/
209  if ((KeyValueInformationGroupOrderList->Type == REG_BINARY) &&
210  (KeyValueInformationGroupOrderList->DataLength))
211  {
212  /* Get the order array */
213  GroupOrder = (PULONG)((ULONG_PTR)KeyValueInformationGroupOrderList +
214  KeyValueInformationGroupOrderList->DataOffset);
215 
216  /* Get the count */
217  Count = *GroupOrder;
218  ASSERT(((Count + 1) * sizeof(ULONG)) <=
219  KeyValueInformationGroupOrderList->DataLength);
220 
221  /* Now loop each tag */
222  GroupOrder++;
223  for (i = 1; i <= Count; i++)
224  {
225  /* If we found it, we're out */
226  if (Tag == *GroupOrder) break;
227 
228  /* Try the next one */
229  GroupOrder++;
230  }
231  }
232 
233  /* Last buffer to free */
234  ExFreePool(KeyValueInformationGroupOrderList);
235  return i;
236 }
237 
238 NTSTATUS
239 NTAPI
241  IN BOOLEAN LoadDriver,
243 {
245  HANDLE EnumRootKey, SubKey;
246  HANDLE ControlKey, ClassKey = NULL, PropertiesKey;
247  UNICODE_STRING ClassGuid, Properties;
250  RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Class");
251  PKEY_VALUE_FULL_INFORMATION KeyValueInformation = NULL;
252  PWCHAR Buffer;
253 
254  /* Open enumeration root key */
255  Status = IopOpenRegistryKeyEx(&EnumRootKey,
256  NULL,
257  &EnumRoot,
258  KEY_READ);
259  if (!NT_SUCCESS(Status))
260  {
261  DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
262  &EnumRoot, Status);
263  return Status;
264  }
265 
266  /* Open instance subkey */
267  Status = IopOpenRegistryKeyEx(&SubKey,
268  EnumRootKey,
269  &DeviceNode->InstancePath,
270  KEY_READ);
271  ZwClose(EnumRootKey);
272  if (!NT_SUCCESS(Status))
273  {
274  DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
275  &DeviceNode->InstancePath, Status);
276  return Status;
277  }
278 
279  /* Get class GUID */
280  Status = IopGetRegistryValue(SubKey,
282  &KeyValueInformation);
283  if (NT_SUCCESS(Status))
284  {
285  /* Convert to unicode string */
286  Buffer = (PVOID)((ULONG_PTR)KeyValueInformation + KeyValueInformation->DataOffset);
287  PnpRegSzToString(Buffer, KeyValueInformation->DataLength, &ClassGuid.Length);
288  ClassGuid.MaximumLength = (USHORT)KeyValueInformation->DataLength;
289  ClassGuid.Buffer = Buffer;
290 
291  /* Open the key */
292  Status = IopOpenRegistryKeyEx(&ControlKey,
293  NULL,
294  &ControlClass,
295  KEY_READ);
296  if (!NT_SUCCESS(Status))
297  {
298  /* No class key */
299  DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
300  &ControlClass, Status);
301  }
302  else
303  {
304  /* Open the class key */
305  Status = IopOpenRegistryKeyEx(&ClassKey,
306  ControlKey,
307  &ClassGuid,
308  KEY_READ);
309  ZwClose(ControlKey);
310  if (!NT_SUCCESS(Status))
311  {
312  /* No class key */
313  DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
314  &ClassGuid, Status);
315  }
316  }
317 
318  /* Check if we made it till here */
319  if (ClassKey)
320  {
321  /* Get the device properties */
323  Status = IopOpenRegistryKeyEx(&PropertiesKey,
324  ClassKey,
325  &Properties,
326  KEY_READ);
327  if (!NT_SUCCESS(Status))
328  {
329  /* No properties */
330  DPRINT("IopOpenRegistryKeyEx() failed for '%wZ' with status 0x%lx\n",
331  &Properties, Status);
332  PropertiesKey = NULL;
333  }
334  else
335  {
336  ZwClose(PropertiesKey);
337  }
338  }
339 
340  /* Free the registry data */
341  ExFreePool(KeyValueInformation);
342  }
343 
344  /* Do ReactOS-style setup */
345  Status = IopAttachFilterDrivers(DeviceNode, SubKey, ClassKey, TRUE);
346  if (!NT_SUCCESS(Status))
347  {
349  goto Exit;
350  }
351 
353  if (!NT_SUCCESS(Status))
354  {
355  goto Exit;
356  }
357 
358  Status = IopAttachFilterDrivers(DeviceNode, SubKey, ClassKey, FALSE);
359  if (!NT_SUCCESS(Status))
360  {
362  goto Exit;
363  }
364 
366 
367 Exit:
368  /* Close keys and return status */
369  ZwClose(SubKey);
370  if (ClassKey != NULL)
371  {
372  ZwClose(ClassKey);
373  }
374  return Status;
375 }
376 
377 INIT_FUNCTION
378 NTSTATUS
379 NTAPI
381 {
384  HANDLE KeyHandle, EnumHandle, ParentHandle, TreeHandle, ControlHandle;
385  UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET");
386  UNICODE_STRING PnpManagerDriverName = RTL_CONSTANT_STRING(DRIVER_ROOT_NAME L"PnpManager");
388 
389  /* Initialize locks and such */
393 
394  /* Get the default interface */
396 
397  /* Initialize arbiters */
399  if (!NT_SUCCESS(Status)) return Status;
400 
401  /* Setup the group cache */
403  if (!NT_SUCCESS(Status)) return Status;
404 
405  /* Open the current control set */
407  NULL,
408  &KeyName,
410  if (!NT_SUCCESS(Status)) return Status;
411 
412  /* Create the control key */
413  RtlInitUnicodeString(&KeyName, L"Control");
414  Status = IopCreateRegistryKeyEx(&ControlHandle,
415  KeyHandle,
416  &KeyName,
419  &Disposition);
420  if (!NT_SUCCESS(Status)) return Status;
421 
422  /* Check if it's a new key */
424  {
425  HANDLE DeviceClassesHandle;
426 
427  /* Create the device classes key */
428  RtlInitUnicodeString(&KeyName, L"DeviceClasses");
429  Status = IopCreateRegistryKeyEx(&DeviceClassesHandle,
430  ControlHandle,
431  &KeyName,
434  &Disposition);
435  if (!NT_SUCCESS(Status)) return Status;
436 
437  ZwClose(DeviceClassesHandle);
438  }
439 
440  ZwClose(ControlHandle);
441 
442  /* Create the enum key */
444  Status = IopCreateRegistryKeyEx(&EnumHandle,
445  KeyHandle,
446  &KeyName,
449  &Disposition);
450  if (!NT_SUCCESS(Status)) return Status;
451 
452  /* Check if it's a new key */
454  {
455  /* FIXME: DACLs */
456  }
457 
458  /* Create the root key */
459  ParentHandle = EnumHandle;
461  Status = IopCreateRegistryKeyEx(&EnumHandle,
462  ParentHandle,
463  &KeyName,
466  &Disposition);
467  NtClose(ParentHandle);
468  if (!NT_SUCCESS(Status)) return Status;
469  NtClose(EnumHandle);
470 
471  /* Open the root key now */
472  RtlInitUnicodeString(&KeyName, L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET\\ENUM");
473  Status = IopOpenRegistryKeyEx(&EnumHandle,
474  NULL,
475  &KeyName,
477  if (NT_SUCCESS(Status))
478  {
479  /* Create the root dev node */
481  Status = IopCreateRegistryKeyEx(&TreeHandle,
482  EnumHandle,
483  &KeyName,
486  NULL);
487  NtClose(EnumHandle);
488  if (NT_SUCCESS(Status)) NtClose(TreeHandle);
489  }
490 
491  /* Create the root driver */
492  Status = IoCreateDriver(&PnpManagerDriverName, PnpRootDriverEntry);
493  if (!NT_SUCCESS(Status))
494  {
495  DPRINT1("IoCreateDriverObject() failed\n");
496  KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
497  }
498 
499  /* Create the root PDO */
501  sizeof(IOPNP_DEVICE_EXTENSION),
502  NULL,
504  0,
505  FALSE,
506  &Pdo);
507  if (!NT_SUCCESS(Status))
508  {
509  DPRINT1("IoCreateDevice() failed\n");
510  KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
511  }
512 
513  /* This is a bus enumerated device */
515 
516  /* Create the root device node */
518 
519  /* Set flags */
522  DNF_ADDED;
523 
524  /* Create instance path */
527 
528  /* Call the add device routine */
531 
532  /* Initialize PnP-Event notification support */
534  if (!NT_SUCCESS(Status)) return Status;
535 
536  /* Report the device to the user-mode pnp manager */
537  IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
539 
540  /* Initialize the Bus Type GUID List */
544 
545  /* Launch the firmware mapper */
547  if (!NT_SUCCESS(Status)) return Status;
548 
549  /* Close the handle to the control set */
551 
552  /* We made it */
553  return STATUS_SUCCESS;
554 }
555 
556 /* 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:38
ULONG Flags
Definition: iotypes.h:836
#define TRUE
Definition: types.h:120
PDEVICE_OBJECT PhysicalDeviceObject
Definition: iotypes.h:839
PDEVICE_NODE IopRootDeviceNode
Definition: pnpmgr.c:18
#define DNF_PROCESSED
Definition: iotypes.h:167
enum _INTERFACE_TYPE INTERFACE_TYPE
_In_ PDEVICE_OBJECT Pdo
Definition: classpnp.h:301
INIT_FUNCTION NTSTATUS NTAPI IopInitializePlugPlayServices(VOID)
Definition: pnpinit.c:380
static const WCHAR ControlClass[]
Definition: cfgmgr.c:33
_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:48
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
INTERFACE_TYPE PnpDefaultInterfaceType
Definition: pnpinit.c:25
_In_opt_ PSID Group
Definition: rtlfuncs.h:1606
LONG NTSTATUS
Definition: precomp.h:26
USHORT NTAPI PpInitGetGroupOrderIndex(IN HANDLE ServiceHandle)
Definition: pnpinit.c:103
#define DNF_NO_RESOURCE_REQUIRED
Definition: iotypes.h:174
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
FAST_MUTEX Lock
Definition: io.h:439
#define REGSTR_VAL_ROOT_DEVNODE
Definition: regstr.h:405
uint16_t * PWCHAR
Definition: typedefs.h:54
NTSTATUS NTAPI PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode, IN BOOLEAN LoadDriver, IN PDRIVER_OBJECT DriverObject)
Definition: pnpinit.c:240
_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
#define PAGED_CODE()
Definition: video.h:57
KSPIN_LOCK IopDeviceActionLock
Definition: pnpmgr.c:39
uint32_t ULONG_PTR
Definition: typedefs.h:63
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)
Definition: pnpmgr.c:3955
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
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:2173
USHORT PiInitGroupOrderTableCount
Definition: pnpinit.c:24
struct _IOPNP_DEVICE_EXTENSION IOPNP_DEVICE_EXTENSION
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
LIST_ENTRY IopDeviceActionRequestList
Definition: pnpmgr.c:36
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:1377
#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
#define REGSTR_VAL_CLASSGUID
Definition: regstr.h:422
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:34
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI IopInitializeArbiters(VOID)
Definition: pnpinit.c:39
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
#define REGSTR_KEY_DEVICE_PROPERTIES
Definition: regstr.h:752
#define REGSTR_KEY_ENUM
Definition: regstr.h:9
UNICODE_STRING InstancePath
Definition: iotypes.h:842
Status
Definition: gdiplustypes.h:24
KSPIN_LOCK IopDeviceTreeLock
Definition: pnpmgr.c:19
PDRIVER_ADD_DEVICE AddDevice
Definition: iotypes.h:2111
NTSTATUS NTAPI IopGetRegistryValue(IN HANDLE Handle, IN PWSTR ValueName, OUT PKEY_VALUE_FULL_INFORMATION *Information)
Definition: pnpmgr.c:3821
NTSTATUS NTAPI IoCreateDriver(IN PUNICODE_STRING DriverName OPTIONAL, IN PDRIVER_INITIALIZE InitializationFunction)
Definition: driver.c:1683
NTSTATUS NTAPI IopOpenRegistryKeyEx(PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name, ACCESS_MASK DesiredAccess)
Definition: pnpmgr.c:3670
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:35
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
INTERFACE_TYPE NTAPI IopDetermineDefaultInterfaceType(VOID)
Definition: pnpinit.c:31
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:3612
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:261
#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:146
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2777
#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)
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
#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 RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
#define REG_SZ
Definition: layer.c:22