ReactOS 0.4.16-dev-2534-gdcd45a5
config.c File Reference
#include <ntoskrnl.h>
Include dependency graph for config.c:

Go to the source code of this file.

Functions

PCONFIGURATION_COMPONENT_DATA NTAPI KeFindConfigurationNextEntry (_In_ PCONFIGURATION_COMPONENT_DATA Child, _In_ CONFIGURATION_CLASS Class, _In_ CONFIGURATION_TYPE Type, _In_opt_ PULONG ComponentKey, _Inout_ PCONFIGURATION_COMPONENT_DATA *NextLink)
 
PCONFIGURATION_COMPONENT_DATA NTAPI KeFindConfigurationEntry (_In_ PCONFIGURATION_COMPONENT_DATA Child, _In_ CONFIGURATION_CLASS Class, _In_ CONFIGURATION_TYPE Type, _In_opt_ PULONG ComponentKey)
 

Function Documentation

◆ KeFindConfigurationEntry()

Definition at line 108 of file config.c.

113{
115
116 /* Start search at the root */
118 Class,
119 Type,
120 ComponentKey,
121 &NextLink);
122}
Type
Definition: Type.h:7
#define NULL
Definition: types.h:112
PCONFIGURATION_COMPONENT_DATA NTAPI KeFindConfigurationNextEntry(_In_ PCONFIGURATION_COMPONENT_DATA Child, _In_ CONFIGURATION_CLASS Class, _In_ CONFIGURATION_TYPE Type, _In_opt_ PULONG ComponentKey, _Inout_ PCONFIGURATION_COMPONENT_DATA *NextLink)
Definition: config.c:21
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536

Referenced by FindBootDisplayFromLoaderARCTree(), and NtLdrDetectBootVid().

◆ KeFindConfigurationNextEntry()

Definition at line 21 of file config.c.

27{
28 ULONG Key = 0;
29 ULONG Mask = 0;
32
33 /* If we did get a key, then use it instead */
34 if (ComponentKey)
35 {
36 Key = *ComponentKey;
37 Mask = -1;
38 }
39
40 /* Loop the components until we find a a match */
41 for (; Child; Child = Child->Child)
42 {
43 /* Check if we are starting somewhere already */
44 if (*NextLink)
45 {
46 /* If we've found the place where we started, clear and continue */
47 if (Child == *NextLink)
48 *NextLink = NULL;
49 }
50 else
51 {
52 /* Try to get a match */
53 if ((Child->ComponentEntry.Class) == Class &&
54 (Child->ComponentEntry.Type) == Type &&
55 (Child->ComponentEntry.Key & Mask) == Key)
56 {
57 /* Match found */
58 return Child;
59 }
60 }
61
62 /* Now we've also got to lookup the siblings */
63 for (Sibling = Child->Sibling; Sibling; Sibling = Sibling->Sibling)
64 {
65 /* Check if we are starting somewhere already */
66 if (*NextLink)
67 {
68 /* If we've found the place where we started, clear and continue */
69 if (Sibling == *NextLink)
70 *NextLink = NULL;
71 }
72 else
73 {
74 /* Try to get a match */
75 if ((Sibling->ComponentEntry.Class == Class) &&
76 (Sibling->ComponentEntry.Type == Type) &&
77 (Sibling->ComponentEntry.Key & Mask) == Key)
78 {
79 /* Match found */
80 return Sibling;
81 }
82 }
83
84 /* We've got to check if the sibling has a child as well */
85 if (Sibling->Child)
86 {
87 /* We're just going to call ourselves again */
88 ReturnEntry = KeFindConfigurationNextEntry(Sibling->Child,
89 Class,
90 Type,
91 ComponentKey,
92 NextLink);
93 if (ReturnEntry)
94 return ReturnEntry;
95 }
96 }
97 }
98
99 /* If we got here, nothing was found */
100 return NULL;
101}
unsigned int Mask
Definition: fpcontrol.c:82
CONFIGURATION_COMPONENT ComponentEntry
Definition: arc.h:287
struct _CONFIGURATION_COMPONENT_DATA * Sibling
Definition: arc.h:286
struct _CONFIGURATION_COMPONENT_DATA * Child
Definition: arc.h:285
CONFIGURATION_TYPE Type
Definition: arc.h:161
CONFIGURATION_CLASS Class
Definition: arc.h:160
uint32_t ULONG
Definition: typedefs.h:59

Referenced by FindBootDisplayFromLoaderARCTree(), HalpAcpiFindRsdtPhase0(), KeFindConfigurationEntry(), and KeFindConfigurationNextEntry().