Skip to content

Custom value types #62

@msuhanov

Description

@msuhanov

Hello.

At present, the data_type() method of the VKRecord class applies the DEVPROP_MASK_TYPE (0x00000FFF) bit mask to a registry value type using the AND operation, and thus clears bits #12-#31 in this value type. I know that the purpose of this operation is to extract the DEVPROP_TYPE_FILETIME (0x00000010) type (you call it RegFileTime), but there is a major issue here:

  • the Windows kernel is using 12 predefined value types in the registry subsystem,
  • other value types are not predefined and can be specific to a kernel subsystem or a driver (e.g. DEVPROP_TYPE_FILETIME),
  • not all kernel subsystems and drivers are expected to use the DEVPROP_MASK_TYPE bit mask when parsing a value type.

Based on this, the library can't silently clear the bits in a value type. For example, the PnP subsystem is using the DEVPROP_TYPE_STRING_LIST (0x00002012) type to store device location paths in the registry (this type will be converted to following value: 0xFFFF2012). Reading such a type with python-registry will return 18 (0x12), or DEVPROP_TYPE_STRING, if we resolve this constant in the context of device properties, but this value is wrong, because it doesn't match the value stored by the subsystem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions