mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Add REG_QWORD handling in registry.py
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
V0.3:
|
||||
Since 0.2:
|
||||
|
||||
* NtStatusException is now a WindowsError
|
||||
* Add shr/shl RM32(64)/Imm8
|
||||
@@ -6,4 +6,5 @@ V0.3:
|
||||
* `execute_64bits_code_from_syswow` able to return ULONG64
|
||||
* utils.get_short_path / utils.get_long_path
|
||||
* Object returned by `windows.native_exec.create_function` has an attribute `code_addr` with the address of the executable code
|
||||
* add `windows.winproxy.is_implemented` Ex: windows.winproxy.is_implemented(windows.winproxy.QueryWorkingSetEx)
|
||||
* add `windows.winproxy.is_implemented` Ex: windows.winproxy.is_implemented(windows.winproxy.QueryWorkingSetEx)
|
||||
* registry.py handle REG_QWORD manually (_winreg does not)
|
||||
@@ -1,9 +1,10 @@
|
||||
import _winreg
|
||||
import itertools
|
||||
import struct
|
||||
from collections import namedtuple
|
||||
|
||||
import windows
|
||||
from windows.generated_def.windef import KEY_READ
|
||||
from windows.generated_def.windef import KEY_READ, REG_QWORD
|
||||
|
||||
|
||||
|
||||
@@ -65,7 +66,15 @@ class PyHKey(object):
|
||||
res = []
|
||||
with ExpectWindowsError(259):
|
||||
for i in itertools.count():
|
||||
res.append(_winreg.EnumValue(self.phkey, i))
|
||||
name_value_type = _winreg.EnumValue(self.phkey, i)
|
||||
# _winreg doest not support REG_QWORD
|
||||
# See http://bugs.python.org/issue23026
|
||||
if name_value_type[2] == REG_QWORD:
|
||||
name = name_value_type[0]
|
||||
value = struct.unpack("<Q", name_value_type[1])[0]
|
||||
type = name_value_type[2]
|
||||
name_value_type = name, value, type
|
||||
res.append(name_value_type)
|
||||
return [KeyValue(*r) for r in res]
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user