-
Notifications
You must be signed in to change notification settings - Fork 102
Description
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_TYPEbit 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.