MCPcopy Create free account
hub / github.com/USBToolBox/kext / checkClassHierarchy

Method checkClassHierarchy

USBToolBox/USBToolBox.cpp:158–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158bool USBToolBox::checkClassHierarchy(IORegistryEntry* entry, const char* className) {
159 const OSSymbol* classSymbol = OSSymbol::withCString(className);
160
161 if (!classSymbol) {
162 DEBUGLOG("Failed to create class symbol for %s!", className);
163 return false;
164 }
165
166 const OSMetaClass* entryMetaclass = entry->getMetaClass();
167 while (entryMetaclass) {
168 if (entryMetaclass->getClassNameSymbol() == classSymbol) {
169 OSSafeReleaseNULL(classSymbol);
170 return true;
171 }
172 entryMetaclass = entryMetaclass->getSuperClass();
173 };
174 OSSafeReleaseNULL(classSymbol);
175 return false;
176}
177
178IORegistryEntry* USBToolBox::getControllerViaIteration() {
179 OSIterator* iterator = pciDevice->getChildIterator(gIOServicePlane);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected