usb_protocol.emitters.descriptors.microsoft10 module

Convenience emitters Microsoft OS 1.0 Descriptors.

class usb_protocol.emitters.descriptors.microsoft10.ExtendedCompatIDDescriptorEmitter(collection=None)[source]

Bases: ComplexDescriptorEmitter

Emitter that creates a ExtendedCompatIDDescriptor

DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
Function()[source]

Context manager that allows addition of a function section to the descriptor.

It can be used with a with statement; and yields an ExtendedCompatIDDescriptorFunctionEmitter that can be populated:

with d.Function() as f:

f.bFirstInterfaceNumber = 0 f.compatibleID = ‘WINUSB’

This adds the relevant descriptor, automatically.

class usb_protocol.emitters.descriptors.microsoft10.ExtendedPropertiesDescriptorEmitter(collection=None)[source]

Bases: ComplexDescriptorEmitter

Emitter that creates a ExtendedPropertiesDescriptor

DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
Property()[source]

Context manager that allows addition of a property section to the descriptor.

It can be used with a with statement; and yields an ExtendedPropertiesDescriptorSectionEmitter that can be populated:

with d.Property() as p:

p.dwPropertyDataType = RegistryTypes.REG_EXPAND_SZ p.PropertyName = “Icons” p.PropertyData = “%SystemRoot%system32shell32.dll,-233”

This adds the relevant descriptor, automatically.

class usb_protocol.emitters.descriptors.microsoft10.ExtendedPropertiesDescriptorSectionEmitter(collection=None)[source]

Bases: ComplexDescriptorEmitter

Emitter that creates a ExtendedPropertiesDescriptorSection

DESCRIPTOR_FORMAT: DescriptorFormat = <DescriptorFormat>
class usb_protocol.emitters.descriptors.microsoft10.MicrosoftOS10DescriptorCollection[source]

Bases: object

Object that builds a full collection of Microsoft OS 1.0 descriptors.

ExtendedCompatIDDescriptor()[source]
ExtendedPropertiesDescriptor()[source]
add_descriptor(descriptor, index=None)[source]

Adds a descriptor to our collection.

Parameters:
  • descriptor – The descriptor to be added.

  • index – The index of the relevant descriptor. Defaults to None.

class usb_protocol.emitters.descriptors.microsoft10.MicrosoftOS10EmitterTests(methodName='runTest')[source]

Bases: TestCase

test_compat_id_descriptor()[source]
test_extended_properties_descriptor()[source]