1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

config.py: Revert conditional orders for Windows Registry gets

I failed to realise the values I'd moved earlier in the conditional were
being passed by reference to the ctypes call.  Thus they had initial
values only upon test, rather than the 'returned' values as they should.

This caused no values to be loaded from the Registry!
This commit is contained in:
Athanasius 2020-10-12 17:50:23 +01:00
parent 61a714513e
commit 2f35275024

View File

@ -309,8 +309,7 @@ class Config():
key_size = DWORD()
# Only strings are handled here.
if (
key_type.value not in [REG_SZ, REG_MULTI_SZ]
or RegQueryValueEx(
RegQueryValueEx(
self.hkey,
key,
0,
@ -318,6 +317,7 @@ class Config():
None,
ctypes.byref(key_size)
)
or key_type.value not in [REG_SZ, REG_MULTI_SZ]
):
return None
@ -337,8 +337,7 @@ class Config():
key_size = DWORD(4)
key_val = DWORD()
if (
key_type.value != REG_DWORD
or RegQueryValueEx(
RegQueryValueEx(
self.hkey,
key,
0,
@ -346,6 +345,7 @@ class Config():
ctypes.byref(key_val),
ctypes.byref(key_size)
)
or key_type.value != REG_DWORD
):
return 0