MCPcopy Create free account
hub / github.com/USBGuard/usbguard / loadConfigurationDescriptor

Method loadConfigurationDescriptor

src/Library/DevicePrivate.cpp:314–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312 }
313
314 void DevicePrivate::loadConfigurationDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor)
315 {
316 (void)descriptor;
317
318 if (!parser->haveDescriptor(USB_DESCRIPTOR_TYPE_DEVICE)) {
319 throw std::runtime_error("Invalid descriptor data: missing parent device descriptor while loading configuration");
320 }
321
322 /*
323 * Clean the descriptor state. There shouldn't be any Interface or Endpoint
324 * descriptors while loading.
325 */
326 parser->delDescriptor(USB_DESCRIPTOR_TYPE_INTERFACE);
327 parser->delDescriptor(USB_DESCRIPTOR_TYPE_ENDPOINT);
328 return;
329 }
330
331 void DevicePrivate::loadInterfaceDescriptor(USBDescriptorParser* parser, const USBDescriptor* const descriptor)
332 {

Callers

nothing calls this directly

Calls 2

haveDescriptorMethod · 0.80
delDescriptorMethod · 0.80

Tested by

no test coverage detected